From fbd117e368c9d72437b746aae00c8b5074a6c5f9 Mon Sep 17 00:00:00 2001 From: Sarah Burbach <106550373+smburbach@users.noreply.github.com> Date: Fri, 20 Nov 2026 23:05:35 +0000 Subject: [PATCH 1/2] hello 1.0.1 also prints the hostname and the CPU count the container sees, so a user on a new cluster sees which node and how many CPUs their job landed on --- tools/hello/SKILL.md | 15 +++++++++------ tools/hello/bin/hello | 4 +++- tools/hello/test/run.sh | 7 ++++++- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/tools/hello/SKILL.md b/tools/hello/SKILL.md index e31758c..55a9adf 100644 --- a/tools/hello/SKILL.md +++ b/tools/hello/SKILL.md @@ -1,21 +1,23 @@ --- name: hello -description: "Checks that this machine or cluster runs toolshed images: prints the OS, the user, and the GPU it sees. Reach for it first on a new cluster, before any real tool." +description: "Checks that this machine or cluster runs toolshed images: prints the OS, the user, the GPU, the hostname, and the CPU count it sees. Reach for it first on a new cluster, before any real tool." metadata: - version: 1.0.0 + version: 1.0.1 --- # hello -Image: `ghcr.io/brineylab/toolshed/hello:1.0.0` +Image: `ghcr.io/brineylab/toolshed/hello:1.0.1` ## Commands -`hello` prints three lines and exits 0: +`hello` prints five lines and exits 0: ``` os= user= gpu= +hostname= +cpus= ``` ## Inputs and outputs @@ -31,16 +33,17 @@ No GPU needed; with one, it names it. Seconds. On a laptop: ```bash -podman run --rm ghcr.io/brineylab/toolshed/hello:1.0.0 hello +podman run --rm ghcr.io/brineylab/toolshed/hello:1.0.1 hello ``` On a Slurm cluster with pyxis: ```bash -srun --gres=gpu:1 --container-image=ghcr.io#brineylab/toolshed/hello:1.0.0 hello +srun --gres=gpu:1 --container-image=ghcr.io#brineylab/toolshed/hello:1.0.1 hello ``` ## Gotchas - `user=` is 0 under podman and under pyxis on a cluster that maps you to root in the container (slinky does); files written to a mount are still yours. - `gpu=none` on a GPU node means the job did not request one (`--gres=gpu:1`) or the node's driver is not visible in the container. Enroot mounts the driver only into an image that sets `NVIDIA_VISIBLE_DEVICES`, and its `nvidia-smi` needs glibc, so hello is built on debian, not alpine. +- `hostname=` is the node's name under pyxis (enroot shares the host's UTS namespace) and the container's own under podman; `cpus=` follows the container's CPU set — the Slurm job's allocation under pyxis, the whole machine under an unrestricted podman — not necessarily the node's total. diff --git a/tools/hello/bin/hello b/tools/hello/bin/hello index 038848b..d1b1122 100755 --- a/tools/hello/bin/hello +++ b/tools/hello/bin/hello @@ -1,7 +1,9 @@ #!/bin/sh -# hello: the OS, the user, and the GPU this container sees. +# hello: the OS, the user, the GPU, the hostname, and the CPUs this container sees. . /etc/os-release echo "os=$ID" echo "user=$(id -u)" gpu=$(nvidia-smi --query-gpu=name --format=csv,noheader 2>/dev/null | head -n 1) echo "gpu=${gpu:-none}" +echo "hostname=$(hostname)" +echo "cpus=$(nproc)" diff --git a/tools/hello/test/run.sh b/tools/hello/test/run.sh index bad7c61..c7137c2 100644 --- a/tools/hello/test/run.sh +++ b/tools/hello/test/run.sh @@ -1,4 +1,9 @@ set -eu out=$(hello) echo "$out" -case "$out" in *"os="*"user="*"gpu="*) ;; *) exit 1 ;; esac +case "$out" in *"os="*"user="*"gpu="*"hostname="*"cpus="*) ;; *) exit 1 ;; esac +host=$(printf '%s\n' "$out" | sed -n 's/^hostname=//p') +[ -n "$host" ] +cpus=$(printf '%s\n' "$out" | sed -n 's/^cpus=//p') +case "$cpus" in ''|*[!0-9]*) exit 1 ;; esac +[ "$cpus" -ge 1 ] From 6e76e412cbc7b161c903ec4124b8c75a175ab07e Mon Sep 17 00:00:00 2001 From: Sarah Burbach <106550373+smburbach@users.noreply.github.com> Date: Fri, 20 Nov 2026 23:42:47 +0000 Subject: [PATCH 2/2] hello 1.0.1's record: its candidate passed on bcr --- results/hello/1.0.1.txt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 results/hello/1.0.1.txt diff --git a/results/hello/1.0.1.txt b/results/hello/1.0.1.txt new file mode 100644 index 0000000..5ba3b46 --- /dev/null +++ b/results/hello/1.0.1.txt @@ -0,0 +1,19 @@ +--- +tool: hello +version: 1.0.1 +image: ghcr.io/brineylab/toolshed/hello@sha256:93cb67da9a65fd671893e188c377bc86a7d7f42a3d7a763a0c1c17c7a3533b0a +digest: sha256:93cb67da9a65fd671893e188c377bc86a7d7f42a3d7a763a0c1c17c7a3533b0a +runner: sbatch --partition=l40s --gres=gpu:1 --time=00:30:00 +host: bcr.scripps.edu +started: 2026-11-20T23:42:30Z +exit: 0 +--- +pyxis: importing docker image: ghcr.io#brineylab/toolshed/hello@sha256:93cb67da9a65fd671893e188c377bc86a7d7f42a3d7a763a0c1c17c7a3533b0a +pyxis: imported docker image: ghcr.io#brineylab/toolshed/hello@sha256:93cb67da9a65fd671893e188c377bc86a7d7f42a3d7a763a0c1c17c7a3533b0a +node: gpu-swann-0 +GPU 0: NVIDIA L40S (UUID: GPU-ab31b94e-1404-7858-604e-4f2a6b62d33e) +os=debian +user=0 +gpu=NVIDIA L40S +hostname=gpu-swann-0 +cpus=48