Closed
Description
Description
When trying to create a docker image for JupyterHub containing jupyter_conda, I'm getting the following error in the terminal:
Fail to load available packages from cache [Errno 2] No such file or directory: '/tmp/jupyter_conda_packages.json
After a few moments, this error does seem to resolve as /tmp/jupyter_conda_packages.json is created by the notebook server.
I have two questions regarding this behaviour:
- Why is the file only showing up later? Is there a way to get this file loaded before? (Currently it is giving an error in the UI as well, together with the terminal error, which is worrying our users needlessly.)
- The jupyter_conda_packages.json file is being writting to /tmp/jupyter_conda_packages.json, and is being owned by the user who first spawned his/her notebook. Will this work in a multi-user setup?
Reproduce
I'm creating a docker image using:
ARG PYTHON_VERSION=3.6
FROM godatadriven/miniconda:${PYTHON_VERSION}
ARG BUILD_DATE
ARG JH_VERSION
LABEL org.label-schema.name="JupyterHub $JH_VERSION" \
org.label-schema.build-date=$BUILD_DATE \
org.label-schema.version=$JH_VERSION
RUN set -x && \
if [ -n "$JH_VERSION" ]; then\
conda install -y nb_conda_kernels jupyter_conda jupyterhub==$JH_VERSION jupyter_client 'tornado<6' -c conda-forge;\
else\
conda install -y nb_conda_kernels jupyter_conda jupyterhub jupyter_client 'tornado<6' -c conda-forge;\
fi && \
python -m nb_conda_kernels.install --enable --prefix=/opt/miniconda3 && \
conda clean -tipsy && \
apt-get update && \
apt-get install -y git build-essential nano vim less procps apt-transport-https ca-certificates --no-install-recommends && \
apt-get clean
RUN useradd -ms /bin/bash -p "$(openssl passwd -1 joyvan)" joyvan
EXPOSE 8000
ENTRYPOINT ["jupyterhub"]
I then start the server using:
docker run --rm -p 8000:8000 jupyterhub:latest --ip 0.0.0.0
and login using user joyvan
with password joyvan
.
Expected behavior
- For the first question, I would expect not to get this error + get packages loaded in the left bottom window of the conda tab on the first view.
- For the second, I would expect the json file to be written in a user-specific location rather than a global location that is the same for all users.
Context
- Python package version: 3.1.1
- Extension version: n/a
- General information:
Conda info:
active environment : None
user config file : /home/joyvan/.condarc
populated config files :
conda version : 4.7.12
conda-build version : not installed
python version : 3.6.9.final.0
virtual packages :
base environment : /opt/miniconda3 (read only)
channel URLs : https://repo.anaconda.com/pkgs/main/linux-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/r/linux-64
https://repo.anaconda.com/pkgs/r/noarch
package cache : /opt/miniconda3/pkgs
/home/joyvan/.conda/pkgs
envs directories : /home/joyvan/.conda/envs
/opt/miniconda3/envs
platform : linux-64
user-agent : conda/4.7.12 requests/2.22.0 CPython/3.6.9 Linux/4.9.184-linuxkit debian/9 glibc/2.24
UID:GID : 1000:1000
netrc file : None
offline mode : False
Metadata
Metadata
Assignees
Labels
No labels