-
Notifications
You must be signed in to change notification settings - Fork 121
478 lines (413 loc) · 16.8 KB
/
build-vineyardd-and-wheels-macos.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
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
# Copyright 2020-2023 Alibaba Group Holding Limited.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Build Packages for MacOS
on:
push:
tags:
- 'v*'
workflow_dispatch:
concurrency:
group: ${{ github.repository }}-${{ github.event.number || github.head_ref || github.sha }}-${{ github.workflow }}
cancel-in-progress: true
env:
MACOSX_DEPLOYMENT_TARGET: "10.15"
jobs:
build-vineyardd:
runs-on: ${{ matrix.os }}
if: ${{ github.repository == 'v6d-io/v6d' || github.event_name == 'workflow_dispatch' }}
strategy:
matrix:
os: [macos-11]
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Generate Summary for Submodules
run: |
git submodule > git-modules.txt
cat git-modules.txt
- name: Cache for cccahe
uses: actions/cache@v3
with:
path: ~/.ccache
key: ${{ matrix.os }}-vineyardd-ccache-${{ hashFiles('**/git-modules.txt') }}
restore-keys: |
${{ matrix.os }}-vineyardd-ccache-
- name: Install dependencies for MacOS
run: |
brew install ccache boost coreutils grpc protobuf openssl || true
export CC=clang
export CXX=clang++
export PATH=/usr/local/opt/ccache/bin:/usr/local/opt/ccache/libexec:$PATH:$HOME/.local/bin
echo "Installing gflags ..."
cd /tmp
curl -L https://github.com/gflags/gflags/archive/v2.2.2.tar.gz --output gflags-v2.2.2.tar.gz
tar zxf gflags-v2.2.2.tar.gz
cd gflags-2.2.2
mkdir -p build-dir
cd build-dir
cmake .. -DBUILD_SHARED_LIBS=OFF
make install -j`nproc`
echo "Installing glog ..."
cd /tmp
curl -L https://github.com/google/glog/archive/v0.5.0.tar.gz --output glog-v0.5.0.tar.gz
tar zxf glog-v0.5.0.tar.gz
cd glog-0.5.0
mkdir -p build-dir
cd build-dir
cmake .. -DBUILD_SHARED_LIBS=OFF \
-DWITH_GFLAGS=OFF \
-DBUILD_TESTING=OFF
make install -j`nproc`
echo "Installing apache-arrow ..."
cd /tmp
curl -L https://github.com/apache/arrow/archive/refs/tags/apache-arrow-12.0.1.tar.gz --output apache-arrow-12.0.1.tar.gz
tar zxf apache-arrow-12.0.1.tar.gz
cd arrow-apache-arrow-12.0.1
mkdir -p build-dir
cd build-dir
cmake ../cpp \
-DARROW_COMPUTE=OFF \
-DARROW_WITH_UTF8PROC=OFF \
-DARROW_CSV=OFF \
-DARROW_CUDA=OFF \
-DARROW_DATASET=OFF \
-DARROW_FILESYSTEM=ON \
-DARROW_FLIGHT=OFF \
-DARROW_GANDIVA=OFF \
-DARROW_GANDIVA_JAVA=OFF \
-DARROW_HDFS=OFF \
-DARROW_HIVESERVER2=OFF \
-DARROW_JSON=OFF \
-DARROW_ORC=OFF \
-DARROW_PARQUET=OFF \
-DARROW_PLASMA=OFF \
-DARROW_PLASMA_JAVA_CLIENT=OFF \
-DARROW_PYTHON=OFF \
-DARROW_S3=OFF \
-DARROW_WITH_BZ2=OFF \
-DARROW_WITH_ZLIB=OFF \
-DARROW_WITH_LZ4=OFF \
-DARROW_WITH_SNAPPY=OFF \
-DARROW_WITH_ZSTD=OFF \
-DARROW_WITH_BROTLI=OFF \
-DARROW_IPC=ON \
-DARROW_BUILD_BENCHMARKS=OFF \
-DARROW_BUILD_EXAMPLES=OFF \
-DARROW_BUILD_INTEGRATION=OFF \
-DARROW_BUILD_UTILITIES=OFF \
-DARROW_BUILD_TESTS=OFF \
-DARROW_ENABLE_TIMING_TESTS=OFF \
-DARROW_FUZZING=OFF \
-DARROW_USE_ASAN=OFF \
-DARROW_USE_TSAN=OFF \
-DARROW_USE_UBSAN=OFF \
-DARROW_JEMALLOC=OFF \
-DARROW_BUILD_SHARED=OFF \
-DARROW_BUILD_STATIC=ON
make install -j`nproc`
- name: Build vineyardd on MacOS
run: |
export CC=clang
export CXX=clang++
export PATH=/usr/local/opt/ccache/bin:/usr/local/opt/ccache/libexec:$PATH:$HOME/.local/bin
# patch cpprestsdk, that is not used, and the cases cannot be handled by delocate well,
#
# see also: https://github.com/matthew-brett/delocate/issues/89
sed -i "" 's/Boost::regex//g' thirdparty/cpprestsdk/Release/cmake/cpprest_find_boost.cmake
sed -i "" 's/regex//g' thirdparty/cpprestsdk/Release/cmake/cpprest_find_boost.cmake
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=OFF \
-DBUILD_VINEYARD_SERVER=ON \
-DBUILD_VINEYARD_CLIENT=OFF \
-DBUILD_VINEYARD_PYTHON_BINDINGS=OFF \
-DBUILD_VINEYARD_PYPI_PACKAGES=OFF \
-DBUILD_VINEYARD_BASIC=OFF \
-DBUILD_VINEYARD_GRAPH=OFF \
-DBUILD_VINEYARD_IO=OFF \
-DBUILD_VINEYARD_HOSSEINMOEIN_DATAFRAME=OFF \
-DBUILD_VINEYARD_TESTS=OFF \
-DBUILD_VINEYARD_TESTS_ALL=OFF \
-DBUILD_VINEYARD_PROFILING=OFF
make vineyardd -j`nproc`
cp ./bin/vineyardd ../vineyardd
- name: Package vineyardd artifact on MacOS
run: |
sha512sum ./vineyardd > vineyardd.${{ github.sha }}.sha512sum
echo "Checksum is: "
cat ./*.sha512sum
tar zcvfh vineyardd.${{ runner.os }}-generic.${{ github.sha }}.tar.gz ./vineyardd vineyardd.${{ github.sha }}.sha512sum
- name: Extract tag name
id: tag
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Upload vineyardd to tagged release
uses: svenstaro/upload-release-action@v2
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'v6d-io/v6d' }}
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: vineyardd.${{ runner.os }}-generic.${{ github.sha }}.tar.gz
asset_name: vineyardd-${{ steps.tag.outputs.TAG }}-macos_x86-64.tar.gz
tag: ${{ steps.tag.outputs.TAG }}
prerelease: false
overwrite: true
body: "vineyard ${{ steps.tag.outputs.TAG }}"
- name: Upload CI artifacts
uses: actions/upload-artifact@v3
with:
name: vineyardd.${{ runner.os }}-generic.${{ github.sha }}.tar.gz
path: vineyardd.${{ runner.os }}-generic.${{ github.sha }}.tar.gz
build-vineyardctl:
runs-on: ${{ matrix.os }}
if: ${{ github.repository == 'v6d-io/v6d' || github.event_name == 'workflow_dispatch' }}
strategy:
matrix:
os: [macos-11]
platform: [x86_64, aarch64]
steps:
- uses: actions/checkout@v3
with:
submodules: false
- uses: actions/setup-go@v3
with:
go-version: 1.19
- name: Install dependencies for MacOS
run: |
pushd $(brew --repo homebrew/core)
git checkout ${{ env.HOMEBREW_REV }} || true
popd
brew install coreutils || true
- name: Extract tag name
id: tag
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'v6d-io/v6d' }}
run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Build vineyardctl
run: |
export arch="${{ matrix.platform }}"
export arch="${arch/x86_64/amd64}"
export arch="${arch/aarch64/arm64}"
echo "arch = $arch"
env CGO_ENABLED=0 GOARCH=$arch go build -a -o vineyardctl k8s/cmd/main.go
go build -a -o vineyardctl k8s/cmd/main.go
strip ./vineyardctl || true
- name: Upload wheels to tagged release
uses: svenstaro/upload-release-action@v2
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'v6d-io/v6d' }}
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./vineyardctl
asset_name: vineyardctl-${{ steps.tag.outputs.TAG }}-darwin-${{ matrix.platform == 'x86_64' && 'amd64' || 'arm64' }}
file_glob: false
tag: ${{ steps.tag.outputs.TAG }}
prerelease: false
overwrite: true
body: "vineyard ${{ steps.tag.outputs.TAG }}"
- name: Package vineyardctl artifact on Linux
if: ${{ matrix.platform == 'x86_64' }}
run: |
sha512sum vineyardctl > vineyardctl.${{ github.sha }}.sha512sum
echo "Checksum is: "
cat ./*.sha512sum
tar zcvfh vineyardctl.${{ runner.os }}-generic.${{ github.sha }}.tar.gz ./vineyardctl vineyardctl.${{ github.sha }}.sha512sum
- name: Upload CI artifacts
if: ${{ matrix.platform == 'x86_64' }}
uses: actions/upload-artifact@v3
with:
name: vineyardctl.${{ runner.os }}-generic.${{ github.sha }}.tar.gz
path: vineyardctl.${{ runner.os }}-generic.${{ github.sha }}.tar.gz
build-wheels:
needs: [build-vineyardd, build-vineyardctl]
runs-on: ${{ matrix.os }}
if: ${{ github.repository == 'v6d-io/v6d' || github.event_name == 'workflow_dispatch' }}
strategy:
matrix:
os: [macos-11]
python: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Generate Summary for Submodules
run: |
git submodule > git-modules.txt
cat git-modules.txt
- name: Cache for cccahe
uses: actions/cache@v3
with:
path: ~/.ccache
key: ${{ matrix.os }}-${{ matrix.python }}-ccache-${{ hashFiles('**/git-modules.txt') }}
restore-keys: |
${{ matrix.os }}-${{ matrix.python }}-ccache-
- name: Download vineyardd artifacts
uses: actions/download-artifact@v3
with:
name: vineyardd.${{ runner.os }}-generic.${{ github.sha }}.tar.gz
- name: Download vineyardctl artifacts
uses: actions/download-artifact@v3
with:
name: vineyardctl.${{ runner.os }}-generic.${{ github.sha }}.tar.gz
- name: Prepare binary
run: |
tar zxvf vineyardd.${{ runner.os }}-generic.${{ github.sha }}.tar.gz
tar zxvf vineyardctl.${{ runner.os }}-generic.${{ github.sha }}.tar.gz
mv vineyardd python/vineyard/bdist/vineyardd
mv vineyardctl python/vineyard/bdist/vineyardctl
- name: Install python for MacOS
if: runner.os == 'macOS'
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Validate installed python version
run: |
python -c "import sys; print(sys.version)"
# install dependencies
curl https://bootstrap.pypa.io/get-pip.py | python
pip3 install delocate
- name: Install dependencies for MacOS
if: runner.os == 'macOS'
run: |
pushd $(brew --repo homebrew/core)
git checkout ${{ env.HOMEBREW_REV }} || true
popd
brew install ccache boost coreutils grpc protobuf openssl || true
export CC=clang
export CXX=clang++
export PATH=/usr/local/opt/ccache/bin:/usr/local/opt/ccache/libexec:$PATH:$HOME/.local/bin
ccache --show-stats
echo "Installing gflags ..."
cd /tmp
curl -L https://github.com/gflags/gflags/archive/v2.2.2.tar.gz --output gflags-v2.2.2.tar.gz
tar zxf gflags-v2.2.2.tar.gz
cd gflags-2.2.2
mkdir -p build-dir
cd build-dir
cmake .. -DBUILD_SHARED_LIBS=OFF
make install -j`nproc`
echo "Installing glog ..."
cd /tmp
curl -L https://github.com/google/glog/archive/v0.5.0.tar.gz --output glog-v0.5.0.tar.gz
tar zxf glog-v0.5.0.tar.gz
cd glog-0.5.0
mkdir -p build-dir
cd build-dir
cmake .. -DBUILD_SHARED_LIBS=OFF \
-DWITH_GFLAGS=OFF \
-DBUILD_TESTING=OFF
make install -j`nproc`
echo "Installing apache-arrow ..."
cd /tmp
curl -L https://github.com/apache/arrow/archive/refs/tags/apache-arrow-12.0.1.tar.gz --output apache-arrow-12.0.1.tar.gz
tar zxf apache-arrow-12.0.1.tar.gz
cd arrow-apache-arrow-12.0.1
mkdir -p build-dir
cd build-dir
cmake ../cpp \
-DARROW_COMPUTE=ON \
-DARROW_WITH_UTF8PROC=OFF \
-DARROW_CSV=ON \
-DARROW_CUDA=OFF \
-DARROW_DATASET=OFF \
-DARROW_FILESYSTEM=ON \
-DARROW_FLIGHT=OFF \
-DARROW_GANDIVA=OFF \
-DARROW_GANDIVA_JAVA=OFF \
-DARROW_HDFS=OFF \
-DARROW_HIVESERVER2=OFF \
-DARROW_JSON=OFF \
-DARROW_ORC=OFF \
-DARROW_PARQUET=OFF \
-DARROW_PLASMA=OFF \
-DARROW_PLASMA_JAVA_CLIENT=OFF \
-DARROW_PYTHON=OFF \
-DARROW_S3=OFF \
-DARROW_WITH_BZ2=OFF \
-DARROW_WITH_ZLIB=OFF \
-DARROW_WITH_LZ4=OFF \
-DARROW_WITH_SNAPPY=OFF \
-DARROW_WITH_ZSTD=OFF \
-DARROW_WITH_BROTLI=OFF \
-DARROW_IPC=ON \
-DARROW_BUILD_BENCHMARKS=OFF \
-DARROW_BUILD_EXAMPLES=OFF \
-DARROW_BUILD_INTEGRATION=OFF \
-DARROW_BUILD_UTILITIES=OFF \
-DARROW_BUILD_TESTS=OFF \
-DARROW_ENABLE_TIMING_TESTS=OFF \
-DARROW_FUZZING=OFF \
-DARROW_USE_ASAN=OFF \
-DARROW_USE_TSAN=OFF \
-DARROW_USE_UBSAN=OFF \
-DARROW_JEMALLOC=OFF \
-DARROW_BUILD_SHARED=OFF \
-DARROW_BUILD_STATIC=ON
make install -j`nproc`
ccache --show-stats
- name: Build wheel package on MacOS
if: runner.os == 'macOS'
run: |
export CC=clang
export CXX=clang++
export PATH=/usr/local/opt/ccache/bin:/usr/local/opt/ccache/libexec:$PATH:$HOME/.local/bin
# run build
mkdir -p build
cd build
cmake .. -DBUILD_SHARED_LIBS=OFF \
-DBUILD_VINEYARD_SERVER=OFF \
-DBUILD_VINEYARD_CLIENT=ON \
-DBUILD_VINEYARD_PYTHON_BINDINGS=ON \
-DBUILD_VINEYARD_PYPI_PACKAGES=ON \
-DBUILD_VINEYARD_BASIC=OFF \
-DBUILD_VINEYARD_IO=OFF \
-DBUILD_VINEYARD_GRAPH=OFF \
-DBUILD_VINEYARD_HOSSEINMOEIN_DATAFRAME=OFF \
-DBUILD_VINEYARD_TESTS=OFF \
-DBUILD_VINEYARD_TESTS_ALL=OFF \
-DBUILD_VINEYARD_COVERAGE=OFF \
-DBUILD_VINEYARD_PROFILING=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DPYTHON_EXECUTABLE=`which python`
make vineyard_client_python -j`nproc`
cd ..
rm -rf build/lib* build/bdist.*
python setup.py bdist_wheel
if [[ "${{ matrix.python }}" == "3.11" ]]; then
rm -rf build/lib* build/bdist.*
python setup_bdist.py bdist_wheel
fi
export LD_LIBRARY_PATH=`pwd`/build/lib:$LD_LIBRARY_PATH
for wheel in `ls dist/*`; do delocate-wheel -w fixed_wheels -v $wheel; done
ls -la ./fixed_wheels
ccache --show-stats
- name: Extract tag name
id: tag
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Upload wheels to tagged release
uses: svenstaro/upload-release-action@v2
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'v6d-io/v6d' }}
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: fixed_wheels/*.whl
file_glob: true
tag: ${{ steps.tag.outputs.TAG }}
prerelease: false
overwrite: true
body: "vineyard ${{ steps.tag.outputs.TAG }}"
- uses: actions/upload-artifact@v3
if: ${{ github.event_name == 'workflow_dispatch' }}
with:
name: vineyard-macosx-wheels-${{ matrix.python }}
path: fixed_wheels/*.whl