Open simonbyrne opened 4 years ago
One idea from JuliaCon BoF on Julia in Production: build a system image of all the dependencies, and invalidate only if the Manifest changes
We could even do this into a Singularity container?
I think that would work as long as nothing had to be written to the singularity container during runtime (after build step)
I think singularity containers are immutable
How about this:
/groups/esm/buildkite/depot/cpu
and /groups/esm/buildkite/depot/gpu
)central-init
) of which there can only be one instance running at a time (either via --dependency=singleton
, or even simply run the agent on the login node), that is only used for the buildkite-agent pipeline upload
steps.module load openmpi/4.0.4
JULIA_DEPOT_PATH=/groups/esm/buildkite/depot/cpu julia --project -e 'using Pkg; Pkg.instantiate(); Pkg.precompile()'
module purge
module load openmpi/4.0.4_cuda-10.2 cuda/10.2
JULIA_DEPOT_PATH=/groups/esm/buildkite/depot/gpu julia --project -e 'using Pkg; Pkg.instantiate(); Pkg.precompile()'
module purge
export JULIA_DEPOT_PATH="$(dirname "$BUILDKITE_BUILD_CHECKOUT_PATH")/.julia:/groups/esm/buildkite/depot/cpu"
If we could do this with a singleton slurm job instead of as extra logic in the agent I think that would be preferable as it is a bit more flexible. Is this possible with slurm?
on second thoughts, I agree an explicit extra step would be better.
Is this possible with slurm?
Yes, you give it a unique job name (say --job-name=buildkite-init
), and then use --dependency=singleton
, and it will only run one instance at a time.
Ok I think this should be straightforward then
This might be a nice solution: https://github.com/JuliaCI/DepotCompactor.jl/
In our old slurmci we have a separate init job that installs the packages and does a round of precompilation. This isn't such an issue with buildkite as agents have a cache that they can use (reducing the need to reinstall packages), but if we wanted to do something like this we would need a way to share the initialized cache between the downstream agents.