Here we show how Julia is deployed at PSC. This repo makes very heavy use of templates, and is split up across several folders, each with their own purpose:
psc
├── data
├── environments
├── julia-env
├── julia
├── juliaup
├── kernels
├── scripts
└── util
The overall dependency layout is summarized as follows:
┌─────────────────┐
│┌────────────────┴┐ ┌─────────────────┐ ┌─────────────────┐
││ PSC │ │ User-Defined │ │ User-Defined │
││ Jupyter Kernels │ │ Julia │◄──┬──►│ Jupyter │
└┤ in OnDemand │ │ Modules │ │ │ Kernels │
└─────────────────┘ └─────────────────┘ │ └─────────────────┘
▲▲ │
││ │
┌────────┴┼───────┐ │
│┌────────┴───────┴┐ ┌─────────────────┐ ┌────────┴────────┐
││ │ │ │ │ │
││ Julia Modules │◄───┤ Juliaup Module ├───►│ Juliaup-HPC │
└┤ │ │ │ │ │
└─────────────────┘ └─────────────────┘ └─────────────────┘
▲ ┌─────────────────┐
│ │┌────────────────┴┐
├─────┤│ PSC │
├─────┼┤Julia Environment│
│ └┤ Preferences │
│ └─────────────────┘
│ ┌─────────────────┐
│ │ julia-env │
└─────┤ Module │
│ │
└─────────────────┘
▲ ┌─────────────────┐
│ │┌────────────────┴┐
├─────┤│ PSC │
└─────┼┤ MPI and CUDA │
└┤ Modules │
└─────────────────┘
(arrows indicate dependencies)
The objective of this structure is to be as modular as possible: rather than having one monster script that will reinstall everything every at once, we install the different aspects of the Julia deployment at PSC in 5 separate phases (see below).
Note that this modular structure follows a very important principle: we
decouple the Julia configuration (managed by the Juliaup and
julia-env modules) from the preferred Julia binaries modules. This way
crucial global preferences (e.g. where to find libmpi.so) can be combined
with a users own Julia deployment.
Installing Julia therefore has the following steps:
- Render the templated global preferences. This is only necessary if a system maintenance has changed the names, or versions of the MPI and CUDA system libraries. See the sections on Juliaup and Helper Scripts for more details.
- Render the
julia-envmodule. This module is a dependency ofjuliaupand ensures that thejuliaupmodule can detect the correct MPI and CUDA versions - Install Juliaup. This will also copy the preferences to a global location.
- Ensure that the
juliaupandjulia-envmodules are in theMODULEPATH-- eg. usingmodule use /path/to/juliaup/module. - Install the preferred Julia Binaries.
Note that these depend on the
juliaupmodule being in theMODULEPATH - Install the default Jupyter "PSC-Julia" kernels and helper scripts.
(Note: These are broken up this way, so to make it easier to install a quick update, rather than needing to reinstall everything)
Run:
./entrypoint.sh ./psc/environments/templates/render.sh(there is no _tmp version -- Global preferences are rendered locally and then
copied by the Juliaup installer)
- For the global version run:
./entrypoint.sh ./psc/julia-env/render.sh- For the local version run:
./entrypoint.sh ./psc/julia-env/render_tmp.sh- For the global version run:
./entrypoint.sh ./psc/juliaup/render.sh- For the local version run:
./entrypoint.sh ./psc/juliaup/render_tmp.sh- For the global version run:
./entrypoint.sh ./psc/julia/render.sh- For the local version run:
./entrypoint.sh ./psc/julia/render_tmp.shImportant: these rely on the juliaup module being in the MODULEPATH. If
installing to a location not on the MODULEPATH (e.g. installing for the first
time to tmp), then be sure to remember running ml use /path/to/juliaup/module before running the Julia binary install (above).
- For the global version run:
./entrypoint.sh ./psc/kernels/templates/render.sh- For the local version run:
./entrypoint.sh ./psc/kernels/templates/render_tmp.sh- For the global version run:
./entrypoint.sh ./psc/scripts/templates/render.sh- For the local version run:
./entrypoint.sh ./psc/scripts/templates/render_tmp.sh