plasmabio / tljh-repo2docker

Plugin for The Littlest JupyterHub to build multiple user environments with repo2docker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Environments tab not appearing

machar94 opened this issue · comments

Thank you for help in my previous issue. My current issue I am trying to resolve is being able to see the environments tab (currently nothing shows up).

I have made a docker image that works (verified with binder) and I installed this plugin. My installation instructions were a bit different than the ones suggested in the README since I already have a TLJH instance up and running, so instead I used the command python3 -m pip install git+https://github.com/plasmabio/tljh-repo2docker@master. Post plugin installation, I tried restarting TLJH with tljh-config reload hub with no luck. Am I missing a setup step that might have automatically been done to register the plugin during the post-build script?

Thanks @machar94 for opening this issue.

Access to the Environments tab is only available to admin users. But it looks like this is indeed not clearly mentioned in the README file.

Is the tab displayed when logged as an admin user?

admin

Hmm so I am logged in as an admin user... I also checked to see where the package is installed and I have it under /opt/tljh/user/lib/python3.7/site-packages.

Screen Shot 2020-06-29 at 8 52 34 PM

Is the root owner an issue? By the way, I merely installed with pip. Is there somewhere in the TLJH config that it needs to be made aware that this tljh-repo2docker package exists and should be used?

By the way, I merely installed with pip. Is there somewhere in the TLJH config that it needs to be made aware that this tljh-repo2docker package exists and should be used?

Ah that's probably why it is not picked up.

Plugins are installed with the --plugin command line option of the TLJH installer, so TLJH is able to process the plugin hooks: https://tljh.jupyter.org/en/latest/topic/customizing-installer.html?#installing-tljh-plugins

So the command becomes something like:

curl https://tljh.jupyter.org/bootstrap.py \
 | sudo python3 --plugin git+https://github.com/plasmabio/tljh-repo2docker@master

If you already have a TLJH installation, re-running the installer script will perform an upgrade.

For future users, I had to modify the above command slightly by adding the -L flag to curl (it follows the redirect URLs since curl was returning nothing as is). The command I ran now looks like:

curl -L https://tljh.jupyter.org/bootstrap.py | sudo python3 - --plugin git+https://github.com/plasmabio/tljh-repo2docker@master

I did manage to get an environments tab, but I'm still having some issues. I tried adding the following repo: https://github.com/machar94/rob101-env. However, as it was building, when I clicked the logs, nothing displayed. It was just a black screen. When I run docker images, I do see my image though. After running docker run IMAGE_ID I do see a notebook start looking at the log output, so I believe it was pulled correctly and runs. I'm just having an issue listing it

Screen Shot 2020-06-30 at 8 28 45 PM

No image is shown in the environments tab after refreshing or on the start page.

Screen Shot 2020-06-30 at 8 28 09 PM

Screen Shot 2020-06-30 at 8 27 38 PM

Any ideas? Thanks, @jtpio for your continued help.

This looks good now.

I had to modify the above command slightly by adding the -L flag to cur

Indeed, there is an open PR to fix this in TLJH: jupyterhub/the-littlest-jupyterhub#593

No image is shown in the environments tab after refreshing or on the start page.

It looks like the environment builds fine, and also on Binder too: https://mybinder.org/v2/gh/machar94/rob101-env/master

What is the output of docker inspect -f '{{ index .Config.Labels }}' rob101-julia-v1?

It's probably related to the fact that tljh-repo2docker adds a couple of labels to the Docker image with repo2docker:

labels = [
f"LABEL tljh_repo2docker.display_name={name}",
f"LABEL tljh_repo2docker.image_name={image_name}",
f"LABEL tljh_repo2docker.mem_limit={memory}",
f"LABEL tljh_repo2docker.cpu_limit={cpu}",
]

And uses these labels to filter the environments on the start page.

These labels are added by repo2docker here: https://github.com/jupyter/repo2docker/blob/8bbced7ded5a21b581f1f3846ffc9f87944ba799/repo2docker/buildpacks/base.py#L165-L170

However in the case where a Dockerfile is provided, it is used directly and it looks like the custom labels will not be added.

Would it be possible to add the following at the end of your Dockerfile?

LABEL repo2docker.ref="master"
LABEL repo2docker.repo="https://github.com/machar94/rob101-env"
LABEL repo2docker.version="0.11.0+54.gbbc3ee0"
LABEL tljh_repo2docker.mem_limit=""
LABEL tljh_repo2docker.cpu_limit=""
LABEL tljh_repo2docker.display_name="rob101-julia-v1"
LABEL tljh_repo2docker.image_name="rob101-julia-v1:master"

Danke schoen! 🥳 🥳

Screen Shot 2020-07-01 at 10 47 08 PM

On to mounting the user's home into the docker so there work is saved across sessions. I'll take a look at the tljh_plasma plugin as you mentioned previously. I hope you don't mind if I reach out again.