Apptainer (Singularity) container management for HPC workloads. Build SIF images, run containers with GPU passthrough. Use when users need HPC-compatible containerization or need to pull/run Apptainer images.
/plugin marketplace add atrawog/bazzite-ai-plugins/plugin install atrawog-bazzite-ai-bazzite-ai@atrawog/bazzite-ai-pluginsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
The apptainer command manages Apptainer (formerly Singularity) containers for HPC-compatible workloads. It provides SIF image management with automatic GPU detection.
Key Concept: Apptainer is the HPC standard. Unlike Docker/Podman, containers run as the user (no root). SIF files are single-file images.
| Action | Command | Description |
|---|---|---|
| Pull | ujust apptainer pull [IMAGE] [TAG] | Download image to SIF |
| Run | ujust apptainer run [SIF] [COMMAND] | Run container |
| Shell | ujust apptainer shell [SIF] | Interactive shell |
| Exec | ujust apptainer exec [SIF] [COMMAND] | Execute command |
| Build | ujust apptainer build [DEF] [OUTPUT] | Build from definition |
| Inspect | ujust apptainer inspect [SIF] | Show metadata |
| GPU | ujust apptainer gpu | Test GPU support |
| Cache | ujust apptainer cache [clean|list] | Manage cache |
| Help | ujust apptainer help | Show help |
# Pull nvidia-python
ujust apptainer pull nvidia-python
# Pull with tag
ujust apptainer pull nvidia-python testing
# Pull jupyter
ujust apptainer pull jupyter stable
# Docker Hub
ujust apptainer pull docker://ubuntu:22.04
# NVIDIA NGC
ujust apptainer pull docker://nvcr.io/nvidia/pytorch:latest
# Sylabs Cloud
ujust apptainer pull library://sylabsed/examples/lolcow
Images are saved as SIF files:
~/.local/share/apptainer/bazzite-ai-pod-nvidia-python.sif
# Run nvidia-python
ujust apptainer run nvidia-python
# Run specific SIF
ujust apptainer run ./my-container.sif
# Run Python in container
ujust apptainer run nvidia-python python
# Run script
ujust apptainer run nvidia-python python script.py
GPU flags are auto-detected:
NVIDIA: Adds --nv
AMD: Adds --rocm
# GPU is automatically enabled
ujust apptainer run nvidia-python python -c "import torch; print(torch.cuda.is_available())"
# Shell into container
ujust apptainer shell nvidia-python
# Now inside container
python --version
nvidia-smi
exit
# Execute single command
ujust apptainer exec nvidia-python "pip list"
# Execute Python one-liner
ujust apptainer exec nvidia-python "python -c 'print(1+1)'"
Bootstrap: docker
From: ubuntu:22.04
%post
apt-get update
apt-get install -y python3 python3-pip
%runscript
python3 "$@"
# Build SIF from definition
ujust apptainer build mydef.def myimage.sif
# Build to default location
ujust apptainer build mydef.def
# Detect and test GPU
ujust apptainer gpu
| GPU | Flag | Auto-Detection |
|---|---|---|
| NVIDIA | --nv | Yes |
| AMD | --rocm | Yes |
| Intel | (none yet) | No |
# Direct apptainer command with GPU
apptainer run --nv nvidia-python.sif nvidia-smi
ujust apptainer cache list
ujust apptainer cache clean
Cache is stored in ~/.apptainer/cache/.
# Pull HPC-ready image
ujust apptainer pull nvidia-python
# Test GPU
ujust apptainer gpu
# Development shell
ujust apptainer shell nvidia-python
# Run production workload
ujust apptainer run nvidia-python python train.py
# Pull NVIDIA PyTorch
ujust apptainer pull docker://nvcr.io/nvidia/pytorch:23.10-py3
# Run training
ujust apptainer run pytorch_23.10-py3.sif python train.py
# Create definition file
cat > myenv.def << 'EOF'
Bootstrap: docker
From: python:3.11
%post
pip install numpy pandas scikit-learn
%runscript
python "$@"
EOF
# Build
ujust apptainer build myenv.def myenv.sif
# Test
ujust apptainer run myenv.sif python -c "import numpy; print(numpy.__version__)"
| Feature | Apptainer | Docker/Podman |
|---|---|---|
| Root required | No | Sometimes |
| Single file | Yes (SIF) | No (layers) |
| HPC compatible | Yes | Limited |
| GPU support | --nv, --rocm | nvidia-docker |
| Security model | User namespace | Container namespace |
Use Apptainer when:
Running on HPC clusters
Need single-file portability
Can't run as root
Need reproducibility
Check:
# Test network
curl -I [https://ghcr.io]([https://ghcr.io](https://ghcr.io))
# Check registry auth
apptainer remote list
Fix:
# Login to registry
apptainer remote login docker://ghcr.io
Check:
ujust apptainer gpu
nvidia-smi # or rocm-smi
Fix:
# Ensure drivers installed
# For NVIDIA:
nvidia-smi
# For AMD:
rocm-smi
Fix:
# Remove and re-pull
rm ~/.local/share/apptainer/*.sif
ujust apptainer pull nvidia-python
Check:
du -sh ~/.apptainer/cache/
Fix:
ujust apptainer cache clean
Related Skills: pod (build OCI images), jupyter (uses containers)
GPU Setup: ujust configure gpu-containers setup
Apptainer Docs: https://apptainer.org/docs/
Use when the user asks about:
"apptainer", "singularity", "HPC container"
"SIF file", "pull image", "build container"
"apptainer GPU", "run with GPU"
"HPC workload", "cluster container"