hamel winglian commited on
Commit
9ca358b
·
unverified ·
1 Parent(s): 553c80f

Simplify Docker Unit Test CI (#1055) [skip ci]

Browse files

* Update tests-docker.yml

* Update tests-docker.yml

* run ci tests on ci yaml updates

---------

Co-authored-by: Wing Lian <[email protected]>

Files changed (1) hide show
  1. .github/workflows/tests-docker.yml +14 -22
.github/workflows/tests-docker.yml CHANGED
@@ -5,6 +5,7 @@ on:
5
  paths:
6
  - '**.py'
7
  - 'requirements.txt'
 
8
  workflow_dispatch:
9
 
10
  jobs:
@@ -19,36 +20,27 @@ jobs:
19
  cuda_version: 11.8.0
20
  python_version: "3.10"
21
  pytorch: 2.0.1
22
- axolotl_extras:
23
  - cuda: 121
24
  cuda_version: 12.1.0
25
  python_version: "3.10"
26
  pytorch: 2.1.1
27
- axolotl_extras:
28
  runs-on: [self-hosted, gpu, docker]
29
  steps:
30
  - name: Checkout
31
  uses: actions/checkout@v4
32
- - name: Docker metadata
33
- id: metadata
34
- uses: docker/metadata-action@v5
35
- with:
36
- images: winglian/axolotl
37
- - name: Set up Docker Buildx
38
- uses: docker/setup-buildx-action@v3
39
  - name: Build Docker image
40
- uses: docker/build-push-action@v5
41
- with:
42
- context: .
43
- load: true
44
- build-args: |
45
- BASE_TAG=main-base-py${{ matrix.python_version }}-cu${{ matrix.cuda }}-${{ matrix.pytorch }}
46
- CUDA=${{ matrix.cuda }}
47
- PYTORCH_VERSION=${{ matrix.pytorch }}
48
- file: ./docker/Dockerfile
49
- tags: |
50
- ${{ steps.metadata.outputs.tags }}-py${{ matrix.python_version }}-cu${{ matrix.cuda }}-${{ matrix.pytorch }}${{ matrix.axolotl_extras != '' && '-' || '' }}${{ matrix.axolotl_extras }}
51
- labels: ${{ steps.metadata.outputs.labels }}
52
  - name: Unit Tests w docker image
53
  run: |
54
- 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/
 
5
  paths:
6
  - '**.py'
7
  - 'requirements.txt'
8
+ - '.github/workflows/*.yml'
9
  workflow_dispatch:
10
 
11
  jobs:
 
20
  cuda_version: 11.8.0
21
  python_version: "3.10"
22
  pytorch: 2.0.1
 
23
  - cuda: 121
24
  cuda_version: 12.1.0
25
  python_version: "3.10"
26
  pytorch: 2.1.1
 
27
  runs-on: [self-hosted, gpu, docker]
28
  steps:
29
  - name: Checkout
30
  uses: actions/checkout@v4
 
 
 
 
 
 
 
31
  - name: Build Docker image
32
+ run: |
33
+ # Set up build arguments
34
+ BASE_TAG="main-base-py${{ matrix.python_version }}-cu${{ matrix.cuda }}-${{ matrix.pytorch }}"
35
+ CUDA="${{ matrix.cuda }}"
36
+ PYTORCH_VERSION="${{ matrix.pytorch }}"
37
+ # Build the Docker image
38
+ docker build . \
39
+ --file ./docker/Dockerfile \
40
+ --build-arg BASE_TAG=$BASE_TAG \
41
+ --build-arg CUDA=$CUDA \
42
+ --build-arg PYTORCH_VERSION=$PYTORCH_VERSION \
43
+ --tag test-axolotl
44
  - name: Unit Tests w docker image
45
  run: |
46
+ docker run --rm test-axolotl pytest --ignore=tests/e2e/ /workspace/axolotl/tests/