slaclab / anarel-manage

Manage the conda based analysis release environments that include psana at LCLS.
Other
3 stars 3 forks source link

Automate generation of jupyterhub kernels with new ana releases #10

Closed davidslac closed 7 years ago

davidslac commented 7 years ago

Clemens has created kernels configuration that clears LD_LIBRARY_PATH and sets SIT_DATA, which depends on the specific conda environment (i.e, it is different for ana-1.1.0 and ana-1.0.7), as well as SIT_ROOT for ana-1.1.0.

Next I need to automate the generation of this when new environments are built.

All jupyterhub config will go at

/reg/g/psdm/sw/conda/jhub_config

there, for each conda installation we'll have a subdirectory, in particular

/reg/g/psdm/sw/conda/jhub_config/prod-rhel7

in that directory we'll have

/reg/g/psdm/sw/conda/jhub_config/prod-rhel7/kernels

that is a directory called kernels. That name is dictated by the jupyter stuff. In there, we'll have subdirs for each environment for which we define this kernel config, i.e

/reg/g/psdm/sw/conda/jhub_config/kernels/ana-1.1.0
/reg/g/psdm/sw/conda/jhub_config/kernels/ana-1.1.0-py3

Each of these subdirs will have a file called kernels.json, here is the ana-1.1.0 one:

{
 "display_name": "Python 2 ana-1.1.0", 
 "language": "python", 
 "argv": [
  "/reg/g/psdm/sw/conda/inst/miniconda2-prod-rhel7/envs/ana-1.1.0/bin/python", 
  "-m", 
  "ipykernel", 
  "-f", 
  "{connection_file}"
 ],
 "env": {"SIT_DATA": "/reg/g/psdm/sw/conda/inst/miniconda2-prod-rhel7/envs/ana-1.1.0/data:/reg/g/psdm/data",
         "SIT_ROOT": "/reg/g/psdm", "LD_LIBRARY_PATH": ""}
}

The python 3 one only varies with the display name, and we don't need to set SIT_ROOT or SIT_DATA, but I guess it can't hurt.

davidslac commented 7 years ago

This is working now in ana-1.2.0