-
Notifications
You must be signed in to change notification settings - Fork 51
584 lines (487 loc) · 16.4 KB
/
Copy pathci.yml
File metadata and controls
584 lines (487 loc) · 16.4 KB
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
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- '**'
env:
GO_VERSION: "1.24.7"
jobs:
ci-lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Go
uses: ./.github/actions/setup-go
with:
go-version: ${{ env.GO_VERSION }}
- name: Install actionlint
run: go install github.com/rhysd/actionlint/cmd/actionlint@latest
- name: Run actionlint
run: actionlint -shellcheck= -pyflakes=
setup-params:
runs-on: [self-hosted, docker]
needs: [ci-lint]
steps:
- name: Fetch parameters
run: lotus fetch-params 8388608
shell: bash
build-mainnet:
runs-on: ubuntu-latest
needs: [ci-lint]
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: ./.github/actions/setup-go
with:
go-version: ${{ env.GO_VERSION }}
- name: Install Dependencies
uses: ./.github/actions/install-deps
- name: Install FFI
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
make deps
shell: bash
- name: Build Go
run: make build
shell: bash
build-calibnet:
runs-on: ubuntu-latest
needs: [ ci-lint ]
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: ./.github/actions/setup-go
with:
go-version: ${{ env.GO_VERSION }}
- name: Install Dependencies
uses: ./.github/actions/install-deps
- name: Install FFI
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
make deps
shell: bash
- name: Build Go
run: make build
shell: bash
build-debug:
runs-on: ubuntu-latest
needs: [ ci-lint ]
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: ./.github/actions/setup-go
with:
go-version: ${{ env.GO_VERSION }}
- name: Install Dependencies
uses: ./.github/actions/install-deps
- name: Install FFI
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
make deps
shell: bash
- name: Build Go
run: make build
shell: bash
build-2k:
runs-on: ubuntu-latest
needs: [ ci-lint ]
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: ./.github/actions/setup-go
with:
go-version: ${{ env.GO_VERSION }}
- name: Install Dependencies
uses: ./.github/actions/install-deps
- name: Install FFI
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
make deps
shell: bash
- name: Build Go
run: make build
shell: bash
build-forest:
runs-on: ubuntu-latest
needs: [ ci-lint ]
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: ./.github/actions/setup-go
with:
go-version: ${{ env.GO_VERSION }}
- name: Install Dependencies
uses: ./.github/actions/install-deps
- name: Install FFI
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
make deps
shell: bash
- name: Build Forest
run: make forest-test
shell: bash
test:
runs-on: [self-hosted, docker]
needs: [setup-params]
env:
CONTAINER_NAME: yugabyte-${{ github.run_id }}-${{ matrix.test-suite.name }}
strategy:
fail-fast: false # Continue running even if one test fails
matrix:
test-suite:
- name: test-itest-curio
target: "./itests/curio_test.go"
- name: test-all
target: "`go list ./... | grep -v curio/itests`"
- name: test-itest-harmonyDB
target: "./itests/harmonydb_test.go"
- name: test-itest-alertnow
target: "./itests/alertnow_test.go"
- name: test-itest-pdp-prove
target: "./itests/pdp_prove_test.go"
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: ./.github/actions/setup-go
with:
go-version: ${{ env.GO_VERSION }}
- name: Install Dependencies
uses: ./.github/actions/install-deps
- name: Install FFI
env:
GITHUB_TOKEN: ${{ github.token }}
CURIO_OPTIMAL_LIBFILCRYPTO: 0
run: |
make deps
shell: bash
- name: Start YugabyteDB container with dynamic ports
id: start-yugabyte
run: |
# Start YugabyteDB container with dynamic port mapping for PostgreSQL and YCQL
docker run --rm --name ${{ env.CONTAINER_NAME }} -d yugabytedb/yugabyte:2024.1.2.0-b77 bin/yugabyted start --daemon=false
- name: Wait for YugabyteDB to start
run: |
while true; do
status=$(docker exec ${{ env.CONTAINER_NAME }} bin/yugabyted status);
echo $status;
echo $status | grep Running && break;
sleep 1;
done
shell: bash
- name: Get YugabyteDB container IP
id: get-yb-ip
run: |
# Retrieve internal bridge IP of YugabyteDB container
YB_IP=$(docker inspect $CONTAINER_NAME --format '{{ .NetworkSettings.Networks.bridge.IPAddress }}')
echo "yb_ip=$YB_IP" >> $GITHUB_OUTPUT
- name: Run tests
env:
CURIO_HARMONYDB_HOSTS: ${{ steps.get-yb-ip.outputs.yb_ip }} # Use internal IP for DB host
LOTUS_HARMONYDB_HOSTS: ${{ steps.get-yb-ip.outputs.yb_ip }}
run: |
echo "Using YugabyteDB Container IP: ${{env.CURIO_HARMONYDB_HOSTS}}"
export CURIO_HARMONYDB_HOSTS=${{ env.CURIO_HARMONYDB_HOSTS }}
export LOTUS_HARMONYDB_HOSTS=${{ env.CURIO_HARMONYDB_HOSTS }}
go test -v --tags="debug,fvm" -timeout 30m ${{ matrix.test-suite.target }}
- name: Stop YugabyteDB container
if: always() # Ensure this run even if the tests fail
run: docker stop ${{ env.CONTAINER_NAME }}
lint:
runs-on: ubuntu-latest
needs: [ci-lint]
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: ./.github/actions/setup-go
with:
go-version: ${{ env.GO_VERSION }}
- name: Install Dependencies
uses: ./.github/actions/install-deps
- name: Install FFI
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
make deps
shell: bash
- name: Install golangci-lint
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.4.0
shell: bash
- name: Lint
run: |
golangci-lint run -v --timeout 15m --concurrency 4
shell: bash
gofmt:
runs-on: ubuntu-latest
needs: [ci-lint]
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: ./.github/actions/setup-go
with:
go-version: ${{ env.GO_VERSION }}
- name: Check gofmt
run: |
go fmt ./...
shell: bash
- name: Git diff check
run: git --no-pager diff
shell: bash
- name: Git diff quiet
run: git --no-pager diff --quiet
shell: bash
build-supraseal-ubuntu24:
runs-on: ubuntu-24.04
needs: [ci-lint]
env:
GCC_VERSION: "12"
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Free up disk space
run: |
# Remove unnecessary packages to free up space for CUDA installation
sudo apt-get clean
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
gcc-12 g++-12 \
nasm \
pkg-config \
autoconf automake libtool \
libssl-dev \
libnuma-dev \
uuid-dev \
libaio-dev \
libfuse3-dev \
libarchive-dev \
libkeyutils-dev \
libncurses-dev \
python3 python3-pip python3-dev \
curl wget git \
xxd
- name: Set up Python virtual environment
run: |
# Python tools will be installed in venv by build.sh
# Just ensure python3-venv is available
python3 -m venv --help > /dev/null || sudo apt-get install -y python3-venv
- name: Set up GCC 12 as default
run: |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 100
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 100
sudo update-alternatives --set gcc /usr/bin/gcc-12
sudo update-alternatives --set g++ /usr/bin/g++-12
gcc --version
g++ --version
- name: Cache CUDA installation
id: cache-cuda
uses: actions/cache@v4
with:
path: |
/usr/local/cuda
/usr/local/cuda-*
key: cuda-toolkit-ubuntu-24.04-${{ runner.os }}-v1
- name: Install CUDA Toolkit from NVIDIA Repository
if: steps.cache-cuda.outputs.cache-hit != 'true'
run: |
# Install CUDA using official NVIDIA repository for Ubuntu 24.04
# Source: https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=24.04&target_type=deb_local
# Download and install the CUDA keyring package
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb
rm cuda-keyring_1.1-1_all.deb
# Update package list and install CUDA toolkit
sudo apt-get update
sudo apt-get -y install cuda-toolkit
# Verify installation and find CUDA location
if [ -d "/usr/local/cuda" ]; then
echo "CUDA installed at /usr/local/cuda"
ls -la /usr/local/cuda*/bin/nvcc || true
else
echo "ERROR: CUDA installation not found"
exit 1
fi
- name: Set up CUDA environment
run: |
# Verify CUDA installation exists
if [ ! -d "/usr/local/cuda" ]; then
echo "ERROR: /usr/local/cuda not found"
exit 1
fi
# Export PATH locally to verify nvcc works
export PATH="/usr/local/cuda/bin:$PATH"
export CUDA_HOME=/usr/local/cuda
export LD_LIBRARY_PATH="/usr/local/cuda/lib64:${LD_LIBRARY_PATH}"
# Verify nvcc is available
nvcc --version
# Set environment for subsequent steps
echo "/usr/local/cuda/bin" >> $GITHUB_PATH
echo "CUDA_HOME=/usr/local/cuda" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH" >> $GITHUB_ENV
- name: Install libconfig++
run: |
sudo apt-get install -y libconfig++-dev || {
# If not available in repos, build from source
wget https://hyperrealm.github.io/libconfig/dist/libconfig-1.7.3.tar.gz
tar -xzf libconfig-1.7.3.tar.gz
cd libconfig-1.7.3
./configure
make -j$(nproc)
sudo make install
sudo ldconfig
cd ..
rm -rf libconfig-1.7.3*
}
- name: Install GMP library
run: |
sudo apt-get install -y libgmp-dev
- name: Cache Python venv
id: cache-venv
uses: actions/cache@v4
with:
path: extern/supraseal/.venv
key: supraseal-venv-ubuntu24-${{ hashFiles('extern/supraseal/build.sh') }}
restore-keys: |
supraseal-venv-ubuntu24-
- name: Cache SPDK build
id: cache-spdk
uses: actions/cache@v4
with:
path: extern/supraseal/deps/spdk-v24.05
key: spdk-v24.05-gcc12-ubuntu24-${{ hashFiles('extern/supraseal/build.sh') }}
restore-keys: |
spdk-v24.05-gcc12-ubuntu24-
- name: Build Supraseal
working-directory: extern/supraseal
run: |
# Ensure we're using GCC 12 and CUDA
export CC=gcc-12
export CXX=g++-12
export CUDA=/usr/local/cuda
export PATH=/usr/local/cuda/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
# Verify CUDA is accessible
which nvcc
nvcc --version
# Run the build script (creates and uses Python venv internally)
./build.sh
- name: Verify binaries
working-directory: extern/supraseal
run: |
echo "=== Built binaries ==="
ls -lh bin/
echo ""
echo "=== Verifying binaries exist ==="
test -f bin/seal && echo "✓ seal binary created" || exit 1
test -f bin/pc2 && echo "✓ pc2 binary created" || exit 1
test -f bin/tree_r && echo "✓ tree_r binary created" || exit 1
test -f bin/tree_r_cpu && echo "✓ tree_r_cpu binary created" || exit 1
test -f bin/tree_d_cpu && echo "✓ tree_d_cpu binary created" || exit 1
echo ""
echo "=== Binary sizes ==="
du -h bin/*
echo ""
echo "✅ All binaries built successfully!"
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: supraseal-binaries-ubuntu24-gcc12-cuda
path: |
extern/supraseal/bin/seal
extern/supraseal/bin/pc2
extern/supraseal/bin/tree_r
extern/supraseal/bin/tree_r_cpu
extern/supraseal/bin/tree_d_cpu
retention-days: 30
- name: Upload library artifact
uses: actions/upload-artifact@v4
with:
name: supraseal-library-ubuntu24-gcc12-cuda
path: extern/supraseal/obj/libsupraseal.a
retention-days: 30
- name: Build summary
run: |
echo "### 🎉 Supraseal Build Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Configuration:**" >> $GITHUB_STEP_SUMMARY
echo "- OS: Ubuntu 24.04" >> $GITHUB_STEP_SUMMARY
echo "- GCC: $(gcc --version | head -1)" >> $GITHUB_STEP_SUMMARY
echo "- CUDA: $(nvcc --version | grep release)" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Built Binaries:**" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
ls -lh extern/supraseal/bin/ >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "✅ All binaries compiled successfully with GCC 12 and CUDA!" >> $GITHUB_STEP_SUMMARY
gen-check:
runs-on: ubuntu-latest
needs: [ci-lint]
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: ./.github/actions/setup-go
with:
go-version: ${{ env.GO_VERSION }}
- name: Install Dependencies
uses: ./.github/actions/install-deps
- name: Install goimports
run: go install golang.org/x/tools/cmd/goimports
shell: bash
- name: Install cbor-gen-for
run: go install github.com/hannahhoward/cbor-gen-for
shell: bash
- name: Install swag cli
run: go install github.com/swaggo/swag/cmd/swag@v1.16.4
shell: bash
# - name: Install gotext
# run: go install golang.org/x/text/cmd/gotext
# shell: bash
- name: Install FFI
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
make deps
shell: bash
- name: Generate Code
env:
LANG: en-US
run: make gen
shell: bash
- name: Git diff check
run: git --no-pager diff
shell: bash
- name: Git diff quiet
run: git --no-pager diff --quiet
shell: bash
mod-tidy-check:
runs-on: ubuntu-latest
needs: [ci-lint]
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: ./.github/actions/setup-go
with:
go-version: ${{ env.GO_VERSION }}
- name: Install Dependencies
uses: ./.github/actions/install-deps
- name: Run mod tidy check
run: go mod tidy -v
shell: bash