 should pick the one that best fits your use case.If you already have one or more GCP Service Connectors configured in your ZenML deployment, you can check which of them can be used to access generic GCP resources like the GCP Image Builder required for your GCP Image Builder by running e.g.:

zenml service-connector list-resources --resource-type gcp-generic

Example Command Output

The following 'gcp-generic' resources can be accessed by service connectors configured in your workspace:

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

┃             CONNECTOR ID             │ CONNECTOR NAME │ CONNECTOR TYPE │ RESOURCE TYPE  │ RESOURCE NAMES ┃

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

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

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

After having set up or decided on a GCP Service Connector to use to authenticate to GCP, you can register the GCP Image Builder as follows:

zenml image-builder register <IMAGE_BUILDER_NAME> \

--flavor=gcp \

--cloud_builder_image=<BUILDER_IMAGE_NAME> \

--network=<DOCKER_NETWORK> \

--build_timeout=<BUILD_TIMEOUT_IN_SECONDS>

# Connect the GCP Image Builder to GCP via a GCP Service Connector

zenml image-builder connect <IMAGE_BUILDER_NAME> -i

A non-interactive version that connects the GCP Image Builder to a target GCP Service Connector:

zenml image-builder connect <IMAGE_BUILDER_NAME> --connector <CONNECTOR_ID>

Example Command Output

$ zenml image-builder connect gcp-image-builder --connector gcp-generic

Successfully connected image builder `gcp-image-builder` to the following resources:

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