-
Notifications
You must be signed in to change notification settings - Fork 362
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
Add support for postBuildAdmin #1009
Comments
Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗 |
My initial reaction is that we shouldn't support this because it is not a frequently used feature and it adds another "magic" file. repo2docker itself tries to support frequently used community practice workflows. And making it as effortless as possible for the user if they follow the community practices. This means we choose the trade-off in favour of the frequent and against the rare. For rare or expert use cases there is the escape hatch of providing your own The magic files we already have in repo2docker are one of the things we regret the most because they are totally custom. Which means they make things more complicated and are less well thought out. So we are trying to not add new ones unless there really, really is no other way. This means: can we find more use cases where a user needs this feature and there is no alternative? For example the user in the linked gitter chat seemed happy to use a |
This is the use-case that started this thread:
The In both this and ImageMagic cases it's not about change of the actual base image but about admin-only config. |
I think part of the issue is that repo2docker allows you to install operating system packages using
to the next LTS then since packages may have been dropped or undergone breaking changes this could result in binder repositories failing to build or run. Compare this with most (maybe all?) of the other buildpacks which can be run as a non-admin. |
My view on using As manics points out: the more we allow people to interact with the base image/distro the harder it becomes to change it. At some point bionic won't be supported any more and we will have to change. All this makes me think the answer to "I want to use distro level packages" and the resulting "I need sudo to edit system level packages" should be to reduce the need/desire to do this. For example by encouraging the use of package managers that install things in user editable directories (conda, nix, homebrew for linux?). This means I'd be excited to explore what those options would look like, how much they are used, etc. Right now my feeling is that needing |
Right, in principle Considering alternatives for being able to change live runtime env by user (except maybe for some hard-core sci packages, that anyway require (*) possibly less of an issue with mamba |
One more remark: to solve an issue of mass breaking build of repos in central solution like mybinder.org on r2d update (with potentially build breaking changes), an option would be to add spec of r2d version to use for repo build. (This could also include allowing to use e.g. r2d forks, though it seems somehow a dangerous idea.) |
From a technical perspective, if we do support this feature, I think it should be through making I'm +/- 0 at this point: I don't think there's a high cost to allowing it. Since we do allow custom Dockerfiles, no security argument can be made about it. @trybik allowing request of a repo2docker version is absolutely a goal, see #490. Specifying a fork less so, and at least wouldn't be supported on mybinder.org for the reasons you mentioned. |
Speed and size costs of using conda definitely vary a lot. Mamba has no effect on size, but does significantly improve dependency resolution time. imagemagick is a bit of a worst case scenario because:
As a result, on my laptop adding: dependencies:
- imagemagick took an extra 90 seconds to build, and increased image size from 2.1GB to 3.2GB, an increase of 50% for one package. |
@minrk that's great input, thanks So for practical (mostly image size) reasons it seems like supporting
So e.g. add $NBUSER to |
Again, one more follow-up remark:
If to be allowed, IMVHO It creates a (micro-scale) separation of concerns. Here, separating all potentially image-breaking specifications (image-breaking because of either not being future-proof wrt r2d changes, or by being just bad usage practices, where a clean non-
Note: such warning is currently missing from the PR, but there seem no to be an equivalent one on |
Given how much we install in the user-space, I don't think that's true. It's really easy to create a broken image with postBuild already. So it's more a question of which parts you can break, and there is a lot more that's relevant and required by r2d and breakable by the user than there is that requires root access.
I'd say postBuild is already at this level of support. We've yet to make any real guarantees about what's available or going to be available in this scope, other than "it's run at the end of whatever else r2d does". It's very possible to break large chunks of functionality with conda install commands (or even pip). |
Based on the above discussion I'm in favour of a
|
I still think that if this needs a new special repo2docker-only file, it's not a feature we should add.
I also think we should not do that. If we allow sudo, it should be allowed, both in build and run. If we disallow it, it should be disallowed in both. That is:
that's all. |
What I meant is "all potentially image-breaking specifications" on inevitable update or change of the base image. That's very likely also not true statement, although I guess the "almost all" affected specs would be in
It seems more safe to go about it in steps. If the |
Hey guys. |
@g-braeunlich Unfortunately most of us are lacking in time (as always....). Since there are differing views amongst the maintainers we'll need to come to a consensus. This should eventually happen, but if you're interested in pushing this forward we have monthly JupyterHub meetings in alternating timezones that are open to everyone. The next one is on Thursday 18 March 17:00 UTC: jupyterhub/team-compass#378 |
Hey @manics |
Use at your own risk. I cherry picked @g-braeunlich PR into current master: jabberaa/repo2docker-admin:latest |
If anyone wants to talk about this at the next meeting it's on Thursday 15 April 08:00 UTC: jupyterhub/team-compass#388 |
5 am my time. Unless my kids are a total nightmare I'll just say that something like this is required and leave it at that. |
I'm likely going to fork this and allow for base image selection as well. The images that are being minted by repo2docker for our use case are enormous with no common layers. Having the ability to use our "stock" (docker-stack + special sauce) base images will greatly decrease pull/startup time as each user gets a dedicated node that comes with our base images. |
I'd be very interested in this feature. For instance nvidia drivers and for linking folders outside of the home dir. |
To add any new repo2docker configuration file adds work for sure, but I think supporting I've hesitated on using repo2docker because the current limitation. Both because of concern that I would end up needing the root escape hatch, and because I knew I had to compromise not installing something such as With this in mind, I'm in clear support of adding a new file like With regards to the discussion of either adding a new file or installing If there is agreement on adding support for such file, I suggest |
Proposed change
In addition to
postBuild
script (userspace) also processpostBuildAdmin
scripts (system space).Alternative options / Who would use this feature?
See discussions in #487 and https://gitter.im/jupyterhub/binder?at=5fce35b6fb7f155587ad481a
The text was updated successfully, but these errors were encountered: