Skip to content

Commit 081cf9c

Browse files
Merge remote-tracking branch 'upstream/main' into adenzler/mujoco-schema-docs
2 parents 08468c8 + c1acd46 commit 081cf9c

File tree

122 files changed

+6347
-2905
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+6347
-2905
lines changed

.github/workflows/aws_gpu_tests.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ name: GPU Unit Tests on AWS EC2 (Reusable)
55
# - pr_target_aws_gpu_tests.yml (for pull requests)
66
# - merge_queue_aws_gpu.yml (for merge groups)
77
# - push_aws_gpu.yml (for pushes to main/release branches)
8-
# - scheduled_weekly_gpu_tests.yml (for weekly multi-GPU tests)
8+
# - scheduled_nightly.yml (for nightly multi-GPU tests)
99

1010
# Workflow configuration variables
1111
env:
@@ -42,6 +42,12 @@ on:
4242
CODECOV_TOKEN:
4343
required: true
4444
workflow_dispatch:
45+
inputs:
46+
instance-type:
47+
description: 'EC2 instance type'
48+
required: false
49+
type: string
50+
default: 'g7e.2xlarge'
4551

4652
jobs:
4753
start-runner:
@@ -215,7 +221,7 @@ jobs:
215221
needs:
216222
- start-runner
217223
- gpu-unit-tests
218-
if: always() && github.repository == 'newton-physics/newton'
224+
if: always() && needs.start-runner.result != 'skipped' && github.repository == 'newton-physics/newton'
219225
steps:
220226
- name: Harden the runner (Audit all outbound calls)
221227
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0

.github/workflows/docs-dev.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ jobs:
4242

4343
- name: Build Sphinx documentation
4444
run: uv run --extra docs --extra sim sphinx-build -j auto -b html docs docs/_build/html
45+
env:
46+
NEWTON_REQUIRE_PANDOC: "1"
4547

4648
- name: Deploy to gh-pages /latest/
4749
run: |

.github/workflows/docs-release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ jobs:
7575
- name: Build Sphinx documentation
7676
if: steps.version.outputs.SHOULD_DEPLOY == 'true'
7777
run: uv run --extra docs --extra sim sphinx-build -j auto -b html docs docs/_build/html
78+
env:
79+
NEWTON_REQUIRE_PANDOC: "1"
7880

