diff --git a/app/placeholder/Dockerfile b/app/placeholder/Dockerfile index 45b23c26..02755678 100644 --- a/app/placeholder/Dockerfile +++ b/app/placeholder/Dockerfile @@ -15,7 +15,7 @@ # Execute with "docker run --build-arg PROJECT_ID=$PROJECT_ID ..." ARG PROJECT_ID=YOURPROJECTID -FROM gcr.io/$PROJECT_ID/firebase +FROM us-docker.pkg.dev/$PROJECT_ID/containers/firebase WORKDIR /app RUN apk add gettext curl diff --git a/app/placeholder/placeholder-image.cloudbuild.yaml b/app/placeholder/placeholder-image.cloudbuild.yaml index 1c81882a..625f56f5 100644 --- a/app/placeholder/placeholder-image.cloudbuild.yaml +++ b/app/placeholder/placeholder-image.cloudbuild.yaml @@ -24,12 +24,12 @@ steps: "--build-arg", "PROJECT_ID=$PROJECT_ID", "-t", - "gcr.io/$PROJECT_ID/$_IMAGE_NAME", + "us-docker.pkg.dev/$PROJECT_ID/containers/$_IMAGE_NAME", ".", ] images: - - gcr.io/$PROJECT_ID/$_IMAGE_NAME + - us-docker.pkg.dev/$PROJECT_ID/containers/$_IMAGE_NAME substitutions: _IMAGE_NAME: placeholder diff --git a/infra/README.md b/infra/README.md index cf4de0c1..a0eb1ccd 100644 --- a/infra/README.md +++ b/infra/README.md @@ -44,18 +44,18 @@ Functional examples are included in the | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| client\_image\_host | Container Registry that hosts the client image (PROJECT\_ID[/folder]) | `string` | `"hsa-public/terraform-python-dynamic-webapp"` | no | +| client\_image\_host | Artifact Registry that hosts the client image (PROJECT\_ID/registry) | `string` | `"hsa-public/containers/terraform-python-dynamic-webapp"` | no | | database\_name | Cloud SQL database name | `string` | `"django"` | no | | database\_username | Cloud SQL database name | `string` | `"server"` | no | | enable\_apis | Whether or not to enable underlying apis in this solution. | `bool` | `true` | no | -| image\_version | Version of the Container Registry image to use | `string` | `"v1.9.0"` | no | +| image\_version | Version of the container image to use | `string` | `"v1.9.0"` | no | | init | Initialize database? | `bool` | `true` | no | | instance\_name | Cloud SQL Instance name | `string` | `"psql"` | no | | labels | A set of key/value label pairs to assign to the resources deployed by this blueprint. | `map(string)` | `{}` | no | | project\_id | Google Cloud Project ID | `string` | n/a | yes | | random\_suffix | Add random suffix to VM name | `string` | `true` | no | | region | Google Cloud Region | `string` | `"us-central1"` | no | -| server\_image\_host | Container Registry that hosts the server image (PROJECT\_ID[/folder]) | `string` | `"hsa-public/terraform-python-dynamic-webapp"` | no | +| server\_image\_host | Artifact Registry that hosts the server image (PROJECT\_ID/registry) | `string` | `"hsa-public/containers/terraform-python-dynamic-webapp"` | no | | service\_name | Cloud Run service name | `string` | `"server"` | no | | zone | GCP zone for provisioning zonal resources. | `string` | `"us-central1-c"` | no | diff --git a/infra/containers.tf b/infra/containers.tf index 1fefdade..be2ef1a8 100644 --- a/infra/containers.tf +++ b/infra/containers.tf @@ -14,10 +14,10 @@ * limitations under the License. */ -# Base images supplied pre-built. +# Base images supplied pre-built locals { - server_image = "gcr.io/${var.server_image_host}/server:${var.image_version}" - client_image = "gcr.io/${var.client_image_host}/client:${var.image_version}" - placeholder_image = "gcr.io/hsa-public/avocano-placeholder:latest" + server_image = "us-docker.pkg.dev/${var.server_image_host}/server:${var.image_version}" + client_image = "us-docker.pkg.dev/${var.client_image_host}/client:${var.image_version}" + placeholder_image = "us-docker.pkg.dev/hsa-public/containers/avocano-placeholder:latest" } diff --git a/infra/metadata.yaml b/infra/metadata.yaml index 0d41b5b1..04fa861b 100644 --- a/infra/metadata.yaml +++ b/infra/metadata.yaml @@ -27,7 +27,7 @@ spec: dir: /infra actuationTool: flavor: Terraform - version: '>= 0.13' + version: ">= 0.13" description: tagline: This is an auto-generated module. detailed: |- @@ -41,125 +41,126 @@ spec: preDeploy: To deploy this blueprint you must have an active billing account and billing permissions. content: documentation: - - title: Hosting a Static Website - url: https://cloud.google.com/storage/docs/hosting-static-website + - title: Hosting a Static Website + url: https://cloud.google.com/storage/docs/hosting-static-website examples: - - name: simple_example - location: examples/simple_example - - name: suffix_example - location: examples/suffix_example + - name: simple_example + location: examples/simple_example + - name: suffix_example + location: examples/suffix_example interfaces: variables: - - name: client_image_host - description: Container Registry that hosts the client image (PROJECT_ID[/folder]) - varType: string - defaultValue: hsa-public/terraform-python-dynamic-webapp - - name: database_name - description: Cloud SQL database name - varType: string - defaultValue: django - - name: database_username - description: Cloud SQL database name - varType: string - defaultValue: server - - name: enable_apis - description: Whether or not to enable underlying apis in this solution. - varType: bool - defaultValue: true - - name: image_version - description: Version of the Container Registry image to use - varType: string - defaultValue: v1.9.0 - - name: init - description: Initialize database? - varType: bool - defaultValue: true - - name: instance_name - description: Cloud SQL Instance name - varType: string - defaultValue: psql - - name: labels - description: A set of key/value label pairs to assign to the resources deployed by this blueprint. - varType: map(string) - defaultValue: {} - - name: project_id - description: Google Cloud Project ID - varType: string - required: true - - name: random_suffix - description: Add random suffix to VM name - varType: string - defaultValue: true - - name: region - description: Google Cloud Region - varType: string - defaultValue: us-central1 - - name: server_image_host - description: Container Registry that hosts the server image (PROJECT_ID[/folder]) - varType: string - defaultValue: hsa-public/terraform-python-dynamic-webapp - - name: service_name - description: Cloud Run service name - varType: string - defaultValue: server - - name: zone - description: GCP zone for provisioning zonal resources. - varType: string - defaultValue: us-central1-c + - name: client_image_host + description: Artifact Registry that hosts the client image (PROJECT_ID/registry[/folder]) + varType: string + defaultValue: hsa-public/containers/terraform-python-dynamic-webapp + - name: database_name + description: Cloud SQL database name + varType: string + defaultValue: django + - name: database_username + description: Cloud SQL database name + varType: string + defaultValue: server + - name: enable_apis + description: Whether or not to enable underlying apis in this solution. + varType: bool + defaultValue: true + - name: image_version + description: Version of the container image to use + varType: string + defaultValue: v1.9.0 + - name: init + description: Initialize database? + varType: bool + defaultValue: true + - name: instance_name + description: Cloud SQL Instance name + varType: string + defaultValue: psql + - name: labels + description: A set of key/value label pairs to assign to the resources deployed by this blueprint. + varType: map(string) + defaultValue: {} + - name: project_id + description: Google Cloud Project ID + varType: string + defaultValue: null + required: true + - name: random_suffix + description: Add random suffix to VM name + varType: string + defaultValue: true + - name: region + description: Google Cloud Region + varType: string + defaultValue: us-central1 + - name: server_image_host + description: Artifact Registry that hosts the server image (PROJECT_ID/registry[/folder]) + varType: string + defaultValue: hsa-public/containers/terraform-python-dynamic-webapp + - name: service_name + description: Cloud Run service name + varType: string + defaultValue: server + - name: zone + description: GCP zone for provisioning zonal resources. + varType: string + defaultValue: us-central1-c outputs: - - name: client_job_name - description: Name of the Cloud Run Job, deploying the front end - - name: django_admin_password - description: Django Admin password - - name: django_admin_url - description: Django Admin URL - - name: firebase_url - description: Firebase URL - - name: neos_toc_url - description: Neos Tutorial URL - - name: server_service_name - description: Name of the Cloud Run service, hosting the server API - - name: usage - description: Next steps for usage + - name: client_job_name + description: Name of the Cloud Run Job, deploying the front end + - name: django_admin_password + description: Django Admin password + - name: django_admin_url + description: Django Admin URL + - name: firebase_url + description: Firebase URL + - name: neos_toc_url + description: Neos Tutorial URL + - name: server_service_name + description: Name of the Cloud Run service, hosting the server API + - name: usage + description: Next steps for usage requirements: roles: - - level: Project - roles: - - roles/cloudbuild.builds.editor - - roles/cloudsql.admin - - roles/compute.admin - - roles/compute.networkAdmin - - roles/firebase.managementServiceAgent - - roles/firebasehosting.admin - - roles/iam.serviceAccountAdmin - - roles/iam.serviceAccountUser - - roles/pubsub.editor - - roles/resourcemanager.projectIamAdmin - - roles/run.admin - - roles/secretmanager.admin - - roles/storage.admin + - level: Project + roles: + - roles/cloudbuild.builds.editor + - roles/cloudsql.admin + - roles/compute.admin + - roles/compute.networkAdmin + - roles/firebase.managementServiceAgent + - roles/firebasehosting.admin + - roles/iam.serviceAccountAdmin + - roles/iam.serviceAccountUser + - roles/pubsub.editor + - roles/resourcemanager.projectIamAdmin + - roles/run.admin + - roles/secretmanager.admin + - roles/storage.admin services: - - bigquery.googleapis.com - - bigquerymigration.googleapis.com - - bigquerystorage.googleapis.com - - cloudtrace.googleapis.com - - datastore.googleapis.com - - logging.googleapis.com - - monitoring.googleapis.com - - servicemanagement.googleapis.com - - serviceusage.googleapis.com - - sql-component.googleapis.com - - storage.googleapis.com - - storage-api.googleapis.com - - storage-component.googleapis.com - - artifactregistry.googleapis.com - - cloudbuild.googleapis.com - - cloudresourcemanager.googleapis.com - - compute.googleapis.com - - firebase.googleapis.com - - firebasehosting.googleapis.com - - iam.googleapis.com - - pubsub.googleapis.com - - run.googleapis.com - - secretmanager.googleapis.com - - sqladmin.googleapis.com + - bigquery.googleapis.com + - bigquerymigration.googleapis.com + - bigquerystorage.googleapis.com + - cloudtrace.googleapis.com + - datastore.googleapis.com + - logging.googleapis.com + - monitoring.googleapis.com + - servicemanagement.googleapis.com + - serviceusage.googleapis.com + - sql-component.googleapis.com + - storage.googleapis.com + - storage-api.googleapis.com + - storage-component.googleapis.com + - artifactregistry.googleapis.com + - cloudbuild.googleapis.com + - cloudresourcemanager.googleapis.com + - compute.googleapis.com + - firebase.googleapis.com + - firebasehosting.googleapis.com + - iam.googleapis.com + - pubsub.googleapis.com + - run.googleapis.com + - secretmanager.googleapis.com + - sqladmin.googleapis.com diff --git a/infra/variables.tf b/infra/variables.tf index de655b9a..f18b5e80 100644 --- a/infra/variables.tf +++ b/infra/variables.tf @@ -63,19 +63,19 @@ variable "init" { variable "image_version" { type = string default = "v1.9.0" - description = "Version of the Container Registry image to use" + description = "Version of the container image to use" } variable "client_image_host" { type = string - default = "hsa-public/terraform-python-dynamic-webapp" - description = "Container Registry that hosts the client image (PROJECT_ID[/folder])" + default = "hsa-public/containers/terraform-python-dynamic-webapp" + description = "Artifact Registry that hosts the client image (PROJECT_ID/registry)" } variable "server_image_host" { type = string - default = "hsa-public/terraform-python-dynamic-webapp" - description = "Container Registry that hosts the server image (PROJECT_ID[/folder])" + default = "hsa-public/containers/terraform-python-dynamic-webapp" + description = "Artifact Registry that hosts the server image (PROJECT_ID/registry)" } # Optional customisation