#!/usr/bin/env bash # Сборка образов llama-cpp-turboquant (CUDA 12 / CUDA 13). # Контекст — клон TheTom/llama-cpp-turboquant; Dockerfile'ы — в этом репозитории. # # ./docker/build.sh # CUDA 12 (RTX 30xx) # ./docker/build.sh 13 # CUDA 13 / sm_120 (RTX 50xx) # ./docker/build.sh 12 13 # оба # # Переменные: LLAMA_CPP_SRC, DOCKER (docker|podman) set -euo pipefail ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" SRC="${LLAMA_CPP_SRC:-$(cd "$ROOT/../llama-cpp-turboquant" && pwd)}" DOCKER="${DOCKER:-docker}" if [[ ! -f "$SRC/CMakeLists.txt" ]]; then echo "llama.cpp source not found at: $SRC" >&2 echo "Set LLAMA_CPP_SRC to the TheTom/llama-cpp-turboquant checkout." >&2 exit 1 fi build_one() { local ver="$1" local df tag case "$ver" in 12) df="$ROOT/docker/server-cuda12.Dockerfile" tag="llama-turboquant:server-cuda12" ;; 13) df="$ROOT/docker/server-cuda13.Dockerfile" tag="llama-turboquant:server-cuda13" ;; *) echo "Unknown CUDA major: $ver (use 12 or 13)" >&2 exit 1 ;; esac echo "==> Building $tag" echo " Dockerfile: $df" echo " Context: $SRC" "$DOCKER" build -f "$df" -t "$tag" "$SRC" } if [[ $# -eq 0 ]]; then set -- 12 fi for ver in "$@"; do build_one "$ver" done