- Add Dockerfile.ci-builder (CUDA 12.4 + Rust 1.89 + protoc + sccache + git + lld) - Add prepare stage to build CI builder image via Kaniko (auto on Dockerfile change, manual otherwise) - Replace before_script apt-get installs with pre-baked image in .rust-base - Add git to Dockerfile.service for candle git dependency - Add sccache stats output to check stage
45 lines
1.5 KiB
Docker
45 lines
1.5 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 \
|
|
protobuf-compiler \
|
|
libprotobuf-dev \
|
|
curl \
|
|
ca-certificates \
|
|
pkg-config \
|
|
libssl-dev \
|
|
lld \
|
|
clang \
|
|
make \
|
|
perl \
|
|
build-essential \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# 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}"
|
|
|
|
# Verify
|
|
RUN rustc --version && cargo --version && git --version && protoc --version && sccache --version && make --version && nvcc --version
|