Skip to content

Commit

Permalink
Merge pull request #53 from European-XFEL/julia
Browse files Browse the repository at this point in the history
Create an official Julia environment with precompiled packages
  • Loading branch information
JamesWrigley authored Jan 27, 2025
2 parents fbdff7e + 365d85a commit bd0f6b4
Show file tree
Hide file tree
Showing 8 changed files with 4,414 additions and 88 deletions.
3 changes: 3 additions & 0 deletions docs/gen_environments.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ def generate_table(packages, lock_dict):
files = {k: v for k, v in files.items() if v.exists()}
page = f"environments/{name}.md"
yamls = {k: yaml.safe_load(v.read_text()) for k, v in files.items()}
if "environment.lock.yml" not in yamls:
continue

lock_dict = {
dep.split("=")[0]: "=".join(dep.split("=")[1:])
for dep in yamls["environment.lock.yml"]["dependencies"]
Expand Down
30 changes: 19 additions & 11 deletions docs/maintenance/julia.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,30 @@ Currently we only maintain modules for minor versions, not patch versions. If it
turns out a specific patch version is necessary then we will need to rethink
this.

## The global depot
## The global depot and environments

The global depot is stored here: `/gpfs/exfel/sw/software/julia-depot`. It's
updated automatically by cron jobs that run the `update-julia-depot` script
(under `scripts/julia` of this repo). The Julia modules will add the global
depot to `JULIA_DEPOT_PATH` with the goal of reducing precompilation times for
users using those packages.
The global depot is stored here: `/gpfs/exfel/sw/software/julia-depot`. It and
the global environments are updated automatically by cron jobs that run the
`update-julia-env` script (under `scripts/julia` of this repo). The Julia
modules will add the global depot to `JULIA_DEPOT_PATH` with the goal of
reducing precompilation times for users using those packages. A default Julia
environment is not activated by default but the latest one can be set with the
`JULIA_EXFEL_ENV` environment variable: `julia --project=$JULIA_EXFEL_ENV`.

The `Project.toml` and `Manifest-v*.toml` files of the environments are stored
in the `environments/` subdirectories along with the Python environment
lockfiles.

[CUDA.jl](https://cuda.juliagpu.org/stable/) is one of the packages we keep in
the depot and that must be precompiled on a GPU to work, so if you're running
`update-julia-depot` manually make sure you do it with e.g. `srun -p allgpu
update-julia-depot`. The cron jobs do that already.
the environment and that must be precompiled on a GPU to work, so if you're
running `update-julia-depot` manually make sure you do it with e.g. `srun -p
allgpu update-julia-depot`. The cron jobs do that already. From time to time the
CUDA runtime should also be updated, to do that change the call to
`CUDA.set_runtime_version!` in the `update-julia-env` script.

- Run `crontab -e` as `xsoft` on `max-exfl-display001` to see the cron jobs for
it. The precompile files are per-Julia version (and also a lot of other
things that we don't care about), so there should be one cron job per
supported Julia module.
- To add a package to the depot just add it to the `packages` array in the
script and it will be installed the next time the script is run.
- To add a package to an environment, activate the environment and `] add` it as
usual. Remember to set a compat bound for it.
3 changes: 3 additions & 0 deletions environments/202501/LocalPreferences.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[CUDA_Runtime_jll]
__clear__ = ["local"]
version = "12.6"
Loading

0 comments on commit bd0f6b4

Please sign in to comment.