Customize and deploy a Google template
This quickstart helps you copy a Google-provided template, customize its components, and deploy a test application. You'll use the Generative AI RAG with Cloud SQL template in this quickstart, but you can apply the procedures in this document to any template.
The following image shows the components and connections of the Generative AI RAG with Cloud SQL template in the design canvas:
Before you begin
- Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
- Set up App Design Center in your project.
Required roles
Ask your administrator to grant you the roles listed in the following table:
| Task | Required roles |
|---|---|
| Copy, design, and edit templates | Application Design Center Admin
(roles/designcenter.admin), orApplication Design Center User ( roles/designcenter.user) |
| Deploy applications and configurations | Application Admin (roles/designcenter.applicationAdmin),
orApplication Editor ( roles/designcenter.applicationEditor) |
| Create service accounts during deployment | Create service accounts
(roles/iam.serviceAccountCreator) on the project |
| Grant service account access to your project | Project IAM Admin (roles/resourcemanager.projectIamAdmin)
on the project |
For more information about roles, see Access control with IAM.
Prepare the environment
You can use one of the following to complete this quickstart.
- Use the design canvas in the Google Cloud console.
- Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
-
Install the Google Cloud CLI.
-
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
-
To initialize the gcloud CLI, run the following command:
gcloud init -
Install the Google Cloud CLI.
-
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
-
To initialize the gcloud CLI, run the following command:
gcloud init
Copy the template and create an application draft
Copy the Google template and configure an application draft.
Design canvas
In the Google Cloud console, go to the Google templates page.
Click Preview and customize on the Generative AI RAG with Cloud SQL template card.
The template opens in the design canvas.
Click Duplicate and customize.
In the Create a new template dialog, enter the following details:
In the Template ID field, enter
quickstart-custom-gen-ai-rag.In the Template Name field, enter
Quickstart custom Generative AI RAG.In the Description field, enter
A custom template copied from the Generative AI RAG with Cloud SQL template.Click Create template.
The template is copied to your space and displayed in the design canvas.
From the design canvas, click Configure an app.
Click Create new application and enter the following details:
In the Name field, enter
quickstart-custom-gen-ai-rag-test.In the Display Name field, enter
Quickstart custom Generative AI RAG test.From the Region list, select
us-central1 (Iowa).From the Environment list, select
Test.From the Criticality list, select
Low.
Click Create Application.
The system creates the application draft.
gcloud CLI
Filter the shared templates in the Google catalog to find the revision URI for the
gen-ai-rag-with-sqltemplate.gcloud design-center spaces shared-templates list \ --google-catalog \ --location=LOCATION \ --filter="displayName:gen-ai-rag-cloud-sql"Replace the following:
LOCATION: Your space location. For example,us-central1.
Identify the revision URI from the output.
Create an application draft from that template revision.
gcloud design-center spaces applications create quickstart-custom-gen-ai-rag-test \ --space=SPACE \ --location=LOCATION \ --project=PROJECT \ --source-shared-template-revision-uri=SHARED_TEMPLATE_REVISION_URI \ --display-name="Quickstart custom Generative AI RAG test" \ --environment-type=test \ --criticality-type=low \ --scope-type=regional \ --deployment-region=LOCATIONReplace the following:
SPACE: Your space ID. For example,default-space.PROJECT: Your project ID.SHARED_TEMPLATE_REVISION_URI: The revision URI of the template. For example,projects/gcpdesigncenter/locations/us-central1/spaces/googlespace/sharedTemplates/f8ddfbd3-6393-4a1e-942c-aaa7292fa30c/revisions/r-28.
Configure components
Configure required component parameters in your application draft. For more information about component parameters, see Supported resources.
Design canvas
In the design canvas, click frontend-service and do the following in the Configuration area:
In the Service Name field, enter
custom-rag-frontend.Click Save.
In the design canvas, click retrieval-service and do the following in the Configuration area:
In the Service Name field, enter
custom-retrieval-service.Click Save.
In the design canvas, click database-postgresql and do the following in the Configuration area:
In the Name field, enter
custom-rag-database.Click Save.
In the design canvas, click vertex-ai and do the following in the Configuration area:
From the Project ID list, make sure your project is selected.
Click Save.
In the design canvas, click secret-manager and do the following in the Configuration area:
In the Name field, enter
db-ai-secret.Click Save.
The canvas displays a green check mark in each component to convey that all required parameters are configured.
gcloud CLI
Describe the application to identify component parameters.
gcloud design-center spaces applications describe quickstart-custom-gen-ai-rag-test \ --space=SPACE \ --location=LOCATION \ --project=PROJECT \ --format='yaml(name,componentParameters)'The output displays parameters for each component.
Get a list of component URIs.
gcloud design-center spaces applications describe quickstart-custom-gen-ai-rag-test \ --space=SPACE \ --location=LOCATION \ --project=PROJECT \ --format='value(serializedApplicationTemplate.components.uri)'Create configuration JSON files in your working directory.
Create
custom-frontend.json.{ "component": "FRONTEND_COMPONENT_URI", "parameters": [ { "key": "service_name", "value": "custom-rag-frontend" }, { "key": "PROJECT", "value": "PROJECT" }, { "key": "location", "value": "LOCATION" } ] }Create
custom-retrieval.json.{ "component": "RETRIEVAL_COMPONENT_URI", "parameters": [ { "key": "service_name", "value": "custom-retrieval-service" }, { "key": "project_id", "value": "PROJECT" }, { "key": "location", "value": "LOCATION" } ] }Create
custom-database.json.{ "component": "DATABASE_COMPONENT_URI", "parameters": [ { "key": "name", "value": "custom-rag-database" }, { "key": "project_id", "value": "PROJECT" }, { "key": "database_version", "value": "POSTGRES_15" }, { "key": "region", "value": "us-central1" }, { "key": "zone", "value": "us-central1-a" } ] }Create
custom-secmanager.json.{ "component": "SECRET_MANAGER_COMPONENT_URI", "parameters": [ { "key": "name", "value": "db-ai-secret" }, { "key": "project_id", "value": "PROJECT" } ] }Create
custom-vertex.json.{ "component": "VERTEX_AI_COMPONENT_URI", "parameters": [ { "key": "project_id", "value": "PROJECT" } ] }
Replace the following:
FRONTEND_COMPONENT_URI: The frontend component URI. For example,projects/gcpdesigncenter/locations/us-central1/spaces/googlespace/applicationTemplates/gen-ai-rag-cloud-sql/components/frontend-service.RETRIEVAL_COMPONENT_URI: The retrieval component URI. For example,projects/gcpdesigncenter/locations/us-central1/spaces/googlespace/applicationTemplates/gen-ai-rag-cloud-sql/components/retrieval-service.DATABASE_COMPONENT_URI: The database component URI. For example,projects/gcpdesigncenter/locations/us-central1/spaces/googlespace/applicationTemplates/gen-ai-rag-cloud-sql/components/database-postgresqlSECRET_MANAGER_COMPONENT_URI: The Secret Manager component URI. For example,projects/gcpdesigncenter/locations/us-central1/spaces/googlespace/applicationTemplates/gen-ai-rag-cloud-sql/components/secret-manager.VERTEX_AI_COMPONENT_URI: The Vertex AI component URI. For example,projects/gcpdesigncenter/locations/us-central1/spaces/googlespace/applicationTemplates/gen-ai-rag-cloud-sql/components/vertex-ai.PROJECT: Your project ID.
Update the application configuration with the JSON parameter files.
gcloud design-center spaces applications update quickstart-custom-gen-ai-rag-test \ --space=SPACE \ --location=LOCATION \ --project=PROJECT \ --component-parameters=./custom-frontend.json \ --component-parameters=./custom-retrieval.json \ --component-parameters=./custom-database.json \ --component-parameters=./custom-secmanager.json \ --component-parameters=./custom-vertex.json
Deploy the application
Deploy the configured application.
Design canvas
Click Deploy.
In the Select service account area, do the following:
Select Create a new service account.
Click Proceed.
Click Deploy.
After a few minutes, the application is deployed and resources are created.
gcloud CLI
Preview the deployment and automatically create a preview service account.
gcloud design-center spaces applications preview quickstart-custom-gen-ai-rag-test \ --space=SPACE \ --location=LOCATION \ --project=PROJECT \ --create-saDeploy the application and automatically create a deployment service account.
gcloud design-center spaces applications deploy quickstart-custom-gen-ai-rag-test \ --space=SPACE \ --location=LOCATION \ --project=PROJECT \ --create-sa \ --asyncCopy the operation ID.
Track the deployment status.
gcloud design-center operations describe operation-OPERATION_ID \ --space=SPACE \ --location=LOCATION \ --project=PROJECTReplace the following:
OPERATION_ID: The operation ID.
Optional: Monitor your deployment
After you deploy your application, you can view telemetry and monitor performance:
-
In the Google Cloud console, go to the Application monitoring page:
If you use the search bar to find this page, then select the result whose subheading is Monitoring.
In the Name column, click the application you deployed.
The page displays monitoring information for the application and its services and workloads.
Review predefined dashboards. For more information, see Application Monitoring overview.
Clean up
To avoid incurring charges to your Google Cloud account for the resources used on this page, delete the Google Cloud project with the resources.
Delete the deployed application
Design canvas
From the navigation menu, click Applications.
Click Quickstart custom Generative AI RAG test.
Click Actions and select Delete application.
In the Delete field, enter
quickstart-custom-gen-ai-rag-test.Click Delete.
gcloud CLI
Delete the application using the CLI.
gcloud design-center spaces applications delete quickstart-custom-gen-ai-rag-test \ --space=SPACE \ --location=LOCATION \ --project=PROJECT
Optional: Delete the project
- In the Google Cloud console, go to the Manage resources page.
- In the project list, select the project that you want to delete, and then click Delete.
- At the prompt, type the project ID, and then click Shut down.
What's next
- Review core concepts and benefits with the App Design Center overview.
- Get started with preconfigured architectures by building on Google templates.
- Define your own configurations by designing application templates.