From 8b854225b2393af272bacaeceba44ce7043d8f24 Mon Sep 17 00:00:00 2001 From: Hamel Husain Date: Thu, 21 Dec 2023 12:12:57 -0800 Subject: [PATCH 1/8] fix spaces --- .github/workflows/main.yml | 21 ++++++++++++++++++--- docker/Dockerfile | 3 +++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bdab96ac21..04205a5b73 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,6 +4,7 @@ on: push: branches: - "main" + - "fix-docker" # will remove this when the PR passes jobs: build-axolotl: @@ -38,14 +39,16 @@ jobs: uses: docker/metadata-action@v5 with: images: winglian/axolotl + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - name: Login to Docker Hub uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Build + - name: Build and export to Docker uses: docker/build-push-action@v5 with: context: . @@ -54,11 +57,23 @@ jobs: CUDA=${{ matrix.cuda }} PYTORCH_VERSION=${{ matrix.pytorch }} file: ./docker/Dockerfile + tags: | + ${{ steps.metadata.outputs.tags }}-py${{ matrix.python_version }}-cu${{ matrix.cuda }}-${{ matrix.pytorch }}${{ matrix.axolotl_extras != '' && '-' || '' }}${{ matrix.axolotl_extras }} + ${{ (matrix.is_latest) && format('{0}-latest', steps.metadata.outputs.tags) || '' }} + - name: Unit Tests + run: | + docker run --rm pytest --ignore=tests/e2e/ /workspace/axolotl/tests/ + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + file: ./docker/Dockerfile push: ${{ github.event_name != 'pull_request' }} tags: | ${{ steps.metadata.outputs.tags }}-py${{ matrix.python_version }}-cu${{ matrix.cuda }}-${{ matrix.pytorch }}${{ matrix.axolotl_extras != '' && '-' || '' }}${{ matrix.axolotl_extras }} ${{ (matrix.is_latest) && format('{0}-latest', steps.metadata.outputs.tags) || '' }} labels: ${{ steps.metadata.outputs.labels }} + build-axolotl-runpod: needs: build-axolotl if: github.repository_owner == 'OpenAccess-AI-Collective' diff --git a/docker/Dockerfile b/docker/Dockerfile index 81a08bc8b7..f8e0528562 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -25,6 +25,9 @@ RUN if [ "$AXOLOTL_EXTRAS" != "" ] ; then \ pip install -e .[deepspeed,flash-attn]; \ fi +# So we can test the Docker image +RUN pip install pytest + # fix so that git fetch/pull from remote works RUN git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" && \ git config --get remote.origin.fetch From ee98d5b58424aedbb2abd00e7ca47822defd2d40 Mon Sep 17 00:00:00 2001 From: Hamel Husain Date: Thu, 21 Dec 2023 12:15:03 -0800 Subject: [PATCH 2/8] add load flag --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 04205a5b73..b18bd58ecf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -52,6 +52,7 @@ jobs: uses: docker/build-push-action@v5 with: context: . + load: true build-args: | BASE_TAG=${{ github.ref_name }}-base-py${{ matrix.python_version }}-cu${{ matrix.cuda }}-${{ matrix.pytorch }} CUDA=${{ matrix.cuda }} From 49042380044d147616b12b50941bc932797c84aa Mon Sep 17 00:00:00 2001 From: Hamel Husain Date: Thu, 21 Dec 2023 12:15:28 -0800 Subject: [PATCH 3/8] add load flag --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b18bd58ecf..e4e7e66897 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -48,6 +48,7 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + # guidance for testing before pushing: https://docs.docker.com/build/ci/github-actions/test-before-push/ - name: Build and export to Docker uses: docker/build-push-action@v5 with: From f0cc8d2ff5989298ff662342d02d7638acc47fc2 Mon Sep 17 00:00:00 2001 From: Hamel Husain Date: Thu, 21 Dec 2023 12:23:57 -0800 Subject: [PATCH 4/8] fight with CI --- .github/workflows/main.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e4e7e66897..e897197e85 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -39,8 +39,6 @@ jobs: uses: docker/metadata-action@v5 with: images: winglian/axolotl - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Login to Docker Hub @@ -54,8 +52,9 @@ jobs: with: context: . load: true + # BASE_TAG=${{ github.ref_name }}-base-py${{ matrix.python_version }}-cu${{ matrix.cuda }}-${{ matrix.pytorch }} build-args: | - BASE_TAG=${{ github.ref_name }}-base-py${{ matrix.python_version }}-cu${{ matrix.cuda }}-${{ matrix.pytorch }} + BASE_TAG=main-base-py${{ matrix.python_version }}-cu${{ matrix.cuda }}-${{ matrix.pytorch }} CUDA=${{ matrix.cuda }} PYTORCH_VERSION=${{ matrix.pytorch }} file: ./docker/Dockerfile From 874da4f950baac20e9f8a6859799823b45528855 Mon Sep 17 00:00:00 2001 From: Hamel Husain Date: Thu, 21 Dec 2023 12:37:43 -0800 Subject: [PATCH 5/8] fight with CI --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e897197e85..0c5d8d3945 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -63,7 +63,7 @@ jobs: ${{ (matrix.is_latest) && format('{0}-latest', steps.metadata.outputs.tags) || '' }} - name: Unit Tests run: | - docker run --rm pytest --ignore=tests/e2e/ /workspace/axolotl/tests/ + docker run --rm ${{ steps.metadata.outputs.tags }}-py${{ matrix.python_version }}-cu${{ matrix.cuda }}-${{ matrix.pytorch }}${{ matrix.axolotl_extras != '' && '-' || '' }}${{ matrix.axolotl_extras }} pytest --ignore=tests/e2e/ /workspace/axolotl/tests/ - name: Build and push uses: docker/build-push-action@v5 with: From 4b14676b58c7210acca8ade223cc17c82796599b Mon Sep 17 00:00:00 2001 From: Hamel Husain Date: Thu, 21 Dec 2023 12:59:14 -0800 Subject: [PATCH 6/8] fight with CI --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0c5d8d3945..fc1edc8d20 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -67,8 +67,8 @@ jobs: - name: Build and push uses: docker/build-push-action@v5 with: - context: . - file: ./docker/Dockerfile + # context: . + # file: ./docker/Dockerfile push: ${{ github.event_name != 'pull_request' }} tags: | ${{ steps.metadata.outputs.tags }}-py${{ matrix.python_version }}-cu${{ matrix.cuda }}-${{ matrix.pytorch }}${{ matrix.axolotl_extras != '' && '-' || '' }}${{ matrix.axolotl_extras }} From d42881c61a07611665cd8840d4b335acb12043b9 Mon Sep 17 00:00:00 2001 From: Hamel Husain Date: Thu, 21 Dec 2023 13:38:42 -0800 Subject: [PATCH 7/8] fight with CI --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fc1edc8d20..0c5d8d3945 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -67,8 +67,8 @@ jobs: - name: Build and push uses: docker/build-push-action@v5 with: - # context: . - # file: ./docker/Dockerfile + context: . + file: ./docker/Dockerfile push: ${{ github.event_name != 'pull_request' }} tags: | ${{ steps.metadata.outputs.tags }}-py${{ matrix.python_version }}-cu${{ matrix.cuda }}-${{ matrix.pytorch }}${{ matrix.axolotl_extras != '' && '-' || '' }}${{ matrix.axolotl_extras }} From 6f9891cfe5e160807e6bc6b584a695bfc970dde8 Mon Sep 17 00:00:00 2001 From: Hamel Husain Date: Thu, 21 Dec 2023 14:42:51 -0800 Subject: [PATCH 8/8] fight with CI --- .github/workflows/main.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0c5d8d3945..6fea025fe2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -61,6 +61,7 @@ jobs: tags: | ${{ steps.metadata.outputs.tags }}-py${{ matrix.python_version }}-cu${{ matrix.cuda }}-${{ matrix.pytorch }}${{ matrix.axolotl_extras != '' && '-' || '' }}${{ matrix.axolotl_extras }} ${{ (matrix.is_latest) && format('{0}-latest', steps.metadata.outputs.tags) || '' }} + cache-to: type=local,dest=/tmp/buildx-cache,mode=max - name: Unit Tests run: | docker run --rm ${{ steps.metadata.outputs.tags }}-py${{ matrix.python_version }}-cu${{ matrix.cuda }}-${{ matrix.pytorch }}${{ matrix.axolotl_extras != '' && '-' || '' }}${{ matrix.axolotl_extras }} pytest --ignore=tests/e2e/ /workspace/axolotl/tests/ @@ -74,6 +75,10 @@ jobs: ${{ steps.metadata.outputs.tags }}-py${{ matrix.python_version }}-cu${{ matrix.cuda }}-${{ matrix.pytorch }}${{ matrix.axolotl_extras != '' && '-' || '' }}${{ matrix.axolotl_extras }} ${{ (matrix.is_latest) && format('{0}-latest', steps.metadata.outputs.tags) || '' }} labels: ${{ steps.metadata.outputs.labels }} + cache-from: type=local,src=/tmp/buildx-cache + - name: delete the cache + run: | + rm -rf /tmp/buildx-cache build-axolotl-runpod: needs: build-axolotl