Skip to content

Model Job - test-e2e-606af1ec #3

Model Job - test-e2e-606af1ec

Model Job - test-e2e-606af1ec #3

name: NVIDIA Model Benchmark Job
on:
workflow_dispatch:
inputs:
run_id:
description: 'Unique identifier for this run'
required: true
type: string
payload:
description: 'Content of the user submission config, as compressed json string'
required: true
type: string
run-name: 'Model Job - ${{ github.event.inputs.run_id }}'
jobs:
run:
runs-on: [nvidia-docker-b200-8-x86-64]
timeout-minutes: 60
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository }}
# Persistent venv with torch + vLLM deps (survives across runs).
# Bootstrap once, then reuse. The user's vLLM fork is installed fresh each run.
MODEL_VENV: /opt/model-venv
steps:
- uses: actions/checkout@v3
- name: Create input files
shell: bash
run: |
# Extract the payload content without printing it
apt-get update && apt-get install -y jq
PAYLOAD=$(jq -r '.inputs.payload' $GITHUB_EVENT_PATH)
# Apply mask to the extracted content
echo "::add-mask::$PAYLOAD"
# Now write to file (won't be logged since it's masked)
echo "$PAYLOAD" > payload.json
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Setup persistent model venv
shell: bash
run: |
# Create persistent venv if it doesn't exist, with torch + vLLM deps pre-installed.
# Mirrors the Modal model_image: install vllm to get all deps, then uninstall vllm.
if [ ! -f "$MODEL_VENV/bin/activate" ]; then
echo "Bootstrapping persistent model venv..."
uv venv "$MODEL_VENV" --python 3.10
export VIRTUAL_ENV="$MODEL_VENV"
export PATH="$MODEL_VENV/bin:$PATH"
uv pip install torch==2.9.1 --index-url https://download.pytorch.org/whl/cu130
uv pip install numpy transformers tokenizers huggingface_hub ray \
uvicorn fastapi pydantic aiohttp requests packaging ninja wheel sccache
uv pip install vllm && uv pip uninstall vllm
echo "Persistent model venv bootstrapped."
else
echo "Reusing existing persistent model venv."
fi
# Activate for subsequent steps
echo "VIRTUAL_ENV=$MODEL_VENV" >> $GITHUB_ENV
echo "$MODEL_VENV/bin" >> $GITHUB_PATH
- name: Install kernelbot
shell: bash
run: |
uv pip install -r "requirements-dev.txt"
uv pip install -e .
- name: Run model benchmark
shell: bash
env:
SETUPTOOLS_SCM_PRETEND_VERSION: "0.0.1.dev0"
SCCACHE_DIR: /opt/sccache
run: |
python3 src/runners/github-runner.py
- name: Upload benchmark results
uses: actions/upload-artifact@v4
if: always()
with:
name: run-result
path: result.json