# sensenova-u1.5-8b-base-gb10.
# Base: nvcr.io/nvidia/pytorch:25.09-py3, pinned by digest (the same as kromoss-dmd2-gb10's).
FROM nvcr.io/nvidia/pytorch@sha256:f3b4a33fd60d5e0358287bb44d57e91eda45e8f1681fef1bfd6c969371417130

# Reproduces gx10's sensenova-u1:gb10 image (vlmtest/machines/gx10/docker/Dockerfile.sensenova-u1,
# built by build_sensenova_u1.sh) exactly: the packages its pip freeze adds to this NGC base, pinned,
# --no-deps (the vendor's torch/torchvision pins stay stripped: NGC's torch has the GB10 kernels),
# and the vendor package at the same commit of the feat/u1.5 branch, as a sha256-checked tarball.
RUN pip install --no-cache-dir --no-deps \
      accelerate==1.15.0 \
      annotated-doc==0.0.5 \
      click==8.5.0 \
      fastapi==0.142.2 \
      hf-xet==1.6.0 \
      huggingface_hub==1.33.0 \
      opentelemetry-api==1.45.0 \
      pillow==12.0.0 \
      regex==2026.9.29 \
      safetensors==0.8.0 \
      sentencepiece==0.2.1 \
      shellingham==1.5.4 \
      starlette==1.7.0 \
      tokenizers==0.23.2 \
      transformers==5.18.0 \
      typer==0.27.2 \
      typing-inspection==0.4.4 \
      uvicorn==0.54.0 \
      "https://github.com/OpenSenseNova/SenseNova-U1/archive/48bf8275478f2216d2e846f48bf7627bf56b1301.tar.gz#sha256=ddb385b98bbbf2b023b4a5253205b800a1aa2547c1ee6d907e5024ef8f826182" \
 && python3 -c "import torch, sensenova_u1; assert torch.__version__.startswith('2.9'), torch.__version__; print('ok')"

# The server imports the vendor's engine wrapper from /opt/sensenova-u1/examples/t2i (the gx10
# image had the repo checked out there); the wheel above does not ship examples/, so the same
# sha256-checked tarball is also unpacked to /opt/sensenova-u1.
RUN python3 -c "import urllib.request as u; u.urlretrieve('https://github.com/OpenSenseNova/SenseNova-U1/archive/48bf8275478f2216d2e846f48bf7627bf56b1301.tar.gz', '/tmp/sn.tgz')" \
 && echo 'ddb385b98bbbf2b023b4a5253205b800a1aa2547c1ee6d907e5024ef8f826182  /tmp/sn.tgz' | sha256sum -c - \
 && mkdir -p /opt/sensenova-u1 && tar xzf /tmp/sn.tgz -C /opt/sensenova-u1 --strip-components=1 && rm /tmp/sn.tgz \
 && test -f /opt/sensenova-u1/examples/t2i/inference.py
