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]>
.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 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
- name: Unit Tests w docker image
|
| 53 |
run: |
|
| 54 |
-
docker run --rm
|
|
|
|
| 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/
|