-
Notifications
You must be signed in to change notification settings - Fork 312
/
config.yml
640 lines (581 loc) · 18.9 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
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
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
version: 2.1
parameters:
nightly-toolchain:
type: string
default: "nightly-2020-11-09"
executors:
default:
docker:
- image: filecoin/rust:latest
working_directory: /mnt/crate
resource_class: 2xlarge+
gpu:
machine:
image: ubuntu-1604-cuda-10.1:201909-23
working_directory: ~/gpuci
resource_class: gpu.nvidia.medium
arm:
machine:
image: ubuntu-2004:202101-01
resource_class: arm.medium
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: rustup install << pipeline.parameters.nightly-toolchain >>
- run: rustup component add rustfmt-preview
- run: rustup component add clippy
- 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 +$(cat rust-toolchain) test --verbose --release --workspace
RUSTFLAGS="-D warnings" cargo +$(cat rust-toolchain) build --examples --release --workspace
no_output_timeout: 30m
test_ignored_release:
executor: default
environment: *setup-env
parameters:
crate:
type: string
features:
type: string
default: ""
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 << parameters.features >> -- --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 pairing enabled
command: |
ulimit -n 20000
ulimit -u 20000
ulimit -n 20000
cargo +<< pipeline.parameters.nightly-toolchain >> -Zpackage-features test --all --verbose --release lifecycle -- --ignored --nocapture
cargo +<< pipeline.parameters.nightly-toolchain >> -Zpackage-features test -p storage-proofs-porep --features single-threaded --release checkout_cores -- --test-threads=1
no_output_timeout: 30m
environment:
RUST_TEST_THREADS: 1
FIL_PROOFS_USE_MULTICORE_SDR: true
- run:
name: Test with use_multicore_sdr and blst enabled
command: |
ulimit -n 20000
ulimit -u 20000
ulimit -n 20000
cargo +<< pipeline.parameters.nightly-toolchain >> -Zpackage-features test --all --no-default-features --features gpu,blst --verbose --release lifecycle -- --ignored --nocapture
no_output_timeout: 30m
environment:
RUST_TEST_THREADS: 1
FIL_PROOFS_USE_MULTICORE_SDR: true
test_gpu_tree_building:
executor: gpu
environment: *setup-env
steps:
- checkout
- attach_workspace:
at: "."
- restore_rustup_cache
- restore_parameter_cache
- run:
name: Set the PATH env variable
command: |
echo 'export PATH="~/.cargo/bin:$PATH"' | tee --append $BASH_ENV
source $BASH_ENV
- run:
name: Install libraries to make thing work on the GPU
command: |
sudo apt-get update -y
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
cd filecoin-proofs
~/.cargo/bin/cargo +<< pipeline.parameters.nightly-toolchain >> -Zpackage-features test --all --no-default-features --features gpu,blst --verbose --release lifecycle -- --ignored --nocapture
no_output_timeout: 30m
environment:
RUST_TEST_THREADS: 1
FIL_PROOFS_USE_GPU_COLUMN_BUILDER: true
FIL_PROOFS_USE_GPU_TREE_BUILDER: true
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 (pairing)
command: |
cargo +<< pipeline.parameters.nightly-toolchain >> -Zpackage-features test --all --verbose --no-default-features --features pairing
no_output_timeout: 30m
- run:
name: Test with no gpu (blst)
command: |
cargo +<< pipeline.parameters.nightly-toolchain >> -Zpackage-features test --all --verbose --no-default-features --features blst
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 (pairing)
command: |
cargo +<< pipeline.parameters.nightly-toolchain >> -Zpackage-features test --all --verbose --no-default-features --features pairing
no_output_timeout: 90m
- run:
name: Test arm with no gpu (blst)
command: |
cargo +<< pipeline.parameters.nightly-toolchain >> -Zpackage-features test --all --verbose --no-default-features --features blst
no_output_timeout: 90m
test_blst:
executor: default
environment: *setup-env
parameters:
crate:
type: string
features:
type: string
default: "gpu,blst"
steps:
- checkout
- attach_workspace:
at: "."
- restore_rustup_cache
- restore_parameter_cache
- run:
name: Test ignored with blst enabled (<< parameters.crate >>)
command: |
ulimit -n 20000
ulimit -u 20000
ulimit -n 20000
RUST_LOG=trace cargo +<< pipeline.parameters.nightly-toolchain >> -Zpackage-features test --no-default-features --features << parameters.features >> --verbose --release --package << parameters.crate >> -- --nocapture
no_output_timeout: 30m
environment:
RUST_TEST_THREADS: 1
test_blst_ignored:
executor: default
environment: *setup-env
parameters:
crate:
type: string
steps:
- checkout
- attach_workspace:
at: "."
- restore_rustup_cache
- restore_parameter_cache
- run:
name: Test with blst enabled (<< parameters.crate >>)
command: |
ulimit -n 20000
ulimit -u 20000
ulimit -n 20000
cargo +<< pipeline.parameters.nightly-toolchain >> -Zpackage-features test --no-default-features --features gpu,blst --verbose --package << parameters.crate >> --release -- --ignored --nocapture
no_output_timeout: 30m
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 --workspace
test_darwin:
macos:
xcode: "10.0.0"
working_directory: ~/crate
resource_class: large
environment: *setup-env
steps:
- checkout
- run:
name: Install hwloc 2.3.0
command: |
cd /tmp
curl https://download.open-mpi.org/release/hwloc/v2.3/hwloc-2.3.0.tar.gz --location --output /tmp/hwloc-2.3.0.tar.gz
tar xzvf hwloc-2.3.0.tar.gz
cd hwloc-2.3.0
./configure
make
sudo make install
- 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: cargo update
- run: cargo fetch
- run:
name: Test Darwin
command: |
sudo ulimit -n 20000
sudo ulimit -u 20000
ulimit -n 20000
cargo +$(cat rust-toolchain) test --release --verbose --workspace -- --nocapture
no_output_timeout: 2h
commands:
ensure_filecoin_parameters:
steps:
- run:
name: Build paramcache if it doesn't already exist
command: |
set -x; test -f /tmp/paramcache.awesome \
|| (cargo build --release --workspace && 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: 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-d-{{ 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-d-{{ 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:
- save_cache:
name: "Save parameter cache"
key: proof-params-v28-e-{{ checksum "filecoin-proofs/parameters.json" }}
paths:
- "/tmp/paramcache.awesome"
- "/tmp/filecoin-proof-parameters/"
restore_parameter_cache:
steps:
- restore_cache:
name: "Restore parameter cache"
key: proof-params-v28-e-{{ 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:
requires:
#- cargo_fetch_gpu
- cargo_fetch
- ensure_groth_parameters_and_keys_linux
- test_multicore_sdr:
requires:
- cargo_fetch
- ensure_groth_parameters_and_keys_linux
- test_blst:
name: test_blst_filecoin_proofs
crate: "filecoin-proofs"
requires:
- cargo_fetch
- ensure_groth_parameters_and_keys_linux
- test_blst_ignored:
name: test_blst_ignored_filecoin_proofs
crate: "filecoin-proofs"
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_blst:
name: test_blst_storage_proofs_core
crate: "storage-proofs-core"
requires:
- cargo_fetch
- ensure_groth_parameters_and_keys_linux
- test_blst_ignored:
name: test_blst_ignored_storage_proofs_core
crate: "storage-proofs-core"
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_blst:
name: test_blst_storage_proofs_post
crate: "storage-proofs-post"
requires:
- cargo_fetch
- ensure_groth_parameters_and_keys_linux
- test_blst_ignored:
name: test_blst_ignored_storage_proofs_post
crate: "storage-proofs-post"
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_blst:
name: test_blst_storage_proofs_porep
crate: "storage-proofs-porep"
requires:
- cargo_fetch
- ensure_groth_parameters_and_keys_linux
- test_blst_ignored:
name: test_blst_ignored_storage_proofs_porep
crate: "storage-proofs-porep"
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_blst:
name: test_blst_fil_proofs_tooling
crate: "fil-proofs-tooling"
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_blst:
name: test_blst_filecoin_hashers
crate: "filecoin-hashers"
features: "blst,gpu,poseidon,sha256,blake2s"
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_blst:
name: test_blst_fil_proofs_param
crate: "fil-proofs-param"
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:
requires:
- cargo_fetch
- ensure_groth_parameters_and_keys_linux
- 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_blst:
name: test_blst_fr32
crate: "fr32"
requires:
- cargo_fetch