-
Notifications
You must be signed in to change notification settings - Fork 317
/
Copy pathconfig.yml
551 lines (506 loc) · 17.1 KB
/
config.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
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
version: 2.1
parameters:
nightly-toolchain:
type: string
default: "nightly-2022-03-10"
executors:
default:
docker:
- image: filecoin/rust:latest
working_directory: /mnt/crate
resource_class: 2xlarge+
gpu:
machine:
image: ubuntu-2004-cuda-11.2:202103-01
working_directory: ~/gpuci
resource_class: gpu.nvidia.medium
arm:
machine:
image: ubuntu-2004:202101-01
resource_class: arm.large
setup-env: &setup-env
FIL_PROOFS_PARAMETER_CACHE: "/tmp/filecoin-proof-parameters/"
RUST_LOG: info
jobs:
ensure_groth_parameters_and_keys_linux:
executor: default
environment: *setup-env
steps:
- checkout
- restore_parameter_cache
- ensure_filecoin_parameters
- save_parameter_cache
cargo_fetch:
executor: default
environment: *setup-env
steps:
- checkout
- run:
name: Calculate dependencies
command: cargo generate-lockfile
no_output_timeout: 30m
- restore_rustup_cache
- run: rustup install $(cat rust-toolchain)
- run: rustup default $(cat rust-toolchain)
- run: cargo update
- run: cargo fetch
- run: rustc +$(cat rust-toolchain) --version
- run: rustup toolchain list --verbose
- persist_to_workspace:
root: "."
paths:
- Cargo.lock
- save_rustup_cache
test:
executor: default
environment: *setup-env
parameters:
crate:
type: string
steps:
- checkout
- attach_workspace:
at: "."
- restore_rustup_cache
- restore_parameter_cache
- run:
name: Test (<< parameters.crate >>)
command: cargo +$(cat rust-toolchain) test --verbose --package << parameters.crate >>
no_output_timeout: 30m
test_release:
executor: default
environment: *setup-env
steps:
- checkout
- attach_workspace:
at: "."
- restore_rustup_cache
- restore_parameter_cache
- run:
name: Test in release profile
command: |
ulimit -n 20000
ulimit -u 20000
ulimit -n 20000
cargo test --verbose --release --workspace --all-targets
# Some `storage-proofs-update` tests need to run sequentially due
# to their high memory usage.
cargo test -p storage-proofs-update --features isolated-testing --release -- --test-threads=1
no_output_timeout: 30m
test_ignored_release:
executor: default
environment: *setup-env
parameters:
crate:
type: string
steps:
- checkout
- attach_workspace:
at: "."
- restore_rustup_cache
- restore_parameter_cache
- run:
name: Test ignored in release profile
command: |
ulimit -n 20000
ulimit -u 20000
ulimit -n 20000
cd << parameters.crate >>
cargo test --release -- --ignored --nocapture
environment:
RUST_TEST_THREADS: 1
no_output_timeout: 30m
# Running with `use_multicore_sdr=true` should be integrated directly into the test code. For now we
# just re-run the lifecycle tests to exercise the use_multicore_sdr code path with that setting set.
test_multicore_sdr:
executor: default
environment: *setup-env
steps:
- checkout
- attach_workspace:
at: "."
- restore_rustup_cache
- restore_parameter_cache
- run:
name: Test with use_multicore_sdr
command: |
ulimit -n 20000
ulimit -u 20000
ulimit -n 20000
cargo test --all --verbose --release lifecycle -- --ignored --nocapture
cargo test -p storage-proofs-porep --features isolated-testing --release checkout_cores -- --test-threads=1
cargo test -p storage-proofs-porep --features isolated-testing --release test_parallel_generation_and_read_partial_range_v1_0
cargo test -p storage-proofs-porep --features isolated-testing --release test_parallel_generation_and_read_partial_range_v1_1
no_output_timeout: 30m
environment:
RUST_TEST_THREADS: 1
FIL_PROOFS_USE_MULTICORE_SDR: true
test_gpu_tree_building:
executor: gpu
environment: *setup-env
parameters:
cargo-args:
description: Addtional arguments for the cargo command
type: string
default: ""
test-args:
description: Additional arguments for the test executable (after the `--`)
type: string
default: ""
steps:
- checkout
- attach_workspace:
at: "."
- restore_rustup_cache
- restore_parameter_cache
- run:
name: Set the PATH env variable
command: |
echo 'export PATH="~/.cargo/bin:/usr/local/cuda-11.2/bin:$PATH"' | tee --append $BASH_ENV
source $BASH_ENV
- run:
name: Install required libraries for GPU support
command: |
sudo apt update
sudo apt install -y ocl-icd-opencl-dev libhwloc-dev
- run:
name: Test with GPU column and tree builders.
command: |
ulimit -n 20000
ulimit -u 20000
ulimit -n 20000
cargo test --verbose --release << parameters.cargo-args >> -- --nocapture << parameters.test-args >>
no_output_timeout: 30m
environment:
FIL_PROOFS_USE_GPU_COLUMN_BUILDER: true
FIL_PROOFS_USE_GPU_TREE_BUILDER: true
BELLMAN_CUDA_NVCC_ARGS: --fatbin --gpu-architecture=sm_75 --generate-code=arch=compute_75,code=sm_75
NEPTUNE_CUDA_NVCC_ARGS: --fatbin --gpu-architecture=sm_75 --generate-code=arch=compute_75,code=sm_75
test_no_gpu:
executor: default
environment: *setup-env
steps:
- checkout
- attach_workspace:
at: "."
- restore_rustup_cache
- restore_parameter_cache
- run:
name: Test with no gpu
command: |
cargo test --all --verbose --release --no-default-features
no_output_timeout: 30m
test_arm_no_gpu:
executor: arm
environment: *setup-env
steps:
- checkout
- attach_workspace:
at: "."
- restore_rustup_cache
- restore_parameter_cache
- run:
name: Install Rust
command: |
curl https://sh.rustup.rs -sSf | sh -s -- -y
- run: rustup install $(cat rust-toolchain)
- run: rustup default $(cat rust-toolchain)
- run: rustup install << pipeline.parameters.nightly-toolchain >>
- run: cargo update
- run: cargo fetch
- run:
name: Install required libraries
command: |
sudo apt-get update -y
sudo apt install -y libhwloc-dev
- run:
name: Test arm with no gpu
command: |
cargo +<< pipeline.parameters.nightly-toolchain >> -Zpackage-features test --release --all --verbose --no-default-features
no_output_timeout: 90m
bench:
executor: default
environment: *setup-env
steps:
- checkout
- attach_workspace:
at: "."
- restore_rustup_cache
- restore_parameter_cache
- run:
name: Benchmarks
command: cargo +$(cat rust-toolchain) build --benches --verbose --workspace
no_output_timeout: 15m
rustfmt:
executor: default
environment: *setup-env
steps:
- checkout
- attach_workspace:
at: "."
- restore_rustup_cache
- run:
name: Run cargo fmt
command: cargo fmt --all -- --check
clippy:
executor: default
environment: *setup-env
steps:
- checkout
- attach_workspace:
at: "."
- restore_rustup_cache
- run:
name: Run cargo clippy
command: cargo +$(cat rust-toolchain) clippy --all-targets --workspace -- -D warnings
test_darwin:
macos:
xcode: "12.5.0"
working_directory: ~/crate
resource_class: large
environment: *setup-env
steps:
- checkout
- run:
name: Install hwloc with Homebrew
command: HOMEBREW_NO_AUTO_UPDATE=1 brew install hwloc
- run:
name: Install Rust
command: |
curl https://sh.rustup.rs -sSf | sh -s -- -y
- run: cargo update
- run: cargo fetch
# On CircleCI you cannot create a cache on Linux and restore it on macOS.
# Hence we need a separate cache for macOS that we create and restore. It
# is not a separate job (like `ensure_groth_parameters_and_keys_linux`,
# as there is only this single job that runs on macOS.
- restore_parameter_cache
- ensure_filecoin_parameters
- save_parameter_cache
- run:
name: Test Darwin
command: |
sudo ulimit -n 20000
sudo ulimit -u 20000
ulimit -n 20000
cargo test --release --verbose --workspace -- --nocapture
no_output_timeout: 2h
commands:
ensure_filecoin_parameters:
steps:
- run:
name: Create parameters directory
command: mkdir -p ${FIL_PROOFS_PARAMETER_CACHE}
- run:
name: Build paramcache if it doesn't already exist
command: |
set -x; test -f /tmp/paramcache.awesome \
|| (cargo build --release --bin paramcache && find . -type f -name paramcache | xargs -I {} mv {} /tmp/paramcache.awesome)
- run:
name: Obtain filecoin groth parameters
command: /tmp/paramcache.awesome --sector-sizes='2048,4096,16384,32768'
no_output_timeout: 60m
- run:
name: Obtain filecoin ipp parameter file
command: |
# paramfetch is using `ipget` which currently always times out on
# CI, hence get this file via HTTP instead.
#cargo run --release --bin paramfetch -- -a -j srs-inner-product.json
# `--insecure` is needed due to an outdated base systems.
curl --insecure https://proofs.filecoin.io/v28-fil-inner-product-v1.srs --output ${FIL_PROOFS_PARAMETER_CACHE}v28-fil-inner-product-v1.srs
- run:
name: Make the parameters world readable
command: chmod -R 755 ${FIL_PROOFS_PARAMETER_CACHE}
save_rustup_cache:
steps:
# Move things from the home directory to `/tmp` first, so that it can be
# restored on executors that have a different home directory.
- run: cp -R ~/.cargo ~/.rustup /tmp/
- save_cache:
name: "Save rustup cache"
key: cargo-v28-e-{{ checksum "rust-toolchain" }}-{{ checksum "Cargo.toml" }}-{{ checksum "Cargo.lock" }}
paths:
- /tmp/.cargo
- /tmp/.rustup
restore_rustup_cache:
steps:
- restore_cache:
name: "Restore rustup cache"
key: cargo-v28-e-{{ checksum "rust-toolchain" }}-{{ checksum "Cargo.toml" }}-{{ checksum "Cargo.lock" }}
# Cache might not be created yet, hence ignore if the move fails
- run: cp -R /tmp/.cargo /tmp/.rustup ~/ || true
save_parameter_cache:
steps:
# Make sure we have different cache for Linux and Darwin.
- run: uname > os.txt
- save_cache:
name: "Save parameter cache"
key: proof-params-v28-k-{{ checksum "os.txt" }}-{{ checksum "filecoin-proofs/parameters.json" }}
paths:
- "/tmp/paramcache.awesome"
- "/tmp/filecoin-proof-parameters/"
restore_parameter_cache:
steps:
# Make sure we have different cache for Linux and Darwin.
- run: uname > os.txt
- restore_cache:
name: "Restore parameter cache"
key: proof-params-v28-k-{{ checksum "os.txt" }}-{{ checksum "filecoin-proofs/parameters.json" }}
workflows:
version: 2.1
test_all:
jobs:
- ensure_groth_parameters_and_keys_linux
- cargo_fetch
- rustfmt:
requires:
- cargo_fetch
- clippy:
requires:
- cargo_fetch
- test_release:
requires:
- cargo_fetch
- ensure_groth_parameters_and_keys_linux
- test_ignored_release:
name: test_ignored_release_storage_proofs_post
crate: "storage-proofs-post"
requires:
- cargo_fetch
- ensure_groth_parameters_and_keys_linux
- test_ignored_release:
name: test_ignored_release_storage_proofs_core
crate: "storage-proofs-core"
requires:
- cargo_fetch
- ensure_groth_parameters_and_keys_linux
- test_ignored_release:
name: test_ignored_release_storage_proofs_porep
crate: "storage-proofs-porep"
requires:
- cargo_fetch
- ensure_groth_parameters_and_keys_linux
- test_ignored_release:
name: test_ignored_release_filecoin_proofs
crate: "filecoin-proofs"
requires:
- cargo_fetch
- ensure_groth_parameters_and_keys_linux
- test_gpu_tree_building:
name: test_gpu_tree_building_opencl (regular)
cargo-args: "--workspace"
requires:
- cargo_fetch
- ensure_groth_parameters_and_keys_linux
- test_gpu_tree_building:
name: test_gpu_tree_building_opencl (ignored, filecoin-proofs, storage-proofs-update)
cargo-args: "--package filecoin-proofs --package storage-proofs-update"
test-args: "--ignored"
requires:
- cargo_fetch
- ensure_groth_parameters_and_keys_linux
- test_gpu_tree_building:
name: test_gpu_tree_building_opencl (ignored, rest)
cargo-args: "--workspace --exclude filecoin-proofs --exclude storage-proofs-update"
test-args: "--ignored"
requires:
- cargo_fetch
- ensure_groth_parameters_and_keys_linux
- test_gpu_tree_building:
name: test_gpu_tree_building_cuda (regular)
cargo-args: "--workspace --features cuda"
requires:
- cargo_fetch
- ensure_groth_parameters_and_keys_linux
- test_gpu_tree_building:
name: test_gpu_tree_building_cuda (ignored, filecoin-proofs, storage-proofs-update)
cargo-args: "--package filecoin-proofs --package storage-proofs-update --features cuda"
test-args: "--ignored"
requires:
- cargo_fetch
- ensure_groth_parameters_and_keys_linux
- test_gpu_tree_building:
name: test_gpu_tree_building_cuda (ignored, rest)
cargo-args: "--workspace --exclude filecoin-proofs --exclude storage-proofs-update --features cuda"
test-args: "--ignored"
requires:
- cargo_fetch
- ensure_groth_parameters_and_keys_linux
- test_multicore_sdr:
requires:
- cargo_fetch
- ensure_groth_parameters_and_keys_linux
- test:
name: test_filecoin_proofs
crate: "filecoin-proofs"
requires:
- cargo_fetch
- ensure_groth_parameters_and_keys_linux
- test:
name: test_storage_proofs_core
crate: "storage-proofs-core"
requires:
- cargo_fetch
- ensure_groth_parameters_and_keys_linux
- test:
name: test_storage_proofs_post
crate: "storage-proofs-post"
requires:
- cargo_fetch
- ensure_groth_parameters_and_keys_linux
- test:
name: test_storage_proofs_porep
crate: "storage-proofs-porep"
requires:
- cargo_fetch
- ensure_groth_parameters_and_keys_linux
- test:
name: test_fil_proofs_tooling
crate: "fil-proofs-tooling"
requires:
- cargo_fetch
- ensure_groth_parameters_and_keys_linux
- test:
name: test_sha2raw
crate: "sha2raw"
requires:
- cargo_fetch
- ensure_groth_parameters_and_keys_linux
- test:
name: test_filecoin_hashers
crate: "filecoin-hashers"
requires:
- cargo_fetch
- ensure_groth_parameters_and_keys_linux
- test:
name: test_fil_proofs_param
crate: "fil-proofs-param"
requires:
- cargo_fetch
- ensure_groth_parameters_and_keys_linux
- test_no_gpu:
name: test_no_gpu
requires:
- cargo_fetch
- ensure_groth_parameters_and_keys_linux
- test_arm_no_gpu:
name: test_arm_no_gpu
requires:
- cargo_fetch
- ensure_groth_parameters_and_keys_linux
- bench:
requires:
- cargo_fetch
- ensure_groth_parameters_and_keys_linux
- test_darwin
- test:
name: test_fr32
crate: "fr32"
requires:
- cargo_fetch
- test:
name: test_fil_store_proofs_update
crate: "storage-proofs-update"
requires:
- cargo_fetch
- ensure_groth_parameters_and_keys_linux