-
Notifications
You must be signed in to change notification settings - Fork 1
335 lines (305 loc) · 12.8 KB
/
Copy pathci.yml
File metadata and controls
335 lines (305 loc) · 12.8 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
name: CI
on:
push:
branches: [main, claude/test-aws-gpu-ci-gl5Jf]
pull_request:
branches: [main]
concurrency:
group: gpu-${{ github.head_ref || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Install dependencies
run: uv pip install --system ruff mypy
- name: Ruff lint
run: ruff check .
- name: Ruff format check
run: ruff format --check .
- name: Mypy type check
run: mypy src/
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Install package with dev dependencies
run: uv pip install --system -e ".[dev]"
- name: Run tests with coverage
run: pytest
test-mujoco:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Install system dependencies (OSMesa for headless rendering)
run: sudo apt-get update && sudo apt-get install -y libosmesa6-dev
- name: Install package with demo and dev dependencies
run: uv pip install --system -e ".[demo,dev]"
- name: Run tests (including MuJoCo-dependent tests)
env:
MUJOCO_GL: osmesa
run: pytest
mujoco-example:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Install system dependencies (OSMesa for headless rendering)
run: sudo apt-get update && sudo apt-get install -y libosmesa6-dev
- name: Install package with demo dependencies
run: uv pip install --system -e ".[demo]"
- name: Run MuJoCo grasp example
env:
MUJOCO_GL: osmesa
run: python examples/demos/mujoco/grasp.py --report --assert-success --output-dir ./harness_output
- name: Upload visual artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: mujoco-grasp-output
path: |
harness_output/report.html
harness_output/mujoco_grasp/trial_001/autonomous_report.json
harness_output/mujoco_grasp/trial_001/alarms.json
harness_output/mujoco_grasp/trial_001/phase_manifest.json
harness_output/mujoco_grasp/trial_001/**/*_rgb.png
harness_output/mujoco_grasp/trial_001/**/metadata.json
retention-days: 30
- name: Post summary with checkpoint images
if: always()
run: |
echo "## MuJoCo Grasp Example Results" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Checkpoint captures from the scripted grasp sequence:" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
for cp in harness_output/mujoco_grasp/trial_001/*/; do
name=$(basename "$cp")
echo "### ${name}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if [ -f "${cp}front_rgb.png" ]; then
echo ")" >> $GITHUB_STEP_SUMMARY
fi
if [ -f "${cp}metadata.json" ]; then
step=$(python3 -c "import json; print(json.load(open('${cp}metadata.json'))['step'])")
sim_time=$(python3 -c "import json; print(f\"{json.load(open('${cp}metadata.json'))['sim_time']:.3f}\")")
echo "" >> $GITHUB_STEP_SUMMARY
echo "Step: ${step} | Sim time: ${sim_time}s" >> $GITHUB_STEP_SUMMARY
fi
echo "" >> $GITHUB_STEP_SUMMARY
done
echo "---" >> $GITHUB_STEP_SUMMARY
echo "Download the full artifact (including HTML report) from the Actions tab." >> $GITHUB_STEP_SUMMARY
lerobot-g1-native-example:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Install system dependencies (OSMesa for headless rendering)
run: sudo apt-get update && sudo apt-get install -y libosmesa6-dev
- name: Install package with demo dependencies
run: uv pip install --system -e ".[demo]"
- name: Install unitree SDK directly from fork
run: |
# unitree-sdk2py is installed directly (not via a pyproject extra —
# PyPI rejects packages with git-based direct references on upload)
uv pip install --system "unitree-sdk2py @ git+https://github.com/MiaoDX-fork-and-pruning/unitree_sdk2_python_uv.git"
- name: Install CPU PyTorch and lerobot
run: |
uv pip install --system torch --index-url https://download.pytorch.org/whl/cpu
uv pip install --system lerobot
- name: Install lerobot/unitree-g1-mujoco runtime deps
run: uv pip install --system loguru pygame scipy pyyaml
- name: Cache HuggingFace models
uses: actions/cache@v4
with:
path: ~/.cache/huggingface/hub
key: hf-models-${{ runner.os }}-v1
- name: Run native LeRobot G1 example (GR00T)
env:
MUJOCO_GL: osmesa
run: python examples/demos/g1/lerobot_native.py --controller groot --report --assert-success --output-dir ./harness_output
- name: Upload visual artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: lerobot-g1-native-output
path: |
harness_output/lerobot_g1_native_groot_report.html
harness_output/lerobot_g1_native_groot/trial_001/**/*_rgb.png
harness_output/lerobot_g1_native_groot/trial_001/**/metadata.json
retention-days: 30
gpu-changes:
runs-on: ubuntu-latest
outputs:
gpu_relevant: ${{ steps.filter.outputs.gpu }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
gpu:
- 'tests/integration/gpu/test_gpu_smoke.py'
- 'tests/integration/gpu/test_isaac_lab_gpu.py'
- 'tests/unit/wrappers/test_isaac_lab_compat.py'
- 'src/roboharness/wrappers/gymnasium_wrapper.py'
- '.cirun.yml'
- 'Dockerfile.gpu'
- '.github/workflows/ci.yml'
# ─── gpu-test (GCP) PAUSED 2026-04-14 ────────────────────────────────
# GCP runner is currently paused in .cirun.yml; AWS Sydney is the
# primary GPU CI. To re-enable, uncomment the block below AND
# uncomment the GCP runner block in .cirun.yml.
#
# gpu-test:
# needs: [gpu-changes]
# runs-on: [self-hosted, cirun-gpu]
# timeout-minutes: 45
# # Only one GCP GPU job runs at a time globally — we only have quota for
# # a single T4. `cancel-in-progress: true` so a new push immediately
# # pre-empts any stale in-progress / queued job in this group; otherwise
# # a stuck provisioning attempt would hold the slot indefinitely and
# # every subsequent push would pile up behind it.
# concurrency:
# group: gpu-test-gcp
# cancel-in-progress: true
# if: |
# github.event_name == 'push' && github.ref == 'refs/heads/main'
# || contains(github.event.pull_request.labels.*.name, 'gpu-test')
# || needs.gpu-changes.outputs.gpu_relevant == 'true'
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-python@v5
# with:
# python-version: "3.12"
# - name: Install uv
# uses: astral-sh/setup-uv@v4
# - name: Install package with dev dependencies and torch
# run: |
# uv pip install --system -e ".[dev]"
# uv pip install --system torch --index-url https://download.pytorch.org/whl/cu121
# - name: Verify GPU
# run: |
# nvidia-smi
# python -c 'import torch; print(f"CUDA: {torch.cuda.is_available()}, GPUs: {torch.cuda.device_count()}")'
# - name: Run GPU tests
# run: pytest -m gpu -v --no-cov
# ─── End paused gpu-test (GCP) ───────────────────────────────────────
# AWS GPU smoke test — primary GPU CI. Runs on the cirun-aws-gpu runner
# provisioned on AWS (g4dn.xlarge in ap-southeast-2 + NVIDIA GPU-Optimized
# AMI). Gated to the test branch and to the gpu-relevant paths filter so
# we don't spin up AWS instances on unrelated pushes.
gpu-test-aws:
needs: [gpu-changes]
runs-on: [self-hosted, cirun-aws-gpu]
timeout-minutes: 45
# Serialize AWS GPU jobs too. `cancel-in-progress: true` so a new push
# pre-empts any stale in-progress / queued attempt — important because
# Cirun provisioning on AWS can silently sit queued (e.g. if the
# Dashboard has no AWS credentials or the Marketplace AMI subscription
# is still propagating), and `false` would stack pushes behind forever.
# Runs in a different group from gpu-test-gcp, so GCP and AWS do not
# block each other.
concurrency:
group: gpu-test-aws
cancel-in-progress: true
if: |
github.ref == 'refs/heads/claude/test-aws-gpu-ci-gl5Jf'
|| contains(github.event.pull_request.labels.*.name, 'gpu-test-aws')
|| needs.gpu-changes.outputs.gpu_relevant == 'true'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Show host info
run: |
uname -a
cat /etc/os-release || true
nvidia-smi
- name: Install package with dev dependencies and torch
run: |
uv pip install --system -e ".[dev]"
uv pip install --system torch --index-url https://download.pytorch.org/whl/cu121
- name: Verify PyTorch CUDA
run: |
python -c 'import torch; print(f"torch={torch.__version__}, CUDA available={torch.cuda.is_available()}, GPUs={torch.cuda.device_count()}, name={torch.cuda.get_device_name(0) if torch.cuda.is_available() else None}")'
- name: Run GPU tests
run: pytest -m gpu -v --no-cov
lerobot-g1-example:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Install system dependencies (OSMesa for headless rendering)
run: sudo apt-get update && sudo apt-get install -y libosmesa6-dev
- name: Install package with demo dependencies
run: uv pip install --system -e ".[demo]"
- name: Run LeRobot G1 example
env:
MUJOCO_GL: osmesa
run: python examples/demos/g1/lerobot_locomotion.py --report --assert-success --output-dir ./harness_output
- name: Upload visual artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: lerobot-g1-output
path: |
harness_output/lerobot_g1_report.html
harness_output/lerobot_g1/trial_001/**/*_rgb.png
harness_output/lerobot_g1/trial_001/**/metadata.json
retention-days: 30
- name: Post summary
if: always()
run: |
echo "## LeRobot G1 Example Results" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Checkpoint captures from the G1 humanoid validation:" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
for cp in harness_output/lerobot_g1/trial_001/*/; do
name=$(basename "$cp")
n_images=$(find "$cp" -name '*_rgb.png' 2>/dev/null | wc -l)
if [ -f "${cp}metadata.json" ]; then
step=$(python3 -c "import json; print(json.load(open('${cp}metadata.json'))['step'])")
echo "- **${name}**: step ${step}, ${n_images} captures" >> $GITHUB_STEP_SUMMARY
else
echo "- **${name}**: ${n_images} captures" >> $GITHUB_STEP_SUMMARY
fi
done
echo "" >> $GITHUB_STEP_SUMMARY
echo "Download the full artifact (including HTML report and images) from the Actions tab." >> $GITHUB_STEP_SUMMARY