-
Notifications
You must be signed in to change notification settings - Fork 1
267 lines (239 loc) · 9.19 KB
/
Copy pathci.yml
File metadata and controls
267 lines (239 loc) · 9.19 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
name: CI
on:
push:
branches: [main]
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/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/**/*_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 + unitree dependencies
run: uv pip install --system -e ".[demo,unitree]"
- 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/lerobot_g1_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/test_gpu_smoke.py'
- 'tests/test_isaac_lab_gpu.py'
- 'tests/test_isaac_lab_compat.py'
- 'src/roboharness/wrappers/gymnasium_wrapper.py'
- '.cirun.yml'
- 'Dockerfile.gpu'
- '.github/workflows/ci.yml'
gpu-test:
needs: [gpu-changes]
runs-on: [self-hosted, cirun-gpu]
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
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/lerobot_g1.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