-
Notifications
You must be signed in to change notification settings - Fork 109
361 lines (295 loc) · 13.2 KB
/
build-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
360
361
name: Build Release Assets
on:
push:
branches: ['*']
workflow_dispatch:
env:
CI_BLADEBIT: 1 # Our own CI, that is, not being built as a dependency
jobs:
# build-ubuntu-x86-64:
# runs-on: ubuntu-20.04
# steps:
# - name: Checkout Repo
# uses: actions/checkout@v3
# - name: Get Version Number
# id: version_number
# run: .github/actions/get-version.sh ubuntu x86-64
# - name: Install Prerequisites
# run: sudo apt install -y libgmp-dev libnuma-dev
# # - name: Build
# # run: .github/actions/build-asset-unix.sh --artifact ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }} --version ${{steps.version_number.outputs.BB_VERSION}}
# - name: Install CUDA Prerequisites
# run: |
# distro=ubuntu2004
# arch=x86_64
# sudo apt-key del 7fa2af80
# wget https://developer.download.nvidia.com/compute/cuda/repos/$distro/$arch/cuda-keyring_1.0-1_all.deb
# sudo dpkg -i cuda-keyring_1.0-1_all.deb
# sudo apt-get update
# sudo apt-get install cuda
# - name: Build CUDA
# run: .github/actions/build-asset-unix.sh --cuda --artifact ${{ steps.version_number.outputs.BB_ARTIFACT_NAME_CUDA }} --version ${{steps.version_number.outputs.BB_VERSION}}
# # - name: Upload Artifact Ubuntu x86-64
# # uses: actions/upload-artifact@v3
# # with:
# # name: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }}
# # path: ${{ github.workspace }}/bin/${{ steps.version_number.outputs.BB_ARTIFACT_NAME }}
# # if-no-files-found: error
# # - name: Upload Artifact CUDA Ubuntu x86-64
# # uses: actions/upload-artifact@v3
# # with:
# # name: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME_CUDA }}
# # path: ${{ github.workspace }}/bin/${{ steps.version_number.outputs.BB_ARTIFACT_NAME_CUDA }}
# # if-no-files-found: error
build-centos-x86-64:
runs-on: ubuntu-20.04
container:
image: quay.io/centos/centos:stream8
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Get Version Number
id: version_number
run: .github/actions/get-version.sh centos x86-64
- name: Install Prerequisites
run: |
set -eo pipefail
dnf install -y gcc-toolset-9-gcc gcc-toolset-9-gcc-c++ \
gmp-devel numactl-devel make git wget subscription-manager
# Get CMake
ref_cmake_sha256='bc0d8be9f37670139ef69af5109e9066351201567b8d4fa52794bf40878cd612'
curl -L https://github.com/Kitware/CMake/releases/download/v3.23.3/cmake-3.23.3-linux-x86_64.sh > cmake.sh
cmake_sh_sha256=$(sha256sum cmake.sh | cut -f1 -d' ')
if [[ "${ref_cmake_sha256}" != "${cmake_sh_sha256}" ]]; then
2>&1 echo "sha256 mismatch!: "
2>&1 echo "Got : '${cmake_sh_sha256}'"
2>&1 echo "Expected: '${ref_cmake_sha256}'"
exit 1
fi
echo 'whoami'
whoami
rm -f /usr/bin/cmake
cmake_prefix=$(pwd)/cmake
mkdir -p ${cmake_prefix}
export PATH=${cmake_prefix}:$PATH
echo '$PATH'
echo $PATH
echo 'ls -la ${cmake_prefix}'
ls -la ${cmake_prefix}
yes | sh cmake.sh --skip-license --prefix=${cmake_prefix} | cat
echo 'ls -la ${cmake_prefix}'
ls -la ${cmake_prefix}
echo 'Cmake Info:'
which cmake
cmake --version
# - name: Build
# run: |
# source /opt/rh/gcc-toolset-9/enable
# .github/actions/build-asset-unix.sh --artifact ${{ steps.version_number.outputs.BB_ARTIFACT_NAME_CUDA }} --version ${{steps.version_number.outputs.BB_VERSION}}
- name: Install CUDA Prerequisites
run: |
distro=rhel8
arch=x86_64
dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
# subscription-manager repos --enable=rhel-8-for-x86_64-appstream-rpms
# subscription-manager repos --enable=rhel-8-for-x86_64-baseos-rpms
# subscription-manager repos --enable=codeready-builder-for-rhel-8-x86_64-rpms
# rpm --erase gpg-pubkey-7fa2af80*
dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/$distro/$arch/cuda-$distro.repo
dnf clean expire-cache
dnf module install -y nvidia-driver:latest-dkms
dnf install -y cuda
ls -la /usr/local/
ls -la /usr/local/cuda/
# wget -nv https://developer.download.nvidia.com/compute/cuda/12.0.1/local_installers/cuda_12.0.1_525.85.12_linux.run
# sh cuda_12.0.1_525.85.12_linux.run
# - name: Build CUDA
# run: |
# source /opt/rh/gcc-toolset-9/enable
# export CMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc
# export PATH=/usr/local/cuda/bin:$PATH
# .github/actions/build-asset-unix.sh --cuda --artifact ${{ steps.version_number.outputs.BB_ARTIFACT_NAME_CUDA }} --version ${{steps.version_number.outputs.BB_VERSION}}
- name: Build Harvester
run: |
source /opt/rh/gcc-toolset-9/enable
export CMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc
export PATH=/usr/local/cuda/bin:$PATH
mkdir -p build-harvester
pushd build-harvester
cmake .. -DCMAKE_BUILD_TYPE=Release
echo "ls -la CMakeFiles/bladebit_harvester.dir/"
ls -la CMakeFiles/bladebit_harvester.dir/
echo "cat -n CMakeFiles/bladebit_harvester.dir/build.make"
cat -n CMakeFiles/bladebit_harvester.dir/build.make
echo "cat -n CMakeFiles/bladebit_harvester.dir/dlink.txt"
cat -n CMakeFiles/bladebit_harvester.dir/dlink.txt
cmake --build . --config Release --target bladebit_harvester -j$(nproc --all)
cmake --install . --prefix harvester_dist
pushd harvester_dist/green_reaper
artifact_files=$(find . -name '*.*' | cut -c3-)
shasum -a 256 ${artifact_files} > sha256checksum
artifact_files="${artifact_files} sha256checksum"
tar --version
tar -czvf bladebit_harvester-centos-x86-64.tar.gz ${artifact_files}
popd
mv harvester_dist/green_reaper/bladebit_harvester-centos-x86-64.tar.gz ./
shasum -a 256 bladebit_harvester-centos-x86-64.tar.gz > bladebit_harvester-centos-x86-64.tar.gz.sha256.txt
ls -la
popd
ls -la
# - name: Upload Artifact CentOS x86-64
# uses: actions/upload-artifact@v3
# with:
# name: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }}
# path: ${{ github.workspace }}/bin/${{ steps.version_number.outputs.BB_ARTIFACT_NAME }}
# if-no-files-found: error
# - name: Upload CUDA Artifact CentOS x86-64
# uses: actions/upload-artifact@v3
# with:
# name: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME_CUDA }}
# path: ${{ github.workspace }}/bin/${{ steps.version_number.outputs.BB_ARTIFACT_NAME_CUDA }}
# if-no-files-found: error
- name: Upload Harvester Artifact CentOS x86-64
uses: actions/upload-artifact@v3
with:
name: bladebit_harvester-centos-x86-64
path: |
${{ github.workspace }}/build-harvester/bladebit_harvester-centos-x86-64.tar.gz
${{ github.workspace }}/build-harvester/bladebit_harvester-centos-x86-64.tar.gz.sha256.txt
if-no-files-found: error
# build-ubuntu-arm64:
# runs-on: [ARM64, Linux]
# container:
# image: chianetwork/ubuntu-20.04-builder:latest
# defaults:
# run:
# shell: bash
# steps:
# - name: Checkout Repo
# uses: actions/checkout@v3
# - name: Get Version Number
# id: version_number
# run: .github/actions/get-version.sh ubuntu arm64
# - name: Install Prerequisites
# run: |
# export DEBIAN_FRONTEND=noninteractive
# apt update
# apt install -y build-essential git libgmp-dev libnuma-dev
# - name: Build
# run: .github/actions/build-asset-unix.sh --artifact ${{ steps.version_number.outputs.BB_ARTIFACT_NAME_CUDA }} --version ${{steps.version_number.outputs.BB_VERSION}}
# - name: Upload Artifact Ubuntu ARM64
# uses: actions/upload-artifact@v3
# with:
# name: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }}
# path: ${{ github.workspace }}/bin/${{ steps.version_number.outputs.BB_ARTIFACT_NAME }}
# if-no-files-found: error
# build-centos-arm64:
# runs-on: [ARM64, Linux]
# container:
# image: quay.io/centos/centos:stream8
# steps:
# - name: Checkout Repo
# uses: actions/checkout@v3
# - name: Get Version Number
# id: version_number
# run: .github/actions/get-version.sh centos arm64
# - name: Install Prerequisites
# run: |
# dnf install -y gcc-toolset-9-gcc gcc-toolset-9-gcc-c++ \
# cmake gmp-devel numactl-devel make git
# - name: Build
# env:
# BB_ARTIFACT_NAME: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }}
# BB_VERSION: ${{steps.version_number.outputs.BB_VERSION}}
# run: |
# source /opt/rh/gcc-toolset-9/enable
# .github/actions/build-asset-unix.sh
# - name: Upload Artifact CentOS ARM64
# uses: actions/upload-artifact@v3
# with:
# name: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }}
# path: ${{ github.workspace }}/bin/${{ steps.version_number.outputs.BB_ARTIFACT_NAME }}
# if-no-files-found: error
# build-windows-x86-64:
# runs-on: windows-2019
# steps:
# - name: Checkout Repo
# uses: actions/checkout@v3
# - name: Get Version Number
# shell: bash
# id: version_number
# run: .github/actions/get-version.sh windows x86-64
# - name: Build
# shell: bash
# env:
# BB_ARTIFACT_NAME: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }}
# BB_VERSION: ${{steps.version_number.outputs.BB_VERSION}}
# run: |
# mkdir build && cd build
# cmake ..
# bash -e -o pipefail ../embed-version.sh
# cat ../src/Version.h
# cmake --build . --target bladebit --config Release
# # Ensure bladebit version matches expected version
# bb_version="$(./Release/bladebit.exe --version | xargs)"
# if [[ "$bb_version" != "$BB_VERSION" ]]; then
# >&2 echo "Incorrect bladebit version. Got but '$bb_version' expected '$BB_VERSION'."
# exit 1
# fi
# mkdir ../bin
# cd Release
# ls -la
# 7z.exe a -tzip ../../bin/${BB_ARTIFACT_NAME} bladebit.exe
# ls -la ../../bin
# - name: Upload Artifact Windows x86-64
# uses: actions/upload-artifact@v3
# with:
# name: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }}
# path: ${{ github.workspace }}/bin/${{ steps.version_number.outputs.BB_ARTIFACT_NAME }}
# if-no-files-found: error
# build-macos-arm64:
# runs-on: [macOS, ARM64]
# steps:
# - name: Cleanup Environment
# uses: Chia-Network/actions/clean-workspace@main
# - name: Checkout Repo
# uses: actions/checkout@v3
# - name: Get Version Number
# id: version_number
# run: bash -e .github/actions/get-version.sh macos arm64
# - name: Install Prerequisites
# run: brew install cmake
# - name: Build
# env:
# BB_ARTIFACT_NAME: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }}
# BB_VERSION: ${{steps.version_number.outputs.BB_VERSION}}
# run: .github/actions/build-asset-unix.sh
# - name: Upload Artifact macOS arm64
# uses: actions/upload-artifact@v3
# with:
# name: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }}
# path: ${{ github.workspace }}/bin/${{ steps.version_number.outputs.BB_ARTIFACT_NAME }}
# if-no-files-found: error
# build-macos-x86-64:
# runs-on: macOS-11
# steps:
# - name: Cleanup Environment
# uses: Chia-Network/actions/clean-workspace@main
# - name: Checkout Repo
# uses: actions/checkout@v3
# - name: Get Version Number
# id: version_number
# run: .github/actions/get-version.sh macos x86-64
# - name: Install Prerequisites
# run: brew install cmake
# - name: Build
# env:
# BB_ARTIFACT_NAME: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }}
# BB_VERSION: ${{steps.version_number.outputs.BB_VERSION}}
# run: .github/actions/build-asset-unix.sh
# - name: Upload Artifact macOS x86-64
# uses: actions/upload-artifact@v3
# with:
# name: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }}
# path: ${{ github.workspace }}/bin/${{ steps.version_number.outputs.BB_ARTIFACT_NAME }}
# if-no-files-found: error