Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions results/hello/1.0.1.txt
Original file line number Diff line number Diff line change
@@ -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
15 changes: 9 additions & 6 deletions tools/hello/SKILL.md
Original file line number Diff line number Diff line change
@@ -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=<the image's OS id, debian>
user=<the uid the container runs as>
gpu=<the first GPU's name from nvidia-smi, or none>
hostname=<the container's hostname: the node's name under pyxis, the container's own under podman>
cpus=<the number of CPUs the container can use, from nproc>
```

## Inputs and outputs
Expand All @@ -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.
4 changes: 3 additions & 1 deletion tools/hello/bin/hello
Original file line number Diff line number Diff line change
@@ -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)"
7 changes: 6 additions & 1 deletion tools/hello/test/run.sh
Original file line number Diff line number Diff line change
@@ -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 ]