ideonate / cdsdashboards

JupyterHub extension for ContainDS Dashboards
https://cdsdashboards.readthedocs.io/
Other
200 stars 38 forks source link

Allow user to select conda env for the dashboard #15

Closed danlester closed 4 years ago

danlester commented 4 years ago

Multiple conda envs work correctly in Voila since the conda env name is embedded in the ipynb.

For the other frameworks, the user should be able to select from a list of available envs when they create the dashboard.

To try, on TLJH:

source /opt/tljh/user/bin/activate 
conda create --name newenv python=3.7 
conda activate newenv
conda install -c conda-forge ipykernel
python -m ipykernel install --name "newenv" --display-name "Python [newenv]"
conda install -c conda-forge dash # To show the env is different

If jhsingle-native-proxy adds something like this before the 'real' command:

conda init bash && conda activate newenv && ...

Then there is an error because the conda command 'eats' all of the command line and doesn't like e.g. '-m' of python -m.

simpervisor/process.py is usingasyncio.create_subprocess_exec instead of asyncio.create_subprocess_shell which could be the problem.

So this still needs some investigation.

fcollonval commented 4 years ago

I don't know if this can help. But nb_conda_kernels is using a special run script to execute the kernel within a conda environment.

More information:

danlester commented 4 years ago

@fcollonval Thank you so much for the pointer! I was aware of nb_conda_kernels and felt the answer must be in there somewhere... Thanks for locating it, I hope - I'll try it out anyway.

Dan

danlester commented 4 years ago

This is now available in version 0.3.0 - thanks for the input @fcollonval !