# syntax=docker/dockerfile:1
# Mistral Large 4 1T A52B NVFP4 — SGLang day-0 image (thin FROM wrapper).
#
# The official lmsysorg/sglang:mistral-large-4 ships SGLang's day-0 Mistral
# Large 4 support with mistral-common 1.13.0+ (required for the checkpoint's
# tekken.json). SGLang loads the bundled DSpark draft from the checkpoint
# (3 drafted tokens, 4-token verify) without --speculative-draft-model-path.
# On Blackwell/Vera Rubin the latent KV cache defaults to FP8 (E4M3).
#
# The multi-arch manifest covers arm64 — the digest pin below IS the arm64
# variant (the cookbook notes the mistral-large-4 image is amd64 + arm64).
# GB10 (sm_121a) is not in the vendor-verified matrix: first boot on the
# cluster is the real test.
#
# One baked layer (the barrier-timeout patch): the wrapper exists so the
# launcher can stamp its sm121.checksum label and sync the image
# node-to-node like every other lane.
ARG BASE_IMAGE
FROM ${BASE_IMAGE}

# Make the post-load monitored_barrier timeout launcher-tunable (the NVFP4
# boot's per-rank load time varies from ~40 min warm to 3.5 h cold on GB10;
# the stock 480 s barrier murders slow-but-fine ranks). Anchor-based patch,
# see patch_barrier_timeout.py.
COPY patch_barrier_timeout.py /tmp/patch_barrier_timeout.py
RUN python3 /tmp/patch_barrier_timeout.py && rm /tmp/patch_barrier_timeout.py
