-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(docs): Add 5-appinfra instructions to deploy on foundation docs (#…
…49) * adding 5-appinfra * add key * update * update service catalog files * add more details * update docs * add more info * remove trailing whitespace
- Loading branch information
1 parent
3a2e40a
commit e95edf3
Showing
99 changed files
with
5,283 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
docs/assets/terraform/5-appinfra/artifact-publish-infra-repo/common.auto.example.tfvars
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/** | ||
* Copyright 2021 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
instance_region = "us-central1" // should be one of the regions used to create network on step 3-networks | ||
|
||
remote_state_bucket = "REMOTE_STATE_BUCKET" |
15 changes: 15 additions & 0 deletions
15
...raform/5-appinfra/artifact-publish-infra-repo/ml_business_unit/shared/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK --> | ||
## Inputs | ||
|
||
| Name | Description | Type | Default | Required | | ||
|------|-------------|------|---------|:--------:| | ||
| instance\_region | The region where compute instance will be created. A subnetwork must exists in the instance region. | `string` | n/a | yes | | ||
| remote\_state\_bucket | Backend bucket to load remote state information from previous steps. | `string` | n/a | yes | | ||
|
||
## Outputs | ||
|
||
| Name | Description | | ||
|------|-------------| | ||
| cloudbuild\_trigger\_id | n/a | | ||
|
||
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK --> |
22 changes: 22 additions & 0 deletions
22
...ssets/terraform/5-appinfra/artifact-publish-infra-repo/ml_business_unit/shared/backend.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/** | ||
* Copyright 2021 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
terraform { | ||
backend "gcs" { | ||
bucket = "UPDATE_APP_INFRA_BUCKET" | ||
prefix = "terraform/app-infra/ml_business_unit/shared" | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
...rraform/5-appinfra/artifact-publish-infra-repo/ml_business_unit/shared/common.auto.tfvars
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../common.auto.tfvars |
20 changes: 20 additions & 0 deletions
20
...assets/terraform/5-appinfra/artifact-publish-infra-repo/ml_business_unit/shared/locals.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/** | ||
* Copyright 2021 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
locals { | ||
business_unit = "ml_business_unit" | ||
environment = "common" | ||
} |
34 changes: 34 additions & 0 deletions
34
...ssets/terraform/5-appinfra/artifact-publish-infra-repo/ml_business_unit/shared/outputs.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/** | ||
* Copyright 2021 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
# output "trigger_sa_account_id" { | ||
# description = "Account id of service account cloudbuild." | ||
# value = module.artifact_pipeline.trigger_sa_account_id | ||
# } | ||
|
||
# output "cloudbuild_v2_repo_id" { | ||
# description = "Repository ID of cloudbuild repository" | ||
# value = module.artifact_pipeline.cloudbuild_v2_repo_id | ||
# } | ||
|
||
# output "kms_key_id" { | ||
# description = "Projects Key ID for encrytion" | ||
# value = module.artifact_pipeline.kms_key_id | ||
# } | ||
|
||
output "cloudbuild_trigger_id" { | ||
value = module.artifact_publish.cloudbuild_trigger_id | ||
} |
47 changes: 47 additions & 0 deletions
47
...aform/5-appinfra/artifact-publish-infra-repo/ml_business_unit/shared/publish_artifacts.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/** | ||
* Copyright 2021 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
locals { | ||
region_kms_keyring = [for i in local.shared_keyrings : i if split("/", i)[3] == var.instance_region] | ||
} | ||
|
||
data "google_project" "common_artifacts" { | ||
project_id = local.common_artifacts_project_id | ||
} | ||
|
||
module "artifact_publish" { | ||
source = "../../modules/publish_artifacts" | ||
|
||
environment = local.environment | ||
description = "Publish Artifacts for ML Projects" | ||
project_id = local.common_artifacts_project_id | ||
name = local.artifacts_repo_name | ||
format = "DOCKER" | ||
region = var.instance_region | ||
cleanup_policies = [{ | ||
id = "keep-tagged-release" | ||
action = "KEEP" | ||
condition = [ | ||
{ | ||
tag_state = "TAGGED", | ||
tag_prefixes = ["release"], | ||
package_name_prefixes = ["webapp", "mobile"] | ||
} | ||
] | ||
}] | ||
|
||
kms_crypto_key = "${one(local.region_kms_keyring)}/cryptoKeys/${data.google_project.common_artifacts.name}" | ||
} |
31 changes: 31 additions & 0 deletions
31
...assets/terraform/5-appinfra/artifact-publish-infra-repo/ml_business_unit/shared/remote.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/** | ||
* Copyright 2021 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
locals { | ||
common_artifacts_project_id = data.terraform_remote_state.projects_shared.outputs.common_artifacts_project_id | ||
service_catalog_project_id = data.terraform_remote_state.projects_shared.outputs.service_catalog_project_id | ||
artifacts_repo_name = data.terraform_remote_state.projects_shared.outputs.artifacts_repo_name | ||
shared_keyrings = data.terraform_remote_state.projects_shared.outputs.shared_level_keyrings | ||
} | ||
|
||
data "terraform_remote_state" "projects_shared" { | ||
backend = "gcs" | ||
|
||
config = { | ||
bucket = var.remote_state_bucket | ||
prefix = "terraform/projects/${local.business_unit}/shared" | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
...ets/terraform/5-appinfra/artifact-publish-infra-repo/ml_business_unit/shared/variables.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/** | ||
* Copyright 2021 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
variable "instance_region" { | ||
description = "The region where compute instance will be created. A subnetwork must exists in the instance region." | ||
type = string | ||
} | ||
|
||
variable "remote_state_bucket" { | ||
description = "Backend bucket to load remote state information from previous steps." | ||
type = string | ||
} |
43 changes: 43 additions & 0 deletions
43
...sets/terraform/5-appinfra/artifact-publish-infra-repo/ml_business_unit/shared/versions.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/** | ||
* Copyright 2022 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
terraform { | ||
required_version = ">= 0.13" | ||
|
||
required_providers { | ||
|
||
google = { | ||
source = "hashicorp/google" | ||
version = ">= 3.77, < 6" | ||
} | ||
|
||
google-beta = { | ||
source = "hashicorp/google-beta" | ||
version = ">= 3.77, < 6" | ||
} | ||
|
||
null = { | ||
source = "hashicorp/null" | ||
version = "~> 3.0" | ||
} | ||
|
||
random = { | ||
source = "hashicorp/random" | ||
version = "~> 3.1" | ||
} | ||
|
||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
docs/assets/terraform/5-appinfra/artifacts-pipeline/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# ml-foundations-docker | ||
Dockerfile repository for ml-foundations artifacts project |
17 changes: 17 additions & 0 deletions
17
docs/assets/terraform/5-appinfra/artifacts-pipeline/images/tf2-cpu.2-13:0.1/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Copyright 2024 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
FROM us-docker.pkg.dev/vertex-ai/prediction/tf2-cpu.2-13:latest | ||
RUN echo "Hello World" > helloworld.txt | ||
|
Oops, something went wrong.