Skip to content

GLM-5.3-Flash EXL3 on 2x DGX Spark with TensorFold

Python

v1.3.1: compare images by content, not .Id (#8)

MiaAI-Lab8f2d4de4deef
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e1ab691..b99b2e7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,16 @@
Every change to this recipe, newest first. Each release names the image it serves: `scripts/prepare.sh` pulls
`ghcr.io/miaai-lab/glm-5.3-flash-exl3-2x-dgx-sparks-tensorfold` by the digest pinned in `scripts/config.sh`.
+## v1.3.1 (2026-10-01): mixed Docker image stores
+
+Image unchanged: `v0.6.0-ae8d1c789b47`.
+
+### Fixed
+- **#8, `prepare.sh` failed on every run when the two Sparks use different Docker image stores** (containerd on one,
+ overlay2 on the other): it compared image `.Id`s, which is the manifest digest under containerd and the config
+ digest under overlay2, so the same image never matched. Images are now compared by content (their layers' diffIDs
+ and runtime config), the same under both stores. Fix by @eleata, confirmed by @kafej.
+
## v1.3 (2026-10-01): TensorFold v0.6.0, issue fixes #2 and #6, whole tool calls
Image `v0.6.0-ae8d1c789b47` (`sha256:22789f0cb3dc308f0b2ce52a33961b88bd624af1725e91e8aba0a74a671bb969`), 53 patches.
diff --git a/scripts/nodes.sh b/scripts/nodes.sh
index 37ddb4a..0bcdd23 100644
--- a/scripts/nodes.sh
+++ b/scripts/nodes.sh
@@ -8,6 +8,16 @@ worker() { ssh -o BatchMode=yes -o ConnectTimeout=10 -o ServerAliveInterval=15 "
# into it and start.sh mounts it into rank 1.
worker_hf_cache() { worker 'echo "${HF_HOME:-$HOME/.cache/huggingface}"'; }
+# An image's identity by content (its layers' diffIDs and runtime config), the same under Docker's overlay2 and
+# containerd image stores: .Id is the config digest under one and the manifest digest under the other, so it never
+# matches across a mixed pair (issue #8). The template holds no spaces: worker() passes it through ssh, which
+# re-splits arguments. A missing image is "missing".
+IMAGE_IDENT='{{.RootFS.Layers}}{{.Config.Env}}{{.Config.Entrypoint}}{{.Config.Cmd}}{{.Config.WorkingDir}}'
+image_ident() { local s; s=$(docker image inspect -f "$IMAGE_IDENT" "$1" 2>/dev/null) && sha256sum <<<"$s" | cut -c1-64 || echo missing; }
+worker_image_ident() {
+ local s; s=$(worker docker image inspect -f "$IMAGE_IDENT" "$1" 2>/dev/null) && sha256sum <<<"$s" | cut -c1-64 || echo missing
+}
+
# WORKER_WEIGHTS=nfs: rank 1 mounts the head's HF_CACHE read-only through the docker volume NFS_VOLUME on the worker.
# ensure_nfs_volume creates it (or checks the one there names the same export); worker_nfs <cmd...> runs a command in
# a throwaway container with the volume at /hf.
diff --git a/scripts/prepare.sh b/scripts/prepare.sh
index cbd82b7..00fba4f 100755
--- a/scripts/prepare.sh
+++ b/scripts/prepare.sh
@@ -108,20 +108,20 @@ fi
docker run --rm --entrypoint tensorfold "$IMAGE" --version 2>/dev/null | tail -1
# ---------------------------------------------------------------- 3. image (worker)
-image_id=$(docker image inspect -f '{{.Id}}' "$IMAGE")
-if [[ "$(worker docker image inspect -f '{{.Id}}' "$IMAGE" 2>/dev/null)" != "$image_id" ]]; then
+image_id=$(image_ident "$IMAGE") # by content: .Id differs between image stores (issue #8)
+if [[ "$(worker_image_ident "$IMAGE")" != "$image_id" ]]; then
wfree=$(worker_free_gb "$WORKER_DOCKER_ROOT")
(( wfree >= IMAGE_FREE_GB )) ||
die "only ${wfree} GB free under the worker's Docker root ($WORKER_DOCKER_ROOT); the image needs ~${IMAGE_FREE_GB} GB (IMAGE_FREE_GB)"
if [[ "${PULL:-1}" == 1 ]] && worker docker pull "$prebuilt" >/dev/null 2>&1 &&
- [[ "$(worker docker image inspect -f '{{.Id}}' "$prebuilt")" == "$image_id" ]]; then
+ [[ "$(worker_image_ident "$prebuilt")" == "$image_id" ]]; then
worker docker tag "$prebuilt" "$IMAGE"
log "Using $prebuilt as $IMAGE on the worker"
else
log "Copying $IMAGE to the worker (docker save | docker load; only missing layers are stored)"
docker save "$IMAGE" | worker docker load >/dev/null
fi
- [[ "$(worker docker image inspect -f '{{.Id}}' "$IMAGE")" == "$image_id" ]] || die "the worker's $IMAGE differs from the head's"
+ [[ "$(worker_image_ident "$IMAGE")" == "$image_id" ]] || die "the worker's $IMAGE differs from the head's"
fi
log "Image $IMAGE identical on both Sparks"