-
Notifications
You must be signed in to change notification settings - Fork 34
262 lines (260 loc) · 8.06 KB
/
main.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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
on:
push:
branches:
- '*'
pull_request:
jobs:
build_linux:
name: Build Wheel - Linux
runs-on: ubuntu-latest
container:
# note: keep same as .devcontainer/Dockerfile
image: milvusdb/milvus-env:amd64-centos7-20221222-0fdc1a0
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_COMPILERCHECK: content
CCACHE_COMPRESS: 1
CCACHE_COMPRESSLEVEL: 5
CCACHE_MAXSIZE: 2G
timeout-minutes: 120
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache go
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: linux-go-${{ hashFiles('milvus_binary/env.sh') }}
restore-keys: linux-go-
- name: Cache conan
uses: actions/cache@v3
with:
path: |
~/.conan/data
key: linux-conan-${{ hashFiles('milvus_binary/env.sh') }}
restore-keys: linux-conan-
- name: Cache ccache
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/.ccache
key: linux-ccache-${{ hashFiles('milvus_binary/env.sh') }}
restore-keys: linux-ccache-
- name: Install build requires
run: |
yum -y install rh-python38 patch
- name: Build Wheel
run: |
# devtoolset 7
export PATH=/opt/rh/devtoolset-7/root/usr/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/opt/rh/devtoolset-7/root$rpmlibdir$rpmlibdir32${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
# python 3.8
export PATH=/opt/rh/rh-python38/root/usr/local/bin:/opt/rh/rh-python38/root/usr/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/opt/rh/rh-python38/root/usr/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
python3 -m pip install --user -U pip
python3 -m pip install --user build wheel 'setuptools>64.0'
# install patchelf
yum -y install patchelf
python3 -m build -w -n
- uses: actions/upload-artifact@v3
with:
name: wheel_linux
path: dist/*.whl
retention-days: 5
build_macos:
name: Build Wheel - macOS
runs-on: macos-11
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_COMPILERCHECK: content
CCACHE_COMPRESS: 1
CCACHE_COMPRESSLEVEL: 5
CCACHE_MAXSIZE: 2G
timeout-minutes: 120
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache go
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: macos-go-${{ hashFiles('milvus_binary/env.sh') }}
restore-keys: macos-go-
- name: Cache conan
uses: actions/cache@v3
with:
path: |
~/.conan/data
key: macos-conan-${{ hashFiles('milvus_binary/env.sh') }}
restore-keys: macos-conan-
- name: Cache ccache
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/.ccache
key: macos-ccache-${{ hashFiles('milvus_binary/env.sh') }}
restore-keys: macos-ccache-
- name: Setup Go environment
uses: actions/setup-go@v4
with:
go-version: '~1.18.10'
cache: false
- name: Build Wheel
run: |
python3 -m pip install --user build wheel 'setuptools>64.0'
python3 -m build -w -n
- uses: actions/upload-artifact@v3
with:
name: wheel_macos
path: dist/*.whl
retention-days: 5
build_windows:
name: Build Wheel - windows
runs-on: windows-latest
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_COMPILERCHECK: content
CCACHE_COMPRESS: 1
CCACHE_COMPRESSLEVEL: 5
CCACHE_MAXSIZE: 2G
timeout-minutes: 120
steps:
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checkout
uses: actions/checkout@v3
- name: Cache go
uses: actions/cache@v3
with:
path: |
~\AppData\Local\go-build
~\go\pkg\mod
key: windows-go-${{ hashFiles('milvus_binary/env.sh') }}
restore-keys: windows-go-
- name: Cache conan
uses: actions/cache@v3
with:
path: |
~/.conan/data
key: windows-conan-${{ hashFiles('milvus_binary/env.sh') }}
restore-keys: windows-conan-
- name: Cache ccache
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/.ccache
key: windows-ccache-${{ hashFiles('milvus_binary/env.sh') }}
restore-keys: windows-ccache-
- name: Configure Toolchain
uses: msys2/[email protected]
with:
msystem: mingw64
- name: Prepare
shell: msys2 {0}
run: |
# workaround for keyring error
sed -i 's/SigLevel.*/SigLevel = Never/' /etc/pacman.conf
pacman -S --noconfirm --needed git patch
pacman -S --noconfirm --needed mingw-w64-x86_64-python mingw-w64-x86_64-python-wheel mingw-w64-x86_64-python-pip
- name: Build Wheel
shell: msys2 {0}
run: |
python3 -m pip install --user build wheel 'setuptools>64.0'
python3 -m build -w -n
- uses: actions/upload-artifact@v3
with:
name: wheel_windows
path: dist/*.whl
retention-days: 5
acceptance_test_many_linux:
needs:
- build_linux
name: Acceptance Test ${{ matrix.os }}
runs-on: ubuntu-latest
container:
image: ${{ matrix.os }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
os: ["ubuntu:18.04", "ubuntu:22.04", "centos:7", "fedora:38"]
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: wheel_linux
path: dist
- name: Install python3 for os
shell: bash
run: |
if [[ "${{ matrix.os }}" == "centos:7" ]] ; then
yum -y install epel-release
yum -y install python36 python36-pip python36-wheel
elif [[ "${{ matrix.os }}" == "fedora:38" ]] ; then
dnf -y install python3 python3-pip python3-wheel python3-devel gcc gcc-c++
elif [[ "${{ matrix.os }}" =~ "ubuntu" ]] ; then
apt update
apt -y install python3 python3-pip python3-wheel
fi
- name: Run hello milvus
run: |
python3 -m pip install --user -U pip
python3 -m pip install --user "$(echo dist/*.whl)[client]"
cd examples
python3 example.py
acceptance_test_macos:
needs:
- build_macos
name: Acceptance Test ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
os: ["macos-11", "macos-12"]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.8'
- uses: actions/download-artifact@v3
with:
name: wheel_macos
path: dist
- name: Run hello milvus
run: |
python3 -m pip install --user wheel setuptools
python3 -m pip install --user "$(echo dist/*.whl)[client]"
cd examples
python3 example.py
acceptance_test_windows:
needs:
- build_windows
name: Acceptance Test Windows (py${{ matrix.python_version }})
runs-on: windows-latest
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
python_version: ["3.8", "3.10"]
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: wheel_windows
path: dist
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python_version }}
- name: Run hello milvus
run: |
$x = Get-ChildItem dist\*.whl
python3 -m pip install --user "$x[client]"
cd examples
python example.py