Repository navigation
1132 lines (981 loc) · 46.3 KB
/
Copy pathci.yaml
File metadata and controls
1132 lines (981 loc) · 46.3 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
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
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
name: CI
on:
push:
branches:
# Main is validated before merge by pull_request and merge_group. Push
# runs on main exist to seed the Actions caches that pull requests
# restore: caches written by pull_request or merge_group runs are scoped
# to that ref and are not readable by other pull requests, so those runs
# only restore, and caches are saved only from push events.
- main
# Keep push validation for supported release branches.
- release-*
pull_request:
branches:
- main
- release-*
merge_group:
types:
- checks_requested
workflow_dispatch:
# Cancel in-progress runs for the same branch/PR to avoid wasted runner time.
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
REGISTRY: ghcr.io/${{ github.repository_owner }}
CNI_PLUGINS_VERSION: v1.9.1
jobs:
# ---------- Frontend ----------
frontend:
name: Build Frontend
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Node
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v6
with:
node-version: "24"
cache: npm
cache-dependency-path: frontend/package-lock.json
- name: Build frontend
run: npm ci --prefer-offline --no-audit && npm run build
working-directory: frontend
- name: Upload frontend dist
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: frontend-dist
path: frontend/dist/
retention-days: 1
# ---------- Lint ----------
lint:
name: Lint
needs: [frontend]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Download frontend dist
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8
with:
name: frontend-dist
path: internal/net/html/dist
- name: Set up Go
id: setup-go
uses: ./.github/actions/setup-go-cached
with:
profile: lint
extra-build-paths: ~/.cache/golangci-lint
- name: Compute Go tools cache key
id: tools-key
run: |
# Hash only the pinned versions that install-tools uses, so unrelated
# Makefile edits do not invalidate the cache.
hash="$(grep -E '^(GOFUMPT|GOLANGCI_LINT|PROTOC_GEN_GO|PROTOC_GEN_GO_GRPC|CONTROLLER_GEN|ACTIONLINT)_VERSION ' Makefile | sha256sum | cut -c1-16)"
echo "key=go-tools-${RUNNER_OS}-${RUNNER_ARCH}-${{ steps.setup-go.outputs.go-version }}-${hash}" >> "$GITHUB_OUTPUT"
echo "dir=$(go env GOPATH)/bin" >> "$GITHUB_OUTPUT"
- name: Restore Go tools
id: tools-cache
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ steps.tools-key.outputs.dir }}
key: ${{ steps.tools-key.outputs.key }}
- name: Install tools
if: steps.tools-cache.outputs.cache-hit != 'true'
run: make install-tools
- name: Save Go tools
if: github.event_name == 'push' && steps.tools-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ steps.tools-key.outputs.dir }}
key: ${{ steps.tools-key.outputs.key }}
- name: Lint
run: make lint
- name: Save Go caches
if: success() && github.event_name == 'push'
uses: ./.github/actions/setup-go-cached
with:
phase: save
profile: lint
# Must match the restore call: actions/cache versions entries by
# their path list, so a different list could not be restored.
extra-build-paths: ~/.cache/golangci-lint
save-build-cache: "true"
save-mod-cache: "false"
# ---------- Test ----------
test:
name: Test
needs: [frontend]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Download frontend dist
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8
with:
name: frontend-dist
path: internal/net/html/dist
- name: Set up Go
id: setup-go
uses: ./.github/actions/setup-go-cached
with:
profile: race
- name: Verify go.mod tidy
run: |
make gomod
if [ -n "$(git diff --name-only go.mod go.sum)" ]; then
echo "::error::go.mod or go.sum is not tidy. Run 'make gomod' and commit the changes."
git diff go.mod go.sum
exit 1
fi
- name: Test
run: make test
- name: Summarize tests
if: always() && hashFiles('tmp/go-test.json') != ''
run: go run ./hack/cmd/test-summary tmp/go-test.json >> "$GITHUB_STEP_SUMMARY"
- name: Upload coverage
if: always()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: coverage
path: coverage.out
retention-days: 7
if-no-files-found: ignore
- name: Save Go caches
if: success() && github.event_name == 'push'
uses: ./.github/actions/setup-go-cached
with:
phase: save
profile: race
save-build-cache: "true"
save-mod-cache: "false"
# ---------- Racer Rust workspace ----------
# Lint, the two workspace feature sets, and the production gates run as
# separate jobs so they build and test concurrently. Lint runs no tests, so
# formatting and Clippy failures report within minutes.
racer-rust-lint:
name: Racer Rust Lint (${{ matrix.features }})
runs-on: ubuntu-24.04
timeout-minutes: 30
# The two workspace Clippy passes resolve different feature sets, so most
# crates recompile between them. Running them as parallel legs halves wall
# time with identical lint coverage. Non-Clippy checks run in one leg only.
strategy:
fail-fast: false
matrix:
features: [default, all-features]
env:
CARGO_TARGET_DIR: ${{ github.workspace }}/bin/racer-cargo
# Make the pinned toolchain active so rust-cache keys on its rustc -vV.
RUSTUP_TOOLCHAIN: 1.96.0
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up pinned Rust
run: timeout --signal=TERM --kill-after=10s 300s rustup toolchain install 1.96.0 --profile minimal --component rustfmt,clippy
# Saved only on push so pull requests reuse base-branch entries without
# writing their own. rust-cache keeps dependency artifacts only.
- name: Cache Cargo dependencies
uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
with:
workspaces: cmd/racer -> ../../bin/racer-cargo
shared-key: racer-lint-${{ matrix.features }}
save-if: ${{ github.event_name == 'push' }}
- name: Check Rust formatting
if: matrix.features == 'default'
run: timeout --signal=TERM --kill-after=10s 300s cargo +1.96.0 fmt --manifest-path cmd/racer/Cargo.toml --all --check
- name: Strict workspace Clippy (default features)
if: matrix.features == 'default'
run: timeout --signal=TERM --kill-after=10s 1200s cargo +1.96.0 clippy --locked --manifest-path cmd/racer/Cargo.toml --workspace --all-targets -- -D warnings
- name: Strict workspace Clippy (all features)
if: matrix.features == 'all-features'
run: timeout --signal=TERM --kill-after=10s 1200s cargo +1.96.0 clippy --locked --manifest-path cmd/racer/Cargo.toml --workspace --all-targets --all-features -- -D warnings
- name: Enforce Racer dependency purity
if: matrix.features == 'default'
run: timeout --signal=TERM --kill-after=10s 300s python3 hack/scripts/racer-purity-graph.py --manifest-path cmd/racer/Cargo.toml --strict
# Allocator simulation is explicit test support (Slab::simulate_in), not a
# cargo feature. Clippy also type-checks every allocator target.
- name: Strict allocator Clippy
if: matrix.features == 'default'
run: |
timeout --signal=TERM --kill-after=10s 600s cargo +1.96.0 clippy --locked --manifest-path cmd/racer/Cargo.toml -p page-alloc --all-targets --no-default-features -- -D warnings
# Fan-in under the original check name so branch protection that requires
# "Racer Rust Lint" keeps gating on both matrix legs.
racer-rust-lint-result:
name: Racer Rust Lint
if: always()
needs: racer-rust-lint
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- name: Require every lint leg to pass
env:
RESULT: ${{ needs.racer-rust-lint.result }}
run: test "$RESULT" = success
# ---------- racer-object Rust sidecar ----------
# Standalone crate (not a member of the cmd/racer workspace) with its own
# lock file, so it gets its own target directory and cache key.
racer-object-rust:
name: racer-object Rust
runs-on: ubuntu-24.04
timeout-minutes: 30
env:
CARGO_TARGET_DIR: ${{ github.workspace }}/bin/racer-object-cargo
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up pinned Rust
run: timeout --signal=TERM --kill-after=10s 300s rustup toolchain install 1.96.0 --profile minimal --component rustfmt,clippy
- name: Cache Cargo dependencies and artifacts
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: |
~/.cargo/registry
~/.cargo/git
bin/racer-object-cargo
key: racer-object-${{ runner.os }}-${{ runner.arch }}-1.96.0-${{ hashFiles('cmd/racer-object/Cargo.lock', 'cmd/racer-object/Cargo.toml') }}-${{ github.sha }}
restore-keys: |
racer-object-${{ runner.os }}-${{ runner.arch }}-1.96.0-${{ hashFiles('cmd/racer-object/Cargo.lock', 'cmd/racer-object/Cargo.toml') }}-
- name: Check Rust formatting
run: timeout --signal=TERM --kill-after=10s 300s cargo +1.96.0 fmt --manifest-path cmd/racer-object/Cargo.toml --all --check
- name: Clippy
run: timeout --signal=TERM --kill-after=10s 600s cargo +1.96.0 clippy --locked --manifest-path cmd/racer-object/Cargo.toml --all-targets -- -D warnings
- name: Test
run: timeout --signal=TERM --kill-after=10s 600s cargo +1.96.0 test --locked --manifest-path cmd/racer-object/Cargo.toml
racer-rust:
name: Racer Rust Workspace (${{ matrix.suite }})
# Library real-I/O tests need a VM rather than a seccomp-restricted container.
runs-on: ubuntu-24.04
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
include:
- suite: default features
key: default
features: ""
- suite: all features
key: all-features
features: --all-features
env:
CARGO_TARGET_DIR: ${{ github.workspace }}/bin/racer-cargo
# Make the pinned toolchain active so rust-cache keys on its rustc -vV.
RUSTUP_TOOLCHAIN: 1.96.0
RUST_TEST_THREADS: "4"
FEATURES: ${{ matrix.features }}
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up pinned Rust
run: timeout --signal=TERM --kill-after=10s 300s rustup toolchain install 1.96.0 --profile minimal
- name: Enable io_uring
run: timeout --signal=TERM --kill-after=10s 300s sudo sysctl -w kernel.io_uring_disabled=0
# Saved only on push so pull requests reuse base-branch entries without
# writing their own. rust-cache keeps dependency artifacts only.
- name: Cache Cargo dependencies
uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
with:
workspaces: cmd/racer -> ../../bin/racer-cargo
shared-key: racer-workspace-${{ matrix.key }}
save-if: ${{ github.event_name == 'push' }}
- name: Check
run: timeout --signal=TERM --kill-after=10s 1200s cargo +1.96.0 check --locked --manifest-path cmd/racer/Cargo.toml --workspace --all-targets $FEATURES
# Compile test binaries separately: a cold build of the dataplane test
# targets takes far longer than running any single step's tests.
- name: Build tests
run: timeout --signal=TERM --kill-after=10s 1800s cargo +1.96.0 test --locked --manifest-path cmd/racer/Cargo.toml --workspace $FEATURES --no-run
- name: Test
run: timeout --signal=TERM --kill-after=10s 1500s cargo +1.96.0 test --locked --manifest-path cmd/racer/Cargo.toml --workspace $FEATURES
# The fuzz crate is a standalone workspace with its own lock, so the
# workspace steps above never build it. Compile every target and check
# that the committed seeds still decode and match their encoders.
- name: Check fuzz targets
if: matrix.key == 'default'
run: timeout --signal=TERM --kill-after=10s 900s cargo +1.96.0 check --locked --manifest-path cmd/racer/fuzz/Cargo.toml --bins
- name: Fuzz seed corpora
if: matrix.key == 'default'
env:
RUSTC_BOOTSTRAP: "1"
run: timeout --signal=TERM --kill-after=10s 900s cargo +1.96.0 test --locked --manifest-path cmd/racer/fuzz/Cargo.toml --test seeds
racer-rust-gates:
name: Racer Rust Production Gates
# Real io_uring and direct I/O need a VM rather than a seccomp-restricted container.
runs-on: ubuntu-24.04
timeout-minutes: 45
env:
CARGO_TARGET_DIR: ${{ github.workspace }}/bin/racer-cargo
# Make the pinned toolchain active so rust-cache keys on its rustc -vV.
RUSTUP_TOOLCHAIN: 1.96.0
RUST_TEST_THREADS: "4"
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up pinned Rust
run: timeout --signal=TERM --kill-after=10s 300s rustup toolchain install 1.96.0 --profile minimal
- name: Enable io_uring
run: timeout --signal=TERM --kill-after=10s 300s sudo sysctl -w kernel.io_uring_disabled=0
# Saved only on push so pull requests reuse base-branch entries without
# writing their own. rust-cache keeps dependency artifacts only.
- name: Cache Cargo dependencies
uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
with:
workspaces: cmd/racer -> ../../bin/racer-cargo
shared-key: racer-gates
save-if: ${{ github.event_name == 'push' }}
- name: Racer I/O real io_uring
env:
RUNTIME_REQUIRE_IO_URING: "1"
run: timeout --signal=TERM --kill-after=10s 900s cargo +1.96.0 test --locked --manifest-path cmd/racer/Cargo.toml -p racer-io
# Real-I/O allocator tests and simulated allocator tests share one run;
# simulation is selected per slab through Slab::simulate_in.
- name: Allocator real I/O and simulation
env:
PAGE_ALLOC_REQUIRE_REAL_IO: "1"
run: timeout --signal=TERM --kill-after=10s 900s cargo +1.96.0 test --locked --manifest-path cmd/racer/Cargo.toml -p page-alloc --no-default-features
racer-verbs:
name: Racer Verbs (${{ matrix.configuration }})
runs-on: ubuntu-24.04
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
include:
- configuration: no-default-features
features: ""
native: false
- configuration: simulation
features: simulation
native: false
- configuration: native
features: native
native: true
- configuration: native-and-simulation
features: native,simulation
native: true
env:
CARGO_TARGET_DIR: ${{ github.workspace }}/bin/racer-verbs-cargo
# Make the pinned toolchain active so rust-cache keys on its rustc -vV.
RUSTUP_TOOLCHAIN: 1.96.0
CARGO_BUILD_JOBS: "2"
RUST_TEST_THREADS: "1"
VERBS_FEATURES: ${{ matrix.features }}
LD_LIBRARY_PATH: ${{ github.workspace }}/bin/racer-verbs-native
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up pinned Rust
run: timeout --signal=TERM --kill-after=10s 300s rustup toolchain install 1.96.0 --profile minimal --component rustfmt,clippy
# Matrix entries differ only in workspace-crate features, and rust-cache
# prunes workspace crates, so one entry saves for all of them.
- name: Cache Cargo dependencies
uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
with:
workspaces: cmd/racer -> ../../bin/racer-verbs-cargo
shared-key: racer-verbs
save-if: ${{ github.event_name == 'push' && matrix.configuration == 'native-and-simulation' }}
- name: Use the archive.ubuntu.com apt mirror
if: matrix.native
# Ubuntu runner sources share this list; bypass the stalled Azure mirror.
run: printf '%s\n' 'https://archive.ubuntu.com/ubuntu/' | timeout --signal=TERM --kill-after=10s 300s sudo tee /etc/apt/apt-mirrors.txt > /dev/null
- name: Install native adapter build dependencies
if: matrix.native
uses: ./.github/actions/apt-install-cached
with:
packages: build-essential pkg-config libibverbs-dev librdmacm-dev
cache-name: racer-verbs-native
timeout-seconds: "300"
# Rust loads the adapter dynamically, so Cargo cannot compile-check its C ABI.
- name: Compile native C adapter (not hardware validation)
if: matrix.native
run: timeout --signal=TERM --kill-after=10s 300s sh images/racer/build-native.sh cmd/racer/verbs/native/verbs.c bin/racer-verbs-native/librdma_verbs.so.1
- name: Require native adapter ABI and symbols (no hardware)
if: matrix.native
run: timeout --signal=TERM --kill-after=10s 300s cargo +1.96.0 test --locked --manifest-path cmd/racer/Cargo.toml -p rdma-verbs --no-default-features --features "$VERBS_FEATURES" --lib ffi::tests::required_native_adapter_loads_abi_and_symbols -- --exact --ignored
- name: Test C discovery and open cleanup faults (no hardware)
if: matrix.native
run: |
timeout --signal=TERM --kill-after=10s 300s sh images/racer/build-native.sh cmd/racer/verbs/native/discovery_faults.c bin/racer-verbs-faults/librdma_verbs.so.1
timeout --signal=TERM --kill-after=10s 300s env LD_LIBRARY_PATH="$GITHUB_WORKSPACE/bin/racer-verbs-faults" cargo +1.96.0 test --locked --manifest-path cmd/racer/Cargo.toml -p rdma-verbs --no-default-features --features "$VERBS_FEATURES" --lib ffi::discovery_fault_tests::internal_close_failures_keep_admission_and_adapter -- --exact --ignored
timeout --signal=TERM --kill-after=10s 300s env LD_LIBRARY_PATH="$GITHUB_WORKSPACE/bin/racer-verbs-faults" cargo +1.96.0 test --locked --manifest-path cmd/racer/Cargo.toml -p rdma-verbs --no-default-features --features "$VERBS_FEATURES" --lib ffi::discovery_fault_tests::open_cleanup_failures_keep_admission_and_adapter -- --exact --ignored
timeout --signal=TERM --kill-after=10s 300s env LD_LIBRARY_PATH="$GITHUB_WORKSPACE/bin/racer-verbs-faults" cargo +1.96.0 test --locked --manifest-path cmd/racer/Cargo.toml -p rdma-verbs --no-default-features --features "$VERBS_FEATURES" --lib ffi::discovery_fault_tests::bind_is_signaled_and_fenced -- --exact --ignored
timeout --signal=TERM --kill-after=10s 300s env LD_LIBRARY_PATH="$GITHUB_WORKSPACE/bin/racer-verbs-faults" cargo +1.96.0 test --locked --manifest-path cmd/racer/Cargo.toml -p rdma-verbs --no-default-features --features "$VERBS_FEATURES" --lib ffi::discovery_fault_tests::wrappers_translate_verbs_results -- --exact --ignored
- name: Check verbs formatting
run: timeout --signal=TERM --kill-after=10s 300s cargo +1.96.0 fmt --manifest-path cmd/racer/Cargo.toml -p rdma-verbs --check
- name: Check verbs feature configuration
run: |
features=()
if [ -n "$VERBS_FEATURES" ]; then features=(--features "$VERBS_FEATURES"); fi
timeout --signal=TERM --kill-after=10s 300s cargo +1.96.0 check --locked --manifest-path cmd/racer/Cargo.toml -p rdma-verbs --all-targets --no-default-features "${features[@]}"
- name: Strict verbs Clippy
run: |
features=()
if [ -n "$VERBS_FEATURES" ]; then features=(--features "$VERBS_FEATURES"); fi
timeout --signal=TERM --kill-after=10s 300s cargo +1.96.0 clippy --locked --manifest-path cmd/racer/Cargo.toml -p rdma-verbs --all-targets --no-default-features "${features[@]}" -- -D warnings
# Explicit zero-port and active-provider tests remain ignored. A hosted
# runner does not establish RDMA hardware or DMA/fencing correctness.
- name: Test verbs without requiring RDMA hardware
run: |
features=()
if [ -n "$VERBS_FEATURES" ]; then features=(--features "$VERBS_FEATURES"); fi
timeout --signal=TERM --kill-after=10s 300s cargo +1.96.0 test --locked --manifest-path cmd/racer/Cargo.toml -p rdma-verbs --no-default-features "${features[@]}"
racer-gpu:
name: Racer GPU (${{ matrix.configuration }})
runs-on: ubuntu-24.04
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
include:
- configuration: no-default-features
features: ""
native: false
- configuration: simulation
features: simulation
native: false
# native compiles the decrypt kernels with nvcc; native-and-simulation
# keeps covering the build without them.
- configuration: native
features: native
native: true
kernels: true
- configuration: native-and-simulation
features: native,simulation
native: true
kernels: false
env:
CARGO_TARGET_DIR: ${{ github.workspace }}/bin/racer-gpu-cargo
# Make the pinned toolchain active so rust-cache keys on its rustc -vV.
RUSTUP_TOOLCHAIN: 1.96.0
CARGO_BUILD_JOBS: "2"
GPU_FEATURES: ${{ matrix.features }}
LD_LIBRARY_PATH: ${{ github.workspace }}/bin/racer-gpu-native
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up pinned Rust
run: timeout --signal=TERM --kill-after=10s 300s rustup toolchain install 1.96.0 --profile minimal --component rustfmt,clippy
# Matrix entries differ only in workspace-crate features, and rust-cache
# prunes workspace crates, so one entry saves for all of them.
- name: Cache Cargo dependencies
uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
with:
workspaces: cmd/racer -> ../../bin/racer-gpu-cargo
shared-key: racer-gpu
save-if: ${{ github.event_name == 'push' && matrix.configuration == 'native-and-simulation' }}
# Hosted runners have no GPU. nvcc (same package as the dataplane image)
# compiles the decrypt kernels to PTX so they at least build; running
# them needs .github/workflows/racer-gpu.yaml on a GPU runner. Kernel
# math is covered by the C-core tests below and the kernel emulation step.
- name: Add CUDA apt repository
if: matrix.kernels
run: |
timeout --signal=TERM --kill-after=10s 120s curl -fsSL -o "$RUNNER_TEMP/cuda-keyring.deb" \
https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/cuda-keyring_1.1-1_all.deb
timeout --signal=TERM --kill-after=10s 120s sudo dpkg -i "$RUNNER_TEMP/cuda-keyring.deb"
- name: Install nvcc
if: matrix.kernels
uses: ./.github/actions/apt-install-cached
with:
packages: cuda-nvcc-12-9
cache-name: racer-gpu-nvcc
- name: Add nvcc to PATH
if: matrix.kernels
run: echo /usr/local/cuda/bin >> "$GITHUB_PATH"
- name: Compile CUDA shim with kernels (not hardware validation)
if: matrix.kernels
run: RACER_GPU_REQUIRE_PTX=1 timeout --signal=TERM --kill-after=10s 300s sh images/racer/build-native-cuda.sh cmd/racer/gpu/native bin/racer-gpu-native/libracer_gpu_cuda.so.1
- name: Compile CUDA shim without kernels (not hardware validation)
if: matrix.native && !matrix.kernels
run: timeout --signal=TERM --kill-after=10s 300s sh images/racer/build-native-cuda.sh cmd/racer/gpu/native bin/racer-gpu-native/libracer_gpu_cuda.so.1
- name: Require CUDA shim ABI and symbols (no hardware)
if: matrix.native
run: timeout --signal=TERM --kill-after=10s 300s cargo +1.96.0 test --locked --manifest-path cmd/racer/Cargo.toml -p racer-gpu --no-default-features --features "$GPU_FEATURES" --lib ffi::tests::required_native_shim_loads_abi_and_symbols -- --exact --ignored
- name: Run decrypt kernels on the CPU (kernel emulation)
if: matrix.native
run: timeout --signal=TERM --kill-after=10s 300s sh cmd/racer/gpu/native/run-kernel-emulation.sh bin/racer-gpu-emulation
- name: Check GPU formatting
run: timeout --signal=TERM --kill-after=10s 300s cargo +1.96.0 fmt --manifest-path cmd/racer/Cargo.toml -p racer-gpu --check
- name: Strict GPU Clippy
run: |
features=()
if [ -n "$GPU_FEATURES" ]; then features=(--features "$GPU_FEATURES"); fi
timeout --signal=TERM --kill-after=10s 300s cargo +1.96.0 clippy --locked --manifest-path cmd/racer/Cargo.toml -p racer-gpu --all-targets --no-default-features "${features[@]}" -- -D warnings
# Includes the C AES-GCM/CRC core check against racer-crypto (16 MiB pages).
- name: Test GPU crate without requiring GPU hardware
run: |
features=()
if [ -n "$GPU_FEATURES" ]; then features=(--features "$GPU_FEATURES"); fi
timeout --signal=TERM --kill-after=10s 300s cargo +1.96.0 test --locked --manifest-path cmd/racer/Cargo.toml -p racer-gpu --no-default-features "${features[@]}"
racer-io-miri:
name: Runtime Miri (${{ matrix.group }})
runs-on: ubuntu-24.04
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
group: [spsc, mailbox, offload, scheduler, memory, rt-memory]
env:
# Make the pinned nightly active so rust-cache keys on its rustc -vV.
RUSTUP_TOOLCHAIN: nightly-2025-11-21
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install pinned Miri
run: timeout --signal=TERM --kill-after=10s 300s rustup toolchain install nightly-2025-11-21 --profile minimal --component miri,rust-src
# Every group builds the same dependencies and Miri sysroot, so one group
# saves for all of them. ~/.cache/miri is the Linux default MIRI_SYSROOT.
- name: Cache Cargo dependencies and Miri sysroot
uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
with:
workspaces: cmd/racer -> ../../tmp/racer-io-miri-target
shared-key: racer-io-miri
cache-directories: ~/.cache/miri
save-if: ${{ github.event_name == 'push' && matrix.group == 'spsc' }}
- name: Prepare Miri sysroot
run: timeout --signal=TERM --kill-after=10s 300s cargo +nightly-2025-11-21 miri setup
- name: Validate exact pure runtime test group
run: timeout --signal=TERM --kill-after=10s 1200s python3 hack/scripts/racer-io-miri.py ${{ matrix.group }}
racer-envtest:
name: Racer API Server Integration Tests
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
# The envtest suite runs with -race, so reuse the race build cache that
# the Test job saves.
- name: Set up Go
id: setup-go
uses: ./.github/actions/setup-go-cached
with:
profile: race
- name: Compute envtest cache key
id: envtest-key
run: |
hash="$(grep -E '^(SETUP_ENVTEST|ENVTEST_K8S)_VERSION ' Makefile | sha256sum | cut -c1-16)"
echo "key=envtest-${RUNNER_OS}-${RUNNER_ARCH}-${{ steps.setup-go.outputs.go-version }}-${hash}" >> "$GITHUB_OUTPUT"
- name: Restore envtest binaries
id: envtest-cache
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: |
bin/setup-envtest-*
bin/envtest
key: ${{ steps.envtest-key.outputs.key }}
- name: Provision envtest and run Racer API-server race tests
run: timeout --signal=TERM --kill-after=10s 300s make racer-envtest-ci
- name: Save envtest binaries
if: github.event_name == 'push' && steps.envtest-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: |
bin/setup-envtest-*
bin/envtest
key: ${{ steps.envtest-key.outputs.key }}
racer-python:
name: Racer Python Client
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Run Python client and vLLM plugin tests
run: timeout --signal=TERM --kill-after=10s 540s make racer-python-test
# ---------- Orca Integration Tests ----------
# Spins up Garage and Azurite via testcontainers-go and runs the
# orca in-process integration suite (internal/orca/inttest). Docker
# is preinstalled on GitHub-hosted Ubuntu runners; no extra services:
# block is required.
orca-inttest:
name: Orca Integration Tests
needs: [frontend]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Download frontend dist
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8
with:
name: frontend-dist
path: internal/net/html/dist
- name: Set up Go
id: setup-go
uses: ./.github/actions/setup-go-cached
with:
profile: race
- name: Run orca-inttest
run: make orca-inttest
# ---------- Build ----------
build:
name: Build
needs: [frontend]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Download frontend dist
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8
with:
name: frontend-dist
path: internal/net/html/dist
- name: Set up Go
id: setup-go
uses: ./.github/actions/setup-go-cached
with:
profile: build
- name: Build
run: make build
- name: Save Go caches
if: success() && github.event_name == 'push'
uses: ./.github/actions/setup-go-cached
with:
phase: save
profile: build
save-build-cache: "true"
save-mod-cache: "true"
# ---------- Vulnerability Check ----------
govulncheck:
name: Vulnerability Check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Go
id: setup-go
uses: ./.github/actions/setup-go-cached
with:
profile: build
- name: Vulnerability check
run: make vulncheck
# ---------- Verify Generated Files ----------
verify-generated:
name: Verify Generated Files
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Go
id: setup-go
uses: ./.github/actions/setup-go-cached
with:
profile: build
- name: Compute Go tools cache key
id: tools-key
run: |
# Hash only the pinned versions that install-tools uses, so unrelated
# Makefile edits do not invalidate the cache.
hash="$(grep -E '^(GOFUMPT|GOLANGCI_LINT|PROTOC_GEN_GO|PROTOC_GEN_GO_GRPC|CONTROLLER_GEN|ACTIONLINT)_VERSION ' Makefile | sha256sum | cut -c1-16)"
echo "key=go-tools-${RUNNER_OS}-${RUNNER_ARCH}-${{ steps.setup-go.outputs.go-version }}-${hash}" >> "$GITHUB_OUTPUT"
echo "dir=$(go env GOPATH)/bin" >> "$GITHUB_OUTPUT"
- name: Restore Go tools
id: tools-cache
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ steps.tools-key.outputs.dir }}
key: ${{ steps.tools-key.outputs.key }}
- name: Install tools
if: steps.tools-cache.outputs.cache-hit != 'true'
run: make install-tools
- name: Install clang/llvm for bpf2go
# Same package list and cache name as the other BPF job, so both share
# one cache entry.
uses: ./.github/actions/apt-install-cached
with:
packages: clang-18 llvm-18 libbpf-dev
cache-name: bpf-clang
- name: Verify BPF CO-RE pin artifacts
run: make net-ebpf-verify
- name: Regenerate
run: make generate
- name: Check for drift
run: |
if ! git diff --exit-code; then
echo "::error::Generated files are out of date. Run 'make generate' and commit the results."
exit 1
fi
# ---------- Verify BPF binary reproducibility ----------
#
# Recompiles bpf/unbounded_encap.c via bpf2go using the pinned clang
# version (bpf/clang-version) and diffs the result against the
# committed internal/net/ebpf/unboundedencap_bpfel.{go,o}. Catches any
# PR that edits the BPF source (or its CO-RE inputs in bpf/vmlinux.h)
# without re-running `make generate` and committing the updated
# bindings.
#
# Reproducibility relies on every build path using the same clang
# binary: contributors invoke clang-18 via `make generate`, this CI
# job installs the same package. Bump the pin by updating
# bpf/clang-version and the references it documents.
verify-bpf-binary:
name: Verify BPF Binary
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Go
id: setup-go
uses: ./.github/actions/setup-go-cached
with:
profile: build
- name: Verify pinned clang version
run: |
pinned="$(grep -v '^#' bpf/clang-version | grep -v '^$' | head -n1)"
if [ "$pinned" != "clang-18" ]; then
echo "::error::bpf/clang-version pins '$pinned' but this CI job installs clang-18."
echo "::error::Update the apt-install-cached packages in .github/workflows/ci.yaml (verify-generated and verify-bpf-binary jobs) to match."
exit 1
fi
- name: Install pinned clang for bpf2go
# Same package list and cache name as the other BPF job, so both share
# one cache entry.
uses: ./.github/actions/apt-install-cached
with:
packages: clang-18 llvm-18 libbpf-dev
cache-name: bpf-clang
- name: Recompile BPF bindings via bpf2go
run: go generate ./internal/net/ebpf/...
- name: Check for drift in bpf2go output
run: |
if ! git diff --exit-code -- internal/net/ebpf/ bpf/; then
echo "::error::Committed BPF bindings are out of date."
echo "::error::Run 'make generate' locally (with $(grep -v '^#' bpf/clang-version | grep -v '^$' | head -n1) installed) and commit the updated"
echo "::error::internal/net/ebpf/unboundedencap_bpfel.{go,o}."
exit 1
fi
# ---------- Verify licenses ----------
license-check:
name: License Check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Check repository license declarations
run: make license-check
# ---------- Verify NOTICE ----------
notice-check:
name: NOTICE Check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Node
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v6
with:
node-version: "24"
cache: npm
cache-dependency-path: frontend/package-lock.json
- name: Install frontend deps
run: npm ci --prefer-offline --no-audit
working-directory: frontend
- name: Set up Go
id: setup-go
uses: ./.github/actions/setup-go-cached
with:
profile: build
- name: Restore Cargo registry
id: cargo-registry
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: |
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
key: cargo-registry-${{ runner.os }}-${{ hashFiles('cmd/racer/Cargo.lock') }}
restore-keys: |
cargo-registry-${{ runner.os }}-
- name: Provision locked Cargo sources for NOTICE
run: |
timeout --signal=TERM --kill-after=10s 300s rustup toolchain install 1.96.0 --profile minimal
timeout --signal=TERM --kill-after=10s 300s cargo +1.96.0 fetch --locked --manifest-path cmd/racer/Cargo.toml
timeout --signal=TERM --kill-after=10s 300s cargo +1.96.0 fetch --locked --manifest-path cmd/racer-object/Cargo.toml
- name: Save Cargo registry
if: github.event_name == 'push' && steps.cargo-registry.outputs.cache-hit != 'true'
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: |
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
key: ${{ steps.cargo-registry.outputs.cache-primary-key }}
- name: Verify NOTICE
run: timeout --signal=TERM --kill-after=10s 300s make notice-check
# ---------- Build Container Images ----------
build-images:
name: Build Images (${{ matrix.arch }})
needs: [frontend]
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: true
matrix:
include:
- arch: amd64
runner: ubuntu-latest
platform: linux/amd64
- arch: arm64
runner: ubuntu-24.04-arm
platform: linux/arm64
steps:
- name: Normalize container registry
run: echo "REGISTRY=${REGISTRY,,}" >> "$GITHUB_ENV"
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- name: Download frontend dist
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8
with:
name: frontend-dist
path: internal/net/html/dist
- name: Cache CNI plugins
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: resources
key: cni-plugins-${{ matrix.arch }}-${{ env.CNI_PLUGINS_VERSION }}
- name: Download CNI plugins
run: |
mkdir -p resources
file="resources/cni-plugins-linux-${{ matrix.arch }}-${CNI_PLUGINS_VERSION}.tgz"
if [ ! -s "$file" ]; then
curl -fsSL "https://github.com/containernetworking/plugins/releases/download/${CNI_PLUGINS_VERSION}/cni-plugins-linux-${{ matrix.arch }}-${CNI_PLUGINS_VERSION}.tgz" -o "$file"
fi
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4
- name: Compute Go version for Docker
id: goversion
run: echo "go_version=$(awk '/^go /{split($2,v,"."); print v[1]"."v[2]}' go.mod)" >> "$GITHUB_OUTPUT"
# Caches are exported only on push (main and release branches) so PR
# and merge-queue runs restore without churning the shared 10 GB
# Actions cache. An empty cache-to disables the export. The net
# controller and node builds use separate scopes because each export
# replaces the scope's cache index.
- name: Build controller image
uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7
with:
context: .
file: images/net/Containerfile
target: controller
platforms: ${{ matrix.platform }}