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

build jupyterhub/singleuser along with other images #3690

Merged
merged 1 commit into from Nov 25, 2021

Conversation

minrk
Copy link
Member

@minrk minrk commented Nov 24, 2021

got lost in the migration to GHA docker builds


- name: Get list of just version tags
id: tags
uses: jupyterhub/action-major-minor-tag-calculator@v2
Copy link
Member Author

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:') }}

Copy link
Member

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?

Copy link
Member

@manics manics Nov 24, 2021

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"]
}

Copy link
Member

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.

Copy link
Member Author

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).

@minrk minrk force-pushed the gha-singleuser branch 3 times, most recently from 4f156d8 to 7c001cf Compare November 24, 2021 20:12
got lost in the migration to GHA docker builds
@minrk
Copy link
Member Author

minrk commented Nov 25, 2021

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.

@manics manics merged commit 750085f into jupyterhub:main Nov 25, 2021
@minrk minrk deleted the gha-singleuser branch November 26, 2021 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants