From 096bf09b3a02d5c327c50510915d81ff3335a05d Mon Sep 17 00:00:00 2001 From: Wei Zhang Date: Sat, 14 Feb 2026 16:25:13 +0800 Subject: [PATCH] chore(ci): drop cuda image --- .github/workflows/docker.yml | 51 ++------------------ docker/Dockerfile | 59 +++++++++++++++++++++++ docker/Dockerfile.cuda | 90 ------------------------------------ docker/Dockerfile.rocm | 77 ------------------------------ 4 files changed, 62 insertions(+), 215 deletions(-) create mode 100644 docker/Dockerfile delete mode 100644 docker/Dockerfile.cuda delete mode 100644 docker/Dockerfile.rocm diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index f2af4232d353..2ad40bb77dd9 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -19,11 +19,10 @@ concurrency: env: RUST_TOOLCHAIN: 1.82.0 - CUDA_VERSION: 12.4.1 jobs: release-docker: - runs-on: buildjet-2vcpu-ubuntu-2204 + runs-on: ubuntu-latest permissions: contents: read packages: write @@ -31,13 +30,6 @@ jobs: # with sigstore/fulcio when running outside of PRs. id-token: write - strategy: - matrix: - device-type: [cuda] - include: - - device-type: cuda - image-suffix: "" - steps: - name: Free Disk Space (Ubuntu) uses: jlumbroso/free-disk-space@main @@ -79,10 +71,8 @@ jobs: password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Generate image name - env: - IMAGE_SUFFIX: ${{ matrix.image-suffix }} run: | - echo "IMAGE_NAME=${GITHUB_REPOSITORY,,}${IMAGE_SUFFIX}" >>${GITHUB_ENV} + echo "IMAGE_NAME=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV} - uses: int128/docker-build-cache-config-action@v1 id: cache @@ -110,7 +100,7 @@ jobs: id: build-and-push uses: docker/build-push-action@v5 with: - file: docker/Dockerfile.${{ matrix.device-type }} + file: docker/Dockerfile push: true context: . tags: ${{ steps.meta.outputs.tags }} @@ -119,41 +109,6 @@ jobs: cache-to: ${{ steps.cache.outputs.cache-to }} build-args: | RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} - CUDA_VERSION=${{ env.CUDA_VERSION }} - - - name: Docker meta for CUDA 11 - if: startsWith(github.ref, 'refs/tags/v') - id: meta-cuda11 - uses: docker/metadata-action@v5 - with: - images: | - ghcr.io/${{ env.IMAGE_NAME }} - ${{ env.IMAGE_NAME }} - # do not generate tags for latest since cuda12 is the latest - flavor: | - latest=false - suffix=-cuda11 - tags: | - type=semver,pattern={{version}} - - # Build and push Docker image with Buildx - # Only built on release tags for compatibility with previous versions - - name: Build and push Docker image for CUDA 11 - if: startsWith(github.ref, 'refs/tags/v') - id: build-and-push-cuda11 - uses: docker/build-push-action@v5 - with: - file: docker/Dockerfile.${{ matrix.device-type }} - push: true - context: . - tags: ${{ steps.meta-cuda11.outputs.tags }} - labels: ${{ steps.meta-cuda11.outputs.labels }} - cache-from: ${{ steps.cache.outputs.cache-from }} - cache-to: ${{ steps.cache.outputs.cache-to }} - build-args: | - RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} - CUDA_VERSION=11.7.1 - - name: Docker Hub Description uses: peter-evans/dockerhub-description@v4 diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 000000000000..e52d5b27489b --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,59 @@ +ARG BASE_CONTAINER_BUILD=rust:1-bullseye +ARG BASE_CONTAINER=ubuntu:22.04 + +FROM ${BASE_CONTAINER_BUILD} AS build + +ENV DEBIAN_FRONTEND=noninteractive +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + curl \ + pkg-config \ + libssl-dev \ + protobuf-compiler \ + git \ + cmake \ + && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +WORKDIR /root/workspace + +RUN mkdir -p /opt/tabby/bin +RUN mkdir -p /opt/tabby/lib +RUN mkdir -p target + +COPY . . + +RUN --mount=type=cache,target=/usr/local/cargo/registry \ + --mount=type=cache,target=/root/workspace/target \ + cargo build --no-default-features --features prod --release --package tabby && \ + cp target/release/tabby /opt/tabby/bin/ + +FROM ${BASE_CONTAINER} AS runtime + +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + git \ + curl \ + unzip \ + openssh-client \ + ca-certificates \ + libgomp1 \ + && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +# Disable safe directory in docker +# Context: https://github.com/git/git/commit/8959555cee7ec045958f9b6dd62e541affb7e7d9 +RUN git config --system --add safe.directory "*" + +# Automatic platform ARGs in the global scope +# https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope +ARG TARGETARCH + +COPY --from=build /opt/tabby /opt/tabby + +ENV PATH="$PATH:/opt/tabby/bin" +ENV TABBY_ROOT=/data + +ENTRYPOINT ["/opt/tabby/bin/tabby"] diff --git a/docker/Dockerfile.cuda b/docker/Dockerfile.cuda deleted file mode 100644 index ae6841bbefdf..000000000000 --- a/docker/Dockerfile.cuda +++ /dev/null @@ -1,90 +0,0 @@ -ARG UBUNTU_VERSION=22.04 -# This needs to generally match the container host's environment. -ARG CUDA_VERSION=11.7.1 -# Target the CUDA build image -ARG BASE_CUDA_DEV_CONTAINER=nvidia/cuda:${CUDA_VERSION}-devel-ubuntu${UBUNTU_VERSION} -# Target the CUDA runtime image -ARG BASE_CUDA_RUN_CONTAINER=nvidia/cuda:${CUDA_VERSION}-runtime-ubuntu${UBUNTU_VERSION} - -FROM ${BASE_CUDA_DEV_CONTAINER} AS build - -# Rust toolchain version -ARG RUST_TOOLCHAIN=stable - -ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update && \ - apt-get install -y --no-install-recommends \ - curl \ - pkg-config \ - libssl-dev \ - protobuf-compiler \ - git \ - cmake \ - && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* - -# setup rust. -RUN curl https://sh.rustup.rs -sSf | bash -s -- --default-toolchain ${RUST_TOOLCHAIN} -y -ENV PATH="/root/.cargo/bin:${PATH}" -ENV LD_LIBRARY_PATH="/usr/local/cuda/compat/:${LD_LIBRARY_PATH}" - -WORKDIR /root/workspace - -RUN mkdir -p /opt/tabby/bin -RUN mkdir -p /opt/tabby/lib -RUN mkdir -p target - -COPY . . - -RUN --mount=type=cache,target=/usr/local/cargo/registry \ - --mount=type=cache,target=/root/workspace/target \ - cargo build --no-default-features --features cuda,prod --release --package tabby && \ - cp target/release/llama-server /opt/tabby/bin/ && \ - cp target/release/tabby /opt/tabby/bin/ - -# For compatibility with the legacy cpu build. -RUN cp /opt/tabby/bin/tabby /opt/tabby/bin/tabby-cpu - -FROM ${BASE_CUDA_RUN_CONTAINER} AS runtime - -RUN apt-get update && \ - apt-get install -y --no-install-recommends \ - git \ - curl \ - unzip \ - openssh-client \ - ca-certificates \ - libgomp1 \ - && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* - -# Install katana -RUN curl -L https://github.com/projectdiscovery/katana/releases/download/v1.1.2/katana_1.1.2_linux_amd64.zip -o katana.zip \ - && unzip katana.zip katana \ - && mv katana /usr/bin/ \ - && rm katana.zip - -# Disable safe directory in docker -# Context: https://github.com/git/git/commit/8959555cee7ec045958f9b6dd62e541affb7e7d9 -RUN git config --system --add safe.directory "*" - -# Automatic platform ARGs in the global scope -# https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope -ARG TARGETARCH - -# AMD64 only: -# Make link to libnvidia-ml.so (NVML) library -# so that we could get GPU stats. -RUN if [ "$TARGETARCH" = "amd64" ]; then \ - ln -s /usr/lib/x86_64-linux-gnu/libnvidia-ml.so.1 \ - /usr/lib/x86_64-linux-gnu/libnvidia-ml.so; \ - fi - -COPY --from=build /opt/tabby /opt/tabby - -ENV PATH="$PATH:/opt/tabby/bin" -ENV TABBY_ROOT=/data - -ENTRYPOINT ["/opt/tabby/bin/tabby"] diff --git a/docker/Dockerfile.rocm b/docker/Dockerfile.rocm deleted file mode 100644 index 2d7d9bd896d1..000000000000 --- a/docker/Dockerfile.rocm +++ /dev/null @@ -1,77 +0,0 @@ -ARG UBUNTU_VERSION=22.04 -# This needs to generally match the container host's environment. -ARG ROCM_VERSION=5.7.1 -# Target the ROCM build image -ARG BASE_ROCM_DEV_CONTAINER=rocm/dev-ubuntu-${UBUNTU_VERSION}:${ROCM_VERSION}-complete -# Target the ROCM runtime image -ARG BASE_ROCM_RUN_CONTAINER=rocm/dev-ubuntu-${UBUNTU_VERSION}:${ROCM_VERSION} - -FROM ${BASE_ROCM_DEV_CONTAINER} AS build - -# Rust toolchain version -ARG RUST_TOOLCHAIN=stable - -ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update && \ - apt-get install -y --no-install-recommends \ - curl \ - pkg-config \ - libssl-dev \ - protobuf-compiler \ - git \ - cmake \ - && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* - -# setup rust. -RUN curl https://sh.rustup.rs -sSf | bash -s -- --default-toolchain ${RUST_TOOLCHAIN} -y -ENV PATH="/root/.cargo/bin:${PATH}" - -WORKDIR /root/workspace - -RUN mkdir -p /opt/tabby/bin -RUN mkdir -p /opt/tabby/lib -RUN mkdir -p target - -COPY . . - -RUN --mount=type=cache,target=/usr/local/cargo/registry \ - --mount=type=cache,target=/root/workspace/target \ - cargo build --no-default-features --features rocm,prod --release --package tabby && \ - cp target/release/llama-server /opt/tabby/bin/ && \ - cp target/release/tabby /opt/tabby/bin/ - -# For compatibility with the legacy cpu build. -RUN cp /opt/tabby/bin/tabby /opt/tabby/bin/tabby-cpu - -FROM ${BASE_ROCM_RUN_CONTAINER} AS runtime - -RUN apt-get update && \ - apt-get install -y --no-install-recommends \ - git \ - curl \ - openssh-client \ - ca-certificates \ - libssl3 \ - rocblas \ - hipblas \ - libgomp1 \ - && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* - -# Disable safe directory in docker -# Context: https://github.com/git/git/commit/8959555cee7ec045958f9b6dd62e541affb7e7d9 -RUN git config --system --add safe.directory "*" - -# Automatic platform ARGs in the global scope -# https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope -ARG TARGETARCH - -COPY --from=build /opt/tabby /opt/tabby - -ENV PATH="$PATH:/opt/tabby/bin" -ENV TABBY_ROOT=/data - -ENTRYPOINT ["/opt/tabby/bin/tabby"]