@@ -45,49 +45,59 @@ jobs:
4545 steps :
4646 - name : Checkout code
4747 uses : actions/checkout@v4
48- - name : Run unit tests
48+ - name : Start container
4949 if : github.event_name == 'pull_request'
5050 run : |
5151 SLURM_JOB_NAME="$(uuidgen)_$(date +%Y%m%d_%H%M%S)"
52+ CONTAINER_NAME="${SLURM_JOB_NAME}"
53+ SRUN_CONTAINER_OPTS="--container-name=${CONTAINER_NAME} \
54+ --container-mounts=${{ github.workspace }}:/root/workspace,${HOME}/.cache/uv:/root/.cache/uv \
55+ --no-container-mount-home \
56+ --container-workdir=/root/workspace"
57+ SLURM_ENV_VARS="NVIDIA_DRIVER_CAPABILITIES=all,BASH_ENV=/root/.bashrc,HF_TOKEN,GS_ENABLE_NDARRAY=${GS_ENABLE_NDARRAY}"
58+
59+ JOBID_FIFO="${{ github.workspace }}/.slurm_job_id_fifo"
60+ [[ -e "$JOBID_FIFO" ]] && rm -f "$JOBID_FIFO"
61+ mkfifo "$JOBID_FIFO"
62+ salloc --job-name="${SLURM_JOB_NAME}" \
63+ --partition=hpc-mid --nodes=1 --gpus=8 --exclusive \
64+ --time="${TIMEOUT_MINUTES}" \
65+ bash -c "echo \$SLURM_JOB_ID > $JOBID_FIFO; sleep ${TIMEOUT_MINUTES}m" &
66+ SLURM_JOB_ID=$(cat "$JOBID_FIFO")
67+ rm -f "$JOBID_FIFO"
68+ SRUN_COMMON="--overlap --jobid=${SLURM_JOB_ID} ${SRUN_CONTAINER_OPTS} --export=${SLURM_ENV_VARS}"
69+ srun --jobid=${SLURM_JOB_ID} \
70+ --container-image=/mnt/data/images/genesis-v${GENESIS_IMAGE_VER}.sqsh \
71+ ${SRUN_CONTAINER_OPTS} \
72+ --export=${SLURM_ENV_VARS} \
73+ echo "Container ready"
74+
5275 echo "SLURM_JOB_NAME=${SLURM_JOB_NAME}" >> $GITHUB_ENV
76+ echo "SRUN_COMMON=${SRUN_COMMON}" >> "$GITHUB_ENV"
77+
78+ - name : Build
79+ if : github.event_name == 'pull_request'
80+ run : |
81+ srun ${SRUN_COMMON} \
82+ bash .github/workflows/scripts/production_build.sh
5383
54- mkdir -p "${HOME}/.cache" "${HOME}/.venv"
55-
56- # TODO: USD baking does not currently support Python 3.11 since
57- # NVIDIA does not currently release `omniverse-kit==107.3` on PyPI.
58- # See: https://github.com/Genesis-Embodied-AI/Genesis/pull/1300
59- srun \
60- --container-image="/mnt/data/images/genesis-v${GENESIS_IMAGE_VER}.sqsh" \
61- --container-mounts=\
62- "${HOME}/.venv":/root/.venv,\
63- "${HOME}/.cache":/root/.cache,\
64- "${{ github.workspace }}":/root/workspace \
65- --no-container-mount-home --container-workdir=/root/workspace \
66- --export=NVIDIA_DRIVER_CAPABILITIES=all,BASH_ENV=/root/.bashrc,HF_TOKEN,GS_ENABLE_NDARRAY=${GS_ENABLE_NDARRAY} \
67- --partition=hpc-mid --nodes=1 --gpus=8 --exclusive --time="${TIMEOUT_MINUTES}" \
68- --job-name=${SLURM_JOB_NAME} \
69- bash -e -s << 'EOF'
70- if test -n "$(find /root/.venv -maxdepth 0 -empty)"; then
71- python3 -m venv --system-site-packages /root/.venv
72- source /root/.venv/bin/activate
73- pip install --no-input --upgrade pip pkg-info wheel
74- pip install --no-input --ignore-installed --upgrade blinker pyparsing setuptools
75- fi
76- source /root/.venv/bin/activate
77-
78- pip install --no-input --extra-index-url https://pypi.nvidia.com/ omniverse-kit
79- pip install --no-input ".[dev,render,usd]"
80-
81- # sudo apt update
82- # sudo apt install -y tmate
83- # tmate -S /tmp/tmate.sock new-session -d
84- # tmate -S /tmp/tmate.sock wait tmate-ready
85- # tmate -S /tmp/tmate.sock display -p '#{tmate_ssh}'
86-
87- pytest -v -ra --backend gpu --dev --forked ./tests
88-
89- # tmate -S /tmp/tmate.sock wait tmate-exit
84+ - name : Run benchmarks
85+ if : github.event_name == 'pull_request'
86+ run : |
87+ srun ${SRUN_COMMON} bash -e -s <<'EOF'
88+ source /venv/bin/activate
89+
90+ # sudo apt update
91+ # sudo apt install -y tmate
92+ # tmate -S /tmp/tmate.sock new-session -d
93+ # tmate -S /tmp/tmate.sock wait tmate-ready
94+ # tmate -S /tmp/tmate.sock display -p '#{tmate_ssh}'
95+
96+ pytest -v -ra --backend gpu --dev --forked ./tests
97+
98+ # tmate -S /tmp/tmate.sock wait tmate-exit
9099 EOF
100+
91101 - name : Kill srun job systematically
92102 if : always()
93103 run : |
0 commit comments