From cec249090382cba360db1fb17df1d4b6c4d607e0 Mon Sep 17 00:00:00 2001 From: Dan Saunders Date: Fri, 26 Sep 2025 19:11:28 -0400 Subject: [PATCH] prune 2.7.0, docker cache invalidation --- .github/workflows/main.yml | 7 ++----- .github/workflows/nightlies.yml | 4 ++++ docker/Dockerfile | 7 +++++++ 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 557a31bbd..68aa8fee6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -88,11 +88,6 @@ jobs: python_version: "3.11" pytorch: 2.6.0 axolotl_extras: - - cuda: 126 - cuda_version: 12.6.3 - python_version: "3.11" - pytorch: 2.7.0 - axolotl_extras: - cuda: 126 cuda_version: 12.6.3 python_version: "3.11" @@ -143,6 +138,8 @@ jobs: build-args: | BASE_TAG=${{ github.ref_type == 'tag' && 'main' || github.ref_name }}-py${{ matrix.python_version }}-cu${{ matrix.cuda }}-${{ matrix.pytorch }}${{ matrix.axolotl_extras != '' && '-' || '' }}${{ matrix.axolotl_extras }} CUDA=${{ matrix.cuda }} + GIT_REF=${{ github.ref }} + GIT_SHA=${{ github.sha }} file: ./docker/Dockerfile-cloud push: ${{ github.event_name != 'pull_request' }} tags: | diff --git a/.github/workflows/nightlies.yml b/.github/workflows/nightlies.yml index 49bce470b..0ff343c36 100644 --- a/.github/workflows/nightlies.yml +++ b/.github/workflows/nightlies.yml @@ -52,6 +52,8 @@ jobs: CUDA=${{ matrix.cuda }} PYTORCH_VERSION=${{ matrix.pytorch }} AXOLOTL_ARGS=${{ matrix.axolotl_args }} + GIT_REF=${{ github.ref }} + GIT_SHA=${{ github.sha }} file: ./docker/Dockerfile push: ${{ github.event_name != 'pull_request' }} tags: | @@ -102,6 +104,8 @@ jobs: build-args: | BASE_TAG=${{ github.ref_name }}-py${{ matrix.python_version }}-cu${{ matrix.cuda }}-${{ matrix.pytorch }}${{ matrix.axolotl_extras != '' && '-' || '' }}${{ matrix.axolotl_extras }} CUDA=${{ matrix.cuda }} + GIT_REF=${{ github.ref }} + GIT_SHA=${{ github.sha }} file: ./docker/Dockerfile-cloud push: ${{ github.event_name != 'pull_request' }} tags: | diff --git a/docker/Dockerfile b/docker/Dockerfile index dcf2637c4..6c939f219 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -6,8 +6,12 @@ ARG AXOLOTL_EXTRAS="" ARG AXOLOTL_ARGS="" ARG CUDA="118" ARG PYTORCH_VERSION="2.1.2" +ARG GIT_REF="refs/heads/main" +ARG GIT_SHA="HEAD" ENV PYTORCH_VERSION=$PYTORCH_VERSION +ENV GIT_REF=$GIT_REF +ENV GIT_SHA=$GIT_SHA RUN apt-get update && \ apt-get install -y --allow-change-held-packages vim curl nano libnccl2 libnccl-dev rsync s3fs && \ @@ -20,6 +24,9 @@ RUN git clone --depth=1 https://github.com/axolotl-ai-cloud/axolotl.git WORKDIR /workspace/axolotl +# Ensure we are on the expected commit and break Docker cache between revisions +RUN git fetch origin "$GIT_REF" && git checkout "$GIT_SHA" + # If AXOLOTL_EXTRAS is set, append it in brackets RUN if [ "$AXOLOTL_EXTRAS" != "" ] ; then \ uv pip install --no-build-isolation -e .[ring-flash-attn,optimizers,ray,$AXOLOTL_EXTRAS] $AXOLOTL_ARGS; \