-
Notifications
You must be signed in to change notification settings - Fork 32
/
azure-release.yml
359 lines (322 loc) · 15.8 KB
/
azure-release.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
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
355
356
357
358
359
stages:
- stage: Release
variables:
? ${{ if startsWith(variables['Build.SourceBranchName'], 'azure-wheel-test-') }}
: TILEDBPY_VERSION: dev
LIBTILEDB_VERSION: dev
LIBTILEDB_SHA: dev
${{ else }}:
TILEDBPY_VERSION: 0.16.2
LIBTILEDB_VERSION: 2.10.2
LIBTILEDB_SHA: 9ab84f907fa5bbbc22099df220ac86f1391509f1
LIBTILEDB_REPO: https://github.com/TileDB-Inc/TileDB
TILEDB_SRC: "$(Build.Repository.Localpath)/tiledb_src"
TILEDB_BUILD: "$(Build.Repository.Localpath)/tiledb_build"
TILEDB_INSTALL: "$(Pipeline.Workspace)/.libtiledb_dist/$(LIBTILEDB_SHA)"
MACOSX_DEPLOYMENT_TARGET: 10.15
condition: or(startsWith(variables['Build.SourceBranch'], 'refs/tags'), startsWith(variables['Build.SourceBranchName'], 'release-'), startsWith(variables['Build.SourceBranchName'], 'azure-wheel-test-'))
jobs:
- job: build1_libtiledb
strategy:
matrix:
macOS_libtiledb:
imageName: "macOS-1015"
windows_libtiledb:
imageName: "windows-latest"
pool:
vmImage: $(imageName)
steps:
- task: UsePythonVersion@0
- template: azure-libtiledb-darwin.yml
- job: build1_libtiledb_on_linux
pool:
vmImage: "ubuntu-latest"
container: quay.io/pypa/manylinux2010_x86_64:2022-04-24-d28e73e
variables:
CXXFLAGS: "-Wno-unused-parameter -lrt -DKJ_USE_EPOLL10 -D__BIONIC__=1"
CFLAGS: "-Wno-unused-parameter -lrt -DKJ_USE_EPOLL=0 -D__BIONIC__=1"
steps:
- task: UsePythonVersion@0
- template: azure-libtiledb-darwin.yml
- job: build2_python310
dependsOn: [build1_libtiledb, build1_libtiledb_on_linux]
condition: succeeded()
variables:
cibw_test_requires: "pytest"
USE_CIBW_VERSION: 2.3.0
strategy:
matrix:
linux_py:
imageName: "ubuntu-latest"
CIBW_BUILD: "cp310-*"
CIBW_SKIP: "*_i686 pp* *musl*"
CIBW_BUILD_VERBOSITY: 3
macOS_py:
imageName: "macOS-1015"
CIBW_BUILD: "cp310-*"
CIBW_SKIP: "pp*"
CIBW_BUILD_VERBOSITY: 3
windows_py:
imageName: "windows-latest"
CIBW_BUILD: "cp310-*"
CIBW_SKIP: "*-win32 pp*"
CIBW_BUILD_VERBOSITY: 3
pool:
vmImage: $(imageName)
steps:
- script: git tag -f $(TILEDBPY_VERSION)
- task: DownloadPipelineArtifact@2
displayName: "Download libtiledb artifact"
inputs:
artifactName: libtiledb-$(Agent.OS)
path: $(TILEDB_INSTALL)
# we have to archive the files because azp breaks newlines in a bare directory restore
- bash: |
set -x
if [[ "$AGENT_OS" == "Windows_NT" ]]; then
7z x -o${TILEDB_INSTALL}/ ${TILEDB_INSTALL}/libtiledb-${LIBTILEDB_VERSION}-${LIBTILEDB_SHA} -y
else
tar xzf ${TILEDB_INSTALL}/libtiledb-${LIBTILEDB_VERSION}-${LIBTILEDB_SHA} -C ${TILEDB_INSTALL};
find ${TILEDB_INSTALL}
fi
# Copy libz (temporary work-around for delocate on macOS)
if [[ "$AGENT_OS" == "Darwin" ]]; then
cp ${TILEDB_INSTALL}/lib/libz.1.dylib $BUILD_REPOSITORY_LOCALPATH
install_name_tool -change libz.1.dylib ${BUILD_REPOSITORY_LOCALPATH}/libz.1.dylib ${TILEDB_INSTALL}/lib/libtiledb.dylib
fi
displayName: "Extract libtiledb files"
- bash: |
# Set the CIBW_ENVIRONMENT from bash in order to get forward slashes because somewhere in the
# cmd/cibw/python chain we end up losing the slashes entirely if we use a job-level variable.
MPATH=$(python -c 'import os; print(os.environ["TILEDB_INSTALL"].replace("\\","/"))')
export CIBW_ENVIRONMENT="TILEDB_PATH=${MPATH}"
# !!! DO NOT PUT OTHER VARIABLES IN THIS SECTION - vars w/out expansions go below !!!"
echo "##vso[task.setvariable variable=CIBW_ENVIRONMENT]$CIBW_ENVIRONMENT"
displayName: "Set CIBW_ENVIRONMENT"
condition: and(succeeded(), ne(variables['Agent.OS'], 'Linux'))
- bash: |
set -xe pipefail
mv ${TILEDB_INSTALL} .libtiledb
export TILEDB_INSTALL=.libtiledb
export CIBW_ENVIRONMENT="TILEDB_PATH=${TILEDB_INSTALL} TILEDB_WHEEL_BUILD=1"
# use the requirements_wheel.txt with numpy pins to ensure ABI compatibility
export CIBW_TEST_COMMAND="python -c 'import tiledb'"
# copy libtiledb into usr/local for audithweel to find
export CIBW_BEFORE_BUILD="cp -R .libtiledb/* /usr/local"
ls -lR "${TILEDB_INSTALL}"
python -c "import os; print(os.environ.get('CIBW_ENVIRONMENT', None))"
git rev-parse HEAD
python3 -m pip install --upgrade pip pytest cython pybind11
python3 setup.py sdist --dist-dir wheelhouse
pip3 install cibuildwheel==${USE_CIBW_VERSION}
cibuildwheel --output-dir wheelhouse .
displayName: "Build and test wheels (Linux)"
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
- bash: |
set -xe pipefail
export TILEDB_WHEEL_BUILD=1
# use the requirements_wheel.txt with numpy pins to ensure ABI compatibility
export CIBW_TEST_COMMAND="python -c 'import tiledb'"
echo "${TILEDB_INSTALL}"
python -c "import os; print(os.environ.get('CIBW_ENVIRONMENT', None))"
git rev-parse HEAD
python3 -m pip install --upgrade pip pytest cython pybind11
python3 setup.py sdist --dist-dir wheelhouse
pip3 install cibuildwheel==${USE_CIBW_VERSION}
cibuildwheel --output-dir wheelhouse .
displayName: "Build and test wheels (macOS)"
condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin'))
- script: |
echo ON
set "TILEDB_WHEEL_BUILD=1"
:: # Have not managed to get this working AZP quoting breaks the command
:: set CIBW_TEST_COMMAND=python -c \"import tiledb\""
echo "cibw env: "
echo "%CIBW_ENVIRONMENT%"
echo "tiledb_install: "
echo "%TILEDB_INSTALL%"
python -c "import os; print(os.environ['CIBW_ENVIRONMENT'])"
python -c "import platform; print('py compiler: ', platform.python_compiler())"
:: this runs under cmd on windows, which we need to use vcvarsall
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
git rev-parse HEAD
python -m pip install --upgrade pip pytest cython pybind11
python setup.py sdist --dist-dir wheelhouse
pip install cibuildwheel==%USE_CIBW_VERSION%
cibuildwheel --output-dir wheelhouse .
:: delete the sdist because we *do not* want files with CRLF endings
:: (if windows builds finish last then the windows sdist will be
:: overwrite any others in the artifact publishing step)
del /q wheelhouse\*.tar.gz
displayName: "Build and test wheels (Windows)"
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
- template: azure-print-logs.yml
- task: PublishBuildArtifacts@1
inputs: { pathtoPublish: "wheelhouse" }
- bash: |
set -x
echo "TILEDB_SRC -----------------------------------------"
find $TILEDB_SRC || true
echo "TILEDB_BUILD -----------------------------------------"
find $TILEDB_BUILD || true
echo "TILEDB_INSTALL -----------------------------------------"
find $TILEDB_INSTALL || true
displayName: "List all the files"
condition: always()
- job: build2_python
dependsOn: [build1_libtiledb, build1_libtiledb_on_linux]
condition: succeeded()
variables:
cibw_test_requires: "pytest"
USE_CIBW_VERSION: 1.6.4
strategy:
matrix:
linux_py:
imageName: "ubuntu-latest"
CIBW_SKIP: "cp27-* cp35-* *_i686 pp*"
CIBW_BUILD_VERBOSITY: 3
macOS_py:
imageName: "macOS-1015"
CIBW_SKIP: "cp27-* cp35-* pp*"
CIBW_BUILD_VERBOSITY: 3
windows_py:
imageName: "windows-latest"
CIBW_SKIP: "cp27-* cp35-* cp36-* *-win32 pp*"
CIBW_BUILD_VERBOSITY: 3
pool:
vmImage: $(imageName)
steps:
- script: git tag -f $(TILEDBPY_VERSION)
- task: DownloadPipelineArtifact@2
displayName: "Download libtiledb artifact"
inputs:
artifactName: libtiledb-$(Agent.OS)
path: $(TILEDB_INSTALL)
# we have to archive the files because azp breaks newlines in a bare directory restore
- bash: |
set -x
if [[ "$AGENT_OS" == "Windows_NT" ]]; then
7z x -o${TILEDB_INSTALL}/ ${TILEDB_INSTALL}/libtiledb-${LIBTILEDB_VERSION}-${LIBTILEDB_SHA} -y
else
tar xzf ${TILEDB_INSTALL}/libtiledb-${LIBTILEDB_VERSION}-${LIBTILEDB_SHA} -C ${TILEDB_INSTALL};
find ${TILEDB_INSTALL}
fi
# Copy libz (temporary work-around for delocate on macOS)
if [[ "$AGENT_OS" == "Darwin" ]]; then
cp ${TILEDB_INSTALL}/lib/libz.1.dylib $BUILD_REPOSITORY_LOCALPATH
install_name_tool -change libz.1.dylib ${BUILD_REPOSITORY_LOCALPATH}/libz.1.dylib ${TILEDB_INSTALL}/lib/libtiledb.dylib
fi
displayName: "Extract libtiledb files"
- bash: |
# Set the CIBW_ENVIRONMENT from bash in order to get forward slashes because somewhere in the
# cmd/cibw/python chain we end up losing the slashes entirely if we use a job-level variable.
MPATH=$(python -c 'import os; print(os.environ["TILEDB_INSTALL"].replace("\\","/"))')
export CIBW_ENVIRONMENT="TILEDB_PATH=${MPATH}"
# !!! DO NOT PUT OTHER VARIABLES IN THIS SECTION - vars w/out expansions go below !!!"
echo "##vso[task.setvariable variable=CIBW_ENVIRONMENT]$CIBW_ENVIRONMENT"
displayName: "Set CIBW_ENVIRONMENT"
condition: and(succeeded(), ne(variables['Agent.OS'], 'Linux'))
- bash: |
set -xe pipefail
mv ${TILEDB_INSTALL} .libtiledb
export TILEDB_INSTALL=.libtiledb
export CIBW_ENVIRONMENT="TILEDB_PATH=${TILEDB_INSTALL} TILEDB_WHEEL_BUILD=1"
# use the requirements_wheel.txt with numpy pins to ensure ABI compatibility
export CIBW_TEST_COMMAND="python -c 'import tiledb'"
# copy libtiledb into usr/local for audithweel to find
export CIBW_BEFORE_BUILD="cp -R .libtiledb/* /usr/local"
ls -lR "${TILEDB_INSTALL}"
python -c "import os; print(os.environ.get('CIBW_ENVIRONMENT', None))"
git rev-parse HEAD
python3 -m pip install --upgrade pip pytest cython pybind11
python3 setup.py sdist --dist-dir wheelhouse
pip3 install cibuildwheel==${USE_CIBW_VERSION}
cibuildwheel --output-dir wheelhouse .
displayName: "Build and test wheels (Linux)"
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
- bash: |
set -xe pipefail
export TILEDB_WHEEL_BUILD=1
# use the requirements_wheel.txt with numpy pins to ensure ABI compatibility
export CIBW_TEST_COMMAND="python -c 'import tiledb'"
echo "${TILEDB_INSTALL}"
python -c "import os; print(os.environ.get('CIBW_ENVIRONMENT', None))"
git rev-parse HEAD
python3 -m pip install --upgrade pip pytest cython pybind11
python3 setup.py sdist --dist-dir wheelhouse
pip3 install cibuildwheel==${USE_CIBW_VERSION}
cibuildwheel --output-dir wheelhouse .
displayName: "Build and test wheels (macOS)"
condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin'))
- script: |
echo ON
set "TILEDB_WHEEL_BUILD=1"
:: # Have not managed to get this working AZP quoting breaks the command
:: set CIBW_TEST_COMMAND=python -c \"import tiledb\""
echo "cibw env: "
echo "%CIBW_ENVIRONMENT%"
echo "tiledb_install: "
echo "%TILEDB_INSTALL%"
python -c "import os; print(os.environ['CIBW_ENVIRONMENT'])"
python -c "import platform; print('py compiler: ', platform.python_compiler())"
:: this runs under cmd on windows, which we need to use vcvarsall
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
git rev-parse HEAD
python -m pip install --upgrade pip pytest cython pybind11
python setup.py sdist --dist-dir wheelhouse
pip install cibuildwheel==%USE_CIBW_VERSION%
cibuildwheel --output-dir wheelhouse .
:: delete the sdist because we *do not* want files with CRLF endings
:: (if windows builds finish last then the windows sdist will be
:: overwrite any others in the artifact publishing step)
del /q wheelhouse\*.tar.gz
displayName: "Build and test wheels (Windows)"
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
- template: azure-print-logs.yml
- task: PublishBuildArtifacts@1
inputs: { pathtoPublish: "wheelhouse" }
- bash: |
set -x
echo "TILEDB_SRC -----------------------------------------"
find $TILEDB_SRC || true
echo "TILEDB_BUILD -----------------------------------------"
find $TILEDB_BUILD || true
echo "TILEDB_INSTALL -----------------------------------------"
find $TILEDB_INSTALL || true
displayName: "List all the files"
condition: always()
- job: trigger_fail_build
dependsOn: [build2_python]
condition: failed()
pool: server
steps:
- task: InvokeRESTAPI@1
inputs:
connectionType: "connectedServiceName"
connectedServiceName: "TileDB-Py-Test"
method: "POST"
body: |
{
"event_type": "failed",
"client_payload": {"build_id:": "$(Build.BuildId)"}
}
urlSuffix: "repos/$(Build.Repository.Name)/dispatches"
waitForCompletion: "false"
- job: trigger_success_build
dependsOn: [build2_python]
condition: succeeded()
pool: server
steps:
- task: InvokeRESTAPI@1
condition: succeeded()
inputs:
connectionType: "connectedServiceName"
connectedServiceName: "TileDB-Py-Test"
method: "POST"
body: |
{
"event_type": "succeeded",
"client_payload": {"build_id:": "$(Build.BuildId)"}
}
urlSuffix: "repos/$(Build.Repository.Name)/dispatches"
waitForCompletion: "false"