-
Notifications
You must be signed in to change notification settings - Fork 29
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
Allow passing arbitrary extra arguments to repo2docker #96
Conversation
Tests this repo2docker action PR: jupyterhub/repo2docker-action#96 to test this repo2docker PR: jupyterhub/repo2docker#909
description: Force a specific version of repo2docker to be installed. Either in the form of `repo2docker==<version>` for install from pypi, or `git+https://<github-url>@<commit-hash` for installing from a github repo / branch | ||
require: false | ||
EXTRA_PIP_INSTALL: | ||
description: Extra packages to install in the image before running repo |
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.
Do we want this to be a required flag?
Update: this looks like it isn't actually used, so it could be removed?
description: Extra packages to install in the image before running repo | |
description: Extra packages to install in the image before running repo | |
require: false |
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.
I figure "in the image" is confusing as "the image" could be the GitHub action container image or the built repo2docker image. So I suggest "in the environment where repo2docker is run" instead.
But also since I suggested removing FORCE_REPO2DOCKER_VERSION
in favor of sticking with EXTRA_PIP_INSTALL
I figure we also need a note about using this to pin repo2docker's version.
And finally, this includes @GeorgianaElena require: false
addition.
description: Extra packages to install in the image before running repo | |
description: Extra packages to install in the environment that runs repo2docker. You can for example use this to pin a specific version of repo2docker by providing `repo2docker==<version>` or `git+https://<github-url>@<commit-hash` to reference a repo2docker fork not on PyPI. | |
require: false |
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.
Thanks @yuvipanda!
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.
There are lengthy notes as it took a while for me to think this through, but I think I got this reduced to quite clear suggested changes making these review notes more of a background to my suggested changes.
Review notes
I figure ideally this should be three PRs as this adds three separate things, currently the title reflects only Add REPO2DOCKER_EXTRA_ARGS input
I think. I care to a large extent because I want the changelog to be easy to follow from the changelog titles.
REPO2DOCKER_EXTRA_ARGS
The implementation of this is straight forward and seems ok, I can go for a quick merge on a PR adding this especially since a changelog entry is self explanatory with a title focused on adding that.FORCE_REPO2DOCKER_VERSION
- I added an inline comment about why we added
base-build
python3-dev
at all time to the custom Dockerfile we have.
- I added an inline comment about why we added
EXTRA_PIP_INSTALL
- This is an input added to the action.yml but not implemented in any way. I suspect its a remnant after needing python3-dev to be able to build repo2docker.
Discussion points
Regarding FORCE_REPO2DOCKER_VERSION
- Naming:
- I think the
FORCE_
prefix is more verbose than we need to be - I suspect
_VERSION
is a surprise as it really is a pip install entry of some kind.
- I think the
- Implementation:
- I suspect adding
build-base
andpython3-dev
setup time will increase quite notably even if this feature isn't used and don't feel great about it, what could be done? Depends, keep reading... - If a GitHub Dockerfile based action that first builds an action and then runs it can be adjusted already while it builds the Dockerfile, then maybe we can make this be conditionally installed. I think though you can't. The documentation don't mention it and the Job's start out by preparing Dockerfile actions by building the Dockerfile, and when they do, no information is passed with
build-args
etc.
- I suspect adding
With all of this considered...
Suggested changes
- Let
REPO2DOCKER_EXTRA_ARGS
be a dedicated PR very easy to merge quickly and include the name in the title - Transform this PR to a
EXTRA_PIP_INSTALL
+base-build
andpython3-dev
PR whereFORCE_REPO2DOCKER_VERSION
is dropped. Let the PR title reflect thatEXTRA_PIP_INSTALL
is added. Document the input with a note thatEXTRA_PIP_INSTALL
can be used to install a specificrepo2docker
version.
@@ -1,17 +1,9 @@ | |||
FROM quay.io/jupyterhub/repo2docker:main | |||
|
|||
RUN apk add --no-cache curl build-base python3 python3-dev py3-pip |
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.
RUN apk add --no-cache curl build-base python3 python3-dev py3-pip | |
RUN apk add --no-cache \ | |
curl \ | |
# build-base etc is installed to support a specified installation of | |
# repo2docker from source, these packages are the added difference | |
# between the build stage and the production stage in repo2docker's | |
# official Dockerfile: | |
# https://github.com/jupyterhub/repo2docker/blob/2022.10.0/Dockerfile#L5 | |
build-base python3-dev py3-pip |
@GeorgianaElena what do you think about my suggested changes above? |
@consideRatio I've split out just the extra-args into #97, will come back to the rest here once that is merged |
I suspect the input variable is available only at runtime, not build time
Is this good to merge? |
@hamelsmu yep! |
Ok merging. I would like the features in this PR as well 🙇🏽 Thank you for doing this. P.S. @yuvipanda we should catch up at JupyterCon if you are going to be there |
repo2docker that we may not explicitly have options for.
helpful for reproducibiliy, but also helpful when we want to test an unreleased version of
repo2docker
required if we want to install an unreleased version of repo2docker. This mostly brings in
packages present in the build stage of the upstream repo2docker image that we use:
https://github.com/jupyterhub/repo2docker/blob/main/Dockerfile
You can see an example of this in action in volcanocyber/VICTOR-notebook#6,
where we switch the base image to Ubuntu 22.04 by bringing in this PR: jupyterhub/repo2docker#909