━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━┓┃             CONNECTOR ID             │ CONNECTOR NAME │ CONNECTOR TYPE │ RESOURCE TYPE  │ RESOURCE NAMES ┃

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

┃ bfdb657d-d808-47e7-9974-9ba6e4919d83 │ gcp-generic    │ 🔵 gcp         │ 🔵 gcp-generic │ zenml-core     ┃

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

As a final step, you can use the GCP Image Builder in a ZenML Stack:

# Register and set a stack with the new image builder

zenml stack register <STACK_NAME> -i <IMAGE_BUILDER_NAME> ... --set

When you register the GCP Image Builder, you can generate a GCP Service Account Key, save it to a local file and then reference it in the Image Builder configuration.

This method has the advantage that you don't need to install and configure the GCP CLI on your host, but it's still not as secure as using a GCP Service Connector and the stack component configuration is not portable to other hosts.

For this method, you need to create a user-managed GCP service account, and grant it privileges to access the Cloud Build API and to run Cloud Builder jobs (e.g. the Cloud Build Editor IAM role.

With the service account key downloaded to a local file, you can register the GCP Image Builder as follows:

zenml image-builder register <IMAGE_BUILDER_NAME> \

--flavor=gcp \

--project=<GCP_PROJECT_ID> \

--service_account_path=<PATH_TO_SERVICE_ACCOUNT_KEY> \

--cloud_builder_image=<BUILDER_IMAGE_NAME> \

--network=<DOCKER_NETWORK> \

--build_timeout=<BUILD_TIMEOUT_IN_SECONDS>

# Register and set a stack with the new image builder

zenml stack register <STACK_NAME> -i <IMAGE_BUILDER_NAME> ... --set

Caveats