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
build jupyterhub/singleuser along with other images #3690
Conversation
.github/workflows/release.yml
Outdated
|
||
- name: Get list of just version tags | ||
id: tags | ||
uses: jupyterhub/action-major-minor-tag-calculator@v2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way we can run this only once without $prefix
and add the prefix on push, rather than N + 1 times for each image? e.g. tags: tags: ${{ env.REGISTRY + 'juptyerhub/jupyterhub:' + join(fromJson(steps.tags.outputs.tags), ',' + env.REGISTRY + 'juptyerhub/jupyterhub:') }}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe, but instead of adding such complexity, can we instead make this job definition be simplified to run x steps N times with different parameterization (one per image), instead of being a very long and complicated job with N*x steps for N images?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general yes, though it's a bit more complicated.
If you set prefix: ""
instead of prefix: registry/org/name:
it should return just the tags, but since it's an array you'll need to loop through instead of just joining:
tags = []
for tag in steps.tags.outputs.tags:
tags.push(env.REGISTRY + 'juptyerhub/jupyterhub:' + tag)
One alternative is to modify the action to optionally take multiple prefixes and return a dictionary:
uses: jupyterhub/action-major-minor-tag-calculator@v2
with:
prefixes:
- "${{ env.REGISTRY }}jupyterhub/jupyterhub:"
- "${{ env.REGISTRY }}jupyterhub/singleuser:"
Returning
"tags": {
"docker.io/jupyterhub/jupyterhub:": ["docker.io/jupyterhub/jupyterhub:1.5", "docker.io/jupyterhub/jupyterhub:1.5.0"],
"docker.io/jupyterhub/singleuser:": ["docker.io/jupyterhub/singleuser:1.5", "docker.io/jupyterhub/singleuser:1.5.0"]
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you in this PR make this a clean copy-paste of the previous logic, without deviations from that structure and way of doing things, then if you want, I could refactor this later into a single job definition that takes parameters to run N times where N is the number of images we should build/publish.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, that's exactly what I did. I'll leave it at that for now, and we can work out a simplification later, if it's worth it. The duplication happened to bite me in #3673 where a version bump of tag-calculator must be applied 5 times after this PR, I think.
I hope to resolve jupyterhub/team-compass#474 soon, in which case all docker building will be removed from this repo, anyway, and we'll probably want to change some of this logic when we do that (tag-calculator may not be appropriate anymore when we do that).
4f156d8
to
7c001cf
Compare
got lost in the migration to GHA docker builds
7c001cf
to
facde96
Compare
Since the only way to test the image publishing is to make and publish a tag, I plan to land this and make a (final?) 2.0.0rc5 tomorrow. |
got lost in the migration to GHA docker builds