-
Notifications
You must be signed in to change notification settings - Fork 98
169 lines (155 loc) · 5.52 KB
/
agent_validation_pipeline.yaml
File metadata and controls
169 lines (155 loc) · 5.52 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
name: RL Tournament Validation Pipeline
on:
workflow_dispatch:
inputs:
username:
description: "GitHub username of the participant (owner of the fork)"
required: true
type: string
use_tenstorrent:
description: "Use Tenstorrent hardware (self-hosted runner)?"
required: true
type: choice
options:
- "no"
- "yes"
default: "no"
jobs:
validate_self_hosted:
if: ${{ github.event.inputs.use_tenstorrent == 'yes' }}
name: Validate Agent and Submit (Self-hosted)
runs-on: self-hosted
container:
image: python:3.10
options: >-
--device /dev/tenstorrent
-v /dev/hugepages-1G:/dev/hugepages-1G
env:
SUPABASE_URL: ${{ secrets.SUPABASE_URL }}
SUPABASE_ANON_KEY: ${{ secrets.SUPABASE_ANON_KEY }}
SUPABASE_SERVICE_ROLE_KEY: ${{ secrets.SUPABASE_SERVICE_ROLE_KEY }}
steps:
# === Step 0: Install dependencies (git + unzip) ===
- name: Install required tools
run: |
apt-get update
apt-get install -y git unzip
# === Step 1: Clone the participant's fork (HTTPS) ===
- name: Clone Participant Submission
run: |
USERNAME="${{ github.event.inputs.username }}"
REPO="https://github.com/${USERNAME}/UTMIST-AI2.git"
BRANCH="main"
echo "Cloning submission for: $USERNAME"
# Ensure a clean target directory
if [ -d submission ]; then
rm -rf submission
fi
git clone --branch "$BRANCH" "$REPO" submission
# === Step 2: Install submission dependencies ===
- name: Install dependencies
working-directory: submission
run: |
chmod +x install_tt.sh
./install_tt.sh
# === Step 3: Run validation ===
- name: Run validation
working-directory: ${{ github.workspace }}
env:
PYTHONPATH: ${{ github.workspace }}/submission
USERNAME: ${{ github.event.inputs.username }}
SUPABASE_URL: ${{ secrets.SUPABASE_URL }}
SUPABASE_ANON_KEY: ${{ secrets.SUPABASE_ANON_KEY }}
SUPABASE_SERVICE_ROLE_KEY: ${{ secrets.SUPABASE_SERVICE_ROLE_KEY }}
run: |
set -e
python -V
pip -V
echo "PWD=$(pwd)"
echo "Listing validate target:"
ls -la user/validate.py || true
echo "Removing rl-model.zip if it exists"
rm -f rl-model.zip
echo "Isolating PYTHONPATH to submission only"
export PYTHONPATH="$(pwd)"
python - <<'PY'
import importlib.util, sys
spec = importlib.util.find_spec('user.validate')
print('user.validate spec:', spec)
try:
import user.validate as v
print('user.validate file:', getattr(v, '__file__', None))
except Exception as e:
print('Pre-import failed:', e)
print('sys.path:', sys.path)
PY
pytest -s user/validate.py
# === Step 4: Upload results as an artifact ===
- name: Upload Results
uses: actions/upload-artifact@v4
with:
name: results-${{ github.event.inputs.username }}
path: submission/results/
validate_ubuntu:
if: ${{ github.event.inputs.use_tenstorrent == 'no' }}
name: Validate Agent and Submit (Ubuntu)
runs-on: ubuntu-latest
container:
image: python:3.10
env:
SUPABASE_URL: ${{ secrets.SUPABASE_URL }}
SUPABASE_ANON_KEY: ${{ secrets.SUPABASE_ANON_KEY }}
SUPABASE_SERVICE_ROLE_KEY: ${{ secrets.SUPABASE_SERVICE_ROLE_KEY }}
steps:
# === Step 0: Install dependencies (git + unzip) ===
- name: Install required tools
run: |
apt-get update
apt-get install -y git unzip
# === Step 1: Clone the participant's fork (HTTPS) ===
- name: Clone Participant Submission
run: |
USERNAME="${{ github.event.inputs.username }}"
REPO="https://github.com/${USERNAME}/UTMIST-AI2.git"
BRANCH="main"
echo "Cloning submission for: $USERNAME"
# Ensure a clean target directory
if [ -d submission ]; then
rm -rf submission
fi
git clone --branch "$BRANCH" "$REPO" submission
# === Step 2: Install submission dependencies ===
- name: Install dependencies
working-directory: submission
run: |
chmod +x install.sh
./install.sh
# === Step 3: Run validation ===
- name: Run validation
working-directory: submission
env:
PYTHONPATH: ${{ github.workspace }}/submission
USERNAME: ${{ github.event.inputs.username }}
run: |
set -e
echo "PWD=$(pwd)"
ls -la user/validate.py || true
export PYTHONPATH="$(pwd)"
python - <<'PY'
import importlib.util, sys
spec = importlib.util.find_spec('user.validate')
print('user.validate spec:', spec)
try:
import user.validate as v
print('user.validate file:', getattr(v, '__file__', None))
except Exception as e:
print('Pre-import failed:', e)
print('sys.path:', sys.path)
PY
pytest -s user/validate.py
# === Step 4: Upload results as an artifact ===
- name: Upload Results
uses: actions/upload-artifact@v4
with:
name: results-${{ github.event.inputs.username }}
path: submission/results/