-
Notifications
You must be signed in to change notification settings - Fork 68
117 lines (114 loc) · 3.57 KB
/
client-test.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
name: DJLServing client tests
on:
pull_request:
paths-ignore:
- "**.md"
- "**.ipynb"
- "**.json"
- "**.html"
- "**.js"
- "**.css"
workflow_dispatch:
jobs:
client_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: 17
- name: Set up Python3
uses: actions/setup-python@v5
with:
python-version: '3.11'
# Enable gradle cache: https://github.com/actions/cache/blob/master/examples.md#java---gradle
- uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Install DJLServing dependencies
run: |
cd serving && ./gradlew --refresh-dependencies createDeb
sudo dpkg -i build/distributions/*.deb
cd ../engines/python/setup
pip install -e ".[test]"
- name: Run Java binary mode tests
run: |
cd tests/binary && python prepare.py pt && cd ..
djl-serving -m test::PyTorch=file://$PWD/binary/model.pt &> output.log &
sleep 40
cd java-client
./gradlew build
cd ../binary && python prepare.py pt --clean && cd ..
jobs
kill %1
- name: Run Python binary mode tests
run: |
cd tests/binary && python prepare.py pt && cd ..
djl-serving -m test::PyTorch=file://$PWD/binary/model.pt &> output.log &
sleep 40
python test_binary.py 1,3,224,224 1,1000
cd binary && python prepare.py pt --clean && cd ..
jobs
kill %1
- name: Run Python mode tests
run: |
cd tests
djl-serving -m test::Python=file://$PWD/python &> output.log &
sleep 15
python integration/test_client.py
jobs
kill %1
- name: On failure step
if: ${{ failure() }}
run: |
cat tests/output.log
client_test_windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: 17
- name: Set up Python3
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install DJLServing dependencies
shell: bash
run: |
cd engines/python/setup
pip install -e ".[test]"
cd ../../../serving
./gradlew jar
- name: Run Java binary mode tests
shell: bash
run: |
cd tests/binary && python prepare.py pt && cd ../../
./gradlew :serving:run --args="-m test::PyTorch=file:$(pwd -W)/tests/binary/model.pt" > output.log &
sleep 30
cd tests/java-client
./gradlew build
- name: Run Python binary mode tests
shell: bash
run: |
cd tests/ && python test_binary.py 1,3,224,224 1,1000
cd binary && python prepare.py pt --clean && cd ..
- name: Run Python mode tests
shell: bash
run: |
./gradlew --stop
./gradlew :serving:run --args="-m test::Python=file:$(pwd -W)/tests/python" &> output.log &
sleep 30
cd tests/ && python integration/test_client.py
- name: On failure step
if: ${{ failure() }}
shell: bash
run: |
cat output.log