Container Deployment
The weather pipeline runs inside a container on HPC clusters (Apptainer) and VMs/workstations (Docker). The image contains only the conda environment and system tools — source code is bind-mounted at runtime.
This means:
Code changes require only an
scpand re-run (seconds).Dependency changes (
weather_env.yml) require an image rebuild (~10 min).
Image Contents
Layer |
What |
|---|---|
Base |
|
System tools |
|
Conda env |
|
Source code |
Not included — bind-mounted at runtime |
Apptainer (HPC / Snellius)
Build (only when weather_env.yml changes):
cd ~/buem
bash src/buem/weather/shell_scripts/build_container.sh def
This submits a SLURM job to the pbuild partition. The SIF image
appears at ~/buem/buem_weather.sif when the job finishes.
Run:
sbatch src/buem/weather/shell_scripts/run_pipeline_container.sh --months 1
The run script bind-mounts:
Host path |
Container path |
Purpose |
|---|---|---|
|
|
Python source code |
|
|
Download, decompress, and output directories |
Update code without rebuilding:
# From local machine:
scp -r src/buem/weather ssahoo@snellius.surf.nl:~/buem/src/buem/
# On Snellius:
sbatch src/buem/weather/shell_scripts/run_pipeline_container.sh --months 1
Interactive debugging:
apptainer shell --bind ~/buem/src:/app/src ~/buem/buem_weather.sif
# Inside the container:
python -m buem.weather info
python -m buem.weather validate
Environment variables (override defaults):
Variable |
Default |
Description |
|---|---|---|
|
|
Path to the SIF image |
|
|
Host data directory |
|
|
Host source directory |
Docker (VMs / Workstations)
Build:
docker build -f src/buem/weather/Dockerfile.weather -t buem-weather .
Run (mount source + data):
docker run --rm \
-v $(pwd)/src:/app/src \
-v ~/buem_weather:/data \
-e COSMO_WORK_DIR=/data \
buem-weather \
python -m buem.weather run --months 1
Push to registry (for apptainer pull on HPC):
docker tag buem-weather docker.io/<user>/buem-weather:latest
docker push docker.io/<user>/buem-weather:latest
Build Methods
build_container.sh supports four methods:
Method |
Command |
Where |
|---|---|---|
|
Build SIF from |
Snellius (pbuild) or local with root |
|
Build Docker image |
Local (Docker required) |
|
Docker image → SIF |
Local (Apptainer required) |
|
Registry → SIF |
Snellius login node (no root) |
Key Files
File |
Purpose |
|---|---|
|
Apptainer definition (deps-only image) |
|
Docker multi-stage build (deps-only image) |
|
Build script (4 methods) |
|
SLURM job script for containerised runs |
|
Conda environment specification |