7981
- name: Deploy to gh-pages
8082
if: steps.version.outputs.SHOULD_DEPLOY == 'true'
Lines changed: 194 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,194 @@
1+
name: Minimum Dependency Version Tests on AWS EC2 (Reusable)
2+
3+
# Standalone workflow that tests Newton with the lowest compatible versions
4+
# of direct PyPI dependencies (as specified by version floors in pyproject.toml).
5+
# Dispatched by scheduled_nightly.yml via the workflow_dispatch API.
6+
7+
env:
8+
AWS_REGION: us-east-2
9+
AWS_INSTANCE_TYPE: g7e.2xlarge
10+
AWS_VOLUME_SIZE: 92
11+
AWS_VOLUME_TYPE: gp3
12+
AWS_SECURITY_GROUP_IDS: sg-07807c44e7f2a368a
13+
AWS_ROLE_ARN: arn:aws:iam::968945269301:role/newton-physics-newton-ec2-github-runner-role
14+
AWS_ROLE_DURATION: 3600
15+
HOME: /actions-runner
16+
17+
on:
18+
workflow_call:
19+
secrets:
20+
GH_PERSONAL_ACCESS_TOKEN:
21+
required: true
22+
CODECOV_TOKEN:
23+
required: true
24+
workflow_dispatch:
25+
26+
jobs:
27+
start-runner:
28+
name: Start self-hosted EC2 runner
29+
if: github.repository == 'newton-physics/newton'
30+
runs-on: ubuntu-latest
31+
permissions:
32+
id-token: write
33+
contents: read
34+
outputs:
35+
label: ${{ steps.start-ec2-runner.outputs.label }}
36+
ec2-instance-id: ${{ steps.start-ec2-runner.outputs.ec2-instance-id }}
37+
steps:
38+
- name: Harden the runner (Audit all outbound calls)
39+
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
40+
with:
41+
egress-policy: audit
42+
43+
- name: Configure AWS credentials
44+
uses: aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7 # v6.0.0
45+
with:
46+
aws-region: ${{ env.AWS_REGION }}
47+
role-to-assume: ${{ env.AWS_ROLE_ARN }}
48+
role-duration-seconds: ${{ env.AWS_ROLE_DURATION }}
49+
50+
- name: Get the latest AWS Deep Learning Base GPU AMI
51+
run: |
52+
echo "Finding the latest AWS Deep Learning Base GPU AMI..."
53+
LATEST_AMI_ID=$(aws ec2 describe-images --region ${{ env.AWS_REGION }} \
54+
--owners amazon \
55+
--filters 'Name=name,Values=Deep Learning Base AMI with Single CUDA (Ubuntu 22.04) ????????' 'Name=state,Values=available' \
56+
--query 'reverse(sort_by(Images, &CreationDate))[:1].ImageId' \
57+
--output text)
58+
if [[ -z "$LATEST_AMI_ID" ]]; then
59+
echo "❌ No AMI ID found. Exiting."
60+
exit 1
61+
fi
62+
echo "Latest AMI ID found: $LATEST_AMI_ID"
63+
echo "LATEST_AMI_ID=$LATEST_AMI_ID" >> "$GITHUB_ENV"
64+
65+
- name: Start EC2 runner
66+
id: start-ec2-runner
67+
uses: machulav/ec2-github-runner@a00f575a87f3a96ec6de9413d16eeb828a3cc0a8 # v2.5.2
68+
with:
69+
mode: start
70+
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
71+
ec2-instance-type: ${{ env.AWS_INSTANCE_TYPE }}
72+
ec2-volume-size: ${{ env.AWS_VOLUME_SIZE }}
73+
ec2-volume-type: ${{ env.AWS_VOLUME_TYPE }}
74+
availability-zones-config: >
75+
[
76+
{"imageId": "${{ env.LATEST_AMI_ID }}", "subnetId": "subnet-051b9d2e71acf8047", "securityGroupId": "${{ env.AWS_SECURITY_GROUP_IDS }}"},
77+
{"imageId": "${{ env.LATEST_AMI_ID }}", "subnetId": "subnet-0c98bd06abe8ee5eb", "securityGroupId": "${{ env.AWS_SECURITY_GROUP_IDS }}"}
78+
]
79+
pre-runner-script: |
80+
if [ -d /opt/dlami/nvme ]; then
81+
mkdir -p /opt/dlami/nvme/actions-runner/_work
82+
mkdir -p /opt/dlami/nvme/actions-runner/.local
83+
mkdir -p /opt/dlami/nvme/actions-runner/.cache
84+
ln -s /opt/dlami/nvme/actions-runner/_work /actions-runner/_work
85+
ln -s /opt/dlami/nvme/actions-runner/.local /actions-runner/.local
86+
ln -s /opt/dlami/nvme/actions-runner/.cache /actions-runner/.cache
87+
fi
88+
aws-resource-tags: >
89+
[
90+
{"Key": "Name", "Value": "ec2-github-runner"},
91+
{"Key": "created-by", "Value": "github-actions-newton-role"},
92+
{"Key": "GitHub-Repository", "Value": "${{ github.repository }}"}
93+
]
94+
95+
minimum-deps-tests:
96+
name: Run Tests with Minimum Dependency Versions
97+
needs: start-runner
98+
if: ${{ !cancelled() && needs.start-runner.result == 'success' }}
99+
runs-on: ${{ needs.start-runner.outputs.label }}
100+
timeout-minutes: 60
101+
permissions:
102+
contents: read
103+
env:
104+
PYTHONFAULTHANDLER: "1"
105+
steps:
106+
- name: Harden the runner (Audit all outbound calls)
107+
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
108+
with:
109+
egress-policy: audit
110+
111+
- name: Checkout repository
112+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
113+
114+
- name: Install uv
115+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
116+
with:
117+
version: "0.11.0"
118+
119+
- name: Set up Python
120+
run: uv python install
121+
122+
- name: Resolve minimum dependency versions
123+
run: |
124+
uv lock --resolution lowest-direct
125+
echo "Resolved dependency versions:"
126+
uv tree --depth 1
127+
128+
- name: Run Tests
129+
run: uv run --extra dev -m newton.tests --junit-report-xml rspec.xml
130+
131+
- name: Test Summary
132+
if: ${{ !cancelled() }}
133+
uses: test-summary/action@31493c76ec9e7aa675f1585d3ed6f1da69269a86 # v2.4
134+
with:
135+
paths: "rspec.xml"
136+
show: "fail"
137+
138+
- name: Upload test results to Codecov
139+
if: ${{ !cancelled() }}
140+
continue-on-error: true
141+
uses: codecov/codecov-action@1af58845a975a7985b0beb0cbe6fbbb71a41dbad # v5.5.3
142+
with:
143+
disable_search: true
144+
files: ./rspec.xml
145+
flags: minimum-deps-nightly
146+
report_type: test_results
147+
token: ${{ secrets.CODECOV_TOKEN }}
148+
149+
- name: Re-run instructions
150+
if: failure()
151+
run: |
152+
echo "::error::DO NOT use 'Re-run failed jobs' - the EC2 runner no longer exists and your job will be queued forever."
153+
echo "::error::USE 'Re-run all jobs' instead to start a fresh EC2 runner."
154+
cat >> "$GITHUB_STEP_SUMMARY" << 'EOF'
155+
## ⚠️ How to Re-run This Workflow
156+
157+
This workflow uses **ephemeral EC2 runners** that are terminated after each run.
158+
159+
| | Option | Result |
160+
|---|--------|--------|
161+
| ❌ | **Re-run failed jobs** | Runner no longer exists → job queued forever |
162+
| ✅ | **Re-run all jobs** | Starts new EC2 runner → tests re-run |
163+
EOF
164+
165+
stop-runner:
166+
name: Stop self-hosted EC2 runner
167+
runs-on: ubuntu-latest
168+
permissions:
169+
id-token: write
170+
contents: read
171+
needs:
172+
- start-runner
173+
- minimum-deps-tests
174+
if: always() && needs.start-runner.result != 'skipped' && github.repository == 'newton-physics/newton'
175+
steps:
176+
- name: Harden the runner (Audit all outbound calls)
177+
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
178+
with:
179+
egress-policy: audit
180+
181+
- name: Configure AWS credentials
182+
uses: aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7 # v6.0.0
183+
with:
184+
aws-region: ${{ env.AWS_REGION }}
185+
role-to-assume: ${{ env.AWS_ROLE_ARN }}
186+
role-duration-seconds: ${{ env.AWS_ROLE_DURATION }}
187+
188+
- name: Stop EC2 runner
189+
uses: machulav/ec2-github-runner@a00f575a87f3a96ec6de9413d16eeb828a3cc0a8 # v2.5.2
190+
with:
191+
mode: stop
192+
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
193+
label: ${{ needs.start-runner.outputs.label }}
194+
ec2-instance-id: ${{ needs.start-runner.outputs.ec2-instance-id }}

