Files
foxhunt/infra/docker/Dockerfile.ci-builder
jgrusewski f13b0df6e8 feat(infra): upgrade CI to L40S + mold linker for faster builds
- Switch linker from lld to mold (~2-5x faster linking for large binaries)
  - Install mold 2.35.1 in CI builder Dockerfile
  - Update .cargo/config.toml: -fuse-ld=mold
- Upgrade CI build pool: L4-1-24G → L40S-1-48G (~2x training throughput)
  - Increase max_size from 1 to 2 (allows concurrent jobs, fixes scheduling deadlocks)
  - Update runner resource limits for L40S node (24 vCPU, 96GB)
- Update runner-values.yaml comments and .gitlab-ci.yml header

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 00:05:23 +01:00

61 lines
2.4 KiB
Docker

# Pre-baked CI builder image for Foxhunt
# Contains: CUDA 12.4, Rust 1.89, protoc, sccache, git, OpenSSL, lld, make
# Build: docker build -f infra/docker/Dockerfile.ci-builder -t foxhunt-ci-builder .
# Push: docker tag foxhunt-ci-builder git.fxhnt.ai:5050/root/foxhunt/ci-builder:latest
# docker push git.fxhnt.ai:5050/root/foxhunt/ci-builder:latest
FROM nvidia/cuda:12.4.1-cudnn-devel-ubuntu22.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
curl \
ca-certificates \
pkg-config \
libssl-dev \
lld \
clang \
make \
perl \
build-essential \
libfontconfig1-dev \
unzip \
&& rm -rf /var/lib/apt/lists/*
# mold linker — 2-5x faster than lld for final link step on large Rust binaries
RUN curl -fsSL https://github.com/rui314/mold/releases/download/v2.35.1/mold-2.35.1-x86_64-linux.tar.gz \
| tar xz -C /usr/local --strip-components=1 \
&& chmod +x /usr/local/bin/mold
# protoc 28.3 (proto3 optional support, matches local dev)
RUN curl -fsSL https://github.com/protocolbuffers/protobuf/releases/download/v28.3/protoc-28.3-linux-x86_64.zip -o /tmp/protoc.zip \
&& unzip -o /tmp/protoc.zip -d /usr/local bin/protoc 'include/*' \
&& rm /tmp/protoc.zip \
&& chmod +x /usr/local/bin/protoc
# Install Rust 1.89 stable
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.89.0
ENV PATH="/root/.cargo/bin:${PATH}"
# sccache for S3-backed build caching
RUN curl -fsSL https://github.com/mozilla/sccache/releases/download/v0.10.0/sccache-v0.10.0-x86_64-unknown-linux-musl.tar.gz \
| tar xz -C /usr/local/bin --strip-components=1 sccache-v0.10.0-x86_64-unknown-linux-musl/sccache \
&& chmod +x /usr/local/bin/sccache
# clippy pre-installed
RUN rustup component add clippy
# CUDA env
ENV CUDA_HOME=/usr/local/cuda
ENV PATH="${CUDA_HOME}/bin:${PATH}"
ENV LD_LIBRARY_PATH="${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}"
# libcuda.so.1 stub — lets CUDA-linked binaries load on GPU-less CI nodes
# (stubs dir has libcuda.so but the dynamic linker needs .so.1)
RUN ln -sf /usr/local/cuda/lib64/stubs/libcuda.so /usr/local/cuda/lib64/stubs/libcuda.so.1
ENV LD_LIBRARY_PATH="/usr/local/cuda/lib64/stubs:${LD_LIBRARY_PATH}"
# Verify
RUN rustc --version && cargo --version && git --version && protoc --version && sccache --version && make --version && nvcc --version