Skip to content

RL Tournament Validation Pipeline #254

RL Tournament Validation Pipeline

RL Tournament Validation Pipeline #254

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/