Răsfoiți Sursa

docker-images: sparkring-shared

Alexander Korolev 1 săptămână în urmă
părinte
comite
df46bb8b07

+ 24 - 0
docker-images/sparkring-shared/Dockerfile

@@ -0,0 +1,24 @@
+# syntax=docker/dockerfile:1.7
+# SparkRing shared stack (FujitsuPolycom/sparkring) as a sm121-managed image.
+#
+# The public image is published digest-only (no tags), so a raw pull leaves an
+# untagged image that (a) sm121's image-presence probe cannot match by tag and
+# (b) `docker image prune` reaps as dangling. Wrapping it in a thin FROM with
+# a local tag puts it under the normal sm121 build/sync flow: built once on a
+# build node, `docker save | ssh docker load` to the rest, checksum-label
+# stamped, and safe from prune.
+#
+# No stages, no layers: the entire runtime lives upstream of the FROM.
+ARG BASE_IMAGE
+FROM ${BASE_IMAGE}
+LABEL sm121.source="ghcr.io/fujitsupolycom/sparkring" sm121.digest="sha256:f25cdb6bf7df85754ea5c62445b139dac3143bc6e910a0442d681b6e63c31c4b"
+
+# The b12x loader JIT-compiles _storage.c with `-L/opt/cuda-13.3/lib64 -lcudart`,
+# but this CUDA 13 image ships libcudart only as pip nvidia/cu13/lib/libcudart.so.13
+# (no lib64 dir, no dev symlink) — the first serve attempt dies with
+# "ld: cannot find -lcudart". Bridge it, then pre-build the extension so the
+# runtime cache is baked into the image and serves never hit the JIT.
+RUN set -eux; \
+    mkdir -p /opt/cuda-13.3/lib64; \
+    ln -s /usr/local/lib/python3.12/dist-packages/nvidia/cu13/lib/libcudart.so.13 /opt/cuda-13.3/lib64/libcudart.so; \
+    python3 -c "import b12x.loader._native as n; n.load(); print('b12x loader native pre-built')"

+ 25 - 0
docker-images/sparkring-shared/build.sh

@@ -0,0 +1,25 @@
+#!/usr/bin/env bash
+# Build the SparkRing shared-image wrapper (thin FROM over the pinned digest).
+#
+# Generic driver: forwards every KEY=VAL pin in versions.env as a
+# --build-arg to the Dockerfile (no hardcoded variable list). The sm121
+# launcher writes a merged versions.env here when a recipe carries
+# [build.versions] overrides (recipe wins over the image defaults).
+set -euo pipefail
+cd "$(dirname "$0")"
+TAG="${TAG:-sparkring-shared:local}"
+
+ARGS=()
+while IFS= read -r line; do
+    # Skip blank lines and comments (# ...).
+    case "$line" in
+        ''|\#*) continue ;;
+    esac
+    key="${line%%=*}"
+    val="${line#*=}"
+    [ -n "$key" ] && ARGS+=(--build-arg "${key}=${val}")
+done < versions.env
+
+echo "=== Building ${TAG} ==="
+docker buildx build "${ARGS[@]}" --progress=plain --load -t "${TAG}" -f Dockerfile . 2>&1
+echo "=== Done: ${TAG} ==="

+ 5 - 0
docker-images/sparkring-shared/versions.env

@@ -0,0 +1,5 @@
+# versions.env - build input for the SparkRing shared-image wrapper.
+# The image is a thin, fully-pinned FROM wrapper over the public SparkRing
+# digest (no rebuildable stages — everything lives upstream of the FROM).
+# Convention: KEY=VAL, no spaces around = (the build.sh driver parses literally).
+BASE_IMAGE=ghcr.io/fujitsupolycom/sparkring@sha256:f25cdb6bf7df85754ea5c62445b139dac3143bc6e910a0442d681b6e63c31c4b