plasmabio / tljh-repo2docker

Plugin for The Littlest JupyterHub to build multiple user environments with repo2docker
BSD 3-Clause "New" or "Revised" License
60 stars 15 forks source link

Dockerfile #45

Closed Grindayzer closed 2 years ago

Grindayzer commented 3 years ago

Hi, I am trying to run an envrionment with a dockerfile based on the image jupyterhub/singleuser

After adding the lines at the beginning of the dockerfile, after FROM ...

LABEL repo2docker.ref="master"
LABEL repo2docker.repo="https://xxxx/jhub/octave"
LABEL repo2docker.version="0.11.0+54.gbbc3ee0"
LABEL tljh_repo2docker.mem_limit=""
LABEL tljh_repo2docker.cpu_limit=""
LABEL tljh_repo2docker.display_name="octave"
LABEL tljh_repo2docker.image_name="octave:master"

the environment appears in the main table image

But when I try to spawn the environment, I have this issue

image

with his log [FATAL tini (6)] exec /srv/conda/envs/notebook/bin/jupyterhub-singleuser failed: No such file or directory

Please how I can resolve this ?

Thank you,

Rafik

jtpio commented 3 years ago

Thanks Rafik for opening the issue.

I think tljh-repo2docker for now assumes jupyterhub is installed in the docker image:

https://github.com/plasmabio/tljh-repo2docker/blob/35e7e940266de0490990acc780b64802afe973c1/tljh_repo2docker/__init__.py#L182

Similar to the plasma config here: https://github.com/plasmabio/plasma/blob/7883a6a1266b69ab49f353bdf9974be408bf0709/tljh-plasma/tljh_plasma/__init__.py#L123

If it's a custom Docker image with a custom Dockerfile, maybe it's possible to install jupyterhub, and point c.DockerSpawner.cmd to where jupyterhub-singleuser is located?

Grindayzer commented 3 years ago

Hi Jeremy, Thank's for the reply.

In tljh_repo2docker/__init__.py the DockerSpawner is enabled c.DockerSpawner.cmd = ["jupyterhub-singleuser"]

then I have to install jupyterhub in the sytem ? Or by docker ?

This is not going to affect the actual setup ?

jtpio commented 3 years ago

then I have to install jupyterhub in the sytem ? Or by docker ?

In the Docker image (user environment). Normally a custom Dockerfile should also have the notebook or jupyterlab dependency to start the Jupyter server as the CMD.

Linking to the Binderhub documentation which might provide more information: https://mybinder.readthedocs.io/en/latest/tutorials/dockerfile.html

jtpio commented 3 years ago

This is not going to affect the actual setup ?

It should only affect the user environment built with the custom Dockerfile.

nikl11 commented 3 years ago

I had the same issue, any image I wanted to start just timed out after 30s just like you. I added these 2 lines into my jupyterhub_config.py, restarted jupyterhub and images now load and run flawlesly

c.Spawner.http_timeout = 3600
c.Spawner.start_timeout = 3600
jtpio commented 2 years ago

@Grindayzer mind sharing a sample Dockerfile, so it's easier to test and reproduce? Thanks!

Looks like the change by @TimoRoth in https://github.com/plasmabio/tljh-repo2docker/pull/48 might fix this issue, as labels would then be handled natively by repo2docker.

jtpio commented 2 years ago

Closing as this should now be fixed by https://github.com/plasmabio/tljh-repo2docker/pull/48.

And can be tested with the following template: https://github.com/plasmabio/template-dockerfile. This template adds the jupyterhub~=1.0 dependency to the image so it can be used with TLJH / JupyterHub: https://github.com/plasmabio/template-dockerfile/blob/88b2f78557d4f4d3686b9d447d2c0dd3c3d236f5/Dockerfile#L4

Feel free to reopen or open a new one if you are still experiencing issues. Thanks!