m64_ca3a28a8569e / Dockerfile
93 lines, 6.0 KBraw
1# opencode-qwen38fn-strata-gb10: opencode 1.18.23 (sst/opencode) driving Qwen3.8-Flash-Next IQ3_S, served by2# Strata 0.2.13's DGX Spark engine in the same container at the model's full 262144-token window.3# The engine part is the qwen38-flash-next-strata-gb10 capsule's Dockerfile, line for line (Strata 0.2.15, the4# latest release, still ships the same linux-aarch64 control 0.1.59 and engine 0.1.59); then the agent's tools,5# Node 22 and opencode, as the other opencode capsules (opencode-qwen38-gb10) install them.6#7# Engine: Strata 0.2.13 (github.com/Niko1221/Strata, MIT) for the DGX Spark's GB108# (linux-aarch64, sm_121), the same parts Strata's own runtime image (docker/Dockerfile) holds, from the9# release's linux-aarch64 packages instead of the x86-64 ones:10# - the Terminal (strata-control 0.1.59: `strata launch`, setup.py and its tools, its own Python 3.12),11# - the CUDA 13 engine package (strata-engine 0.1.59, sm_121, built by Strata's spark/build_engine.sh),12# - llama.cpp's gguf-py at the commit setup.py pins (it prepares the model's pack at start),13# - Qwen3.8-Flash-Next's MTP draft layer, which Strata does not ship as a file: tools/mtp_fetch.py reads only14# the ~5 GB of mtp.* tensors out of Qwen/Qwen3.8-Flash-Next at the revision Strata pins, by HTTP range15# requests, and checks every tensor against Strata's pinned SHA-256; mtp_pack.py and mtp_rt.py then make16# the 0.8 GB runtime form, exactly as setup.py does. The raw tensors are removed (Strata re-verifies them17# only when they are there).18# Base: ubuntu:24.04 (glibc 2.39, which the engine package needs), arm64, pinned by digest.19FROM ubuntu@sha256:c92376659a7f14cc1f51615d73c9f4b7d8e18d59f370e02b4ed683ab4485c66c2021ENV DEBIAN_FRONTEND=noninteractive22RUN apt-get update \23 && apt-get install -y --no-install-recommends ca-certificates curl libgomp1 libatomic1 libnuma1 zlib1g \24 && rm -rf /var/lib/apt/lists/* /var/cache/apt/*2526# The release packages, checked against the release's SHA256SUMS.txt (v0.2.13).27ARG REL=https://github.com/Niko1221/Strata/releases/download/v0.2.1328RUN set -e; mkdir -p /opt/strata/terminal /opt/strata/components/engine/0.1.59-linux-aarch64-cuda-cuda13; cd /tmp; \29 curl -fsSL -o control.tgz "$REL/strata-control-0.1.59-linux-aarch64.tar.gz"; \30 curl -fsSL -o engine.tgz "$REL/strata-engine-0.1.59-linux-aarch64-cuda-cuda13.tar.gz"; \31 printf '%s %s\n' \32 1579f7c6490e52334ca2d134b81534e6a5a351247a506918cbfd1f8285114523 control.tgz \33 b213d9b173aae99645fc5922d42276fa1ed17ac67f7b788c55c912ba49e148f1 engine.tgz | sha256sum -c -; \34 tar xzf control.tgz -C /opt/strata/terminal; \35 tar xzf engine.tgz -C /opt/strata/components/engine/0.1.59-linux-aarch64-cuda-cuda13; \36 rm control.tgz engine.tgz; \37 /opt/strata/terminal/bin/strata --version3839ENV PY=/opt/strata/terminal/python/bin/python3 PYTHONNOUSERSITE=1 LANG=C.UTF-840# llama.cpp at setup.py's pinned commit (3cf0325); only gguf-py and the marker file setup.py looks for are kept,41# as in Strata's image.42RUN cd /opt/strata/terminal && STRATA_CONTROL_INSTALL=1 STRATA_INSTALL_DIR=/opt/strata/seed $PY -c "import setup; print(setup.get_llama_cpp())" \43 && rm -rf /opt/strata/seed/third_party/*.zip* \44 && cd /opt/strata/seed/third_party/llama.cpp \45 && find . -mindepth 1 -maxdepth 1 ! -name gguf-py ! -name ggml ! -name 'LICENSE*' -exec rm -rf {} + \46 && find ggml -mindepth 1 -depth ! -type d ! -name CMakeLists.txt -delete && find ggml -mindepth 1 -type d -empty -delete4748# The MTP draft layer (see the header), as setup.py makes it.49RUN set -e; cd /opt/strata/terminal; M=/opt/strata/mtp; \50 export STRATA_CONTROL_INSTALL=1 STRATA_INSTALL_DIR=/opt/strata/seed; \51 $PY tools/mtp_fetch.py fetch --out $M; \52 $PY tools/mtp_fetch.py verify --out $M; \53 $PY tools/mtp_pack.py --src $M --experts q2_0 --out $M/mtp-q2_0.gguf; \54 $PY tools/mtp_rt.py --gguf $M/mtp-q2_0.gguf --out $M/rt; \55 rm -rf $M/tensors; test -f $M/rt/experts.bin; du -sh $M5657ENV STRATA_COMPONENTS_DIR=/opt/strata/components STRATA_IN_DOCKER=1 PYTHONUNBUFFERED=1 \58 NVIDIA_VISIBLE_DEVICES=all NVIDIA_DRIVER_CAPABILITIES=compute,utility5960# The agent's tools (as gx10's agent images: git, ripgrep, jq, a C toolchain, Python 3).61RUN apt-get update -qq && apt-get install -y --no-install-recommends \62 git ripgrep jq xz-utils unzip file less procps build-essential python3 python3-venv \63 && rm -rf /var/lib/apt/lists/*6465# Node 22.23.2 (the version of the node:22 image gx10's agents use), official arm64 build,66# checked against nodejs.org's SHASUMS256.txt.67RUN curl -fsSL https://nodejs.org/dist/v22.23.2/node-v22.23.2-linux-arm64.tar.xz -o /tmp/node.tar.xz \68 && echo "fff4078c5def658577f92c88db7db3bc0072924bfb93fe52c1e744a54e94abb8 /tmp/node.tar.xz" | sha256sum -c - \69 && mkdir -p /opt/node && tar xJf /tmp/node.tar.xz -C /opt/node --strip-components=1 && rm /tmp/node.tar.xz \70 && ln -s /opt/node/bin/node /opt/node/bin/npm /opt/node/bin/npx /usr/local/bin/71ENV PATH=/opt/node/bin:$PATH7273RUN npm install -g opencode-ai@1.18.23 && npm cache clean --force7475# Everything opencode would otherwise fetch at run time (models.dev catalogue, LSP servers,76# self-update) is disabled. The npm packages it installs on a project's first use are77# warmed here, where the build has network (warm_opencode.sh); start.sh copies them into78# the throwaway HOME.79ENV OPENCODE_DISABLE_AUTOUPDATE=1 \80 OPENCODE_DISABLE_LSP_DOWNLOAD=1 \81 OPENCODE_DISABLE_MODELS_FETCH=1 \82 OPENCODE_DISABLE_SHARE=183COPY opencode.json /etc/opencode/opencode.json84COPY warm_opencode.sh /tmp/warm_opencode.sh85RUN bash /tmp/warm_opencode.sh && rm /tmp/warm_opencode.sh8687# Gateway deps, the same pinned set as the other agent capsules' gateways.88RUN python3 -m venv /opt/gateway && /opt/gateway/bin/pip install --no-cache-dir \89 fastapi==0.115.14 uvicorn==0.32.1 httpx==0.28.1 \90 starlette==0.46.2 pydantic==2.14.1 pydantic_core==2.50.1 annotated-types==0.8.0 \91 typing_extensions==4.16.0 typing-inspection==0.4.4 anyio==4.15.1 idna==3.20 \92 certifi==2026.10.23 httpcore==1.0.9 h11==0.16.0 click==8.5.093WORKDIR /scratch