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

Update Docker registry to new default #413

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bradfordcp
Copy link
Member

@bradfordcp bradfordcp commented Sep 22, 2022

What this PR does:

Updates the registry coordinates to refer to the new Google Artifact Registry
GHA writes images to us-docker.pkg.dev/k8ssandra/images
Tests and defaults refer to us-docker.pkg.dev/k8ssandra/images
Makefile updates for new repository locations

Fixes #414

Checklist

  • Changes manually tested
  • Automated Tests added/updated
  • Documentation added/updated
  • CHANGELOG.md updated (not required for documentation PRs)
  • CLA Signed: DataStax CLA

@bradfordcp bradfordcp force-pushed the registry-changes branch 2 times, most recently from 9d21c8b to 4ba9eb9 Compare September 22, 2022 21:04
Makefile Outdated

ORG ?= k8ssandra
ORG ?= us-docker.pkg.dev/k8ssandra/images
Copy link
Contributor

Choose a reason for hiding this comment

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

This will break all local builds.

Copy link
Member Author

Choose a reason for hiding this comment

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

Why? It is working for me locally. The presence of a domain only affects pulling and pushing. I can import this package into Kind without issue.

Copy link
Contributor

@burmanm burmanm Sep 24, 2022

Choose a reason for hiding this comment

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

It's only working for certain use-cases. See, now you're overriding the default repository - not just the org. If I want to use a localhost:5000 repository (local registry) - which I've setup for example, this won't work. The images now become: localhost:5000/us-docker.pkg.dev/k8ssandra/images - and this is invalid.

Same applies to the image_config.yaml. If you wish to override the default repository, use the imageRegistry field, otherwise everyone who uses their own local registry (not just localhost, but say a proxy also) will not be able to use that feature anymore. Our parsing does not understand that there's repository applied in the wrong field - it assumes the format for certain image structures is organization/image and the additional repository comes from a different property.

Copy link
Member Author

Choose a reason for hiding this comment

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

Alright, I'm understanding the relationships in image_config.yaml but there's a bunch of overlap. Why are we baking in the ORG as well, shouldn't that be part of the registry definition?

So if I want to use docker.io why not just specify imageRegistry: docker.io/k8ssandra with the image name system-logger:latest?

There's another gotcha in that we don't host the DSE images within the k8ssandra org, there isn't a way for me to specify the imageRegistry for particular images and not others. Should we mirror the the images with management API to our org?

Copy link
Member Author

Choose a reason for hiding this comment

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

For the Makefile, should we add a REGISTRY parameter that can be overridden?

Makefile Show resolved Hide resolved
@@ -3,7 +3,7 @@ kind: ImageConfig
metadata:
name: image-config
images:
system-logger: "k8ssandra/system-logger:latest"
system-logger: "artifacts.k8ssandra.io/k8ssandra/images/system-logger:latest"
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here, won't work in local builds correctly.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, if you wonder why to my previous question - the repository is different here than anything I would build. In the previous Makefile we build:

us-docker.pkg.dev/k8ssandra/images/system-logger:latest (which itself is problematic, but see another comment), but here we're calling artifacts.k8ssandra.io as prefix. So while your development env will popup, it's not actually loading the correct image, it's loading some historic one from the official repo, which is not what I'm actually developing.

Copy link
Member Author

Choose a reason for hiding this comment

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

To be clear, us-docker.pkg.dev and artifacts.k8ssandra.io are the same repository. We want to push all images to us-docker.pkg.dev and pull from artifacts.k8ssandra.io.

Copy link
Contributor

Choose a reason for hiding this comment

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

But that's not the same string - thus if you push there and load from another, you will not load from say local cache (like kind).

@bradfordcp bradfordcp changed the title [WIP] Updated Docker registry references Update Docker registry to new default Sep 23, 2022
@bradfordcp bradfordcp force-pushed the registry-changes branch 2 times, most recently from 43ef52c to 7601e11 Compare September 23, 2022 21:15
Tests and defaults refer to artifacts.k8ssandra.io/k8ssandra/images
Makefile updates for new repository locations
@burmanm
Copy link
Contributor

burmanm commented Sep 29, 2022

I'm still confused with why we want to change images.go and other processing, or set the default image names to be different. Why won't adding them to GHA and just setting a new imageRegistry to image_config.yaml be enough? Isn't the point that users just download from artifacts.k8ssandra.io? All the other changes seem unnecessary.

@bradfordcp
Copy link
Member Author

I'm still confused with why we want to change images.go...

At this point the only change in images.go is to set DefaultCassandraRepository. I agree we should set the imageRegistry, but there are some gotchas as we apply the registry to all images. This would be a problem for users trying to use datastax/dse-server as we don't currently mirror that repository.

All the other changes seem unnecessary

Does this statement include the changes to push packages to us-docker.pkg.dev?

@burmanm
Copy link
Contributor

burmanm commented Sep 30, 2022

Does this statement include the changes to push packages to us-docker.pkg.dev?

I mean, only GHA needs to push there (that's the GHA part). But since Makefile's pushes are used only for local development work, there's no need to push with longer names there.

One thing I obviously forgot is that the pre-release.sh needs the change to modify the cass-operator's deployment image to use the artifacts.k8ssandra.io/ .. path for the cass-operator image.

The DSE image is more interesting - I didn't think about that. Are we intending to keep them on different repos?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: No status
Development

Successfully merging this pull request may close these issues.

Update default container registry to something other than Docker Hub (keep publishing images to Docker Hub)
3 participants