-
Notifications
You must be signed in to change notification settings - Fork 99
144 lines (129 loc) · 4.57 KB
/
Copy patheval.yml
File metadata and controls
144 lines (129 loc) · 4.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: eval
on:
workflow_dispatch:
inputs:
pr_number:
description: 'PR number to evaluate'
required: false
type: string
submission_name:
description: 'Name for this submission (e.g. "my_submission")'
required: true
type: string
submission_url:
description: 'Link to submission zip'
required: true
type: string
runner:
description: 'Runner to use'
required: false
type: choice
default: 'ubuntu-latest'
options:
- 'ubuntu-latest'
- 'linux-nvidia-t4'
jobs:
test:
runs-on: ${{ inputs.runner }}
timeout-minutes: 30
env:
UV_GROUP: ${{ inputs.runner == 'linux-nvidia-t4' && 'cu128' || 'cpu' }}
EVAL_DEVICE: ${{ inputs.runner == 'linux-nvidia-t4' && 'cuda' || 'cpu' }}
steps:
- id: checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.pr_number && format('refs/pull/{0}/merge', inputs.pr_number) || 'master' }}
- id: check_name
name: Check submission_name is unique (except for "baseline" for testing)
run: |
git fetch origin master --depth=1
if [ "${{ inputs.submission_name }}" != "baseline" ] && git ls-tree --name-only origin/master -- "submissions/${{ inputs.submission_name }}/" | grep -q .; then
echo "::error::submission_name '${{ inputs.submission_name }}' already exists in master"
exit 1
fi
- id: check_gpu
name: Check GPU
if: ${{ inputs.runner == 'linux-nvidia-t4' }}
run: |
nvidia-smi
- id: download
name: Download submission
run: |
mkdir -p ./submissions/${{ inputs.submission_name }}
curl -L -o ./submissions/${{ inputs.submission_name }}/archive.zip "${{ inputs.submission_url }}"
- id: install_lfs
name: Install git-lfs
run: |
sudo apt-get update
sudo apt-get install -y git-lfs
git lfs install
- id: pull_lfs
name: Pull LFS files
run: git lfs pull
- id: install_uv
name: Install uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
- id: install_deps
name: Install dependencies
run: uv sync --group "$UV_GROUP"
- id: install_ffmpeg
name: Install ffmpeg
run: sudo apt-get update && sudo apt-get install -y ffmpeg
- id: evaluate
name: Evaluate
run: uv run --group "$UV_GROUP" bash evaluate.sh --device "$EVAL_DEVICE" --submission-dir ./submissions/${{ inputs.submission_name }}
- name: Upload artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: eval-${{ inputs.submission_name }}
path: |
./submissions/${{ inputs.submission_name }}/archive.zip
./submissions/${{ inputs.submission_name }}/report.txt
comment:
needs: test
if: always() && inputs.pr_number
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: eval-${{ inputs.submission_name }}
path: ./artifacts
continue-on-error: true
- name: Comment on PR
uses: actions/github-script@v7
env:
TEST_RESULT: ${{ needs.test.result }}
with:
script: |
const fs = require('fs');
const testResult = process.env.TEST_RESULT;
let body;
if (testResult === 'success') {
const reportPath = './artifacts/report.txt';
let report = 'No report.txt found.';
if (fs.existsSync(reportPath)) {
report = fs.readFileSync(reportPath, 'utf8');
}
body = `## Eval Results: \`${{ inputs.submission_name }}\`\n\n\`\`\`\n${report}\n\`\`\``;
} else {
let reason;
if (testResult === 'cancelled') {
reason = 'Job timed out or was cancelled';
} else {
reason = `Job failed`;
}
body = `## Eval Failed: \`${{ inputs.submission_name }}\`\n\n${reason}\n\n[View logs](${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID})`;
}
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: parseInt('${{ inputs.pr_number }}'),
body
});