diff options
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/prepare-julia-depot.sh | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/scripts/prepare-julia-depot.sh b/scripts/prepare-julia-depot.sh new file mode 100755 index 0000000..0e7b2d9 --- /dev/null +++ b/scripts/prepare-julia-depot.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash +# Prepare the Julia depot BulkLMM needs, once, deliberately. +# +# The depot is small on purpose (79 packages, ~140 MB: CSV, DataFrames, +# Distributions, Optim and their dependencies -- no GPU/CUDA stack). Requests +# run with JULIA_PKG_OFFLINE=true, so a scan never downloads anything; this +# script is the only thing that does, and only when run by hand. +# +# scripts/prepare-julia-depot.sh /path/to/depot /path/to/project +# +# The project must carry the pinned Manifest.toml (see docs/bulklmm.md); the +# deployment's copy lives in factory/gn4-julia-env. +set -euo pipefail + +DEPOT="${1:-$HOME/.julia}" +PROJECT="${2:-$(cd "$(dirname "$0")/.." && pwd)/../gn4-julia-env}" +JULIA="${JULIA:-julia}" + +[ -f "$PROJECT/Manifest.toml" ] || { + echo "$PROJECT: no Manifest.toml -- the depot must be built from a pinned project" >&2 + exit 1 +} + +echo "depot: $DEPOT" +echo "project: $PROJECT" +echo "julia: $("$JULIA" --version)" + +JULIA_DEPOT_PATH="$DEPOT" "$JULIA" --startup-file=no --project="$PROJECT" -e ' + using Pkg + Pkg.instantiate() + Pkg.precompile() + println("depot ready: ", length(readdir(joinpath(DEPOT, "packages"))), " packages") +' +echo +echo "Point the API at it: BULKLMM_DEPOT=$DEPOT BULKLMM_ENV=$PROJECT" |
