-
Notifications
You must be signed in to change notification settings - Fork 27
192 lines (149 loc) · 4.42 KB
/
workflow_tests.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
name: Tests
on:
workflow_call:
inputs:
ci_type:
type: string
default: 'pr'
jobs:
setup-test:
name: setup-test
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
runs-on: ubuntu-latest
env:
SHELL: bash -eo pipefail
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{matrix.python-version}}
architecture: 'x64'
- name: Display Python version
run: |
python -c "import sys; print(sys.version)"
- name: Run Test for Setup
run: |
./tests/test_setup.sh CPU false
getting-started-test:
name: getting-started-test
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
runs-on: ubuntu-latest
env:
SHELL: bash -eo pipefail
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{matrix.python-version}}
architecture: 'x64'
- name: Display Python version
run: |
python -c "import sys; print(sys.version)"
- name: Run Test for Getting Started
run: |
./tests/test_getting_started.sh
bare-test:
name: bare-test
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
runs-on: ubuntu-latest
env:
SHELL: bash -eo pipefail
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{matrix.python-version}}
architecture: 'x64'
- name: Display Python version
run: |
python -c "import sys; print(sys.version)"
- name: Install dependencies for tests
run: |
python -m pip install --upgrade pip
pip install .[cpu] --extra-index-url https://download.pytorch.org/whl/cpu --extra-index-url https://pytorch-extension.intel.com/release-whl/stable/cpu/us/
# Dynamic link oneCCL and Intel MPI libraries
source $(python -c "import oneccl_bindings_for_pytorch as torch_ccl; print(torch_ccl.cwd)")/env/setvars.sh
# Additional libraries required for pytest
pip install -r ./tests/requirements.txt
- name: Start Ray Cluster
run: |
ray start --head
- name: Run Tests
run: |
./tests/run-tests.sh
docker-test:
name: docker-test
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
runs-on: ubuntu-latest
env:
SHELL: bash -eo pipefail
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Determine Target
id: "target"
run: |
target="inference"
echo "target is ${target}"
echo "target=$target" >> $GITHUB_OUTPUT
- name: Build Docker Image
run: |
DF_SUFFIX=".tests_cpu"
TARGET=${{steps.target.outputs.target}}
PYTHON_V=${{matrix.python-version}}
USE_PROXY="0"
source dev/scripts/ci-functions.sh
build_and_prune ${TARGET} ${DF_SUFFIX} ${USE_PROXY} ${PYTHON_V}
- name: Start Docker Container
run: |
TARGET=${{steps.target.outputs.target}}
code_checkout_path=${{ github.workspace }}
source dev/scripts/ci-functions.sh
start_docker ${TARGET} ${code_checkout_path}
- name: Install Dependencies for Tests
run: |
TARGET=${{steps.target.outputs.target}}
source dev/scripts/ci-functions.sh
install_dependencies ${TARGET}
- name: Start Ray Cluster
run: |
TARGET=${{steps.target.outputs.target}}
source dev/scripts/ci-functions.sh
strat_ray ${TARGET}
- name: Run Tests
run: |
TARGET=${{steps.target.outputs.target}}
source dev/scripts/ci-functions.sh
run_tests ${TARGET}
- name: Stop Container
if: success() || failure()
run: |
TARGET=${{steps.target.outputs.target}}
source dev/scripts/ci-functions.sh
stop_container ${TARGET}