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

Issue on page /howto/customize/custom-image.html #1158

Closed
jameshowison opened this issue Mar 31, 2022 · 13 comments
Closed

Issue on page /howto/customize/custom-image.html #1158

jameshowison opened this issue Mar 31, 2022 · 13 comments

Comments

@jameshowison
Copy link

I ended up here figuring out (for the second time :) how to update the image for the utexas hub (adding rstudio).

The section on pushing the image to a repo (quay.io) says to do it, but doesn't say how to do it. At the point I looked at this I had just merged a PR into the utexas-image repo: 2i2c-org/utexas-image#4

The change built fine (after a detour in which I thought I should have repo2docker installed locally to check the build. Then I yak-shaved to install brew, python, repo2docker and eventually got that sorted (new laptop). Of course repo2docker didn't work for me locally, so I just added the runtime.txt file on github where things worked (including testing at binder.org).

One additional point is that I'm nervous about making a change to the image and then making that default for everyone ... is the thinking that I test things on binder then push it out to everyone (after I remember how to push to quay.io) and can always rollback if people encounter issues? That probably does make sense.

@jameshowison
Copy link
Author

Hmmm, perhaps this is the documentation on pushing the image to quay.io:

https://pilot-hubs.2i2c.org/en/latest/howto/configure/update-env.html

But that says that merging the PR will automatically push the image to quay.io ... but that doesn't seem to have happened. I manually changed the quay.io URL to https://quay.io/repository/2i2c/utexas-image?tab=tags but that doesn't show a new image having been pushed.

I'm hoping to help realize the "self serve" approach to image customization discussed here #1145 but obviously having a little trouble.

@jameshowison
Copy link
Author

Ah, I recall now that I had some steps from support@2i2c:

  1. Go to the UT Austin hub user image repo.
  2. Edit the environment.yml file to add the extra dependency (you might also need to edit postBuild depending on how this package is set up.
  3. Open a PR for these changes.
  4. (optional) try the "test this PR on binder" comment. (though I'm not 100% it'll work for this repo because of all the database sidecar stuff, but worth a shot)
    ​5. Merge the PR, and wait for the GitHub Action to finish that builds the new image and pushes it.
  5. When it's finished, go to the log outputs for the "Build container image" job that just finished.
  6. In the logs, go to the "Update jupyter dependencies with repo2docker" step. ​here's a link to the logs from a previous PR
  7. Look for "Successfully pushed quay.io...
  8. The string after utexas-image: is the tag for your new image.
  9. Go to the Configurator page for your hub (https://utexas.pilot.2i2c.cloud/hub/admin -> services -> configurator)
  10. Update the "User docker image" string to point to your new tag

Once you hit "submit", from then on the user image for the repository should start pulling from your updated one. If for some reason something doesn't work, you can always roll it back to a previous image tag.

Seems like these should be documented within this documentation?

@jameshowison
Copy link
Author

Hmmm, ok I tried to follow step 6/7 going to the post merge PR build: https://github.com/2i2c-org/utexas-image/runs/5764487810?check_suite_focus=true

I see "Build quay.io/2i2c.org/ ..." but I don't see "Successfully pushed quay.io".

Screen Shot 2022-03-30 at 10 07 27 PM

@jameshowison
Copy link
Author

Hmmm, I know I got this to work before on this earlier PR and build. https://github.com/2i2c-org/utexas-image/runs/5367920503?check_suite_focus=true

But now I can't see the bit where I find the tag on quay.io to then change in the configurator.

@sgibson91
Copy link
Member

I see "Build quay.io/2i2c.org/ ..." but I don't see "Successfully pushed quay.io".

I think you have to expand those logs by clicking the arrow next to "Build quay.io/2i2c/..." to see the success message

@jameshowison
Copy link
Author

Thanks @sgibson91 I expanded that and (much scrolling ensues) and I see:

Screen Shot 2022-04-01 at 10 29 07 AM

Which says success in tagging but not in pushing ... but eventually an image did actually push to quay.io:

https://quay.io/repository/2i2c/utexas-image?tab=tags&tag=latest

but it seems to have a different tag.

@sgibson91
Copy link
Member

Is that screenshot from a job that ran as a PR, whereas the one that did push was post-merge maybe? Images don't usually get pushed from PRs, only built (to check they do indeed build)

@jameshowison
Copy link
Author

Yes, that screenshot is from the PR. I thought that was the workflow: edit files, make a PR to the image repo, test build on binder, merge PR, image is built and pushed to quay.io then find the tag, update that on configurator.

I'm afraid I don't know then how the image gets pushed (and I'm a bit lost in knowing the documentation to follow that explains it).

@sgibson91
Copy link
Member

The GitHub Action workflow file has some logic in it to only push to quay.io when it knows the event is not a Pull Request. @GeorgianaElena has a PR to update the documentation here: 2i2c-org/hub-user-image-template#10

@damianavila
Copy link
Contributor

@jameshowison, can you confirm that the landed docs improvements actually clarify the workflow for you? Thanks!

@jameshowison
Copy link
Author

Thing I was confused about was how a PR (without a push) ended up getting pushed. Now I think I understand that it happens when the PR is merged (because that is a commit on main). Attempted to characterize my understanding in 2i2c-org/hub-user-image-template#12

I'm a newbie with github actions. Is it possible to see the build/push logs after a PR is merged? For example, I go to 2i2c-org/utexas-image#6 and I think, now was that actually pushed? This is what I see:

Screen Shot 2022-04-05 at 1 32 43 PM

So I click on "View details" and then build --> "details" which takes me to:

https://github.com/2i2c-org/utexas-image/runs/5790965853?check_suite_focus=true

here I unfold "update jupyter dependencies with repo2docker" and then "Build quay.io/212c/utexas-image:a8..." and scroll all the way to the bottom where i see

"Successfully tagged quay.io/2i2c/utexas-image:a823300f0f7c"

but then I'm left wondering whether this was pushed ... which makes me wonder if I'm looking at the right log for the post-merge action driven by build.yaml which includes the push to quay.io ...

@damianavila
Copy link
Contributor

@jameshowison, thanks for the PR!

Regarding your question about the actions... if you go to the Actions tab and filter by the "Build container image" as it is shown below:

Screen Shot 2022-04-05 at 16 11 51

You will see the (pull-request) merge-associated build, and you can see the push event starting here: https://github.com/2i2c-org/utexas-image/runs/5791169904?check_suite_focus=true#step:5:2114

Hopefully, this clarifies the confusion 😉.

jameshowison added a commit to jameshowison/hub-user-image-template that referenced this issue Apr 5, 2022
Tried to explan which log shows "pushing to quay.io/..." as discussed here: 2i2c-org/infrastructure#1158 (comment)
@damianavila damianavila moved this to In Progress ⚡ in Sprint Board Apr 12, 2022
Repository owner moved this from In Progress ⚡ to Done 🎉 in Sprint Board Apr 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Archived in project
Development

No branches or pull requests

3 participants