#!/usr/bin/env bash # Fetch the TensorFold 2x 1017 build sources at their pins OUTSIDE the image # directory, so the image dir stays tiny and its build checksum stays stable. # # Pins (upstream `x00byte/DeepSeek-V4.1-Flash-1017-Dual-Spark` @ TF1017_REPO_REV, # whose own scripts/fetch-sources.sh pins everything else): # MiaAI-Lab/DeepSeek-v4.1-Flash-EXL3-2x-DGX-Sparks 6f7d1590... # jayleaton/deepseek-v41-tensorfold-spark 2dcce030... # └─ vendor/TensorFold c4646171... # # Usage: fetch-sources.sh [target-dir] (default /tmp/dsv41-tf-1017-src) set -euo pipefail TARGET="${1:-/tmp/dsv41-tf-1017-src}" REPO=https://github.com/x00byte/DeepSeek-V4.1-Flash-1017-Dual-Spark REV="${TF1017_REPO_REV:-2df9e96a886d778c3fd5ef9d3c272c3c9972d89d}" if [[ ! -d "$TARGET/upstream/.git" ]]; then mkdir -p "$TARGET" git clone "$REPO" "$TARGET/upstream" fi git -C "$TARGET/upstream" fetch --depth 1 origin "$REV" git -C "$TARGET/upstream" checkout --detach "$REV" # Their fetcher clones the Mia runtime + Jay Leaton's fork (+ the TensorFold # submodule) at pins and applies the 1017 patches to build/tensorfold. It # refuses to run twice (build/mia-runtime already exists), so a repeat build # reuses the prepared tree. if [[ -d "$TARGET/upstream/build/tensorfold" && -d "$TARGET/upstream/build/mia-runtime" ]]; then echo "[fetch-sources] already prepared in $TARGET/upstream/build" else bash "$TARGET/upstream/scripts/fetch-sources.sh" fi echo "[fetch-sources] sources ready in $TARGET/upstream/build (tensorfold, mia-runtime)"