2020 env :
2121 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
2222 GITHUB_REPOSITORY : ${{ github.repository }}
23+ # Persistent venv with torch + vLLM deps (survives across runs).
24+ # Bootstrap once, then reuse. The user's vLLM fork is installed fresh each run.
25+ MODEL_VENV : /opt/model-venv
2326 steps :
2427 - uses : actions/checkout@v3
2528
@@ -39,17 +42,40 @@ jobs:
3942 - name : Install uv
4043 uses : astral-sh/setup-uv@v4
4144
42- - name : Setup Virtual Environment and Install Dependencies
45+ - name : Setup persistent model venv
46+ shell : bash
47+ run : |
48+ # Create persistent venv if it doesn't exist, with torch + vLLM deps pre-installed.
49+ # Mirrors the Modal model_image: install vllm to get all deps, then uninstall vllm.
50+ if [ ! -f "$MODEL_VENV/bin/activate" ]; then
51+ echo "Bootstrapping persistent model venv..."
52+ uv venv "$MODEL_VENV" --python 3.10
53+ export VIRTUAL_ENV="$MODEL_VENV"
54+ export PATH="$MODEL_VENV/bin:$PATH"
55+ uv pip install torch==2.9.1 --index-url https://download.pytorch.org/whl/cu130
56+ uv pip install numpy transformers tokenizers huggingface_hub ray \
57+ uvicorn fastapi pydantic aiohttp requests packaging ninja wheel sccache
58+ uv pip install vllm && uv pip uninstall vllm
59+ echo "Persistent model venv bootstrapped."
60+ else
61+ echo "Reusing existing persistent model venv."
62+ fi
63+
64+ # Activate for subsequent steps
65+ echo "VIRTUAL_ENV=$MODEL_VENV" >> $GITHUB_ENV
66+ echo "$MODEL_VENV/bin" >> $GITHUB_PATH
67+
68+ - name : Install kernelbot
4369 shell : bash
4470 run : |
45- uv venv .venv
46- echo "VIRTUAL_ENV=$PWD/.venv" >> $GITHUB_ENV
47- echo "$PWD/.venv/bin" >> $GITHUB_PATH
4871 uv pip install -r "requirements-dev.txt"
4972 uv pip install -e .
5073
5174 - name : Run model benchmark
5275 shell : bash
76+ env :
77+ SETUPTOOLS_SCM_PRETEND_VERSION : " 0.0.1.dev0"
78+ SCCACHE_DIR : /opt/sccache
5379 run : |
5480 python3 src/runners/github-runner.py
5581
0 commit comments