-
Notifications
You must be signed in to change notification settings - Fork 863
60 lines (51 loc) · 2.02 KB
/
docker-ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Docker CI
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
merge_group:
jobs:
test-build-and-container:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Test build_image.sh script with custom tagging and gpu flag
working-directory: docker
run: ./test_build_image_tagging.sh ${{ matrix.python-version }}
- name: Determine the branch name
id: branch-name
run: |
if [[ "${GITHUB_REF}" == refs/heads/* ]]; then
GITHUB_BRANCH=${GITHUB_REF#refs/heads/}
elif [[ "${GITHUB_REF}" == refs/pull/*/merge ]]; then
GITHUB_BRANCH=${GITHUB_HEAD_REF}
fi
echo "GITHUB_BRANCH=${GITHUB_BRANCH}" >> $GITHUB_OUTPUT
- name: Build Image for container test
id: image_build
working-directory: docker
run: |
IMAGE_TAG=test-image-${{ matrix.python-version }}
REPO_URL="${{ github.event.pull_request.head.repo.clone_url }}"
if [[ -z "${REPO_URL}" ]]; then
REPO_URL="https://github.com/pytorch/serve.git"
fi
./build_image.sh -py "${{ matrix.python-version }}" -t "${IMAGE_TAG}" -b "${{ steps.branch-name.outputs.GITHUB_BRANCH }}" -repo ${REPO_URL} -s
echo "IMAGE_TAG=${IMAGE_TAG}" >> $GITHUB_OUTPUT
- name: Container Healthcheck
working-directory: docker
run: ./test_container_health.sh ${{ steps.image_build.outputs.IMAGE_TAG }}
- name: Check Python version in container
working-directory: docker
run: ./test_container_python_version.sh ${{ steps.image_build.outputs.IMAGE_TAG }} ${{ matrix.python-version }}
- name: Test model running in container with sample image data
working-directory: docker
run: |
./test_container_model_prediction.sh ${{ steps.image_build.outputs.IMAGE_TAG }}