-
Notifications
You must be signed in to change notification settings - Fork 35
Description
terra-jupyter-base
should allow the jupyter user to create conda environments in its home directory without having to sudo or run as root. As conda itself tells us, "In general, it's not advisable to use 'sudo conda'"
, and it can cause problems with libraries that default to storing configuration in the user home. Indeed, I was unable to get my nb_conda_kernels
-generated GATK kernel working in https://github.com/broadinstitute/gatk-workshop-terra-jupyter-image/blob/main/Dockerfile (which is derived from terra-jupyter-base
) until I switched to creating the conda environment as the jupyter user.
The main obstacle to enabling this functionality is the /opt/conda/pkgs/cache
directory -- this directory needs to be writable by the jupyter user (or the users
group), even if the jupyter user is just trying to create a conda environment in their own home directory. In https://github.com/broadinstitute/gatk-workshop-terra-jupyter-image/blob/main/Dockerfile I use a terrible hack to allow this directory to be written by the users
group, but there should be a more principled approach involving setting the setgid
bit on the directory and changing the default umask
to allow group write permission (or perhaps by making use of the CONDA_PKGS_DIRS
environment variable).