forked from NVIDIA/NemoClaw
-
Notifications
You must be signed in to change notification settings - Fork 0
6002 lines (5660 loc) · 295 KB
/
Copy pathe2e.yaml
File metadata and controls
6002 lines (5660 loc) · 295 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
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
name: E2E
run-name: "${{ inputs.checkout_sha != '' && format('E2E PR #{0} ({1})', inputs.pr_number, inputs.correlation_id) || inputs.correlation_id != '' && format('E2E {0} ({1})', github.ref_name, inputs.correlation_id) || format('E2E {0}', github.ref_name) }}"
on:
push:
branches: [main]
workflow_dispatch:
inputs:
targets:
description: "Optional comma-separated typed target IDs. On trusted main runs, empty jobs and targets select all supported registry E2E tests. PR revision runs use the trusted controller target matrix."
required: false
default: ""
type: string
jobs:
description: "Optional comma-separated E2E test IDs. Empty selectors choose the default suite. Set include_staging_brev_launchable for Launchable. Jetson dispatch and DGX Spark require their opt-in flags. PR revisions use the trusted controller matrix."
required: false
default: ""
type: string
include_staging_brev_launchable:
description: "Include Exact staging Brev Launchable in a full E2E run when jobs and targets are empty."
required: false
default: false
type: boolean
release_qualification_waived_jobs:
description: "Admin-only comma-separated release-required E2E job IDs to waive. Leave empty to require every release E2E job."
required: false
default: ""
type: string
release_qualification_waiver_reason:
description: "Admin-only reason for release qualification waived jobs. Required when release_qualification_waived_jobs is not empty."
required: false
default: ""
type: string
inference_mode:
description: "Inference adapter mode for compatible Vitest E2E jobs: mock, internal-nvidia, or public-nvidia."
required: false
default: "mock"
type: choice
options:
- mock
- internal-nvidia
- public-nvidia
allow_jetson_dispatch:
description: "Set true for a manual jetson-nvmap-gpu run. Main pushes dispatch it automatically. The operator-owned dispatch backend must be available, and JETSON_DISPATCH_URL must contain its verified HTTPS origin. Refer to test/e2e/docs/jetson-dispatch.md."
required: false
default: false
type: boolean
allow_dgx_spark_runner_queue:
description: "Before setting true for llama-cpp-dgx-spark-qualification, obtain repository administrator confirmation of an online DGX Spark runner in the authoritative NVIDIA/NemoClaw Settings -> Actions -> Runners inventory; queued jobs do not honor timeout-minutes before assignment."
required: false
default: false
type: boolean
pr_number:
description: Optional current PR number for manual exact-revision E2E.
required: false
type: string
default: ""
post_to_slack:
description: Post a selective-dispatch scorecard to the preview Slack route.
required: false
default: false
type: boolean
checkout_sha:
description: Optional lowercase 40-character latest PR commit SHA for manual E2E.
required: false
default: ""
type: string
checkout_repository:
description: Optional PR source repository for manual E2E.
required: false
default: ""
type: string
review_reason:
description: Optional review reason containing 10 to 500 printable characters.
required: false
default: ""
type: string
base_sha:
description: Optional lowercase PR base SHA for manual exact-revision E2E.
required: false
default: ""
type: string
workflow_sha:
description: Optional trusted main workflow SHA for manual E2E.
required: false
default: ""
type: string
correlation_id:
description: Run correlation ID (UUIDv4).
required: false
default: ""
type: string
permissions:
checks: read
contents: read
pull-requests: read
concurrency:
group: e2e-${{ github.ref }}-${{ inputs.checkout_sha != '' && format('pr-{0}', inputs.pr_number) || (inputs.include_staging_brev_launchable && inputs.jobs == '' && inputs.targets == '' && format('full-{0}', github.run_id)) || inputs.targets || 'supported' }}-${{ inputs.checkout_sha != '' && 'manual-pr' || inputs.jobs || 'all-jobs' }}
cancel-in-progress: ${{ inputs.checkout_sha != '' && !inputs.allow_jetson_dispatch }}
env:
NEMOCLAW_E2E_EXPECTED_SHA: ${{ inputs.checkout_sha }}
NEMOCLAW_E2E_CORRELATION_ID: ${{ inputs.correlation_id }}
NEMOCLAW_E2E_SHARD: default
jobs:
base-image-publication:
runs-on: ubuntu-latest
timeout-minutes: 55
outputs:
dcode_base_contract: ${{ steps.validate_dcode_base.outputs.contract }}
dcode_base_ref: ${{ steps.validate_dcode_base.outputs.base_ref }}
permissions:
actions: read
contents: read
steps:
- id: publication_mode
name: Classify base-image publication requirement
env:
CHECKOUT_SHA: ${{ inputs.checkout_sha }}
EVENT_NAME: ${{ github.event_name }}
REF: ${{ github.ref }}
REPOSITORY: ${{ github.repository }}
shell: bash
run: |
set -euo pipefail
case "${REPOSITORY}:${REF}:${EVENT_NAME}:${CHECKOUT_SHA:+controller}" in
NVIDIA/NemoClaw:refs/heads/main:push:|NVIDIA/NemoClaw:refs/heads/main:workflow_dispatch:)
required=1
;;
NVIDIA/NemoClaw:refs/heads/main:workflow_dispatch:controller)
required=1
;;
*)
echo "::error::base-image publication mode is not trusted" >&2
exit 1
;;
esac
printf 'required=%s\n' "${required}" >> "${GITHUB_OUTPUT}"
- name: Check out trusted E2E workflow
if: ${{ steps.publication_mode.outputs.required == '1' }}
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.sha }}
fetch-depth: 0
persist-credentials: false
- name: Set up Node for publication verification
if: ${{ steps.publication_mode.outputs.required == '1' }}
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 22
- id: publication
name: Verify applicable base-image publication
if: ${{ steps.publication_mode.outputs.required == '1' }}
env:
EXPECTED_SHA: ${{ github.sha }}
GITHUB_TOKEN: ${{ github.token }}
run: node --experimental-strip-types --no-warnings tools/e2e/base-image-publication.mts --wait-seconds 3000 --poll-seconds 30
- name: Download immutable Deep Agents Code base contract
if: ${{ steps.publication_mode.outputs.required == '1' }}
env:
GITHUB_TOKEN: ${{ github.token }}
PUBLICATION_HEAD_SHA: ${{ steps.publication.outputs.head_sha }}
PUBLICATION_RUN_ATTEMPT: ${{ steps.publication.outputs.run_attempt }}
PUBLICATION_RUN_ID: ${{ steps.publication.outputs.run_id }}
run: node --experimental-strip-types --no-warnings tools/e2e/exact-artifact-download.mts "${RUNNER_TEMP}/dcode-base-contract"
- id: validate_dcode_base
name: Validate immutable Deep Agents Code base
if: ${{ steps.publication_mode.outputs.required == '1' }}
env:
PUBLICATION_HEAD_SHA: ${{ steps.publication.outputs.head_sha }}
PUBLICATION_RUN_ATTEMPT: ${{ steps.publication.outputs.run_attempt }}
PUBLICATION_RUN_ID: ${{ steps.publication.outputs.run_id }}
run: node --experimental-strip-types --no-warnings tools/e2e/dcode-base-image-contract.mts "${RUNNER_TEMP}/dcode-base-contract/contract.json"
generate-matrix:
runs-on: ubuntu-latest
timeout-minutes: 10
outputs:
cli_artifact_provenance: ${{ steps.record_cli_artifact.outputs.provenance }}
e2e_credentials_allowed: ${{ steps.e2e_credentials.outputs.allowed }}
matrix: ${{ steps.matrix.outputs.matrix }}
test_matrix: ${{ steps.matrix.outputs.test_matrix }}
hermes_selected: ${{ steps.matrix.outputs.hermes_selected }}
explicit_only_jobs: ${{ steps.matrix.outputs.explicit_only_jobs }}
release_required_jobs: ${{ steps.matrix.outputs.release_required_jobs }}
release_qualification_waived_jobs: ${{ steps.matrix.outputs.release_qualification_waived_jobs }}
selected_jobs: ${{ steps.matrix.outputs.selected_jobs }}
selected_workflow_jobs: ${{ steps.matrix.outputs.selected_workflow_jobs }}
catalogue_standard_matrix: ${{ steps.matrix.outputs.catalogue_standard_matrix }}
catalogue_nvidia_api_matrix: ${{ steps.matrix.outputs.catalogue_nvidia_api_matrix }}
catalogue_nvidia_inference_matrix: ${{ steps.matrix.outputs.catalogue_nvidia_inference_matrix }}
catalogue_github_read_matrix: ${{ steps.matrix.outputs.catalogue_github_read_matrix }}
catalogue_brave_nvidia_inference_matrix: ${{ steps.matrix.outputs.catalogue_brave_nvidia_inference_matrix }}
runner_routing: ${{ steps.runner_routing.outputs.runner_routing }}
steps:
- id: controller_matrix
name: Build trusted controller target matrix
if: ${{ inputs.checkout_sha != '' }}
env:
JOBS: ${{ inputs.jobs }}
TARGETS: ${{ inputs.targets }}
shell: bash
run: |
set -euo pipefail
test_matrix='[]'
case "${JOBS}:${TARGETS}" in
:)
matrix='[{"id":"ubuntu-policy-custom-missing-presets-negative","runner":"ubuntu-latest"},{"id":"ubuntu-repo-cloud-langchain-deepagents-code","runner":"ubuntu-latest"},{"id":"ubuntu-repo-cloud-openclaw","runner":"ubuntu-latest"},{"id":"ubuntu-repo-docker-post-reboot-recovery","runner":"ubuntu-latest"}]'
test_matrix='[{"id":"onboard-managed-image-buildless-e2e","file":"test/onboard-managed-image-buildless-e2e.test.ts","project":"integration"},{"id":"vllm-docker-storage","file":"test/vllm-docker-storage.test.ts","project":"integration"}]'
;;
inference-routing: | managed-image-protected-runtime: | native-runtime-qualification-producer: | :jetson-nvmap-gpu)
matrix='[]'
;;
:ubuntu-repo-cloud-langchain-deepagents-code)
matrix='[{"id":"ubuntu-repo-cloud-langchain-deepagents-code","runner":"ubuntu-latest","label":"ubuntu-repo-cloud-langchain-deepagents-code"}]'
;;
:ubuntu-repo-docker-post-reboot-recovery)
matrix='[{"id":"ubuntu-repo-docker-post-reboot-recovery","runner":"ubuntu-latest","label":"ubuntu-repo-docker-post-reboot-recovery"}]'
;;
:ubuntu-repo-cloud-langchain-deepagents-code,ubuntu-repo-docker-post-reboot-recovery)
matrix='[{"id":"ubuntu-repo-cloud-langchain-deepagents-code","runner":"ubuntu-latest","label":"ubuntu-repo-cloud-langchain-deepagents-code"},{"id":"ubuntu-repo-docker-post-reboot-recovery","runner":"ubuntu-latest","label":"ubuntu-repo-docker-post-reboot-recovery"}]'
;;
*)
echo "::error::PR E2E target is not approved by the trusted controller" >&2
exit 1
;;
esac
printf 'matrix=%s\n' "${matrix}" >> "${GITHUB_OUTPUT}"
printf 'test_matrix=%s\n' "${test_matrix}" >> "${GITHUB_OUTPUT}"
- id: runner_routing
name: Build trusted larger-runner routing
env:
CHECKOUT_SHA: ${{ inputs.checkout_sha }}
LARGER_RUNNER_LABEL: ${{ vars.E2E_LARGER_RUNNER_LABEL }}
REF: ${{ github.ref }}
REPOSITORY: ${{ github.repository }}
shell: bash
run: |
set -euo pipefail
larger_runner="ubuntu-latest"
if [[ "${REPOSITORY}" == "NVIDIA/NemoClaw" && "${REF}" == "refs/heads/main" && -z "${CHECKOUT_SHA}" && -n "${LARGER_RUNNER_LABEL}" ]]; then
if [[ ! "${LARGER_RUNNER_LABEL}" =~ ^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$ ]]; then
echo "::error::E2E_LARGER_RUNNER_LABEL must be a 1-64 character workflow label using letters, digits, dots, underscores, or hyphens" >&2
exit 1
fi
larger_runner="${LARGER_RUNNER_LABEL}"
fi
runner_routing="$(jq -cn --arg standard "ubuntu-latest" --arg larger "${larger_runner}" '{"channels-stop-start-hermes":$larger,"common-egress-agent":$larger,"hermes-discord":$larger,"hermes-e2e":$larger,"hermes-inference-switch":$larger,"hermes-shields-config":$larger,"mcp-bridge-deepagents":$larger,"mcp-bridge-hermes":$larger,"mcp-bridge-openclaw":$standard,"rebuild-hermes":$larger,"rebuild-hermes-stale-base":$larger,"security-posture-hermes":$larger}')"
printf 'runner_routing=%s\n' "${runner_routing}" >> "${GITHUB_OUTPUT}"
- name: Authenticate manual PR dispatch
if: ${{ inputs.checkout_sha != '' }}
env:
ACTOR: ${{ github.actor }}
ALLOW_JETSON_DISPATCH: ${{ inputs.allow_jetson_dispatch && 'true' || 'false' }}
BASE_SHA: ${{ inputs.base_sha }}
CHECKOUT_REPOSITORY: ${{ inputs.checkout_repository }}
CHECKOUT_SHA: ${{ inputs.checkout_sha }}
GITHUB_TOKEN: ${{ github.token }}
EXPECTED_WORKFLOW_SHA: ${{ inputs.workflow_sha }}
INCLUDE_LAUNCHABLE: ${{ inputs.include_staging_brev_launchable }}
JOBS: ${{ inputs.jobs }}
PR_NUMBER: ${{ inputs.pr_number }}
REVIEW_REASON: ${{ inputs.review_reason }}
RUN_ATTEMPT: ${{ github.run_attempt }}
TARGETS: ${{ inputs.targets }}
TRIGGERING_ACTOR: ${{ github.triggering_actor }}
WORKFLOW_EVENT: ${{ github.event_name }}
WORKFLOW_REF: ${{ github.ref }}
WORKFLOW_SHA: ${{ github.workflow_sha }}
shell: bash
run: |
set -euo pipefail
read_collaborator_permission() {
local maintainer="$1"
local attempt curl_exit failure http_status permission_file
permission_file="$(mktemp "${RUNNER_TEMP:-/tmp}/nemoclaw-collaborator-permission.XXXXXX")"
for attempt in 1 2 3; do
: >"$permission_file"
if http_status="$(curl --silent --proto '=https' --connect-timeout 10 --max-time 30 \
--output "$permission_file" --write-out "%{http_code}" \
--header "Authorization: Bearer ${GITHUB_TOKEN}" \
--header "Accept: application/vnd.github+json" \
--header "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/repos/${GITHUB_REPOSITORY}/collaborators/${maintainer}/permission" \
2>/dev/null)"; then
if [[ "$http_status" =~ ^2[0-9]{2}$ ]]; then
if jq -e 'type == "object" and (.user.login | type == "string") and (.role_name | type == "string")' "$permission_file" >/dev/null 2>&1; then
if (( attempt > 1 )); then
echo "::notice::Collaborator permission read passed after retry on attempt ${attempt}/3" >&2
fi
cat "$permission_file"
rm -f "$permission_file"
return 0
fi
echo "::error::Collaborator permission read attempt ${attempt}/3 failed: malformed response" >&2
rm -f "$permission_file"
return 1
fi
if [[ "$http_status" =~ ^[0-9]{3}$ ]]; then
failure="HTTP ${http_status}"
case "$http_status" in
408 | 429 | 5??) ;;
*) echo "::error::Collaborator permission read attempt ${attempt}/3 failed: ${failure}" >&2; rm -f "$permission_file"; return 1 ;;
esac
else
echo "::error::Collaborator permission read attempt ${attempt}/3 failed: invalid HTTP status" >&2
rm -f "$permission_file"
return 1
fi
else
curl_exit=$?
case "$curl_exit" in
5 | 6 | 7 | 16 | 18 | 28 | 35 | 52 | 55 | 56 | 92 | 95 | 96) failure="transport" ;;
*) echo "::error::Collaborator permission read attempt ${attempt}/3 failed: curl exit ${curl_exit}" >&2; rm -f "$permission_file"; return 1 ;;
esac
fi
if (( attempt == 3 )); then
echo "::error::Collaborator permission read exhausted after attempt ${attempt}/3: ${failure}" >&2
rm -f "$permission_file"
return 1
fi
echo "::warning::Collaborator permission read attempt ${attempt}/3 failed: ${failure}; retrying" >&2
sleep "$attempt"
done
}
require_maintainer() {
local maintainer="$1"
[[ "$maintainer" =~ ^[A-Za-z0-9-]{1,39}$ && "$maintainer" != -* && "$maintainer" != *- ]] || {
echo "::error::Manual PR E2E actor is invalid" >&2
exit 1
}
local permission_json
permission_json="$(read_collaborator_permission "$maintainer")"
if [[ "$(jq -r '.user.login // ""' <<< "$permission_json" | tr '[:upper:]' '[:lower:]')" != "$(tr '[:upper:]' '[:lower:]' <<< "$maintainer")" ]]; then
echo "::error::Manual PR E2E permission response did not match the actor" >&2
exit 1
fi
case "$(jq -r '.role_name // ""' <<< "$permission_json")" in
maintain | admin) ;;
*) echo "::error::Manual PR E2E requires a repository maintainer or administrator" >&2; exit 1 ;;
esac
}
[[ "$WORKFLOW_EVENT" == "workflow_dispatch" && "$WORKFLOW_REF" == "refs/heads/main" ]] || {
echo "::error::Manual PR E2E must be dispatched from main" >&2
exit 1
}
[[ "$RUN_ATTEMPT" == "1" ]] || { echo "::error::Manual PR E2E cannot be rerun" >&2; exit 1; }
case "${JOBS}:${TARGETS}:${INCLUDE_LAUNCHABLE}:${ALLOW_JETSON_DISPATCH}" in
::false:false | inference-routing::false:false | managed-image-protected-runtime::false:false | native-runtime-qualification-producer::false:false | :jetson-nvmap-gpu:false:true) ;;
*)
echo "::error::Manual PR E2E accepts only empty selectors, inference-routing, managed-image-protected-runtime, native-runtime-qualification-producer, or jetson-nvmap-gpu with its dispatch flag" >&2
exit 1
;;
esac
[[ "$PR_NUMBER" =~ ^[1-9][0-9]*$ ]] || { echo "::error::pr_number must be a positive integer" >&2; exit 1; }
[[ "$CHECKOUT_REPOSITORY" =~ ^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$ ]] || { echo "::error::checkout_repository must be an owner/repository name" >&2; exit 1; }
[[ "$CHECKOUT_SHA" =~ ^[a-f0-9]{40}$ ]] || { echo "::error::checkout_sha must be a lowercase 40-character SHA" >&2; exit 1; }
[[ "$BASE_SHA" =~ ^[a-f0-9]{40}$ ]] || { echo "::error::base_sha must be a lowercase 40-character SHA" >&2; exit 1; }
[[ "$REVIEW_REASON" =~ ^[[:print:]]+$ ]] &&
(( ${#REVIEW_REASON} >= 10 && ${#REVIEW_REASON} <= 500 )) ||
{ echo "::error::review_reason must contain 10 to 500 printable characters" >&2; exit 1; }
[[ "$EXPECTED_WORKFLOW_SHA" =~ ^[a-f0-9]{40}$ && "$EXPECTED_WORKFLOW_SHA" == "$WORKFLOW_SHA" ]] || { echo "::error::workflow_sha must match the trusted main workflow SHA" >&2; exit 1; }
require_maintainer "$ACTOR"
if [[ "$(printf '%s' "$TRIGGERING_ACTOR" | tr '[:upper:]' '[:lower:]')" != "$(printf '%s' "$ACTOR" | tr '[:upper:]' '[:lower:]')" ]]; then
require_maintainer "$TRIGGERING_ACTOR"
fi
pull_json="$(curl --fail --silent --show-error --proto '=https' \
--header "Authorization: Bearer ${GITHUB_TOKEN}" \
--header "Accept: application/vnd.github+json" \
--header "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/repos/${GITHUB_REPOSITORY}/pulls/${PR_NUMBER}")"
[[ "$(jq -r '.state' <<< "$pull_json")" == "open" ]] || { echo "::error::pull request must be open" >&2; exit 1; }
[[ "$(jq -r '.head.repo.full_name // ""' <<< "$pull_json")" == "$CHECKOUT_REPOSITORY" ]] || { echo "::error::checkout_repository must match the PR source repository" >&2; exit 1; }
[[ "$(jq -r '.head.sha' <<< "$pull_json")" == "$CHECKOUT_SHA" ]] || { echo "::error::checkout_sha must match the latest PR commit SHA" >&2; exit 1; }
[[ "$(jq -r '.base.sha' <<< "$pull_json")" == "$BASE_SHA" ]] || { echo "::error::base_sha must match the PR base SHA" >&2; exit 1; }
- name: Authorize release qualification waiver
if: ${{ github.event_name == 'workflow_dispatch' && (inputs.release_qualification_waived_jobs != '' || inputs.release_qualification_waiver_reason != '') }}
env:
ACTOR: ${{ github.actor }}
ALLOW_DGX_SPARK_RUNNER_QUEUE: ${{ inputs.allow_dgx_spark_runner_queue && 'true' || 'false' }}
ALLOW_JETSON_DISPATCH: ${{ inputs.allow_jetson_dispatch && 'true' || 'false' }}
CHECKOUT_SHA: ${{ inputs.checkout_sha }}
GITHUB_TOKEN: ${{ github.token }}
INCLUDE_LAUNCHABLE: ${{ inputs.include_staging_brev_launchable && 'true' || 'false' }}
JOBS: ${{ inputs.jobs }}
TARGETS: ${{ inputs.targets }}
TRIGGERING_ACTOR: ${{ github.triggering_actor }}
WAIVED_JOBS: ${{ inputs.release_qualification_waived_jobs }}
WAIVER_REASON: ${{ inputs.release_qualification_waiver_reason }}
WORKFLOW_REF: ${{ github.ref }}
shell: bash
run: |
set -euo pipefail
read_collaborator_permission() {
local administrator="$1"
local attempt curl_exit failure http_status permission_file
permission_file="$(mktemp "${RUNNER_TEMP:-/tmp}/nemoclaw-collaborator-permission.XXXXXX")"
for attempt in 1 2 3; do
: >"$permission_file"
if http_status="$(curl --silent --proto '=https' --connect-timeout 10 --max-time 30 \
--output "$permission_file" --write-out "%{http_code}" \
--header "Authorization: Bearer ${GITHUB_TOKEN}" \
--header "Accept: application/vnd.github+json" \
--header "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/repos/${GITHUB_REPOSITORY}/collaborators/${administrator}/permission" \
2>/dev/null)"; then
if [[ "$http_status" =~ ^2[0-9]{2}$ ]]; then
if jq -e 'type == "object" and (.user.login | type == "string") and (.role_name | type == "string")' "$permission_file" >/dev/null 2>&1; then
if (( attempt > 1 )); then
echo "::notice::Collaborator permission read passed after retry on attempt ${attempt}/3" >&2
fi
cat "$permission_file"
rm -f "$permission_file"
return 0
fi
echo "::error::Collaborator permission read attempt ${attempt}/3 failed: malformed response" >&2
rm -f "$permission_file"
return 1
fi
if [[ "$http_status" =~ ^[0-9]{3}$ ]]; then
failure="HTTP ${http_status}"
case "$http_status" in
408 | 429 | 5??) ;;
*) echo "::error::Collaborator permission read attempt ${attempt}/3 failed: ${failure}" >&2; rm -f "$permission_file"; return 1 ;;
esac
else
echo "::error::Collaborator permission read attempt ${attempt}/3 failed: invalid HTTP status" >&2
rm -f "$permission_file"
return 1
fi
else
curl_exit=$?
case "$curl_exit" in
5 | 6 | 7 | 16 | 18 | 28 | 35 | 52 | 55 | 56 | 92 | 95 | 96) failure="transport" ;;
*) echo "::error::Collaborator permission read attempt ${attempt}/3 failed: curl exit ${curl_exit}" >&2; rm -f "$permission_file"; return 1 ;;
esac
fi
if (( attempt == 3 )); then
echo "::error::Collaborator permission read exhausted after attempt ${attempt}/3: ${failure}" >&2
rm -f "$permission_file"
return 1
fi
echo "::warning::Collaborator permission read attempt ${attempt}/3 failed: ${failure}; retrying" >&2
sleep "$attempt"
done
}
require_admin() {
local administrator="$1"
if [[ ! "$administrator" =~ ^[A-Za-z0-9-]{1,39}$ || "$administrator" == -* || "$administrator" == *- ]]; then
echo "::error::Release qualification waiver actor is invalid" >&2
exit 1
fi
local permission_json
permission_json="$(read_collaborator_permission "$administrator")"
if [[ "$(jq -r '.user.login // ""' <<< "$permission_json" | tr '[:upper:]' '[:lower:]')" != "$(tr '[:upper:]' '[:lower:]' <<< "$administrator")" ]]; then
echo "::error::Release qualification waiver permission response did not match the actor" >&2
exit 1
fi
[[ "$(jq -r '.role_name // ""' <<< "$permission_json")" == "admin" ]] || {
echo "::error::Release qualification waiver requires a repository administrator" >&2
exit 1
}
}
[[ "$WORKFLOW_REF" == "refs/heads/main" ]] || {
echo "::error::Release qualification waiver must be dispatched from main" >&2
exit 1
}
[[ -z "$CHECKOUT_SHA" && -z "$JOBS" && -z "$TARGETS" ]] || {
echo "::error::Release qualification waiver requires an exact main release run with empty selectors" >&2
exit 1
}
[[ "$INCLUDE_LAUNCHABLE" == "true" && "$ALLOW_JETSON_DISPATCH" == "false" && "$ALLOW_DGX_SPARK_RUNNER_QUEUE" == "false" ]] || {
echo "::error::Release qualification waiver conflicts with another release-run override" >&2
exit 1
}
waived_jobs_pattern='^[a-z0-9]+(-[a-z0-9]+)*(,[a-z0-9]+(-[a-z0-9]+)*)*$'
[[ "$WAIVED_JOBS" =~ $waived_jobs_pattern ]] || {
echo "::error::release_qualification_waived_jobs must contain comma-separated E2E job IDs" >&2
exit 1
}
waiver_reason_pattern="^[A-Za-z0-9][A-Za-z0-9 .,:;/_()'-]*$"
[[ ${#WAIVER_REASON} -ge 10 && ${#WAIVER_REASON} -le 500 && "$WAIVER_REASON" =~ $waiver_reason_pattern ]] || {
echo "::error::release_qualification_waiver_reason must start with a letter or number and contain 10 to 500 allowed ASCII characters" >&2
exit 1
}
require_admin "$ACTOR"
if [[ "$(printf '%s' "$TRIGGERING_ACTOR" | tr '[:upper:]' '[:lower:]')" != "$(printf '%s' "$ACTOR" | tr '[:upper:]' '[:lower:]')" ]]; then
require_admin "$TRIGGERING_ACTOR"
fi
- name: Record trusted E2E dispatch receipt
if: ${{ github.event_name == 'workflow_dispatch' }}
env:
ACTOR: ${{ github.actor }}
ALLOW_DGX_SPARK_RUNNER_QUEUE: ${{ inputs.allow_dgx_spark_runner_queue && 'true' || 'false' }}
ALLOW_JETSON_DISPATCH: ${{ inputs.allow_jetson_dispatch && 'true' || 'false' }}
ALLOW_JETSON_RUNNER_QUEUE: "false"
BASE_SHA: ${{ inputs.checkout_sha != '' && inputs.base_sha || github.sha }}
CANDIDATE_REPOSITORY: ${{ inputs.checkout_repository || github.repository }}
CANDIDATE_SHA: ${{ inputs.checkout_sha || github.sha }}
DISPATCH_JOBS: ${{ inputs.jobs }}
DISPATCH_RECEIPT_DIR: ${{ runner.temp }}/nemoclaw-e2e-dispatch
DISPATCH_TARGETS: ${{ inputs.targets }}
EVENT_NAME: ${{ github.event_name }}
INCLUDE_STAGING_BREV_LAUNCHABLE: ${{ inputs.include_staging_brev_launchable && 'true' || 'false' }}
PR_NUMBER: ${{ inputs.checkout_sha != '' && inputs.pr_number || '' }}
REPOSITORY: ${{ github.repository }}
RUN_ATTEMPT: ${{ github.run_attempt }}
RUN_ID: ${{ github.run_id }}
RELEASE_QUALIFICATION_WAIVED_JOBS: ${{ inputs.release_qualification_waived_jobs }}
RELEASE_QUALIFICATION_WAIVER_REASON: ${{ inputs.release_qualification_waiver_reason }}
TRIGGERING_ACTOR: ${{ github.triggering_actor }}
WORKFLOW_SHA: ${{ github.workflow_sha }}
shell: bash
run: |
set -euo pipefail
install -d -m 0700 "$DISPATCH_RECEIPT_DIR"
jq -n \
--arg actor "$ACTOR" \
--arg baseSha "$BASE_SHA" \
--arg candidateRepository "$CANDIDATE_REPOSITORY" \
--arg candidateSha "$CANDIDATE_SHA" \
--arg eventName "$EVENT_NAME" \
--arg jobs "$DISPATCH_JOBS" \
--arg prNumber "$PR_NUMBER" \
--arg repository "$REPOSITORY" \
--arg releaseQualificationWaivedJobs "$RELEASE_QUALIFICATION_WAIVED_JOBS" \
--arg releaseQualificationWaiverReason "$RELEASE_QUALIFICATION_WAIVER_REASON" \
--arg targets "$DISPATCH_TARGETS" \
--arg triggeringActor "$TRIGGERING_ACTOR" \
--arg workflowRunId "$RUN_ID" \
--arg workflowSha "$WORKFLOW_SHA" \
--argjson allowDgxSparkRunnerQueue "$ALLOW_DGX_SPARK_RUNNER_QUEUE" \
--argjson allowJetsonDispatch "$ALLOW_JETSON_DISPATCH" \
--argjson allowJetsonRunnerQueue "$ALLOW_JETSON_RUNNER_QUEUE" \
--argjson includeStagingBrevLaunchable "$INCLUDE_STAGING_BREV_LAUNCHABLE" \
--argjson workflowRunAttempt "$RUN_ATTEMPT" \
'{
kind: "nemoclaw-e2e-dispatch-v2",
actor: $actor,
repository: $repository,
prNumber: (if $prNumber == "" then null else ($prNumber | tonumber) end),
candidateRepository: $candidateRepository,
candidateSha: $candidateSha,
baseSha: $baseSha,
workflowSha: $workflowSha,
workflowRunId: $workflowRunId,
workflowRunAttempt: $workflowRunAttempt,
eventName: $eventName,
jobs: $jobs,
targets: $targets,
allowDgxSparkRunnerQueue: $allowDgxSparkRunnerQueue,
allowJetsonDispatch: $allowJetsonDispatch,
allowJetsonRunnerQueue: $allowJetsonRunnerQueue,
includeStagingBrevLaunchable: $includeStagingBrevLaunchable,
releaseQualificationWaivedJobs: (if $releaseQualificationWaivedJobs == "" then [] else ($releaseQualificationWaivedJobs | split(",")) end),
releaseQualificationWaiverReason: (if $releaseQualificationWaiverReason == "" then null else $releaseQualificationWaiverReason end),
triggeringActor: $triggeringActor,
emptySelectors: ($jobs == "" and $targets == "")
}' >"$DISPATCH_RECEIPT_DIR/dispatch.json"
- name: Upload trusted E2E dispatch receipt
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: NVIDIA/NemoClaw/.github/actions/upload-e2e-artifacts@7768e15eb90d3ee2d33432f481dfe8747e4f6d57
with:
name: e2e-dispatch-${{ github.run_id }}-${{ github.run_attempt }}
path: ${{ runner.temp }}/nemoclaw-e2e-dispatch/dispatch.json
- name: Authorize Launchable E2E maintainer dispatch
if: ${{ github.event_name == 'workflow_dispatch' && ((inputs.jobs == 'staging-brev-launchable' && inputs.targets == '') || (inputs.include_staging_brev_launchable && inputs.jobs == '' && inputs.targets == '')) }}
env:
ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ github.token }}
TRIGGERING_ACTOR: ${{ github.triggering_actor }}
shell: bash
run: |
set -euo pipefail
read_collaborator_permission() {
local maintainer="$1"
local attempt curl_exit failure http_status permission_file
permission_file="$(mktemp "${RUNNER_TEMP:-/tmp}/nemoclaw-collaborator-permission.XXXXXX")"
for attempt in 1 2 3; do
: >"$permission_file"
if http_status="$(curl --silent --proto '=https' --connect-timeout 10 --max-time 30 \
--output "$permission_file" --write-out "%{http_code}" \
--header "Authorization: Bearer ${GITHUB_TOKEN}" \
--header "Accept: application/vnd.github+json" \
--header "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/repos/${GITHUB_REPOSITORY}/collaborators/${maintainer}/permission" \
2>/dev/null)"; then
if [[ "$http_status" =~ ^2[0-9]{2}$ ]]; then
if jq -e 'type == "object" and (.user.login | type == "string") and (.role_name | type == "string")' "$permission_file" >/dev/null 2>&1; then
if (( attempt > 1 )); then
echo "::notice::Collaborator permission read passed after retry on attempt ${attempt}/3" >&2
fi
cat "$permission_file"
rm -f "$permission_file"
return 0
fi
echo "::error::Collaborator permission read attempt ${attempt}/3 failed: malformed response" >&2
rm -f "$permission_file"
return 1
fi
if [[ "$http_status" =~ ^[0-9]{3}$ ]]; then
failure="HTTP ${http_status}"
case "$http_status" in
408 | 429 | 5??) ;;
*) echo "::error::Collaborator permission read attempt ${attempt}/3 failed: ${failure}" >&2; rm -f "$permission_file"; return 1 ;;
esac
else
echo "::error::Collaborator permission read attempt ${attempt}/3 failed: invalid HTTP status" >&2
rm -f "$permission_file"
return 1
fi
else
curl_exit=$?
case "$curl_exit" in
5 | 6 | 7 | 16 | 18 | 28 | 35 | 52 | 55 | 56 | 92 | 95 | 96) failure="transport" ;;
*) echo "::error::Collaborator permission read attempt ${attempt}/3 failed: curl exit ${curl_exit}" >&2; rm -f "$permission_file"; return 1 ;;
esac
fi
if (( attempt == 3 )); then
echo "::error::Collaborator permission read exhausted after attempt ${attempt}/3: ${failure}" >&2
rm -f "$permission_file"
return 1
fi
echo "::warning::Collaborator permission read attempt ${attempt}/3 failed: ${failure}; retrying" >&2
sleep "$attempt"
done
}
require_maintainer() {
local maintainer="$1"
if [[ ! "$maintainer" =~ ^[A-Za-z0-9-]{1,39}$ || "$maintainer" == -* || "$maintainer" == *- ]]; then
echo "::error::Launchable E2E actor is invalid" >&2
exit 1
fi
local permission_json
permission_json="$(read_collaborator_permission "$maintainer")"
if [[ "$(jq -r '.user.login // ""' <<< "$permission_json" | tr '[:upper:]' '[:lower:]')" != "$(tr '[:upper:]' '[:lower:]' <<< "$maintainer")" ]]; then
echo "::error::Launchable E2E permission response did not match the actor" >&2
exit 1
fi
case "$(jq -r '.role_name // ""' <<< "$permission_json")" in
maintain | admin) ;;
*)
echo "::error::Launchable E2E requires a repository maintainer or administrator" >&2
exit 1
;;
esac
}
require_maintainer "$ACTOR"
if [[ "$(printf '%s' "$TRIGGERING_ACTOR" | tr '[:upper:]' '[:lower:]')" != "$(printf '%s' "$ACTOR" | tr '[:upper:]' '[:lower:]')" ]]; then
require_maintainer "$TRIGGERING_ACTOR"
fi
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
if: ${{ inputs.checkout_sha == '' || inputs.jobs != 'native-runtime-qualification-producer' || inputs.targets != '' }}
with:
repository: ${{ inputs.checkout_repository || github.repository }}
ref: ${{ inputs.checkout_sha || github.sha }}
fetch-depth: 0
persist-credentials: false
- name: Validate manual PR checkout
if: ${{ inputs.checkout_sha != '' && (inputs.jobs != 'native-runtime-qualification-producer' || inputs.targets != '') }}
env:
BASE_SHA: ${{ inputs.base_sha }}
CHECKOUT_REPOSITORY: ${{ inputs.checkout_repository }}
CHECKOUT_SHA: ${{ inputs.checkout_sha }}
GITHUB_TOKEN: ${{ github.token }}
PR_NUMBER: ${{ inputs.pr_number }}
shell: bash
run: |
set -euo pipefail
[[ "$(git rev-parse --verify HEAD)" == "$CHECKOUT_SHA" ]] || { echo "::error::checked-out commit does not match checkout_sha" >&2; exit 1; }
pull_json="$(curl --fail --silent --show-error --proto '=https' \
--header "Authorization: Bearer ${GITHUB_TOKEN}" \
--header "Accept: application/vnd.github+json" \
--header "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/repos/${GITHUB_REPOSITORY}/pulls/${PR_NUMBER}")"
[[ "$(jq -r '.state' <<< "$pull_json")" == "open" ]] || { echo "::error::pull request must still be open" >&2; exit 1; }
[[ "$(jq -r '.head.repo.full_name // ""' <<< "$pull_json")" == "$CHECKOUT_REPOSITORY" ]] || { echo "::error::checkout_repository changed before execution" >&2; exit 1; }
[[ "$(jq -r '.head.sha' <<< "$pull_json")" == "$CHECKOUT_SHA" ]] || { echo "::error::checkout_sha changed before execution" >&2; exit 1; }
[[ "$(jq -r '.base.sha' <<< "$pull_json")" == "$BASE_SHA" ]] || { echo "::error::base_sha changed before execution" >&2; exit 1; }
- id: e2e_credentials
name: Authorize E2E credentials
if: ${{ inputs.checkout_sha != '' && (inputs.jobs != 'native-runtime-qualification-producer' || inputs.targets != '') }}
env:
CHECKOUT_REPOSITORY: ${{ inputs.checkout_repository }}
CHECKOUT_SHA: ${{ inputs.checkout_sha }}
EVENT_NAME: ${{ github.event_name }}
EXPECTED_WORKFLOW_SHA: ${{ inputs.workflow_sha }}
REF: ${{ github.ref }}
WORKFLOW_REPOSITORY: ${{ github.repository }}
WORKFLOW_SHA: ${{ github.workflow_sha }}
shell: bash
run: |
set -euo pipefail
credentials_allowed=false
if [[ "$WORKFLOW_REPOSITORY" == "NVIDIA/NemoClaw" &&
"$CHECKOUT_REPOSITORY" == "$WORKFLOW_REPOSITORY" &&
"$EVENT_NAME" == "workflow_dispatch" &&
"$REF" == "refs/heads/main" &&
"$CHECKOUT_SHA" =~ ^[a-f0-9]{40}$ &&
"$WORKFLOW_SHA" =~ ^[a-f0-9]{40}$ &&
"$EXPECTED_WORKFLOW_SHA" == "$WORKFLOW_SHA" &&
"$(git rev-parse --verify HEAD)" == "$CHECKOUT_SHA" ]]; then
credentials_allowed=true
fi
printf 'allowed=%s\n' "$credentials_allowed" >> "$GITHUB_OUTPUT"
- name: Prepare E2E workspace
if: ${{ inputs.checkout_sha == '' || inputs.jobs != 'native-runtime-qualification-producer' || inputs.targets != '' }}
uses: NVIDIA/NemoClaw/.github/actions/prepare-e2e@f6304bc25fc35bfaa441c8c2fbfee38f72805a75
- id: package_cli_artifact
name: Package exact-commit CLI
if: ${{ inputs.checkout_sha == '' || inputs.jobs != 'native-runtime-qualification-producer' || inputs.targets != '' }}
env:
CANDIDATE_REPOSITORY: ${{ inputs.checkout_repository || github.repository }}
CANDIDATE_SHA: ${{ inputs.checkout_sha || github.sha }}
RUN_ATTEMPT: ${{ github.run_attempt }}
RUN_ID: ${{ github.run_id }}
WORKFLOW_SHA: ${{ github.workflow_sha }}
shell: bash
run: |
set -euo pipefail
[[ "$CANDIDATE_REPOSITORY" =~ ^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$ ]] ||
{ echo "::error::candidate repository is invalid"; exit 1; }
[[ "$CANDIDATE_SHA" =~ ^[a-f0-9]{40}$ ]] ||
{ echo "::error::candidate SHA must be a lowercase 40-character SHA"; exit 1; }
[[ "$WORKFLOW_SHA" =~ ^[a-f0-9]{40}$ ]] ||
{ echo "::error::workflow SHA must be a lowercase 40-character SHA"; exit 1; }
[[ "$(git rev-parse --verify HEAD)" == "$CANDIDATE_SHA" ]] ||
{ echo "::error::checked-out commit does not match the artifact candidate SHA"; exit 1; }
[[ "$RUN_ATTEMPT" =~ ^[1-9][0-9]*$ && "$RUN_ID" =~ ^[1-9][0-9]*$ ]] ||
{ echo "::error::workflow run identity is invalid"; exit 1; }
for required_file in dist/nemoclaw.js dist/build-identity.json; do
[[ -f "$required_file" && ! -L "$required_file" && -s "$required_file" ]] ||
{ echo "::error::candidate CLI build output is missing or is not a nonempty regular file: $required_file"; exit 1; }
done
for boundary in \
openshell-policy-boundary.cjs \
sandbox-name.cjs \
snapshot-sanitizer-boundary.cjs; do
boundary_path="nemoclaw/dist/shared/$boundary"
[[ -f "$boundary_path" && ! -L "$boundary_path" && -s "$boundary_path" ]] ||
{ echo "::error::candidate CLI build shared module is missing or is not a nonempty regular file: $boundary"; exit 1; }
done
jq -e --arg candidateSha "$CANDIDATE_SHA" '
type == "object" and
(keys | sort) == ["nemoclawVersion", "sourceRevision"] and
(.nemoclawVersion | strings | length > 0) and
.sourceRevision == $candidateSha
' dist/build-identity.json >/dev/null ||
{ echo "::error::candidate CLI build identity does not match the candidate commit SHA"; exit 1; }
artifact_dir="${RUNNER_TEMP}/nemoclaw-cli-artifact"
install -d -m 0700 "$artifact_dir"
payload="$artifact_dir/nemoclaw-cli.tar"
manifest="$artifact_dir/manifest.json"
tar \
--sort=name \
--mtime=@0 \
--owner=0 \
--group=0 \
--numeric-owner \
-cf "$payload" \
dist \
nemoclaw/dist/shared
payload_sha256="$(sha256sum "$payload" | awk '{print $1}')"
source_tree="$(git rev-parse 'HEAD^{tree}')"
lockfile_sha256="$(sha256sum package-lock.json | awk '{print $1}')"
node_version="$(node --version)"
npm_version="$(npm --version)"
artifact_name="nemoclaw-cli-${CANDIDATE_SHA}-${payload_sha256}"
jq -n \
--arg artifactName "$artifact_name" \
--arg buildCommand "npm run build:cli" \
--arg candidateRepository "$CANDIDATE_REPOSITORY" \
--arg candidateSha "$CANDIDATE_SHA" \
--arg lockfileSha256 "$lockfile_sha256" \
--arg nodeVersion "$node_version" \
--arg npmVersion "$npm_version" \
--arg payloadFile "nemoclaw-cli.tar" \
--arg payloadSha256 "$payload_sha256" \
--arg runAttempt "$RUN_ATTEMPT" \
--arg runId "$RUN_ID" \
--arg runnerArch "$RUNNER_ARCH" \
--arg runnerOs "$RUNNER_OS" \
--arg sourceTree "$source_tree" \
--arg workflowSha "$WORKFLOW_SHA" \
'{
kind: "nemoclaw-e2e-cli-artifact-v1",
artifactName: $artifactName,
candidate: {
repository: $candidateRepository,
sha: $candidateSha,
sourceTree: $sourceTree,
lockfileSha256: $lockfileSha256
},
workflow: {
sha: $workflowSha,
runId: $runId,
runAttempt: $runAttempt
},
toolchain: {
node: $nodeVersion,
npm: $npmVersion,
runnerOs: $runnerOs,
runnerArch: $runnerArch
},
build: {
command: $buildCommand,
sourceRevision: $candidateSha
},
payload: {
file: $payloadFile,
sha256: $payloadSha256
}
}' >"$manifest"
chmod 0600 "$manifest" "$payload"
printf 'artifact_name=%s\n' "$artifact_name" >>"$GITHUB_OUTPUT"
printf 'candidate_sha=%s\n' "$CANDIDATE_SHA" >>"$GITHUB_OUTPUT"
printf 'payload_sha256=%s\n' "$payload_sha256" >>"$GITHUB_OUTPUT"
- id: upload_cli_artifact
name: Publish content-addressed CLI artifact
if: ${{ inputs.checkout_sha == '' || inputs.jobs != 'native-runtime-qualification-producer' || inputs.targets != '' }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: ${{ steps.package_cli_artifact.outputs.artifact_name }}
path: ${{ runner.temp }}/nemoclaw-cli-artifact/
if-no-files-found: error
retention-days: 3
compression-level: 0
- id: record_cli_artifact
name: Record CLI artifact provenance
if: ${{ inputs.checkout_sha == '' || inputs.jobs != 'native-runtime-qualification-producer' || inputs.targets != '' }}
env:
ARTIFACT_DIGEST: ${{ steps.upload_cli_artifact.outputs.artifact-digest }}
ARTIFACT_ID: ${{ steps.upload_cli_artifact.outputs.artifact-id }}
ARTIFACT_NAME: ${{ steps.package_cli_artifact.outputs.artifact_name }}
CANDIDATE_REPOSITORY: ${{ inputs.checkout_repository || github.repository }}
CANDIDATE_SHA: ${{ steps.package_cli_artifact.outputs.candidate_sha }}
PAYLOAD_SHA256: ${{ steps.package_cli_artifact.outputs.payload_sha256 }}
RUN_ATTEMPT: ${{ github.run_attempt }}
RUN_ID: ${{ github.run_id }}
WORKFLOW_SHA: ${{ github.workflow_sha }}
shell: bash
run: |
set -euo pipefail
[[ "$ARTIFACT_ID" =~ ^[1-9][0-9]*$ ]] ||
{ echo "::error::artifact upload did not return an immutable artifact ID"; exit 1; }
[[ "$ARTIFACT_DIGEST" =~ ^[a-f0-9]{64}$ ]] ||
{ echo "::error::artifact upload did not return a SHA-256 digest"; exit 1; }
provenance="$(jq -cn \
--arg artifactDigest "$ARTIFACT_DIGEST" \
--arg artifactId "$ARTIFACT_ID" \
--arg artifactName "$ARTIFACT_NAME" \
--arg candidateRepository "$CANDIDATE_REPOSITORY" \
--arg candidateSha "$CANDIDATE_SHA" \
--arg payloadSha256 "$PAYLOAD_SHA256" \
--arg runAttempt "$RUN_ATTEMPT" \
--arg runId "$RUN_ID" \
--arg workflowSha "$WORKFLOW_SHA" \
'{
kind: "nemoclaw-e2e-cli-provenance-v1",
artifactDigest: $artifactDigest,
artifactId: $artifactId,
artifactName: $artifactName,
candidateRepository: $candidateRepository,
candidateSha: $candidateSha,
payloadSha256: $payloadSha256,
workflowSha: $workflowSha,
runId: $runId,
runAttempt: $runAttempt
}')"
printf 'provenance=%s\n' "$provenance" >>"$GITHUB_OUTPUT"
{
echo "## Exact-commit CLI artifact"
echo
echo "- Candidate: \`${CANDIDATE_SHA}\`"
echo "- Artifact: \`${ARTIFACT_NAME}\` (ID \`${ARTIFACT_ID}\`)"
echo "- GitHub archive digest: \`${ARTIFACT_DIGEST}\`"
echo "- Payload digest: \`${PAYLOAD_SHA256}\`"
} >>"$GITHUB_STEP_SUMMARY"
- id: matrix
name: Generate E2E target matrix
env:
CHECKOUT_SHA: ${{ inputs.checkout_sha }}
CONTROLLER_MATRIX: ${{ steps.controller_matrix.outputs.matrix }}
CONTROLLER_TEST_MATRIX: ${{ steps.controller_matrix.outputs.test_matrix }}
INFERENCE_MODE: ${{ inputs.inference_mode || 'mock' }}
JOBS: ${{ inputs.jobs }}
TARGETS: ${{ inputs.targets }}
EVENT_NAME: ${{ github.event_name }}
BEFORE_SHA: ${{ github.event.before }}
CANDIDATE_SHA: ${{ github.sha }}
RELEASE_QUALIFICATION_WAIVED_JOBS: ${{ inputs.release_qualification_waived_jobs }}
run: |
set -euo pipefail
if [[ "${JOBS:-}" == "native-runtime-qualification-producer" && -z "${TARGETS:-}" ]]; then
{
echo 'matrix=[]'
echo 'test_matrix=[]'
echo 'catalogue_standard_matrix=[]'
echo 'catalogue_nvidia_api_matrix=[]'
echo 'catalogue_nvidia_inference_matrix=[]'
echo 'catalogue_github_read_matrix=[]'
echo 'catalogue_brave_nvidia_inference_matrix=[]'
echo 'selected_jobs=["native-runtime-qualification-producer"]'
echo 'selected_workflow_jobs=["native-runtime-qualification-producer"]'
echo 'hermes_selected=false'
echo 'explicit_only_jobs=native-runtime-qualification-producer'
echo 'release_qualification_waived_jobs=[]'
echo 'release_required_jobs=[]'
} >>"$GITHUB_OUTPUT"
exit 0
fi
if [ "${EVENT_NAME:-}" = "push" ]; then
[[ "${BEFORE_SHA}" =~ ^[a-f0-9]{40}$ && "${CANDIDATE_SHA}" =~ ^[a-f0-9]{40}$ ]] || {
echo "::error::Main push E2E requires exact before and candidate commit SHAs" >&2
exit 1
}
CHANGED_FILES="$(git diff --name-only --diff-filter=ACMRD "${BEFORE_SHA}" "${CANDIDATE_SHA}")"
export CHANGED_FILES
fi
npx tsx tools/e2e/workflow-plan.mts --ci-output
if [ -n "${CHECKOUT_SHA}" ]; then
matrix="$(sed -n 's/^matrix=//p' "${GITHUB_OUTPUT}")"
expected_controller_matrix="$(jq -c 'map({id, runner}) | sort_by(.id)' <<< "${CONTROLLER_MATRIX}")"
actual_controller_matrix="$(jq -c 'map({id, runner}) | sort_by(.id)' <<< "${matrix}")"
test_matrix="$(sed -n 's/^test_matrix=//p' "${GITHUB_OUTPUT}")"
expected_controller_test_matrix="$(jq -c 'map({id, file, project}) | sort_by(.id)' <<< "${CONTROLLER_TEST_MATRIX}")"
actual_controller_test_matrix="$(jq -c 'map({id, file, project}) | sort_by(.id)' <<< "${test_matrix}")"
if [ "${actual_controller_matrix}" != "${expected_controller_matrix}" ] ||
[ "${actual_controller_test_matrix}" != "${expected_controller_test_matrix}" ]; then
: > "${GITHUB_OUTPUT}"
echo "::error::E2E planner matrix does not match controller-selected targets or shared tests" >&2
exit 1
fi
fi
native-runtime-qualification-producer-plan:
needs: generate-matrix
if: ${{ github.event_name == 'workflow_dispatch' && github.repository == 'NVIDIA/NemoClaw' && github.ref == 'refs/heads/main' && inputs.checkout_sha != '' && inputs.jobs == 'native-runtime-qualification-producer' && inputs.targets == '' }}
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
actions: read
contents: read
pull-requests: read
outputs:
matrix: ${{ steps.plan.outputs.matrix }}
steps:
- name: Check out the trusted qualification producer
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1