motif64

m64_5e83a5ad34b1 / Dockerfile

79 lines, 5.5 KBraw
1# opencode-ornith15-122b-tf-gb10: opencode 1.18.23 driving Ornith-1.5-122B served by TensorFold in the same container.2# The engine stages are the ornith15-122b-tensorfold-gb10 capsule's, line for line (MiaAI-Lab's DGX Spark recipe);3# the harness lines are opencode-inkling2mini-tf-v2-gb10's.4# ornith15-122b-tensorfold-gb10: TensorFold's Zig engine (tensorfold-native) with EXL3 support for the Qwen3.5-MoE CUDA5# engine, built for the DGX Spark's GB10 (linux-aarch64, sm_121) exactly as MiaAI-Lab's recipe does it:6#   github.com/MiaAI-Lab/Ornith-1.5-122B-TensorFold @ 0c8fd6a0d1e2ece7557978a7d8c3d96d137eb0757# - TensorFold (Apache-2.0) from github.com/ashhart/TensorFold at d1018b31, plus the recipe's patches/0001-00268#   (EXL3 loader and kernels, DFlash2 drafter, prompt-pass speedups), taken from the recipe's tarball at that commit9#   (SHA-256 checked).10# - Zig 0.17.0 (checked by SHA-256). Base: NVIDIA's PyTorch 26.07 container (CUDA 13, nvcc with sm_121a), pinned by11#   digest. The kernels are embedded in the binary (fatbins).12# One change from the recipe: its final stage also pip-installs huggingface_hub for downloads; m64 fetches the weights.1314FROM nvcr.io/nvidia/pytorch@sha256:2140e699b3beaf7f96a0081fd9c9406bc3832b435cdb60dfa2d261f7d2f34a1c AS build15ARG ZIG_VERSION=0.17.016ARG ZIG_SHA256=9e8d11661d4ae3bd57702a3832781e23ad151dde5798e16a5ccd503f65234ff817RUN curl -fsSL -o /tmp/zig.tar.xz "https://ziglang.org/download/${ZIG_VERSION}/zig-aarch64-linux-${ZIG_VERSION}.tar.xz" && \18    echo "${ZIG_SHA256}  /tmp/zig.tar.xz" | sha256sum -c - && \19    mkdir -p /opt/zig && tar -xJf /tmp/zig.tar.xz -C /opt/zig --strip-components=1 && rm /tmp/zig.tar.xz && \20    /opt/zig/zig version21ARG TF_REPO=https://github.com/ashhart/TensorFold.git22ARG TF_REF=d1018b318fb51981c4a18f12e40269a4d3ee971323RUN git init -q /tensorfold && cd /tensorfold && git remote add origin "${TF_REPO}" && \24    git fetch -q --depth 1 origin "${TF_REF}" && git checkout -q --detach FETCH_HEAD && \25    test "$(git rev-parse HEAD)" = "${TF_REF}"26ARG RECIPE_COMMIT=0c8fd6a0d1e2ece7557978a7d8c3d96d137eb07527ARG RECIPE_SHA256=aa60e40eac0dc8dd5a1141337ee3a2add01fb5d3a7b91706087be7a8afd18e0d28RUN curl -fsSL -o /tmp/recipe.tgz "https://github.com/MiaAI-Lab/Ornith-1.5-122B-TensorFold/archive/${RECIPE_COMMIT}.tar.gz" && \29    echo "${RECIPE_SHA256}  /tmp/recipe.tgz" | sha256sum -c - && \30    mkdir -p /opt/recipe && tar -xzf /tmp/recipe.tgz -C /opt/recipe --strip-components=1 && rm /tmp/recipe.tgz && \31    mkdir -p /opt/tensorfold/share/doc/recipe && \32    for f in LICENSE NOTICE CREDITS.md; do cp "/opt/recipe/$f" /opt/tensorfold/share/doc/recipe/ || exit 1; done33RUN cd /tensorfold && \34    for p in /opt/recipe/patches/*.patch; do [ -e "$p" ] || continue; echo "applying $p"; git apply --check "$p" && git apply "$p" || exit 1; done35RUN cd /tensorfold && /opt/zig/zig build -Dnvcc=/usr/local/cuda/bin/nvcc -Doptimize=fast --prefix /opt/tensorfold \36      -j"$(nproc)" fatbins install native && \37    test -x /opt/tensorfold/native/bin/tensorfold-native38RUN mkdir -p /opt/tensorfold/share/doc/tensorfold && cd /tensorfold && \39    for f in LICENSE LICENSE.md LICENSES NOTICE THIRD_PARTY_NOTICES.md; do \40      if [ -e "$f" ]; then cp -a "$f" /opt/tensorfold/share/doc/tensorfold/ || exit 1; fi; done4142FROM nvcr.io/nvidia/pytorch@sha256:2140e699b3beaf7f96a0081fd9c9406bc3832b435cdb60dfa2d261f7d2f34a1c43COPY --from=build /opt/tensorfold /opt/tensorfold44RUN ln -s /opt/tensorfold/native/bin/tensorfold-native /usr/local/bin/tensorfold-native && \45    test -x /opt/tensorfold/native/bin/tensorfold-native46ENV PYTHONUNBUFFERED=1 TENSORFOLD_CUDA_KERNELS=native4748RUN apt-get update -qq && apt-get install -y --no-install-recommends \49      ca-certificates git ripgrep jq curl xz-utils unzip file less procps build-essential python3-venv \50    && rm -rf /var/lib/apt/lists/*5152# Node 22.23.2, official arm64 build, checked against nodejs.org's SHASUMS256.txt.53RUN curl -fsSL https://nodejs.org/dist/v22.23.2/node-v22.23.2-linux-arm64.tar.xz -o /tmp/node.tar.xz \54 && echo "fff4078c5def658577f92c88db7db3bc0072924bfb93fe52c1e744a54e94abb8  /tmp/node.tar.xz" | sha256sum -c - \55 && mkdir -p /opt/node && tar xJf /tmp/node.tar.xz -C /opt/node --strip-components=1 && rm /tmp/node.tar.xz \56 && ln -s /opt/node/bin/node /opt/node/bin/npm /opt/node/bin/npx /usr/local/bin/57ENV PATH=/opt/node/bin:$PATH5859RUN npm install -g opencode-ai@1.18.23 && npm cache clean --force6061# Everything opencode would otherwise fetch at run time (models.dev catalogue, LSP servers,62# self-update) is disabled. The npm packages it installs on a project's first use are63# warmed here, where the build has network (warm_opencode.sh); start.sh copies them into64# the throwaway HOME. Without this, every run would log a blocked registry.npmjs.org.65ENV OPENCODE_DISABLE_AUTOUPDATE=1 \66    OPENCODE_DISABLE_LSP_DOWNLOAD=1 \67    OPENCODE_DISABLE_MODELS_FETCH=1 \68    OPENCODE_DISABLE_SHARE=169COPY opencode.json /etc/opencode/opencode.json70COPY warm_opencode.sh /tmp/warm_opencode.sh71RUN bash /tmp/warm_opencode.sh && rm /tmp/warm_opencode.sh7273# Gateway deps, the same pinned set as the other agent capsules' gateways (the vLLM image had them; this base does not).74RUN python3 -m venv /opt/gateway && /opt/gateway/bin/pip install --no-cache-dir \75      fastapi==0.115.14 uvicorn==0.32.1 httpx==0.28.1 \76      starlette==0.46.2 pydantic==2.14.1 pydantic_core==2.50.1 annotated-types==0.8.0 \77      typing_extensions==4.16.0 typing-inspection==0.4.4 anyio==4.15.1 idna==3.20 \78      certifi==2026.10.23 httpcore==1.0.9 h11==0.16.0 click==8.5.079WORKDIR /scratch