-
Notifications
You must be signed in to change notification settings - Fork 201
354 lines (354 loc) · 11.6 KB
/
nightly-build.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
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
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
name: Nightly Build
on:
schedule:
- cron: '0 16 * * *'
workflow_dispatch:
jobs:
build-and-test:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
modules:
- dl-on-flink-framework
- dl-on-flink-operator
- dl-on-flink-tensorflow-common
- dl-on-flink-tensorflow
- dl-on-flink-tensorflow-2.x
- dl-on-flink-pytorch
- dl-on-flink-lib
- dl-on-flink-examples
- dl-on-flink-examples/dl-on-flink-examples-pytorch
- dl-on-flink-examples/dl-on-flink-examples-tensorflow
- dl-on-flink-examples/dl-on-flink-examples-tensorflow-2.x
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
- name: Set up python 3.7
uses: actions/setup-python@v2
with:
# Semantic version range syntax or exact version of a Python version
python-version: '3.7'
# Optional - x64 or x86 architecture, defaults to x64
architecture: 'x64'
- name: Install Python dependencies
run: |
pip install -U --user wheel
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: build
run: |
mvn -B install -pl ${{ matrix.modules }} -am -DskipTests -Dfast -Pinstall-py-dep
- name: test
env:
TF_ON_FLINK_IP: 127.0.0.1
run: |
mvn -B test -pl ${{ matrix.modules }}
build-and-upload-bin:
needs: build-and-test
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Set up python 3.7
uses: actions/setup-python@v2
with:
# Semantic version range syntax or exact version of a Python version
python-version: '3.7'
# Optional - x64 or x86 architecture, defaults to x64
architecture: 'x64'
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
- name: Build bin
run: mvn -B clean package -DskipTests
- uses: actions/upload-artifact@v2
with:
name: dl-on-flink-dist
path: dl-on-flink-dist/target/dl-on-flink-dist-*-bin.tgz
build-and-test-python:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
modules:
- dl-on-flink-framework
- dl-on-flink-tensorflow
- dl-on-flink-tensorflow-2.x
- dl-on-flink-pytorch
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
- name: Set up python 3.7
uses: actions/setup-python@v2
with:
# Semantic version range syntax or exact version of a Python version
python-version: '3.7'
# Optional - x64 or x86 architecture, defaults to x64
architecture: 'x64'
- name: Install Python dependencies
run: |
pip install -U --user wheel
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: build
run: |
mvn -B install -pl ${{ matrix.modules }} -am -DskipTests -Dfast -Pinstall-py-dep
- name: test
run: |
cd ${{ matrix.modules }}/python
pip install -e .
python -m unittest discover -v .
build-pytorch-nightly-wheel:
needs: build-and-test-python
name: Build ${{ matrix.package }} wheels on ubuntu-20.04
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
package:
- dl-on-flink-pytorch
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Set up python 3.7
uses: actions/setup-python@v2
with:
# Semantic version range syntax or exact version of a Python version
python-version: '3.7'
# Optional - x64 or x86 architecture, defaults to x64
architecture: 'x64'
- name: Build python${{ matrix.python-version }} ${{ matrix.package }} wheels
env:
NIGHTLY_WHEEL: true
run: |
pip install wheel
cd ${{ matrix.package }}/python
python setup.py bdist_wheel
- uses: actions/upload-artifact@v2
with:
name: dl-on-flink-wheels
path: ./dl-on-flink-pytorch/python/dist/*.whl
build-linux-nightly-wheel:
needs: build-and-test-python
name: Build python${{ matrix.python-version }} ${{ matrix.package }} wheels on ubuntu-20.04
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
python-version: [ 3.7, 3.8 ]
package:
- dl-on-flink-framework
- dl-on-flink-tensorflow
- dl-on-flink-tensorflow-2.x
exclude:
- package: dl-on-flink-tensorflow
python-version: 3.8
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Build python${{ matrix.python-version }} ${{ matrix.package }} wheels
env:
NIGHTLY_WHEEL: true
run: |
docker run -i --rm -v $PWD:/v -w /v -e 'NIGHTLY_WHEEL=true' --net=host quay.io/pypa/manylinux2010_x86_64 \
bash -c 'cd /v/${{ matrix.package }}/python \
&& python${{ matrix.python-version }} setup.py bdist_wheel \
&& for f in dist/*.whl; do echo repairing $f && bash -x -e /v/tools/auditwheel repair --plat manylinux2010_x86_64 -w /v/wheelhouse/ $f; done'
- uses: actions/upload-artifact@v2
with:
name: dl-on-flink-wheels
path: ./wheelhouse/*.whl
build-macos-nightly-wheel:
needs: build-and-test-python
name: Build python${{ matrix.python-version }} ${{ matrix.package }} wheels on macOS-10.15
runs-on: macos-10.15
strategy:
fail-fast: false
matrix:
python-version: [ 3.7, 3.8 ]
package:
- dl-on-flink-framework
- dl-on-flink-tensorflow
- dl-on-flink-tensorflow-2.x
exclude:
- package: dl-on-flink-tensorflow
python-version: 3.8
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Build python${{ matrix.python-version }} ${{ matrix.package }} wheels on macOS-10.15
env:
NIGHTLY_WHEEL: true
run: |
pip install wheel auditwheel
export ROOT_DIR=$PWD
mkdir $ROOT_DIR/wheelhouse
cd ${{ matrix.package }}/python
python setup.py bdist_wheel
cp dist/* $ROOT_DIR/wheelhouse
- uses: actions/upload-artifact@v2
with:
name: dl-on-flink-wheels
path: ./wheelhouse/*.whl
test-wheel:
name: Test python${{ matrix.python-version }} ${{ matrix.package }} wheels on ${{ matrix.os }}
needs: [ build-linux-nightly-wheel, build-macos-nightly-wheel, build-pytorch-nightly-wheel ]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ macOS-10.15, ubuntu-20.04 ]
python-version: [ 3.7, 3.8 ]
package:
- dl-on-flink-framework
- dl-on-flink-tensorflow
- dl-on-flink-tensorflow-2.x
- dl-on-flink-pytorch
exclude:
- package: dl-on-flink-tensorflow
python-version: 3.8
- package: dl-on-flink-tensorflow-2.x
python-version: 3.6
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: actions/download-artifact@v2
with:
name: dl-on-flink-wheels
path: ./wheelhouse
- name: build
run: |
mvn -B install -pl ${{ matrix.package }} -am -DskipTests
- name: test
env:
TF_ON_FLINK_IP: 127.0.0.1
run: |
ls $PWD/wheelhouse
pip install --pre ${{ matrix.package }} -f file://${PWD}/wheelhouse
mvn -B test -pl ${{ matrix.package }}
run-example:
needs: [ build-and-upload-bin, build-linux-nightly-wheel, build-macos-nightly-wheel, build-pytorch-nightly-wheel ]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ macos-10.15, ubuntu-18.04, ubuntu-20.04 ]
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
- uses: actions/setup-python@v2
with:
python-version: 3.7
- uses: actions/download-artifact@v2
with:
name: dl-on-flink-wheels
path: ./wheelhouse
- uses: actions/download-artifact@v2
with:
name: dl-on-flink-dist
- name: Install coreutil on Mac
if: ${{ matrix.os == 'macos-10.15' }}
run: brew install coreutils
- name: Run example on ${{ matrix.os }}
run: |
bash tools/run_example.sh dl-on-flink-*-bin.tgz wheelhouse
- uses: actions/upload-artifact@v2
if: always()
with:
name: e2e-example-logs
path: ./flink-*/log
deploy-snapshot:
if: github.repository == 'flink-extended/dl-on-flink'
needs: [ run-example, test-wheel ]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Set up python 3.7
uses: actions/setup-python@v2
with:
# Semantic version range syntax or exact version of a Python version
python-version: '3.7'
# Optional - x64 or x86 architecture, defaults to x64
architecture: 'x64'
- name: Install Python dependencies
run: |
pip install -U --user wheel
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
server-id: oss_id
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Publish snapshot
run: mvn -B clean deploy -DskipTests -Prelease
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
- uses: actions/upload-artifact@v2
with:
name: dl-on-flink-dist
path: dl-on-flink-dist/target/dl-on-flink-dist-*-bin.tgz