Singularity apptainer

From uw-ssec/rse-plugins · View interactive version

Singularity apptainer is an AI agent skill from the GitHub repository uw-ssec/rse-plugins. Use when the user asks about Singularity, Apptainer, HPC containers, running containers on clusters, or converting Docker images for HPC environments. Creates definition files, builds and validates .sif images, configures MPI/GPU execution, and integrates container runs with Slurm.

How to use this skill

Skill file

Singularity/Apptainer

Primary Actions

Quick Command Card

# Build/pull
apptainer build image.sif definition.def
apptainer pull image.sif docker://python:3.12-slim

# Run/inspect/test
apptainer exec image.sif python --version
apptainer inspect image.sif
apptainer test image.sif

# GPU
apptainer exec --nv image.sif nvidia-smi

# MPI (example)
srun --mpi=pmix apptainer exec image.sif ./my_mpi_app

End-to-End Workflow With Validation Gates

  1. Build or convert image.
  2. Validate image metadata and %test checks.
  3. Run a runtime smoke command (apptainer exec ...).
  4. For GPU jobs, validate with --nv and nvidia-smi.
  5. For MPI jobs, run a small multi-rank test before scaling.
  6. If any gate fails, fix definition/runtime config and repeat from step 1.

Definition File At a Glance

Bootstrap / From
%post
%environment
%runscript
%test

Templates

Deep References

references/definition-files.md

references/mpi-containers.md

references/hpc-workflow-patterns.md

references/validation-and-recovery.md

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.