.github/workflows/scheduled_nightly_mujoco_warp_tests.yml renamed to .github/workflows/mujoco_warp_tests.yml

Lines changed: 46 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
1-
name: Newton + MuJoCo Warp Nightly Builds
1+
name: MuJoCo Warp Tests on AWS EC2 (Reusable)
22

3-
# This workflow runs daily to test Newton with the latest mujoco-warp from source.
4-
# It installs mujoco-warp directly from the google-deepmind/mujoco_warp repository,
5-
# which pulls in whatever mujoco version it depends on.
6-
# Scheduled workflows automatically run on the default branch (main).
3+
# Standalone workflow that tests Newton with the latest mujoco-warp from source.
4+
# Not currently dispatched by scheduled_nightly.yml; kept available for manual dispatch/reuse.
75

8-
# Workflow configuration variables
96
env:
107
AWS_REGION: us-east-2
118
AWS_INSTANCE_TYPE: g7e.2xlarge
129
AWS_VOLUME_SIZE: 92
1310
AWS_VOLUME_TYPE: gp3
1411
AWS_SECURITY_GROUP_IDS: sg-07807c44e7f2a368a
1512
AWS_ROLE_ARN: arn:aws:iam::968945269301:role/newton-physics-newton-ec2-github-runner-role
16-
AWS_ROLE_DURATION: 7200
17-
PYTHONFAULTHANDLER: "1" # Dump tracebacks on fatal signals (SIGSEGV, SIGABRT, etc.)
13+
AWS_ROLE_DURATION: 3600
14+
HOME: /actions-runner
1815

1916
on:
20-
schedule:
21-
- cron: '0 12 * * *' # Daily at 12 PM UTC (4 AM PST)
22-
workflow_dispatch: # Allow manual triggers
17+
workflow_call:
18+
secrets:
19+
GH_PERSONAL_ACCESS_TOKEN:
20+
required: true
21+
CODECOV_TOKEN:
22+
required: true
23+
workflow_dispatch:
2324

