Unidata / science-gateway

Unidata Science Gateway on the NSF Jetstream2 Cloud
https://science-gateway.unidata.ucar.edu/
BSD 3-Clause "New" or "Revised" License
19 stars 13 forks source link

Consider Moving Location of conda Environments w/ .condarc #222

Closed julienchastang closed 5 years ago

julienchastang commented 6 years ago

https://stackoverflow.com/questions/35280479/can-i-choose-where-my-conda-environment-is-stored

julienchastang commented 6 years ago

@rsignell-usgs Give it a shot now. Your environments should be persisted between container restarts.

rsignell-usgs commented 6 years ago

@julienchastang , actually, this doesn't seem to be working.

Even though I can see that CONDA_ENVS_PATH is set, and my envs are there:

rsignell@af74b435f540:/notebooks/rsignell$ env | grep CONDA
CONDA_ENVS_PATH=/notebooks/rsignell/my-conda-envs:/opt/anaconda/envs
rsignell@af74b435f540:/notebooks/rsignell$ ls /notebooks/rsignell/my-conda-envs
IOOS  globus  hsds  mi  pygdp

if I remove the specification in my ~/.condarc directory, changing:

channels:
  - conda-forge
  - defaults
envs_dirs:
  - /notebooks/rsignell/my-conda-envs

to

channels:
  - conda-forge
  - defaults

and restart my server, it doesn't work. No envs are found.

julienchastang commented 6 years ago

@rsignell-usgs I can confirm the issues you are having with ~/.condarc. Apparently ~/.condarc supersedes your environment vars so you may be back to having to use:

channels:
  - conda-forge
  - defaults
envs_dirs:
  - /notebooks/rsignell/my-conda-envs
rsignell-usgs commented 5 years ago

I just got bit by this again. I created a .condarc and then my custom env did not get persisted. How about creating a default .condarc for users that just contains one line:

envs_dirs:
  - /home/jovyan/my-conda-envs