forked from mlcommons/medperf
-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (56 loc) · 2.42 KB
/
docker-ci.yml
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
61
62
63
64
65
66
67
# This workflow runs inside a github actions docker container. The workflow
# itself runs another docker container for hosting the dev server which is
# configured with some specific configurations (container network, port...)
# so that it works properly within the docker-in-docker setup. Keep in mind
# that github actions mounts the docker daemon path when running the
# workflow container.
#
# ******** NOTE ********
# MLCubes use docker behind the scenes by default. We don't have direct
# control over how docker commands are called by the MLCube, so care
# should be taken when we start using new container configurations
# inside the mlcube (e.g. networking)
name: Integration local docker workflow
on: pull_request
jobs:
setup:
name: local-docker-deploy
runs-on: ubuntu-latest
container:
image: mlcommons/medperf-tests-container:latest
options: --privileged --name medperf-tests
volumes:
- /tmp:/tmp # To share the directory where the test dataset is downloaded
- /github/home/.medperf:/github/home/.medperf # To share medperf storage
env:
IMAGE_NAME: medperf-api:test
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set server environment vars
working-directory: ./server
run: cp .env.example .env
- name: Generate SSL certificate
working-directory: ./server
run: sh setup-dev-server.sh -c cert.crt -k cert.key -d 0
- name: Build container image
working-directory: ./server
run: docker build -t ${{ env.IMAGE_NAME }} -f Dockerfile.gha .
- name: Run server in background
working-directory: ./server
run: PORT=8000 && docker run --name medperf-api -d --network container:medperf-tests -e PORT=${PORT} -e SSL_FLAGS="--certfile=cert.crt --keyfile=cert.key" ${{ env.IMAGE_NAME }}
- name: Run integration tests
working-directory: ./server
run: pip install -r test-requirements.txt --user && python seed.py --cert cert.crt
- name: Install dependencies
working-directory: .
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f cli/requirements.txt ]; then pip install -e cli; fi
- name: Run chestxray demo
working-directory: .
run: sh cli/cli_chestxray_tutorial_test.sh -f
- name: Run client integration tests
working-directory: .
run: sh cli/cli_tests.sh