Skip to content
41 changes: 32 additions & 9 deletions .github/workflows/gpu_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ on:
permissions:
contents: read # Required for actions/checkout

env:
MUJOCO_GL: "egl"
PYOPENGL_PLATFORM: "egl"

jobs:
start-runner:
name: Start GPU Runner
Expand All @@ -34,7 +38,7 @@ jobs:
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: us-west-1
aws-region: us-west-2

- name: Start Instance
run: |
Expand All @@ -44,7 +48,7 @@ jobs:
gpu-test:
name: Run Pytest on GPU
needs: start-runner
runs-on: [g6.xlarge]
runs-on: [g6.2xlarge]
timeout-minutes: 60

container:
Expand All @@ -57,18 +61,37 @@ jobs:
with:
persist-credentials: false

- name: Install Python and dependencies
- name: Install system dependencies
run: |
apt-get update && apt-get install -y python3 python3-pip git ffmpeg libegl1 libegl-mesa0 libegl-dev libgl1 libglx-mesa0 libgles2 mesa-utils curl cmake build-essential

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: "latest"

- name: Install dependencies
run: |
apt-get update && apt-get install -y python3 python3-pip git
pip3 install pytest torch torchvision --index-url https://download.pytorch.org/whl/cu121
# Install other dependencies
if [ -f requirements.txt ]; then pip3 install -r requirements.txt; fi
uv sync --extra dev --extra libero --extra openai

- name: Check GPU
run: nvidia-smi

- name: Set up HuggingFace authentication
shell: bash
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: |
source .venv/bin/activate
hf auth login --token $HF_TOKEN

- name: Run Tests
run: pytest -m "gpu" -n 0 -v tests/
shell: bash
run: |
source .venv/bin/activate
mkdir -p /tmp/libero-assets/libero/libero
export LIBERO_CONFIG_PATH="$(pwd)/.github/assets/libero"
pytest -m "gpu" -n 0 -v tests/

stop-runner:
name: Stop GPU Runner
Expand All @@ -83,7 +106,7 @@ jobs:
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: us-west-1
aws-region: us-west-2

- name: Stop Instance
run: |
Expand Down
Loading