use tags again for test image, only run docker e2e after pre-commit checks (#1081)

This commit is contained in:
Wing Lian
2024-01-10 09:04:56 -05:00
committed by GitHub
parent d69ba2b0b7
commit 9032e610b1
2 changed files with 47 additions and 74 deletions

View File

@@ -1,54 +0,0 @@
name: e2e-docker-tests
on:
pull_request:
paths:
- '**.py'
- 'requirements.txt'
- '.github/workflows/*.yml'
workflow_dispatch:
jobs:
build-axolotl:
if: github.repository_owner == 'OpenAccess-AI-Collective'
# this job needs to be run on self-hosted GPU runners...
strategy:
fail-fast: false
matrix:
include:
- cuda: 118
cuda_version: 11.8.0
python_version: "3.10"
pytorch: 2.0.1
- cuda: 121
cuda_version: 12.1.0
python_version: "3.10"
pytorch: 2.1.1
runs-on: [self-hosted, gpu, docker]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build Docker image
run: |
# Set up build arguments
BASE_TAG="main-base-py${{ matrix.python_version }}-cu${{ matrix.cuda }}-${{ matrix.pytorch }}"
CUDA="${{ matrix.cuda }}"
PYTORCH_VERSION="${{ matrix.pytorch }}"
# Build the Docker image
docker build . \
--file ./docker/Dockerfile-tests \
--build-arg BASE_TAG=$BASE_TAG \
--build-arg CUDA=$CUDA \
--build-arg GITHUB_REF=$GITHUB_REF \
--build-arg PYTORCH_VERSION=$PYTORCH_VERSION \
--tag test-axolotl \
--no-cache
- name: Unit Tests w docker image
run: |
docker run --rm test-axolotl pytest --ignore=tests/e2e/ /workspace/axolotl/tests/
- name: GPU Unit Tests w docker image
run: |
docker run --privileged --gpus "all" --env WANDB_DISABLED=true --rm test-axolotl pytest --ignore=tests/e2e/patched/ /workspace/axolotl/tests/e2e/
- name: GPU Unit Tests monkeypatched w docker image
run: |
docker run --privileged --gpus "all" --env WANDB_DISABLED=true --rm test-axolotl pytest /workspace/axolotl/tests/e2e/patched/

View File

@@ -7,10 +7,12 @@ on:
paths: paths:
- '**.py' - '**.py'
- 'requirements.txt' - 'requirements.txt'
- '.github/workflows/*.yml'
pull_request: pull_request:
paths: paths:
- '**.py' - '**.py'
- 'requirements.txt' - 'requirements.txt'
- '.github/workflows/*.yml'
workflow_dispatch: workflow_dispatch:
jobs: jobs:
@@ -53,29 +55,54 @@ jobs:
run: | run: |
pytest --ignore=tests/e2e/ tests/ pytest --ignore=tests/e2e/ tests/
e2e-test: docker-e2e-tests:
name: E2E Tests if: github.repository_owner == 'OpenAccess-AI-Collective'
runs-on: [self-hosted, gpu] # this job needs to be run on self-hosted GPU runners...
timeout-minutes: 20 runs-on: [self-hosted, gpu, docker]
timeout-minutes: 30
needs: [pre-commit, pytest] needs: [pre-commit, pytest]
strategy:
fail-fast: false
matrix:
include:
- cuda: 118
cuda_version: 11.8.0
python_version: "3.10"
pytorch: 2.0.1
- cuda: 121
cuda_version: 12.1.0
python_version: "3.10"
pytorch: 2.1.1
steps: steps:
- name: Check out repository code - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v4
- name: Docker metadata
- name: Setup Python id: metadata
uses: actions/setup-python@v4 uses: docker/metadata-action@v5
with: with:
python-version: "3.10" images: winglian/axolotl-tests
# cache: 'pip' # caching pip dependencies - name: Build Docker image
- name: Install dependencies
run: | run: |
pip3 install --extra-index-url https://download.pytorch.org/whl/cu118 -U torch==2.0.1 # Set up build arguments
pip3 uninstall -y transformers accelerate BASE_TAG="main-base-py${{ matrix.python_version }}-cu${{ matrix.cuda }}-${{ matrix.pytorch }}"
pip3 install -U -e .[flash-attn,mamba-ssm] CUDA="${{ matrix.cuda }}"
pip3 install -r requirements-tests.txt PYTORCH_VERSION="${{ matrix.pytorch }}"
# Build the Docker image
- name: Run e2e tests docker build . \
--file ./docker/Dockerfile-tests \
--build-arg BASE_TAG=$BASE_TAG \
--build-arg CUDA=$CUDA \
--build-arg GITHUB_REF=$GITHUB_REF \
--build-arg PYTORCH_VERSION=$PYTORCH_VERSION \
--tag ${{ steps.metadata.outputs.tags }}-py${{ matrix.python_version }}-cu${{ matrix.cuda }}-${{ matrix.pytorch }} \
--no-cache
- name: Unit Tests w docker image
run: | run: |
pytest tests/e2e/ docker run --rm ${{ steps.metadata.outputs.tags }}-py${{ matrix.python_version }}-cu${{ matrix.cuda }}-${{ matrix.pytorch }} pytest --ignore=tests/e2e/ /workspace/axolotl/tests/
- name: GPU Unit Tests w docker image
run: |
docker run --privileged --gpus "all" --env WANDB_DISABLED=true --rm ${{ steps.metadata.outputs.tags }}-py${{ matrix.python_version }}-cu${{ matrix.cuda }}-${{ matrix.pytorch }} pytest --ignore=tests/e2e/patched/ /workspace/axolotl/tests/e2e/
- name: GPU Unit Tests monkeypatched w docker image
run: |
docker run --privileged --gpus "all" --env WANDB_DISABLED=true --rm ${{ steps.metadata.outputs.tags }}-py${{ matrix.python_version }}-cu${{ matrix.cuda }}-${{ matrix.pytorch }} pytest /workspace/axolotl/tests/e2e/patched/