Google Cloud Container Registry

Storing container images in GCP.

The GCP container registry is a container registry flavor that comes built-in with ZenML and uses the Google Artifact Registryarrow-up-right.

circle-exclamation

When to use it

You should use the GCP container registry if:

  • one or more components of your stack need to pull or push container images.

  • you have access to GCP. If you're not using GCP, take a look at the other container registry flavors.

How to deploy it

circle-info

Would you like to skip ahead and deploy a full ZenML cloud stack already, including a Google Artifact Registry? Check out thein-browser stack deployment wizardarrow-up-right, the stack registration wizardarrow-up-right, or the ZenML GCP Terraform modulearrow-up-right for a shortcut on how to deploy & register this stack component.

When using the Google Artifact Registry, you need to:

How to find the registry URI

When using the Google Artifact Registry, the GCP container registry URI should have the following format:

<REGION>-docker.pkg.dev/<PROJECT_ID>/<REPOSITORY_NAME>

# Examples:
europe-west1-docker.pkg.dev/zenml/my-repo
southamerica-east1-docker.pkg.dev/zenml/zenml-test
asia-docker.pkg.dev/my-project/another-repo

To figure out the URI for your registry:

  • Go herearrow-up-right and select the repository that you want to use to store Docker images. If you don't have a repository yet, take a look at the deployment section.

  • On the top, click the copy button to copy the full repository URL.

How to use it

To use the GCP container registry, we need:

We can then register the container registry and use it in our active stack:

You also need to set up authentication required to log in to the container registry.

Authentication Methods

Integrating and using a GCP Container Registry in your pipelines is not possible without employing some form of authentication. If you're looking for a quick way to get started locally, you can use the Local Authentication method. However, the recommended way to authenticate to the GCP cloud platform is through a GCP Service Connectorarrow-up-right. This is particularly useful if you are configuring ZenML stacks that combine the GCP Container Registry with other remote stack components also running in GCP.

This method uses the Docker client authentication available in the environment where the ZenML code is running. On your local machine, this is the quickest way to configure a GCP Container Registry. You don't need to supply credentials explicitly when you register the GCP Container Registry, as it leverages the local credentials and configuration that the GCP CLI and Docker client store on your local machine. However, you will need to install and set up the GCP CLI on your machine as a prerequisite, as covered in the GCP CLI documentationarrow-up-right, before you register the GCP Container Registry.

With the GCP CLI installed and set up with credentials, we'll need to configure Docker, so it can pull and push images:

  • for a Google Container Registry:

  • for a Google Artifact Registry:

circle-exclamation

For more information and a full list of configurable attributes of the GCP container registry, check out the SDK Docsarrow-up-right .

ZenML Scarf

Last updated

Was this helpful?