66 description : ' Content of the user submission, as json string'
77 required : true
88 type : string
9+ requirements :
10+ description : ' Contents for a requirements.txt file'
11+ required : false
12+ type : string
913
1014jobs :
1115 run :
@@ -14,47 +18,52 @@ jobs:
1418 container :
1519 image : nvidia/cuda:12.4.0-devel-ubuntu22.04
1620 steps :
17- - uses : actions/checkout@v3
18-
19- - name : Setup Python
20- uses : actions/setup-python@v5
21- with :
22- python-version : ' 3.10'
23-
24- - name : Install uv
25- uses : astral-sh/setup-uv@v3
26- with :
27- version : " latest"
28-
29- - name : Setup Python environment
30- run : |
31- uv venv .venv
32- echo "VIRTUAL_ENV=$PWD/.venv" >> $GITHUB_ENV
33- echo "$PWD/.venv/bin" >> $GITHUB_PATH
34- # TODO the old script was more selective!
35- uv pip install numpy torch setuptools ninja
36- uv pip install triton
37-
38- - name : Create input files
39- shell : bash
40- run : |
41- cat > "payload.json" <<EOL
42- ${{ github.event.inputs.payload }}
43- EOL
44-
45- - name : Run script
46- shell : bash
47- run : |
48- python .github/workflows/runner.py
49- cat result.json # Debug: show output
50-
51- - name : Upload training artifacts
52- uses : actions/upload-artifact@v4
53- if : always()
54- with :
55- name : run-result
56- path : |
57- result.json
21+ - uses : actions/checkout@v3
22+
23+ - name : Setup Python
24+ uses : actions/setup-python@v5
25+ with :
26+ python-version : ' 3.10'
27+
28+ - name : Create input files
29+ shell : bash
30+ run : |
31+ cat > "payload.json" <<'EOL'
32+ ${{ github.event.inputs.payload }}
33+ EOL
34+
35+ - name : Install uv
36+ uses : astral-sh/setup-uv@v3
37+ with :
38+ version : " latest"
39+
40+ - name : Setup Python environment
41+ shell : bash
42+ run : |
43+ uv venv .venv
44+ echo "VIRTUAL_ENV=$PWD/.venv" >> $GITHUB_ENV
45+ echo "$PWD/.venv/bin" >> $GITHUB_PATH
46+
47+ if [[ -n "${{ github.event.inputs.requirements }}" ]]; then
48+ cat > "requirements.txt" <<'EOL'
49+ ${{ github.event.inputs.requirements }}
50+ EOL
51+ uv pip install -r "requirements.txt"
52+ fi
53+
54+ - name : Run script
55+ shell : bash
56+ run : |
57+ python .github/workflows/runner.py
58+ cat result.json # Debug: show output
59+
60+ - name : Upload training artifacts
61+ uses : actions/upload-artifact@v4
62+ if : always()
63+ with :
64+ name : run-result
65+ path : |
66+ result.json
5867
5968 env :
6069 CUDA_VISIBLE_DEVICES : 0
0 commit comments