Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to artifact registry #1509

Merged
merged 1 commit into from
May 3, 2024
Merged

Move to artifact registry #1509

merged 1 commit into from
May 3, 2024

Conversation

sjahl
Copy link
Contributor

@sjahl sjahl commented Apr 22, 2024

with broadinstitute/tgg-terraform-modules#39, update our deployctl config so that images are built and tagged with an artifact registry URL.

The intention is that each of our GCP projects will end up with a "gnomad" namespace / registry, with multiple images inside of it. So we'll have a $LOCATION-docker.pkg.dev/$PROJECT/gnomad/gnomad-api, $LOCATION-docker.pkg.dev/$PROJECT/gnomad/gnomad-browser, etc.

Note that one side effect of this change, is that you may need to add additional credential helper lines to your ~/.docker/config.json to handle additional non-gcr.io URLs. See https://cloud.google.com/artifact-registry/docs/docker/pushing-and-pulling#cred-helper

My credHelpers config looks like

  "credHelpers": {
    "gcr.io": "gcloud",
    "us-central1-docker.pkg.dev": "gcloud",
    "us-east1-docker.pkg.dev": "gcloud",
    "us-docker.pkg.dev": "gcloud",
    "us-west1-docker.pkg.dev": "gcloud",
    "us.gcr.io": "gcloud"
  },

@sjahl sjahl self-assigned this Apr 22, 2024
@sjahl sjahl linked an issue Apr 22, 2024 that may be closed by this pull request
@sjahl
Copy link
Contributor Author

sjahl commented Apr 26, 2024

Hey all -- small change here to point our deployctl stuff (e.g. deployctl images build) at artifact registry. I tagged everyone for review, since there's a possibility you'll need to tell your local docker config to use the gcloud credential helper for more than just gcr.io domains. You may have already done this if you're working on something like a cloud run service, or another app that's using the new artifact registry *.pkg.dev domains.

@phildarnowsky-broad
Copy link
Contributor

@sjahl

there's a possibility you'll need to tell your local docker config to use the gcloud credential helper for more than just gcr.io domains

Is there an error or some such we'd expect to see if we do need to do this and haven't?

@sjahl
Copy link
Contributor Author

sjahl commented Apr 26, 2024

@phildarnowsky-broad

Is there an error or some such we'd expect to see if we do need to do this and haven't?

Yes, when attempting to push an image that you've built, you'd see something along the lines of:

denied: Unauthenticated request. Unauthenticated requests do not have permission "artifactregistry.repositories.uploadArtifacts" on resource "projects/exac-gnomad/locations/us/repositories/gnomad" (or it may not exist)

Copy link
Contributor

@rileyhgrant rileyhgrant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I added the lines to my docker config and was able to just use deployctl as usual to build and push an image to the artifact registry

@sjahl sjahl merged commit 0dbcef8 into main May 3, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate away from GCP Container Registry
3 participants