 your GCP Image Builder to the GCP cloud platform.To set up the GCP Image Builder to authenticate to GCP and access the GCP Cloud Build services, it is recommended to leverage the many features provided by the GCP Service Connector such as auto-configuration, best security practices regarding long-lived credentials and reusing the same credentials across multiple stack components.

If you don't already have a GCP Service Connector configured in your ZenML deployment, you can register one using the interactive CLI command. You also have the option to configure a GCP Service Connector that can be used to access more than just the GCP Cloud Build service:

zenml service-connector register --type gcp -i

A non-interactive CLI example that leverages the Google Cloud CLI configuration on your local machine to auto-configure a GCP Service Connector for the GCP Cloud Build service:

zenml service-connector register <CONNECTOR_NAME> --type gcp --resource-type gcp-generic --resource-name <GCS_BUCKET_NAME> --auto-configure

Example Command Output

$ zenml service-connector register gcp-generic --type gcp --resource-type gcp-generic --auto-configure

Successfully registered service connector `gcp-generic` with access to the following resources:

┏━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━┓

┃ RESOURCE TYPE  │ RESOURCE NAMES ┃

┠────────────────┼────────────────┨

┃ 🔵 gcp-generic │ zenml-core     ┃

┗━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━┛

Note: Please remember to grant the entity associated with your GCP credentials permissions to access the Cloud Build API and to run Cloud Builder jobs (e.g. the Cloud Build Editor IAM role). The GCP Service Connector supports many different authentication methods with different levels of security and convenience. You should pick the one that best fits your use case.