-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Create base image to base-notebook for non-server Jupyter applications #1825
Conversation
Thank you! This means a lot because many attempts have failed before I came up with this and I've spent much time implementing it this way ❤️ I will try to review this PR in the next two days. I appreciate, that you have a nice list of all decisions you made here 👍 |
I don't have strong opinion on this one. I may suggest
In the most root container (
No, let's remove them. Preserving them might confuse users, who think it's ok to change them in minimal (but it will be too late).
👌
👌
Let's maybe create a small function which runs docker for one particular package manager and import it from both tests?
Could you maybe check for another hidden folder?
Please, let's update this file as well, because we would like to have a nice description for this docker image as well, because it will be pushed to DockerHub as well. |
One more thing that bothers me is the image size increase. For example, |
Delibaration on the image nameI'm thinking quite a bit on the naming of the new image. What do you think about I value if it becomes quite clear for whoever ends up seeing the name can guess that this is a opinionated functionality defined in this project, and not something one can read and learn about in any jupyter project. I've quite a few times found myself communicating that |
@mathbunnyru - thank you for the review. I'm going to hold off with the image name change until a consensus has been reached. Regarding the image size differences, that is interesting. Could you please share how you're accessing the image sizes? I found looking into the "Load image to docker" step of the links you sent shows some sizes and found the following: From main:
From this PR:
From what I can see, the introduction of FWIW - the size changes are consistent across the x86_64 images as well. Are you asking me to "dive" into why there's a 10MB increase or figure out the increase due to spark (and/or perhaps pyarrow) installs across main and this PR? |
FWIW - when I build the images locally (using
No increase. I'll build all the images locally and see if their sizes are consistent with those listed in the previous comment from the main branch. Are the images built during a given PR pushed anywhere so they can be analyzed from that build? |
The answer is the same here. Under the graph, you will see all the artefacts.
I will rebuild images in |
This is the run: https://github.com/jupyter/docker-stacks/actions/runs/3395647439 |
10MB size increase is perfectly fine. |
Co-authored-by: Ayaz Salikhov <mathbunnyru@users.noreply.github.com>
main: https://github.com/jupyter/docker-stacks/actions/runs/3395647439 PR: https://github.com/jupyter/docker-stacks/actions/runs/3396469599 I think this issue is resolved 🎉 |
@@ -130,206 +78,27 @@ def test_nb_user_change(container: TrackedContainer) -> None: | |||
), f"Hidden folder .jupyter was not copied properly to {nb_user} home folder. stat: {output}, expected {expected_output}" |
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.
Sorry that I wasn't clear about this one.
Let's move everything except the hidden folder test (the last part of this function) to the jupyter-base
tests and keep hidden folder test here.
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.
ok - that's what my previous commit did, so I think we're good. Thanks.
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 would like you to split test_nb_user_change
function into two parts.
The first part works perfectly fine in foundation image and should go to the appropriate test folder.
The second one only checks that the .jupyter
folder is properly copied for base-notebook image and this part of this function stays in base-notebook
tests.
There will be some small duplication how we start the container, but it's fine.
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.
Sorry about that. Re-reading your original comment - this is what you were getting at. So there's only a constraint on the names of the test files, but not on the names of the test functions themselves?
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.
Unfortunately, I don't know the restrictions of pytest 😢
But I know, that there is an ability to run one particular test in pytest, so I would definitely try to use different function names for different tests.
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.
LGTM 🎉
The only thing left to be done is to create DockerHub image.
I will do it as soon as I get right permissions there.
I hope it will happen next week.
jupyterhub/team-compass#559
Hi @mathbunnyru. I've split Also, thank you for the fix-up commits. I had noticed the alphabetical ordering the first time but completely forgot that the name change would lead to a position change - so thanks for correcting that. I was too focused on the replacement activity. |
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.
Thank you @kevin-bates!
I'm absolutely happy with this PR now.
So, let's wait until I get permissions, and then I will merge this.
@consideRatio please, take a look at this PR as well, please.
Closed and reopened the PR to trigger CI once again (there were some network failures). |
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.
This LGTM, amazing work on this @kevin-bates and @mathbunnyru!! Super happy to see the build system manages to handle it!
I created the repo: https://hub.docker.com/r/jupyter/docker-stacks-foundation |
My plan is the following:
|
@kevin-bates @consideRatio and it worked 🎉 https://github.com/jupyter/docker-stacks/actions/runs/3452686673 |
Awesome - thank you for your help and guidance @mathbunnyru! |
Describe your changes
This pull request introduces the image
base-jupyter
docker-stacks-foundation
from whichbase-notebook
is derived. This enables the ability for other Jupyter-related images (e.g., Jupyter kernel ornbclient
applications) to be built which adhere to the same infrastructure found across the images.This exercise was a bit more involved than I originally anticipated, but I guess I'm not surprised given the nature of what is actually provided here. I'm impressed with the build system you've assembled! Along the way, I ran into some questions and needed to make decisions, which I've attempted to document below, and I anticipate other issues arising during your review and the ultimate completion of the tests.
Issue ticket if applicable
Resolves: #1809
Checklist (especially for first-time contributors)
base-notebook
since this image is a direct subset.Questions and decisions:
(There are a number of naming decisions here, none of which I hold a strong affinity to, so don't hesitate to suggest changes.)
I wanted to name the
jovyan-base
(seemed like a play on the 'solar system' aspect) but felt the base-prefix precedent was already set bybase-notebook
- so went withbase-jupyter
rather thanbase-jovyan
.base-notebook/Dockerfile
: Should argumentROOT_CONTAINER
be changed toBASE_CONTAINER
like other "derived" Dockerfiles? Left asROOT_CONTAINER
for b/c purposes?base-notebook/Dockerfile
: Should argumentsNB_USER
,NB_UID
, andNB_GID
be preserved in base-notebook/Dockerfile for b/c purposes?base-notebook/Dockerfile
:mamba install
does not support--root-prefix
(unlikemicromamba install
) so it was removed.test_container_options.py
was split intotest_user_options.py
(for uid, chown tests) inbase-jupyter
and left astest_container_options.py
for port-based tests inbase-notebook
.The
base-jupyter
testtest_package_managers.py
removednpm
andtest_npm_package_manager.py
added tobase-notebook
tests sincenpm
is not installed until Lab is installed.The
base-jupyter
testtest_user_options.py
- changed the hidden folder named'.jupyter'
to'work'
since.jupyter
doesn't exist inbase-jupyter
(as a function of creating configuration inbase-notebook
).GH workflow,
hub-overview.yml
unchanged sincebase-jupyter
doesn't apply.Current build status (from tests within my fork)
Have hit two CI snags (that I'm aware of):
base-notebook
gets when attempting to pull the new base image:jupyter/base-jupyter
.