/hvantk:hpc-container [--out <image path>] [--promote] (builds from the checkout named in the site profile)from hvantk
Builds, validates, and promotes the hvantk container image from a lock file on HPC clusters without root access, using fakeroot or proot. Handles build failures, install validation, and provenance recording.
Ships in hvantk. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Read the hvantk:workflow-conventions skill (skills/workflow-conventions/SKILL.md)
first; this skill assumes its site-profile rule, its section contract and its
measurement contract.
The image is the environment hvantk runs in on the cluster: Python 3.10, Java 11, Hail
and every locked dependency, built from containers/hvantk.def and the checkout's
poetry.lock. The outcome is a versioned image file, a provenance record next to it
(<image>.provenance.json) naming the commit, the lock file hash and the install check's
result, and, when asked, the default image pointer moved to it with the old default kept.
Build when the lock file changed, when the package's entry points changed, when the
base image or the def file changed, and before a release's first cluster run. Do not
build for a code change alone: jobs run the checkout's code inside the image
(hpc-hail-job exports PYTHONPATH), so the image only has to carry dependencies.
Not this skill: running jobs (that is hpc-hail-job), editing the def file (a code
change with its own review), and clusters where images are built by administrators
only (then the "build elsewhere and copy" note in section 4 applies).
source "$HVANTK_SITE_PROFILE" && bash "$HVANTK_REPO/skills/_site/check-site-profile.sh" --allow-missing-image;
stop and ask for any missing value. --allow-missing-image is needed because this
skill runs before HVANTK_SIF exists on a new site. Every later command that reads a
profile value starts with the same source "$HVANTK_SITE_PROFILE" &&.git -C "$HVANTK_REPO" rev-parse HEAD and git -C "$HVANTK_REPO" status --porcelain.
Build from a clean tree at the commit the user expects; a dirty or stale tree builds
an image whose provenance names a commit that is not what went in. If the clone is
behind, run the hpc-sync skill first.grep -cE "^($USER|$(id -u)):" /etc/subuid
greater than zero means --fakeroot works; zero means the build needs a static
proot on PATH with SingularityCE (references/build-troubleshooting.md says how
to get one; Apptainer sites may build without either, check your site). Record which.HVANTK_EGRESS says whether compute nodes have it; if they do not,
build elsewhere and copy the image file (section 4); the templates only build inside a
job.$HVANTK_WORK/containers/{cache,tmp}), never under the home directory; a build needs
several GB there and the image is about 2 GB.HVANTK_CONTAINER_BIN (singularity or apptainer); the template
uses it for the build and for the check. The def file's %arguments and the build's
--build-arg need SingularityCE 4.0+ or Apptainer 1.2+: check
"$HVANTK_CONTAINER_BIN" --version once per site.hvantk-<tag or short sha>.sif under
$HVANTK_WORK/containers/. Never build straight onto the default name.source "$HVANTK_SITE_PROFILE" && bash "$HVANTK_REPO/skills/hpc-container/templates/submit-build-image.sh" \
--out "$HVANTK_WORK/containers/hvantk-<id>.sif" --name <run>-build --wait
The job builds from the repository root (the def file's %files are relative),
refuses a name that resolves to the profile's default image, gates the Java version
and records the Hail version inside the image, passes the commit as a build arg,
which the def file stamps into the image's own copy of hvantk
(references/provenance.md), runs hvantk utils check-install through the scratch
pattern, and writes the provenance record. Allow ten to twenty
minutes on a shared partition, longer the first time; the request is 8 cores, 32 GB
and 1h45 so a slow pull does not kill it. A foreground --wait outlives most tool
timeouts, so run it as
nohup bash -c 'source "$HVANTK_SITE_PROFILE" && bash ... --wait' > <run>-build.log 2>&1 &
and poll the job id.cat "<image>.provenance.json". The fields are in
references/provenance.md; check_install_rc must be 0 and hail_version must be
the locked one.source "$HVANTK_SITE_PROFILE" && bash "$HVANTK_REPO/skills/hpc-container/templates/promote-image.sh" "$HVANTK_WORK/containers/hvantk-<id>.sif" --name <run>-promote
The default is the profile's HVANTK_SIF. The script refuses while you have any
job queued or running (squeue -u "$USER"), or while the queue cannot be read at
all; when the default is a real file it is
kept as hvantk-<date>.sif with its record, when it is a symlink the old target is
kept as it is; then the default (and its record) point at the new file and a
verification job runs the install check through the promoted name. Run it in the
background and poll, as for the build. Say in the run notes which image is now the
default.sha256sum of the new file), job ids, and
whether the default moved.$HVANTK_WORK/containers/: one per release or per lock
file change, each with its provenance record. Old defaults keep their dated names
until the user removes them; a job that still names one keeps working.git_commit is a tag that the cluster can resolve (sync tags with hpc-sync).singularity build --build-arg HVANTK_COMMIT=$(git rev-parse HEAD) hvantk-<id>.sif containers/hvantk.def from the repository root (SingularityCE 4.0+
or Apptainer 1.2+, with --fakeroot or proot as the host allows), copy the file
and write the provenance record by hand from the same fields; then run the
verification job on the cluster, because an image that was never checked on a
compute node is not validated.$HVANTK_WORK/containers/cache grows with every pull; clear it
between releases, never during a build.could not use fakeroot: no valid mapping entry found for <user> or --remote, --fakeroot, or the proot command are required. Cause: no /etc/subuid entry.
Fix: a static proot on PATH (section 2 step 3); the template detects which to use.unknown flag: --build-arg. Cause: SingularityCE older than 4.0 or Apptainer older
than 1.2. Fix: a newer container tool (section 2 step 6), or build elsewhere and copy
the image.%files with files not found. Cause: it was not started from the
repository root; the def file copies relative paths. Fix: the template cds to
$HVANTK_REPO; if you build by hand, do the same.apt-get finds the index but every package 404s. Cause: a base image whose
distribution left support (the old Debian bullseye base). Fix: the def file pins a
supported base; do not "fix" it by pointing apt at a snapshot.openjdk-11 and the distribution offers only 17. Cause: a base
without Java 11 (Debian bookworm). Fix: keep the def file's base; Hail supports Java
8 and 11 only.check-install fails with Connection refused right after the build. Cause: it was
run on the login node or without node-local scratch. Fix: the template runs it in the
job through the scratch pattern; by hand, use containers/hvantk_run.sh on a compute
node.SINGULARITY_CACHEDIR and SINGULARITY_TMPDIR (or the APPTAINER_
pair) before building.hpc-sync first; compare
poetry_lock_md5 in the record with md5sum poetry.lock in the synced clone.squeue -u "$USER" lists anything at
all, pending included, not specifically a running job. Fix: wait for the queue
to clear.singularity is not on PATH but apptainer is (or the reverse). Cause: site
naming. Fix: HVANTK_CONTAINER_BIN in the profile.host or slurm_job field is empty. Cause: the build ran outside a job.
Fix: fine for a build elsewhere; say so in the run notes.<image>.provenance.json exists, check_install_rc is 0, git_commit is the
commit you built from, worktree is clean, poetry_lock_md5 equals
md5sum "$HVANTK_REPO/poetry.lock".hail_version in the record starts with the locked Hail version (the record carries
the full string, for example 0.2.137-<hash>), and java_version starts with 11.--sif "$HVANTK_WORK/containers/hvantk-<id>.sif"), the profile's default after it
(--sif "$HVANTK_SIF"):
source "$HVANTK_SITE_PROFILE" && bash "$HVANTK_REPO/skills/hpc-hail-job/templates/submit-hail-job.sh" --sif "$HVANTK_WORK/containers/hvantk-<id>.sif" --name <run>-verify --cpus 4 --mem-gb 16 --time 0-00:20:00 --wait -- hvantk utils check-install
prints the Hail version and All checks passed.references/provenance.md
shows the record and how each field is read (every command there that reads a
profile value starts with source "$HVANTK_SITE_PROFILE" &&, as in this skill).eval/check.py (opens in a new tab)eval/control.sh (opens in a new tab)eval/reference.json (opens in a new tab)eval/stage.sh (opens in a new tab)eval/task.md (opens in a new tab)references/build-troubleshooting.md (opens in a new tab)references/provenance.md (opens in a new tab)templates/build-image.sbatch (opens in a new tab)templates/promote-image.sh (opens in a new tab)templates/submit-build-image.sh (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub bigbio/hvantk --plugin hvantk13 skills in this plugin
/ancestry-inferenceUse when samples of a cohort must be assigned a continental ancestry with hvantk: building a labelled reference MatrixTable from 1000 Genomes, running the PCA and random-forest pipeline as a Slurm job, and reading the predictions and their confidence. Also when the pipeline refuses for too few shared variants, mixed genome builds or a missing label column, or when many samples come back unassigned./callset-subset-exportUse when a sample subset of a joint callset must be delivered as a verified VCF: subsetting the lossless VDS by sample list, densifying and exporting with hvantk, verifying header samples and record counts, writing checksums and a manifest, per contig for large callsets. Also when sample names in a list do not match the callset, when per-contig VCFs refuse to concatenate, or when a delivery must go to a read-only share./