Skip to content
Simon Byrne edited this page Jan 25, 2023 · 6 revisions

Managing depots

Julia uses a shared depot to store files like packages, artifacts and precompiled images. Unfortunately, this is susceptible to race conditions when multiple processes (either from multiple Slurm jobs, or multiple MPI processes within a Slurm job) attempt to perform package operations.

To reduce the likelihood of this occurring, by default we set the JULIA_DEPOT_PATH variable so that each build will have its own depot. The recommended way to set up a pipeline is to then have a single step which performs the necessary package operations, followed by a buildkite wait step before any other steps.

In order to reduce the time spent precompiling, you can allocate multiple CPU cores to the initialization step, and set JULIA_NUM_PRECOMPILE_TASKS.

For example:

steps:
  - label: "initialize"
    key: "init"
    command:
      - echo "--- Instantiate project"
      - julia --project -e 'using Pkg; Pkg.instantiate(;verbose=true); Pkg.precompile(;strict=true)'
    agents:
      slurm_cpus_per_task: 8
    env:
      JULIA_NUM_PRECOMPILE_TASKS: 8

  - wait

# all other steps
Clone this wiki locally