2425
jobs:
2526
start-runner:
@@ -44,6 +45,7 @@ jobs:
4445
aws-region: ${{ env.AWS_REGION }}
4546
role-to-assume: ${{ env.AWS_ROLE_ARN }}
4647
role-duration-seconds: ${{ env.AWS_ROLE_DURATION }}
48+
4749
- name: Get the latest AWS Deep Learning Base GPU AMI
4850
run: |
4951
echo "Finding the latest AWS Deep Learning Base GPU AMI..."
@@ -58,6 +60,7 @@ jobs:
5860
fi
5961
echo "Latest AMI ID found: $LATEST_AMI_ID"
6062
echo "LATEST_AMI_ID=$LATEST_AMI_ID" >> "$GITHUB_ENV"
63+
6164
- name: Start EC2 runner
6265
id: start-ec2-runner
6366
uses: machulav/ec2-github-runner@a00f575a87f3a96ec6de9413d16eeb828a3cc0a8 # v2.5.2
@@ -88,14 +91,16 @@ jobs:
8891
{"Key": "GitHub-Repository", "Value": "${{ github.repository }}"}
8992
]
9093
91-
nightly-mujoco-warp-tests:
94+
mujoco-warp-tests:
9295
name: Run Tests with MuJoCo Warp from Source
9396
needs: start-runner
97+
if: ${{ !cancelled() && needs.start-runner.result == 'success' }}
9498
runs-on: ${{ needs.start-runner.outputs.label }}
99+
timeout-minutes: 60
95100
permissions:
96101
contents: read
97102
env:
98-
HOME: /actions-runner
103+
PYTHONFAULTHANDLER: "1"
99104
steps:
100105
- name: Harden the runner (Audit all outbound calls)
101106
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
@@ -138,6 +143,33 @@ jobs:
138143
paths: "rspec.xml"
139144
show: "fail"
140145

146+
- name: Upload test results to Codecov
147+
if: ${{ !cancelled() }}
148+
continue-on-error: true
149+
uses: codecov/codecov-action@1af58845a975a7985b0beb0cbe6fbbb71a41dbad # v5.5.3
150+
with:
151+
disable_search: true
152+
files: ./rspec.xml
153+
flags: mujoco-warp-nightly
154+
report_type: test_results
155+
token: ${{ secrets.CODECOV_TOKEN }}
156+
157+
- name: Re-run instructions
158+
if: failure()
159+
run: |
160+
echo "::error::DO NOT use 'Re-run failed jobs' - the EC2 runner no longer exists and your job will be queued forever."
161+
echo "::error::USE 'Re-run all jobs' instead to start a fresh EC2 runner."
162+
cat >> "$GITHUB_STEP_SUMMARY" << 'EOF'
163+
## ⚠️ How to Re-run This Workflow
164+
165+
This workflow uses **ephemeral EC2 runners** that are terminated after each run.
166+
167+
| | Option | Result |
168+
|---|--------|--------|
169+
| ❌ | **Re-run failed jobs** | Runner no longer exists → job queued forever |
170+
| ✅ | **Re-run all jobs** | Starts new EC2 runner → tests re-run |
171+
EOF
172+
141173
stop-runner:
142174
name: Stop self-hosted EC2 runner
143175
runs-on: ubuntu-latest
@@ -146,7 +178,7 @@ jobs:
146178
contents: read
147179
needs:
148180
- start-runner
149-
- nightly-mujoco-warp-tests
181+
- mujoco-warp-tests
150182
if: always() && needs.start-runner.result != 'skipped' && github.repository == 'newton-physics/newton'
151183
steps:
152184
- name: Harden the runner (Audit all outbound calls)

.github/workflows/pr.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ jobs:
6161
uses: pandoc/actions/setup@86321b6dd4675f5014c611e05088e10d4939e09e # v1.1.1
6262
- name: Build Sphinx documentation
6363
run: uv run --extra docs --extra sim sphinx-build -j auto -W -b html docs docs/_build/html
64+
env:
65+
NEWTON_REQUIRE_PANDOC: "1"
6466
- name: Verify API docs are up-to-date
6567
run: |
6668
git diff --exit-code docs/api/ || {

0 commit comments

Comments
 (0)