Repository navigation
2230 lines (2148 loc) · 108 KB
/
Copy pathtesting.yml
File metadata and controls
2230 lines (2148 loc) · 108 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
# Robonix full-stack testing — real Webots sim + real components + fake VLM.
#
# Runs on the self-hosted GPU runner (label `robonix-testing`). The selected
# GPU is configurable via workflow input, repository/org variable, or runner env.
# Cheap checks (fmt/clippy/build/unit)
# live in ci.yml on GitHub-hosted runners and gate every PR; THIS workflow is the
# heavy GPU testing job and is deliberately NOT exposed to untrusted PR code.
#
# ─────────────────────────── SECURITY (read first) ───────────────────────────
# A self-hosted runner executes whatever the triggering ref contains — and
# `rbnx build` runs each package's build.sh + Dockerfiles. So a fork PR that
# auto-ran here would be arbitrary code execution on our box. Controls:
#
# 1. Triggers below are TRUSTED ONLY: `push` to dev/main (already-merged =
# reviewed), manual `workflow_dispatch`, ChatOps `workflow_call`, and a
# narrow `pull_request_target` label gate. For direct PR auto-runs, the
# workflow source stays on the trusted base branch; the GPU job starts only
# after `safe-to-test` was added by admin/maintain and the current PR head
# has an admin/maintain APPROVED review.
# 2. Also turn ON in repo settings: Actions → Fork pull request workflows →
# "Require approval for all external contributors".
# 3. `permissions: contents: read` — the job gets a read-only GITHUB_TOKEN.
# The GPU testing job uses a FAKE VLM and needs NO real secrets; keep the runner
# secret-free. Do not add repo secrets to this workflow.
# 4. Run the runner as a DEDICATED unprivileged user (not a human account with
# SSH keys / access to other users' data), ideally with `--ephemeral`
# registration or each job in a throwaway container, so a compromised job
# can't persist or read neighbouring state.
# 5. Protect this file via CODEOWNERS so a PR can't weaken the gating.
name: Webots Integration Tests
on:
push:
branches: [dev, main, dev-ci-test]
workflow_dispatch:
inputs:
gpu_id:
description: "GPU index visible on the selected self-hosted runner; defaults to vars.ROBONIX_CI_GPU_ID or 0"
required: false
default: ""
pull_request_target:
types: [labeled, synchronize, reopened]
# Lets the ChatOps bot (ci-bot.yml) invoke this whole pipeline on an
# authorized `@robonix-ci test` comment and read back the result summary.
workflow_call:
inputs:
authorized:
description: "true when a trusted caller has already authorized the run"
type: boolean
required: false
default: false
ref:
description: "git ref to test (defaults to the triggering ref)"
type: string
required: false
pr_number:
description: "pull request number when invoked by ChatOps"
type: string
required: false
pr_title:
description: "pull request title when invoked by ChatOps"
type: string
required: false
pr_author:
description: "pull request author when invoked by ChatOps"
type: string
required: false
pr_url:
description: "pull request URL when invoked by ChatOps"
type: string
required: false
pr_head_ref:
description: "pull request head branch when invoked by ChatOps"
type: string
required: false
pr_base_ref:
description: "pull request base branch when invoked by ChatOps"
type: string
required: false
pr_head_repo:
description: "pull request head repository when invoked by ChatOps"
type: string
required: false
pr_head_sha:
description: "pull request head commit when invoked by ChatOps"
type: string
required: false
triggered_by:
description: "user who requested the ChatOps run"
type: string
required: false
enable_llm_analysis:
description: "true only for trusted ChatOps runs that should spend LLM credits"
type: boolean
required: false
default: false
gpu_id:
description: "GPU index visible on the selected self-hosted runner; defaults to vars.ROBONIX_CI_GPU_ID or 0"
type: string
required: false
secrets:
DEEPSEEK_API_KEY:
required: false
ROBONIX_REPORTS_DEPLOY_KEY:
required: false
outputs:
result:
description: "PASS/FAIL summary line from the harness"
value: ${{ jobs.gpu_testing.outputs.result }}
report_url:
description: "Published Pages URL for the generated Webots report"
value: ${{ jobs.publish_report.outputs.report_url }}
permissions:
contents: read
issues: read
pull-requests: read
jobs:
# ── Gate 1: cheap, GitHub-hosted, untrusted-safe ──────────────────────────
# Scans the ref for forbidden high-risk operations BEFORE anything runs on the
# self-hosted GPU box. gpu_testing `needs:` this, so a dirty diff never reaches the
# 5090 — and because it runs on push(dev/main) too, it gates merged code as
# well. No `environment:` here, so it never blocks normal contributor CI.
security-gate:
name: Preflight security checks
runs-on: ubuntu-22.04
outputs:
safe_to_test_authorized: ${{ steps.safe_to_test.outputs.authorized }}
safe_to_test_labeler: ${{ steps.safe_to_test.outputs.labeler }}
safe_to_test_permission: ${{ steps.safe_to_test.outputs.permission }}
pr_review_approved: ${{ steps.pr_review.outputs.approved }}
pr_review_approver: ${{ steps.pr_review.outputs.approver }}
pr_review_permission: ${{ steps.pr_review.outputs.permission }}
steps:
- name: Authorize safe-to-test label
id: safe_to_test
uses: actions/github-script@v7
with:
script: |
if (context.eventName !== 'pull_request_target') {
core.setOutput('authorized', 'true');
core.setOutput('labeler', 'trusted-event');
core.setOutput('permission', 'trusted-event');
return;
}
const pr = context.payload.pull_request;
const labels = (pr.labels || []).map(l => l.name);
if (!labels.includes('safe-to-test')) {
core.setOutput('authorized', 'false');
core.setOutput('labeler', '');
core.setOutput('permission', 'none');
core.notice('safe-to-test label is absent; GPU test will be skipped');
return;
}
const events = await github.paginate(github.rest.issues.listEventsForTimeline, {
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pr.number,
per_page: 100,
});
const labeled = [...events].reverse().find(e =>
e.event === 'labeled' && e.label && e.label.name === 'safe-to-test' && e.actor && e.actor.login
);
const labeler = labeled?.actor?.login || '';
let permission = 'none';
if (labeler) {
try {
const r = await github.rest.repos.getCollaboratorPermissionLevel({
owner: context.repo.owner, repo: context.repo.repo, username: labeler,
});
permission = r.data.permission || 'none';
} catch (e) {
core.notice(`could not resolve repo permission for safe-to-test labeler @${labeler}: ${e.message}`);
}
}
const authorized = ['admin', 'maintain'].includes(permission);
core.setOutput('authorized', String(authorized));
core.setOutput('labeler', labeler);
core.setOutput('permission', permission);
if (!authorized) {
core.notice(`safe-to-test was added by @${labeler || 'unknown'} with permission '${permission}', so GPU test will be skipped`);
}
- name: Require maintainer approval for PR Webots testing
id: pr_review
uses: actions/github-script@v7
env:
# ChatOps (`workflow_call`) already resolved and froze the PR head at
# its own authorization gate; reuse that value instead of re-reading
# the live head here. Re-reading would reopen a time-of-check /
# time-of-use window in which the PR author can push a new commit
# between authorization and the approval match below.
PR_NUMBER: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.number || inputs.pr_number || '' }}
PR_HEAD_SHA: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || inputs.pr_head_sha || '' }}
with:
script: |
const prNumber = process.env.PR_NUMBER;
if (!prNumber) {
core.setOutput('approved', 'true');
core.setOutput('approver', 'trusted-event');
core.setOutput('permission', 'trusted-event');
return;
}
let headSha = process.env.PR_HEAD_SHA || '';
if (!headSha) {
const pr = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: Number(prNumber),
});
headSha = pr.data.head.sha || '';
}
const reviews = await github.paginate(github.rest.pulls.listReviews, {
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: Number(prNumber),
per_page: 100,
});
const approved = [...reviews].reverse().filter(r =>
r.state === 'APPROVED' && (!headSha || r.commit_id === headSha) && r.user && r.user.login
);
for (const review of approved) {
const username = review.user.login;
let permission = 'none';
try {
const r = await github.rest.repos.getCollaboratorPermissionLevel({
owner: context.repo.owner,
repo: context.repo.repo,
username,
});
permission = r.data.permission || 'none';
} catch (e) {
core.notice(`could not resolve repo permission for approver @${username}: ${e.message}`);
}
if (['admin', 'maintain'].includes(permission)) {
core.setOutput('approved', 'true');
core.setOutput('approver', username);
core.setOutput('permission', permission);
return;
}
}
core.setOutput('approved', 'false');
core.setOutput('approver', '');
core.setOutput('permission', 'none');
core.notice(`PR #${prNumber} has no current-head APPROVED review from an admin/maintain user; Webots GPU test will be skipped`);
- uses: actions/checkout@v4
with:
# For PR tests, checkout the current base branch first; the next
# step merges the PR head locally so stale refs/pull/*/merge refs
# cannot make CI test an old base.
ref: ${{ (inputs.pr_number != '' || github.event_name == 'pull_request_target') && (inputs.pr_base_ref || github.event.pull_request.base.ref || github.event.repository.default_branch) || inputs.ref }}
fetch-depth: ${{ (inputs.pr_number != '' || github.event_name == 'pull_request_target') && '0' || '1' }}
- name: Merge PR head into current base
if: ${{ inputs.pr_number != '' || github.event_name == 'pull_request_target' }}
env:
TEST_PR_NUMBER: ${{ inputs.pr_number || github.event.pull_request.number }}
run: |
set -euo pipefail
git fetch --no-tags --prune origin \
"+refs/pull/${TEST_PR_NUMBER}/head:refs/remotes/robonix-pr/${TEST_PR_NUMBER}/head"
git -c user.name=github-actions[bot] \
-c user.email=41898282+github-actions[bot]@users.noreply.github.com \
merge --no-edit --no-ff "refs/remotes/robonix-pr/${TEST_PR_NUMBER}/head"
git log -1 --oneline
- name: Scan executable build and runtime files
run: |
set -euo pipefail
# Patterns that must never execute on the shared GPU host. We scan the
# code that actually RUNS on the self-hosted runner — package build.sh,
# Dockerfiles, and Python drivers — NOT the workflow YAML (it defines
# these very patterns, would self-match, and is CODEOWNERS-protected)
# and NOT docs/markdown (TROUBLESHOOTING.md lists them as red lines).
# Red lines: GPU destruction, reverse shells, obfuscated shell payloads,
# and pipe-to-shell downloads in files that can run during package build
# or provider startup. Use tracked files only; generated rbnx-build,
# target, and venv trees are not part of the review surface.
PAT='nvidia-smi[^|]*(--gpu-reset|--reset|(^| )-r( |$))|rmmod[[:space:]]+nvidia|modprobe[[:space:]]+nvidia|/dev/tcp/|[^a-z]nc[[:space:]]+.*-e[[:space:]]|base64[[:space:]]+-d[^|]*\|[^|]*sh|(curl|wget)[^|]*\|[[:space:]]*(sudo[[:space:]]+)?(ba)?sh'
git ls-files \
'examples/webots/**' 'services/**' 'system/**' 'capabilities/**' 'tools/**' \
| grep -E '(\.sh|\.py|(^|/)Dockerfile[^/]*)$' > "$RUNNER_TEMP/forbidden-scan-files" || true
if [ -s "$RUNNER_TEMP/forbidden-scan-files" ] &&
xargs -r grep -nE "$PAT" < "$RUNNER_TEMP/forbidden-scan-files"; then
echo "::error::forbidden high-risk pattern — needs manual maintainer review"; exit 1
fi
echo "forbidden-operation scan clean"
- name: Scan for committed secrets
run: |
set -euo pipefail
# ChatOps PR tests need full git history for local merge-base
# resolution. Never scan .git history here; scan only tracked files
# from the merged working tree that will actually run.
scan_dir="$RUNNER_TEMP/gitleaks-tree"
rm -rf "$scan_dir"
mkdir -p "$scan_dir"
while IFS= read -r -d '' f; do
mkdir -p "$scan_dir/$(dirname "$f")"
cp -a "$f" "$scan_dir/$f"
done < <(git ls-files -z)
docker run --rm -v "$scan_dir:/repo:ro" zricethezav/gitleaks:latest \
dir /repo --no-banner --redact \
|| { echo "::error::possible secret in checked-out tree"; exit 1; }
# ── Gate 2: the GPU testing job itself ────────────────────────────────────
gpu_testing:
name: Webots integration suite (${{ matrix.backend }})
needs: security-gate
# Scene has two perception backends and both ship, so both run the full
# suite. The legs run one after another: the concurrency group below keeps
# a single pending job, so a second leg queued behind the first would
# cancel it.
strategy:
fail-fast: false
max-parallel: 1
matrix:
include:
- backend: concept_graphs
key: cg
- backend: dualmap
key: dm
concurrency:
group: robonix-webots-gpu-${{ inputs.gpu_id || vars.ROBONIX_CI_GPU_ID || '0' }}
cancel-in-progress: false
outputs:
result: ${{ steps.scenarios.outputs.result }}
# Optional per-run manual approval: configure the `gpu-testing` Environment
# with Required reviewers in repo settings if we want GitHub to pause this
# job before it is assigned to the self-hosted runner.
environment: gpu-testing
# Belt-and-suspenders: direct safe-to-test PR auto-runs require current-head
# approval by admin/maintain. ChatOps callers are authorized separately in
# ci-bot.yml and do not require PR approval.
if: >-
inputs.authorized == true ||
github.event_name == 'push' ||
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'pull_request_target' &&
needs.security-gate.outputs.safe_to_test_authorized == 'true' &&
needs.security-gate.outputs.pr_review_approved == 'true')
runs-on: [self-hosted, robonix-testing]
timeout-minutes: 90
env:
# ── Build-env fixes for this box (see examples/webots/TROUBLESHOOTING.md) ──
# Prefer the GitHub mirror, but fall back to GitHub through the runner's
# loopback Clash proxy when the mirror is unavailable.
GIT_MIRROR_INSTEADOF: "true"
# codegen grpcio-tools MUST match the runtime grpcio pinned by packages
# (1.80.0) or RegisterService fails with a version-skew error.
GRPCIO_PIN: "1.80.0"
# ── Per-run isolation (coexist with interactive users on the shared box) ──
RUN_ID: "${{ github.run_id }}"
RUN_ATTEMPT: "${{ github.run_attempt }}"
RUN_KEY: "${{ github.run_id }}-${{ github.run_attempt }}-${{ matrix.key }}"
# GPU selection is runner-specific. Priority:
# workflow_call input -> repo/org variable -> runner env -> default GPU 0.
ROBONIX_CI_GPU_ID_INPUT: ${{ inputs.gpu_id || '' }}
ROBONIX_CI_GPU_ID_VAR: ${{ vars.ROBONIX_CI_GPU_ID || '' }}
ROBONIX_CI_MIN_GPU_FREE_MIB: ${{ vars.ROBONIX_CI_MIN_GPU_FREE_MIB || '4096' }}
RMW_IMPLEMENTATION: "rmw_zenoh_cpp"
ROBONIX_DRIVER_INIT_TIMEOUT_S: "240"
AUDIO_MIC_DEVICE: "null"
AUDIO_SPEAKER_DEVICE: "null"
# CI should not depend on external Tencent/FunASR credentials or quota.
SPEECH_BACKEND: "mock"
# Keep build-time ECAPA verification off the GPU reserved for Webots and Scene.
VOICEPRINT_DEVICE: "cpu"
SCENE_GRAPH_INTERVAL_SEC: "1"
SCENE_GRAPH_MIN_OBSERVATIONS: "1"
ROBONIX_SIM_NETWORK: "bridge"
ROBONIX_SIM_IPC: "private"
WEBOTS_HEADLESS_MODE: "nvidia"
WEBOTS_STREAM: "1"
ROBONIX_SIM_PRIVILEGED: "true"
# Named explicitly so a missing or stale image fails the run instead of
# quietly falling back to the other backend.
SCENE_PERCEPTION_BACKEND: ${{ matrix.backend }}
steps:
- name: Configure network egress policy
uses: step-security/harden-runner@v2
with:
# Start in 'audit' to learn the real egress set from the first runs,
# then switch to 'block' and trim allowed-endpoints to exactly these.
egress-policy: audit
# disable-telemetry: true
allowed-endpoints: >
ghfast.top:443
github.com:443
objects.githubusercontent.com:443
pypi.org:443
files.pythonhosted.org:443
pypi.tuna.tsinghua.edu.cn:443
www.modelscope.cn:443
modelscope.cn:443
registry-1.docker.io:443
auth.docker.io:443
production.cloudflare.docker.com:443
- name: Initialize current-run diagnostics
run: |
set -euo pipefail
case "${GITHUB_WORKSPACE:-}" in
/home/*/*/_work/*/*) ;;
*) echo "::error::refusing to sanitize unexpected workspace: ${GITHUB_WORKSPACE:-<unset>}"; exit 1 ;;
esac
# The capacity gate deliberately runs before checkout. Self-hosted
# workspaces persist between jobs, so remove only generated evidence
# from the previous run before a pre-checkout failure can upload it.
for relative in \
testing/logs \
testing/report \
examples/webots/rbnx-boot/logs \
examples/webots/rbnx-boot/processes.json \
examples/webots/logs \
system/scene/logs; do
target="$GITHUB_WORKSPACE/$relative"
[ -e "$target" ] || continue
sudo -n chown -R "$(id -u):$(id -g)" "$target" 2>/dev/null || true
rm -rf -- "$target"
# Containers in this suite run as root and leave root-owned
# evidence behind (the Soma runtime bind mount, driver logs).
# Runners without passwordless sudo cannot chown that back, which
# jams every later run at this step. Docker is a hard dependency of
# the suite, so reclaim ownership through a throwaway container.
if [ -e "$target" ]; then
docker run --rm -v "$target":/reclaim busybox \
chown -R "$(id -u):$(id -g)" /reclaim >/dev/null 2>&1 || true
rm -rf -- "$target"
fi
if [ -e "$target" ]; then
echo "::error::could not remove stale generated evidence: $target"
exit 1
fi
done
for target in \
"$RUNNER_TEMP/sim-logs" \
"$RUNNER_TEMP/lifecycle-logs" \
"$RUNNER_TEMP/report-assets" \
"$RUNNER_TEMP/cache-provider-logs" \
"$RUNNER_TEMP/report-metadata.json" \
"$RUNNER_TEMP/remote-provenance.txt" \
"$RUNNER_TEMP/fake_vlm.log" \
"$RUNNER_TEMP/rbnx-boot.log" \
"$RUNNER_TEMP/lifecycle.out" \
"$RUNNER_TEMP/scenarios.out" \
"$RUNNER_TEMP/scenarios.restart.out"; do
[ -e "$target" ] || continue
sudo -n chown -R "$(id -u):$(id -g)" "$target" 2>/dev/null || true
rm -rf -- "$target"
done
mkdir -p "$RUNNER_TEMP/sim-logs"
printf 'Webots suite has not started for run %s attempt %s.\n' \
"$RUN_ID" "$RUN_ATTEMPT" \
>"$RUNNER_TEMP/sim-logs/infrastructure.txt"
{
echo "ROBONIX_CI_CHECKOUT_READY=false"
echo "ROBONIX_CI_ISOLATION_READY=false"
} >> "$GITHUB_ENV"
- name: Select runner GPU
run: |
set -euo pipefail
gpu_id="${ROBONIX_CI_GPU_ID_INPUT:-${ROBONIX_CI_GPU_ID_VAR:-${ROBONIX_CI_GPU_ID:-${CUDA_VISIBLE_DEVICES:-${ROBONIX_GPU_ID:-0}}}}}"
if [ -z "$gpu_id" ]; then
gpu_id=0
fi
case "$gpu_id" in
''|*[!0-9]*) echo "::error::ROBONIX_CI_GPU_ID must be a numeric GPU index, got '$gpu_id'"; exit 1 ;;
esac
if ! nvidia-smi --query-gpu=index --format=csv,noheader,nounits | awk '{print $1}' | grep -Fxq "$gpu_id"; then
echo "::error::selected GPU index $gpu_id is not present on this runner"
nvidia-smi --query-gpu=index,name,memory.used,memory.total --format=csv,noheader,nounits || true
exit 1
fi
{
echo "ROBONIX_CI_GPU_ID=$gpu_id"
echo "CUDA_VISIBLE_DEVICES=$gpu_id"
echo "ROBONIX_GPU_ID=$gpu_id"
echo "NVIDIA_VISIBLE_DEVICES=$gpu_id"
} >> "$GITHUB_ENV"
- name: Verify GPU health
run: |
# NEVER nvidia-smi --gpu-reset / rmmod / driver writes (RTX 5090 GSP
# fragility). Read-only check; a dirty GPU is an infra failure, not a
# test failure — bail and let a human recover.
nvidia-smi -q >/dev/null || { echo "::error::nvidia-smi unhealthy"; exit 1; }
if dmesg 2>/dev/null | grep -qi 'NVRM: Xid'; then
echo "::warning::Xid in dmesg — GPU may be degraded"; fi
- name: Remove containers left by an interrupted run
run: |
set -euo pipefail
# A runner killed mid-job never reaches its own cleanup, and its
# containers keep the GPU, so the next run fails the capacity check.
# This runner takes one job at a time and this step runs before this
# job starts anything, so every ci-* resource here belongs to a job
# that is no longer running.
docker ps -aq --filter "name=^ci-" | xargs -r docker rm -f
docker images --format '{{.Repository}}:{{.Tag}}' | grep '^ci-' | xargs -r docker rmi || true
docker volume ls -q | grep '^ci-' | xargs -r docker volume rm || true
docker network ls --format '{{.Name}}' | grep '^ci-' | xargs -r docker network rm || true
- name: Wait for runner GPU capacity
run: |
set -euo pipefail
case "${ROBONIX_CI_MIN_GPU_FREE_MIB}" in
''|*[!0-9]*) echo "::error::ROBONIX_CI_MIN_GPU_FREE_MIB must be an integer"; exit 1 ;;
esac
free_mib=0
for attempt in $(seq 1 30); do
free_mib="$(nvidia-smi --id="${ROBONIX_CI_GPU_ID}" --query-gpu=memory.free --format=csv,noheader,nounits | head -1 | tr -d ' ')"
case "$free_mib" in ''|*[!0-9]*) free_mib=0 ;; esac
if [ "$free_mib" -ge "$ROBONIX_CI_MIN_GPU_FREE_MIB" ]; then
echo "runner GPU ${ROBONIX_CI_GPU_ID} ready: ${free_mib} MiB free"
break
fi
echo "runner GPU ${ROBONIX_CI_GPU_ID} busy: ${free_mib} MiB free; waiting (${attempt}/30)"
sleep 10
done
if [ "$free_mib" -lt "$ROBONIX_CI_MIN_GPU_FREE_MIB" ]; then
echo "::error title=Runner GPU unavailable::GPU ${ROBONIX_CI_GPU_ID} has ${free_mib} MiB free; ${ROBONIX_CI_MIN_GPU_FREE_MIB} MiB is required"
printf 'Runner GPU capacity gate failed before checkout: GPU %s has %s MiB free; %s MiB is required.\n' \
"$ROBONIX_CI_GPU_ID" "$free_mib" "$ROBONIX_CI_MIN_GPU_FREE_MIB" \
>"$RUNNER_TEMP/sim-logs/infrastructure.txt"
nvidia-smi --query-compute-apps=pid,process_name,used_memory --format=csv,noheader || true
exit 1
fi
- name: Reset runner workspace
run: |
set -euo pipefail
case "${GITHUB_WORKSPACE:-}" in
/home/*/*/_work/*/*) ;;
*) echo "::error::refusing to reset unexpected workspace: ${GITHUB_WORKSPACE:-<unset>}"; exit 1 ;;
esac
mkdir -p "$GITHUB_WORKSPACE"
sudo -n chown -R "$(id -u):$(id -g)" "$GITHUB_WORKSPACE" 2>/dev/null || true
if ! find "$GITHUB_WORKSPACE" -mindepth 1 -maxdepth 1 -exec rm -rf -- {} + 2>/dev/null; then
if ! docker image inspect busybox:latest >/dev/null 2>&1; then
echo "::error::workspace has non-removable residue and busybox:latest is unavailable"
exit 1
fi
timeout 60s docker run --rm --network none \
-v "$GITHUB_WORKSPACE:$GITHUB_WORKSPACE:rw" \
-w "$GITHUB_WORKSPACE" \
busybox:latest sh -c 'find . -mindepth 1 -maxdepth 1 -exec rm -rf -- {} +'
fi
- name: Configure Git mirror for checkout
if: env.GIT_MIRROR_INSTEADOF == 'true'
run: |
set -euo pipefail
# Keep all routing scoped to this Actions job. The runner is also a
# developer workstation, so CI must not mutate ~/.gitconfig.
git_config="$RUNNER_TEMP/robonix-ci-gitconfig"
: > "$git_config"
# The runner service inherited HTTP_PROXY=127.0.0.1:9981 from a
# macOS-forwarding config that was disabled on 2026-08-10. The
# listener is still up but forwards nothing, so every clone since has
# died with `GnuTLS, handshake failed` — an error that names TLS and
# hides the fact that the proxy is a dead end. Drop the inherited
# values for this job so the routing decided below is the one that
# applies.
for stale in HTTP_PROXY HTTPS_PROXY ALL_PROXY http_proxy https_proxy all_proxy; do
printf '%s=\n' "$stale" >> "$GITHUB_ENV"
done
unset HTTP_PROXY HTTPS_PROXY ALL_PROXY http_proxy https_proxy all_proxy
if timeout 15s git ls-remote --exit-code \
"https://ghfast.top/https://github.com/syswonder/robonix.git" \
HEAD >/dev/null 2>&1; then
git config --file "$git_config" \
url."https://ghfast.top/https://github.com/".insteadOf \
"https://github.com/"
echo "Using ghfast.top for GitHub clones"
elif proxy_ok=0
# Clash on this runner drops out for stretches at a time. Both
# other routes are hard-blocked here — a direct clone and
# ghfast.top both come back "Connection reset by peer" — so the
# proxy is the only way out and a single failed probe is worth
# waiting on rather than treating as absent.
for attempt in 1 2 3 4 5 6; do
if timeout 20s git -c 'http.https://github.com/.proxy=http://127.0.0.1:7897' \
ls-remote --exit-code "https://github.com/syswonder/robonix.git" \
HEAD >/dev/null 2>&1; then
proxy_ok=1; break
fi
echo "Clash probe $attempt/6 failed; retrying in 10s"
sleep 10
done
[ "$proxy_ok" = 1 ]; then
git config --file "$git_config" \
'http.https://github.com/.proxy' \
'http://127.0.0.1:7897'
echo "ghfast.top unavailable; using GitHub through Clash at 127.0.0.1:7897"
else
# Both routes are gone. Pointing git at a proxy that is not
# listening is worse than not setting one: every clone dies with a
# GnuTLS handshake failure against a closed port, which reads like
# a TLS problem rather than a missing proxy. Leave git alone and
# let it reach github.com directly; if that also fails the error
# will at least name the real cause.
echo "ghfast.top unavailable and no proxy on 127.0.0.1:7897; going direct"
fi
echo "GIT_CONFIG_GLOBAL=$git_config" >> "$GITHUB_ENV"
- uses: actions/checkout@v4
with:
ref: ${{ inputs.pr_number != '' && (inputs.pr_base_ref || github.event.repository.default_branch) || inputs.ref }}
fetch-depth: ${{ inputs.pr_number != '' && '0' || '1' }}
- name: Mark checkout ready
run: echo "ROBONIX_CI_CHECKOUT_READY=true" >> "$GITHUB_ENV"
- name: Merge PR head into current base
if: ${{ inputs.pr_number != '' }}
run: |
set -euo pipefail
git fetch --no-tags --prune origin \
"+refs/pull/${{ inputs.pr_number }}/head:refs/remotes/robonix-pr/${{ inputs.pr_number }}/head"
git -c user.name=github-actions[bot] \
-c user.email=41898282+github-actions[bot]@users.noreply.github.com \
merge --no-edit --no-ff "refs/remotes/robonix-pr/${{ inputs.pr_number }}/head"
git log -1 --oneline
- name: Initialize submodules
run: |
set -euo pipefail
git submodule sync --recursive
git submodule update --init --recursive
- name: Configure run isolation
run: |
set -euo pipefail
base_suffix=$((RUN_ID % 1000))
suffix=""
xdisplay=""
port_is_listening() {
ss -ltn "sport = :$1" | grep -q LISTEN
}
xdisplay_has_live_server() {
ps -eo pid=,args= | awk -v d=":$1" '$0 ~ /(Xorg|Xvfb)/ && index($0, d) {found=1} END {exit found ? 0 : 1}'
}
remove_stale_x_socket() {
display="$1"
socket="/tmp/.X11-unix/X${display}"
[ -S "$socket" ] || return 0
if xdisplay_has_live_server "$display"; then
return 1
fi
echo "removing stale per-run X socket: $socket"
rm -f "$socket" 2>/dev/null || sudo -n rm -f "$socket" 2>/dev/null || true
if [ -S "$socket" ] && docker image inspect busybox:latest >/dev/null 2>&1; then
timeout 10s docker run --rm --network none -v /tmp/.X11-unix:/tmp/.X11-unix:rw busybox:latest rm -f "$socket" >/dev/null 2>&1 || true
fi
[ ! -S "$socket" ]
}
for offset in $(seq 0 199); do
candidate_suffix=$(((base_suffix + offset) % 1000))
candidate_xdisplay=$((1000 + candidate_suffix))
candidate_ports=(
$((19000 + candidate_suffix))
$((20000 + candidate_suffix))
$((21000 + candidate_suffix))
$((22000 + candidate_suffix))
$((18000 + candidate_suffix))
$((23000 + candidate_suffix))
$((24000 + candidate_suffix))
$((25000 + candidate_suffix))
$((26000 + candidate_suffix))
$((27000 + candidate_suffix))
$((28000 + candidate_suffix))
)
busy=0
for port in "${candidate_ports[@]}"; do
if port_is_listening "$port"; then
busy=1
break
fi
done
[ "$busy" -eq 0 ] || continue
if [ -S "/tmp/.X11-unix/X${candidate_xdisplay}" ] && ! remove_stale_x_socket "$candidate_xdisplay"; then
continue
fi
suffix="$candidate_suffix"
xdisplay="$candidate_xdisplay"
break
done
if [ -z "$suffix" ] || [ -z "$xdisplay" ]; then
echo "::error::could not find an unused per-run port/display slot from base suffix $base_suffix"
exit 1
fi
atlas_port=$((19000 + suffix))
executor_port=$((20000 + suffix))
pilot_port=$((21000 + suffix))
liaison_port=$((22000 + suffix))
fake_vlm_port=$((18000 + suffix))
stream_port=$((23000 + suffix))
viewer_port=$((24000 + suffix))
mapping_port=$((25000 + suffix))
nav2_port=$((26000 + suffix))
scene_web_port=$((27000 + suffix))
soma_port=$((28000 + suffix))
ros_domain_id=$((90 + (suffix % 100)))
runtime_dir="$RUNNER_TEMP/robonix-ci-${RUN_KEY}"
rm -rf "$runtime_dir"
mkdir -p "$runtime_dir"
echo "run isolation slot: suffix=${suffix} xdisplay=:${xdisplay} ports=${fake_vlm_port},${atlas_port},${executor_port},${pilot_port},${liaison_port},${stream_port},${viewer_port},${mapping_port},${nav2_port},${scene_web_port},${soma_port} ros_domain_id=${ros_domain_id} runtime_dir=${runtime_dir}"
{
echo "ATLAS_PORT=$atlas_port"
echo "EXECUTOR_PORT=$executor_port"
echo "PILOT_PORT=$pilot_port"
echo "LIAISON_PORT=$liaison_port"
echo "SOMA_PORT=$soma_port"
echo "FAKE_VLM_PORT=$fake_vlm_port"
echo "MAPPING_GRPC_PORT=$mapping_port"
echo "NAV2_DRIVER_PORT=$nav2_port"
echo "SCENE_WEB_PORT=$scene_web_port"
echo "ROBONIX_CI_ATLAS=127.0.0.1:$atlas_port"
echo "ROBONIX_ATLAS=127.0.0.1:$atlas_port"
echo "ROBONIX_SIM_STREAM_PORT=$stream_port"
echo "ROBONIX_SIM_VIEWER_PORT=$viewer_port"
echo "ROBONIX_SIM_CONTAINER=ci-${RUN_KEY}-sim"
echo "ROBONIX_SIM_PROJECT=ci-${RUN_KEY}"
echo "ROBONIX_SIM_XDISPLAY=:$xdisplay"
echo "ROBONIX_WEBOTS_CACHE_VOLUME=robonix_ci_webots_cache"
echo "ROBONIX_MAPPING_CONTAINER=ci-${RUN_KEY}-mapping"
echo "ROBONIX_NAV2_CONTAINER=ci-${RUN_KEY}-nav2"
echo "ROBONIX_EXPLORE_CONTAINER=ci-${RUN_KEY}-explore"
echo "ROBONIX_SCENE_CONTAINER=ci-${RUN_KEY}-scene"
echo "ROBONIX_CI_RUNTIME_DIR=$runtime_dir"
echo "AGENT_MEMORY_DIR=$runtime_dir/agent_memory"
echo "AGENT_MILVUS_URI=$runtime_dir/agent_milvus.db"
echo "MAPPING_MAPS_DIR=$runtime_dir/mapping-maps"
echo "SCENE_DATA_DIR=$runtime_dir/scene-data"
echo "ROS_DOMAIN_ID=$ros_domain_id"
echo "ROBONIX_DRIVER_INIT_TIMEOUT_S=${ROBONIX_DRIVER_INIT_TIMEOUT_S}"
echo "ROBONIX_GPU_ID=${ROBONIX_GPU_ID}"
echo "NVIDIA_VISIBLE_DEVICES=${NVIDIA_VISIBLE_DEVICES}"
echo "ROBONIX_MODEL_CACHE_DIR=${RUNNER_TOOL_CACHE:-$HOME/.cache}/robonix-models"
echo "RBNX_MODEL_DOWNLOAD_MAX_TIME=600"
echo "RBNX_MODEL_DOWNLOAD_CONNECT_TIMEOUT=20"
echo "RBNX_MODEL_DOWNLOAD_RETRIES=2"
echo "ROBONIX_CI_ISOLATION_READY=true"
} >> "$GITHUB_ENV"
mkdir -p "${RUNNER_TOOL_CACHE:-$HOME/.cache}/robonix-models"
- name: Configure toolchain and workspace
run: |
set -euo pipefail
python3 -m venv "$ROBONIX_CI_RUNTIME_DIR/venv"
export ROBONIX_HOME="$ROBONIX_CI_RUNTIME_DIR/robonix-home"
mkdir -p "$ROBONIX_HOME"
echo "ROBONIX_HOME=$ROBONIX_HOME" >> "$GITHUB_ENV"
export PATH="$ROBONIX_CI_RUNTIME_DIR/venv/bin:$HOME/.local/bin:$PATH"
echo "$ROBONIX_CI_RUNTIME_DIR/venv/bin" >> "$GITHUB_PATH"
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
command -v uv >/dev/null || curl -LsSf https://astral.sh/uv/install.sh | sh
# codegen tools pinned to the runtime grpcio version. Install them in
# a per-job venv so Debian/Ubuntu PEP 668 system Python remains intact.
python3 -m pip install "grpcio-tools==${GRPCIO_PIN}" "grpcio==${GRPCIO_PIN}"
# testing harness (fake VLM + scenario runner) parses YAML scenarios.
python3 -m pip install pyyaml
# Build and use binaries from THIS checkout. Do not mutate or trust the
# runner user's ~/.cargo/bin; this is a shared Webots host.
cargo build --workspace
echo "$PWD/target/debug" >> "$GITHUB_PATH"
echo "ROBONIX_CODEGEN_BIN=$PWD/target/debug/robonix-codegen" >> "$GITHUB_ENV"
"$PWD/target/debug/rbnx" setup "$PWD"
- name: Validate scenario harness
run: |
set -euo pipefail
python3 testing/simulate_ci.py
- name: Build Webots deployment
working-directory: examples/webots
run: |
set -euo pipefail
mkdir -p "$RUNNER_TEMP/sim-logs"
rbnx build 2>&1 | tee "$RUNNER_TEMP/sim-logs/build-webots-deployment.log"
# provenance: record exactly which upstream commit each remote built from
for d in rbnx-boot/cache/*/; do
[ -d "$d/.git" ] && echo "$(basename "$d") @ $(git -C "$d" rev-parse --short HEAD) $(git -C "$d" log -1 --format=%s)"
done | tee "$RUNNER_TEMP/remote-provenance.txt"
- name: Prepare scene image for ${{ matrix.backend }}
run: |
set -euo pipefail
if [ "$SCENE_PERCEPTION_BACKEND" = "concept_graphs" ]; then
echo "ROBONIX_SCENE_IMAGE=robonix-scene" >> "$GITHUB_ENV"
exit 0
fi
# DualMap is a layer over the scene image. Tag it by the Dockerfile
# and the base image it was built from, so it is rebuilt exactly
# when either changes and reused otherwise (it downloads ~400 MB).
df=system/scene/docker/Dockerfile.dualmap
base_id="$(docker image inspect robonix-scene --format '{{.Id}}')"
tag="robonix-scene-dualmap:ci-$( { cat "$df"; echo "$base_id"; } | sha256sum | cut -c1-12)"
if docker image inspect "$tag" >/dev/null 2>&1; then
echo "reusing $tag"
else
# Same mirrors the checkout uses: large GitHub and Hugging Face
# transfers from this runner get cut off mid-stream.
docker build --network=host -f "$df" --build-arg BASE_IMAGE=robonix-scene \
--build-arg GITHUB_PREFIX=https://ghfast.top/ --build-arg HF_ENDPOINT=https://hf-mirror.com \
-t "$tag" system/scene/docker
fi
docker run --rm --entrypoint sh "$tag" -c 'test -d /opt/dualmap/utils'
# Drop the tags earlier Dockerfiles or base images produced. Usually
# there are none, which must not fail the step under pipefail.
for old in $(docker images robonix-scene-dualmap --format '{{.Tag}}' | grep '^ci-' || true); do
[ "$old" = "${tag#*:}" ] || docker rmi "robonix-scene-dualmap:$old" >/dev/null 2>&1 || true
done
echo "ROBONIX_SCENE_IMAGE=$tag" >> "$GITHUB_ENV"
- name: Validate Executor control-plane isolation
run: |
set -euo pipefail
bash scripts/test_executor_cancel_isolation.sh
- name: Start isolated Webots simulator
working-directory: examples/webots/sim
env:
NVIDIA_DRIVER_CAPABILITIES: "graphics,display,utility,compute"
run: |
set -euo pipefail
# Avoid Docker Hub metadata checks on every Webots sim rebuild.
# The helper creates a local alias and pulls through configured
# mirrors on first use.
helper="$GITHUB_WORKSPACE/scripts/docker_base_image.sh"
if [ -f "$helper" ]; then
# shellcheck disable=SC1090
source "$helper"
else
# The reusable workflow may test an older PR merge tree that does not
# yet contain scripts/docker_base_image.sh. Keep this minimal fallback
# here so CI infrastructure changes do not make old PRs untestable.
robonix_ensure_local_base_image() {
local dest="$1"
local upstream="$2"
local mirrors_raw="${ROBONIX_DOCKER_MIRRORS:-${ROBONIX_DOCKER_MIRROR:-docker.m.daocloud.io,dockerproxy.net}}"
local image_path="$upstream"
local candidates=()
if docker image inspect "$dest" >/dev/null 2>&1; then return 0; fi
if docker image inspect "$upstream" >/dev/null 2>&1; then
echo "[docker-base] tagging cached $upstream as $dest"
docker tag "$upstream" "$dest"
return 0
fi
image_path="${image_path#docker.io/}"
image_path="${image_path#registry-1.docker.io/}"
if [[ "$image_path" != */* ]]; then image_path="library/$image_path"; fi
IFS=',' read -r -a _mirror_items <<< "$mirrors_raw"
for mirror in "${_mirror_items[@]}"; do
mirror="${mirror#${mirror%%[![:space:]]*}}"
mirror="${mirror%${mirror##*[![:space:]]}}"
[[ -z "$mirror" ]] && continue
mirror="${mirror%/}"
candidates+=("${mirror}/${image_path}")
done
candidates+=("$upstream")
for candidate in "${candidates[@]}"; do
echo "[docker-base] pulling base candidate: $candidate"
if docker pull "$candidate"; then docker tag "$candidate" "$dest"; return 0; fi
echo "[docker-base] warning: failed to pull $candidate" >&2
done
echo "[docker-base] error: failed to prepare local base image $dest from $upstream" >&2
return 1
}
fi
export ROBONIX_SIM_ROS_BASE_IMAGE="${ROBONIX_SIM_ROS_BASE_IMAGE:-robonix-osrf-ros:humble-desktop-full}"
robonix_ensure_local_base_image "$ROBONIX_SIM_ROS_BASE_IMAGE" "osrf/ros:humble-desktop-full"
export ROBONIX_WEBOTS_CACHE_VOLUME="${ROBONIX_WEBOTS_CACHE_VOLUME:-robonix_ci_webots_cache}"
docker volume create "$ROBONIX_WEBOTS_CACHE_VOLUME" >/dev/null
cache_count=$(docker run --rm -v "$ROBONIX_WEBOTS_CACHE_VOLUME:/cache" busybox sh -lc 'find /cache -type f 2>/dev/null | wc -l')
if [ "${cache_count:-0}" -lt 1000 ]; then
seed_volume="${ROBONIX_WEBOTS_SEED_CACHE_VOLUME:-robonix_tiago_sim_webots_cache}"
seed_count=0
if docker volume inspect "$seed_volume" >/dev/null 2>&1; then
seed_count=$(docker run --rm -v "$seed_volume:/seed:ro" busybox sh -lc 'find /seed -type f 2>/dev/null | wc -l')
fi
if [ "${seed_count:-0}" -lt 1000 ]; then
echo "::error::Webots asset cache $ROBONIX_WEBOTS_CACHE_VOLUME is not pre-warmed, and seed volume $seed_volume has only ${seed_count:-0} files. Run ROBONIX_WEBOTS_DOWNLOAD_ALL_ASSETS=1 bash examples/webots/sim/start.sh once on this runner, then rerun CI."
exit 1
fi
echo "[webots-cache] prewarming $ROBONIX_WEBOTS_CACHE_VOLUME from $seed_volume ($seed_count files)"
docker run --rm -v "$seed_volume:/seed:ro" -v "$ROBONIX_WEBOTS_CACHE_VOLUME:/cache" busybox sh -lc 'cp -a /seed/. /cache/'
else
echo "[webots-cache] using prewarmed $ROBONIX_WEBOTS_CACHE_VOLUME ($cache_count files)"
fi
: > "$RUNNER_TEMP/xauth"; export ROBONIX_HOST_XAUTH="$RUNNER_TEMP/xauth" DISPLAY=:49
source ./nvidia_host.sh
robonix_resolve_nvidia_xorg_modules "$ROBONIX_GPU_ID"
# sim/start.sh creates the Soma runtime bind-mount source before
# compose runs; CI drives compose directly, so it has to do the same.
# Docker would otherwise create the whole rbnx-boot/logs path as root,
# and every provider that writes <name>.log into it dies with an empty
# log and no diagnostic.
mkdir -p ../rbnx-boot/logs/soma-runtime
docker compose -p "$ROBONIX_SIM_PROJECT" \
-f compose.yaml \
-f compose.gpu.yaml \
-f compose.nvidia-xorg.yaml \
-f compose.stream.yaml \
up --build -d
# robot publishes /scanner /odom /head_front_camera/* within ~15s.
for i in $(seq 1 40); do
if docker exec "$ROBONIX_SIM_CONTAINER" bash -lc 'source /opt/ros/humble/setup.bash 2>/dev/null && ros2 topic list 2>/dev/null | grep -qx /scanner' 2>/dev/null; then
echo "sim up"
break
fi
if [ "$i" -eq 40 ]; then
echo "::error::sim did not expose /scanner"
docker logs "$ROBONIX_SIM_CONTAINER" | tail -200 || true
exit 1
fi
sleep 4
done
sim_network_mode=$(docker inspect -f '{{.HostConfig.NetworkMode}}' "$ROBONIX_SIM_CONTAINER")
if [ "$sim_network_mode" = "host" ]; then
sim_gateway="127.0.0.1"
sim_ip="127.0.0.1"
sim_atlas_host="127.0.0.1"
zenoh_router_host="127.0.0.1"
else
sim_gateway=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{if .Gateway}}{{println .Gateway}}{{end}}{{end}}' "$ROBONIX_SIM_CONTAINER" | head -n1)
if [ -z "$sim_gateway" ] || [ "$sim_gateway" = "invalid IP" ]; then
echo "::error::cannot determine sim bridge gateway (network_mode=$sim_network_mode, gateway=$sim_gateway)"
exit 1
fi
sim_ip=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{if .IPAddress}}{{println .IPAddress}}{{end}}{{end}}' "$ROBONIX_SIM_CONTAINER" | head -n1)
if [ -z "$sim_ip" ] || [ "$sim_ip" = "invalid IP" ]; then
echo "::error::cannot determine sim bridge IP (network_mode=$sim_network_mode, ip=$sim_ip)"
exit 1
fi
sim_atlas_host="$sim_gateway"
zenoh_router_host="$sim_ip"
fi
{
echo "ROBONIX_SIM_ATLAS=${sim_atlas_host}:${ATLAS_PORT}"
echo "ROBONIX_ZENOH_ROUTER=tcp/${zenoh_router_host}:7447"
echo "ROBONIX_ZENOH_MODE=client"
echo "ROBONIX_ZENOH_LISTEN=tcp/${sim_gateway}:0"
echo "NO_PROXY=127.0.0.1,localhost,${sim_gateway},${sim_ip}"
echo "no_proxy=127.0.0.1,localhost,${sim_gateway},${sim_ip}"
} >> "$GITHUB_ENV"
echo "sim network mode: $sim_network_mode"
echo "sim atlas: ${sim_atlas_host}:${ATLAS_PORT}"
echo "sim zenoh router: tcp/${zenoh_router_host}:7447"
- name: Start deterministic VLM planner
working-directory: examples/webots
run: |
set -euo pipefail
# OpenAI-compatible endpoint that scripts pilot's planning via the RTDL
# envelope. Bound to a per-run localhost port; pilot dials it instead
# of a real VLM.
python3 "$GITHUB_WORKSPACE/testing/fake_vlm/server.py" \
--port "$FAKE_VLM_PORT" >"$RUNNER_TEMP/fake_vlm.log" 2>&1 &
echo "FAKE_VLM_PID=$!" >> "$GITHUB_ENV"
for i in $(seq 1 20); do
curl -fsS --noproxy '*' "http://127.0.0.1:${FAKE_VLM_PORT}/v1/models" >/dev/null 2>&1 && break
sleep 0.5
done
- name: Boot Robonix deployment
working-directory: examples/webots
env:
VLM_API_KEY: "fake-ci-key"
VLM_MODEL: "fake-vlm"
run: |
set -euo pipefail
export VLM_BASE_URL="http://127.0.0.1:${FAKE_VLM_PORT}/v1"
mkdir -p "$AGENT_MEMORY_DIR" "$MAPPING_MAPS_DIR" "$SCENE_DATA_DIR"
python3 - <<'PY'
import os
from pathlib import Path
import yaml
env_keys = [
"ROBONIX_SIM_ATLAS",
"ROBONIX_SIM_CONTAINER",
"ROBONIX_MAPPING_CONTAINER",