Simplify Docker Unit Test CI (#1055) [skip ci]
* Update tests-docker.yml * Update tests-docker.yml * run ci tests on ci yaml updates --------- Co-authored-by: Wing Lian <wing.lian@gmail.com>
This commit is contained in:
36
.github/workflows/tests-docker.yml
vendored
36
.github/workflows/tests-docker.yml
vendored
@@ -5,6 +5,7 @@ on:
|
|||||||
paths:
|
paths:
|
||||||
- '**.py'
|
- '**.py'
|
||||||
- 'requirements.txt'
|
- 'requirements.txt'
|
||||||
|
- '.github/workflows/*.yml'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -19,36 +20,27 @@ jobs:
|
|||||||
cuda_version: 11.8.0
|
cuda_version: 11.8.0
|
||||||
python_version: "3.10"
|
python_version: "3.10"
|
||||||
pytorch: 2.0.1
|
pytorch: 2.0.1
|
||||||
axolotl_extras:
|
|
||||||
- cuda: 121
|
- cuda: 121
|
||||||
cuda_version: 12.1.0
|
cuda_version: 12.1.0
|
||||||
python_version: "3.10"
|
python_version: "3.10"
|
||||||
pytorch: 2.1.1
|
pytorch: 2.1.1
|
||||||
axolotl_extras:
|
|
||||||
runs-on: [self-hosted, gpu, docker]
|
runs-on: [self-hosted, gpu, docker]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
- name: Docker metadata
|
|
||||||
id: metadata
|
|
||||||
uses: docker/metadata-action@v5
|
|
||||||
with:
|
|
||||||
images: winglian/axolotl
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
- name: Build Docker image
|
- name: Build Docker image
|
||||||
uses: docker/build-push-action@v5
|
run: |
|
||||||
with:
|
# Set up build arguments
|
||||||
context: .
|
BASE_TAG="main-base-py${{ matrix.python_version }}-cu${{ matrix.cuda }}-${{ matrix.pytorch }}"
|
||||||
load: true
|
CUDA="${{ matrix.cuda }}"
|
||||||
build-args: |
|
PYTORCH_VERSION="${{ matrix.pytorch }}"
|
||||||
BASE_TAG=main-base-py${{ matrix.python_version }}-cu${{ matrix.cuda }}-${{ matrix.pytorch }}
|
# Build the Docker image
|
||||||
CUDA=${{ matrix.cuda }}
|
docker build . \
|
||||||
PYTORCH_VERSION=${{ matrix.pytorch }}
|
--file ./docker/Dockerfile \
|
||||||
file: ./docker/Dockerfile
|
--build-arg BASE_TAG=$BASE_TAG \
|
||||||
tags: |
|
--build-arg CUDA=$CUDA \
|
||||||
${{ steps.metadata.outputs.tags }}-py${{ matrix.python_version }}-cu${{ matrix.cuda }}-${{ matrix.pytorch }}${{ matrix.axolotl_extras != '' && '-' || '' }}${{ matrix.axolotl_extras }}
|
--build-arg PYTORCH_VERSION=$PYTORCH_VERSION \
|
||||||
labels: ${{ steps.metadata.outputs.labels }}
|
--tag test-axolotl
|
||||||
- name: Unit Tests w docker image
|
- name: Unit Tests w docker image
|
||||||
run: |
|
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/
|
docker run --rm test-axolotl pytest --ignore=tests/e2e/ /workspace/axolotl/tests/
|
||||||
|
|||||||
Reference in New Issue
Block a user