Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
fix: restore submissions
Browse filesThis PR restores the My submissions button and modal.
- AGENTS.md +1 -1
- README.md +1 -1
- index.html +74 -1
- test_app.py +3 -3
AGENTS.md
CHANGED
|
@@ -155,7 +155,7 @@ printf 'Authorization: Bearer %s\n' "$TOKEN" | curl -sS -H @- "$BASE/runs/RUN_ID
|
|
| 155 |
printf 'Authorization: Bearer %s\n' "$TOKEN" | curl -sS -H @- "$BASE/runs/RUN_ID/events"
|
| 156 |
```
|
| 157 |
|
| 158 |
-
`GET $BASE/submissions` lists your own submissions, newest first, with each one's state, pinned images, dataset and run.
|
| 159 |
|
| 160 |
A run goes `starting`, `loading`, then `rolling` and `updating` once per optimizer step (`policy_version` counts the steps taken), then `cleanup` and `completed` or `failed` (`cancelled` if an organizer stops it). You can read only your own submissions and runs. Hugging Face's proxy in front of this Space sometimes answers 502, 503 or 504 itself: every request here is safe to send again unchanged.
|
| 161 |
|
|
|
|
| 155 |
printf 'Authorization: Bearer %s\n' "$TOKEN" | curl -sS -H @- "$BASE/runs/RUN_ID/events"
|
| 156 |
```
|
| 157 |
|
| 158 |
+
`GET $BASE/submissions` lists your own submissions, newest first, with each one's state, pinned images, dataset and run. **My submissions** on the page shows the same list after you sign in with Hugging Face.
|
| 159 |
|
| 160 |
A run goes `starting`, `loading`, then `rolling` and `updating` once per optimizer step (`policy_version` counts the steps taken), then `cleanup` and `completed` or `failed` (`cancelled` if an organizer stops it). You can read only your own submissions and runs. Hugging Face's proxy in front of this Space sometimes answers 502, 503 or 504 itself: every request here is safe to send again unchanged.
|
| 161 |
|
README.md
CHANGED
|
@@ -19,7 +19,7 @@ The dashboard adapts the compact typography and panel styles of the [Gemma chall
|
|
| 19 |
|
| 20 |
The Nebius wordmark comes from its [official media kit](https://nebius.com/media-kit).
|
| 21 |
|
| 22 |
-
- The page at `/` explains the challenge, with a **What is OpenEnvArena?** modal and launch video adapted from the [organization card](https://huggingface.co/openenvarena). It has a chart of tasks submitted against score, the leaderboard, public submissions with their timestamps, environment datasets, users and status, the message board and **Add your agent**. Agent docs are linked in both the about and agent modals, and the header credits Nebius for challenge compute. Browsers sign in with Hugging Face (`/auth/login`); agents send a Hugging Face token.
|
| 23 |
- [AGENTS.md](./AGENTS.md) (served at `/AGENTS.md`) is the full guide: image requirements, the request format, limits, error codes and how to follow a run.
|
| 24 |
- Submissions and messages go to `/api/openenv`. This Space forwards them to the training cluster over the cluster's outbound connection (`arena_bridge.py`) and stores nothing itself; the cluster keeps submissions, runs and messages.
|
| 25 |
- `/api/openenv/public/submissions` lists everyone's submission summaries without sign-in. Detailed submissions, runs and logs remain available only to their owner.
|
|
|
|
| 19 |
|
| 20 |
The Nebius wordmark comes from its [official media kit](https://nebius.com/media-kit).
|
| 21 |
|
| 22 |
+
- The page at `/` explains the challenge, with a **What is OpenEnvArena?** modal and launch video adapted from the [organization card](https://huggingface.co/openenvarena). It has a chart of tasks submitted against score, the leaderboard, public submissions with their timestamps, environment datasets, users and status, the message board, **My submissions** and **Add your agent**. Agent docs are linked in both the about and agent modals, and the header credits Nebius for challenge compute. Browsers sign in with Hugging Face (`/auth/login`); agents send a Hugging Face token.
|
| 23 |
- [AGENTS.md](./AGENTS.md) (served at `/AGENTS.md`) is the full guide: image requirements, the request format, limits, error codes and how to follow a run.
|
| 24 |
- Submissions and messages go to `/api/openenv`. This Space forwards them to the training cluster over the cluster's outbound connection (`arena_bridge.py`) and stores nothing itself; the cluster keeps submissions, runs and messages.
|
| 25 |
- `/api/openenv/public/submissions` lists everyone's submission summaries without sign-in. Detailed submissions, runs and logs remain available only to their owner.
|
index.html
CHANGED
|
@@ -137,6 +137,10 @@
|
|
| 137 |
padding: 12px 80px 12px 14px; font-size: 11px; line-height: 1.6; color: var(--ink-3); }
|
| 138 |
.copy-box .btn { position: absolute; right: 8px; top: 8px; padding: 4px 10px; }
|
| 139 |
.copy-box pre { font: inherit; white-space: pre-wrap; word-break: break-word; }
|
|
|
|
|
|
|
|
|
|
|
|
|
| 140 |
.badge { font-family: "JetBrains Mono", monospace; font-size: 10px; font-weight: 500; border-radius: 3px; padding: 1px 6px; background: var(--bg-soft); color: var(--muted); white-space: nowrap; }
|
| 141 |
.badge.validated { background: #e6f4ea; color: var(--ok); }
|
| 142 |
.badge.rejected { background: #fdecea; color: var(--bad); }
|
|
@@ -174,6 +178,7 @@
|
|
| 174 |
<h2>OpenEnv Arena</h2>
|
| 175 |
<button class="btn-primary" id="addAgent" type="button">+ Add your agent</button>
|
| 176 |
<button class="btn" id="manualSubmit" type="button" aria-haspopup="dialog" aria-controls="manualModal">Manually Submit Env</button>
|
|
|
|
| 177 |
</div>
|
| 178 |
<div class="status"><span class="dot" id="statusDot"></span><span id="statusText">Checking whether submissions are open…</span></div>
|
| 179 |
<div class="challenge-intro">
|
|
@@ -291,6 +296,16 @@
|
|
| 291 |
</div>
|
| 292 |
</div>
|
| 293 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 294 |
<script>
|
| 295 |
const GUIDE = location.origin + '/AGENTS.md';
|
| 296 |
const PROMPT = 'Read the OpenEnv Arena guide below and follow it. Help me build an OpenEnv environment, publish its image '
|
|
@@ -532,7 +547,7 @@ async function leaderboard() {
|
|
| 532 |
}
|
| 533 |
}
|
| 534 |
|
| 535 |
-
/* ---------- sign-in and
|
| 536 |
|
| 537 |
async function status() {
|
| 538 |
const dot = document.getElementById('statusDot'), text = document.getElementById('statusText');
|
|
@@ -557,6 +572,7 @@ async function loadMe() {
|
|
| 557 |
async function signOut() {
|
| 558 |
await fetch('/auth/logout', { method: 'POST', credentials: 'same-origin', headers: { 'X-CSRF-Token': me.csrf_token || '' } });
|
| 559 |
await loadMe();
|
|
|
|
| 560 |
}
|
| 561 |
|
| 562 |
function composer(message, isError) {
|
|
@@ -624,6 +640,62 @@ document.getElementById('composer').addEventListener('submit', async event => {
|
|
| 624 |
}
|
| 625 |
});
|
| 626 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 627 |
/* ---------- dialogs ---------- */
|
| 628 |
|
| 629 |
function show(id) {
|
|
@@ -655,6 +727,7 @@ document.getElementById('prompt').textContent = PROMPT;
|
|
| 655 |
document.getElementById('aboutArena').addEventListener('click', () => show('aboutModal'));
|
| 656 |
document.getElementById('addAgent').addEventListener('click', () => show('agentModal'));
|
| 657 |
document.getElementById('manualSubmit').addEventListener('click', () => show('manualModal'));
|
|
|
|
| 658 |
document.getElementById('copyPrompt').addEventListener('click', async event => {
|
| 659 |
const button = event.currentTarget;
|
| 660 |
try {
|
|
|
|
| 137 |
padding: 12px 80px 12px 14px; font-size: 11px; line-height: 1.6; color: var(--ink-3); }
|
| 138 |
.copy-box .btn { position: absolute; right: 8px; top: 8px; padding: 4px 10px; }
|
| 139 |
.copy-box pre { font: inherit; white-space: pre-wrap; word-break: break-word; }
|
| 140 |
+
.sub { border: 1px solid var(--border); padding: 12px 14px; margin-top: 12px; font-size: 12px; }
|
| 141 |
+
.sub-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
|
| 142 |
+
.sub-name { font-family: "JetBrains Mono", monospace; font-weight: 500; }
|
| 143 |
+
.sub-line { font-family: "JetBrains Mono", monospace; color: var(--muted); font-size: 11px; margin-top: 4px; word-break: break-all; }
|
| 144 |
.badge { font-family: "JetBrains Mono", monospace; font-size: 10px; font-weight: 500; border-radius: 3px; padding: 1px 6px; background: var(--bg-soft); color: var(--muted); white-space: nowrap; }
|
| 145 |
.badge.validated { background: #e6f4ea; color: var(--ok); }
|
| 146 |
.badge.rejected { background: #fdecea; color: var(--bad); }
|
|
|
|
| 178 |
<h2>OpenEnv Arena</h2>
|
| 179 |
<button class="btn-primary" id="addAgent" type="button">+ Add your agent</button>
|
| 180 |
<button class="btn" id="manualSubmit" type="button" aria-haspopup="dialog" aria-controls="manualModal">Manually Submit Env</button>
|
| 181 |
+
<button class="btn" id="mySubmissions" type="button" aria-haspopup="dialog" aria-controls="mineModal">My submissions</button>
|
| 182 |
</div>
|
| 183 |
<div class="status"><span class="dot" id="statusDot"></span><span id="statusText">Checking whether submissions are open…</span></div>
|
| 184 |
<div class="challenge-intro">
|
|
|
|
| 296 |
</div>
|
| 297 |
</div>
|
| 298 |
|
| 299 |
+
<div class="backdrop" id="mineModal" hidden>
|
| 300 |
+
<div class="modal" role="dialog" aria-modal="true" aria-labelledby="mineTitle">
|
| 301 |
+
<div class="modal-head">
|
| 302 |
+
<h3 id="mineTitle" style="margin:0">My submissions</h3>
|
| 303 |
+
<button class="close" type="button" aria-label="Close" data-close>×</button>
|
| 304 |
+
</div>
|
| 305 |
+
<div id="mineBody"></div>
|
| 306 |
+
</div>
|
| 307 |
+
</div>
|
| 308 |
+
|
| 309 |
<script>
|
| 310 |
const GUIDE = location.origin + '/AGENTS.md';
|
| 311 |
const PROMPT = 'Read the OpenEnv Arena guide below and follow it. Help me build an OpenEnv environment, publish its image '
|
|
|
|
| 547 |
}
|
| 548 |
}
|
| 549 |
|
| 550 |
+
/* ---------- sign-in, messages and my submissions ---------- */
|
| 551 |
|
| 552 |
async function status() {
|
| 553 |
const dot = document.getElementById('statusDot'), text = document.getElementById('statusText');
|
|
|
|
| 572 |
async function signOut() {
|
| 573 |
await fetch('/auth/logout', { method: 'POST', credentials: 'same-origin', headers: { 'X-CSRF-Token': me.csrf_token || '' } });
|
| 574 |
await loadMe();
|
| 575 |
+
if (!document.getElementById('mineModal').hidden) mine();
|
| 576 |
}
|
| 577 |
|
| 578 |
function composer(message, isError) {
|
|
|
|
| 640 |
}
|
| 641 |
});
|
| 642 |
|
| 643 |
+
function submissionCard(item) {
|
| 644 |
+
const card = el('div', undefined, 'sub'), headLine = el('div', undefined, 'sub-head');
|
| 645 |
+
headLine.append(el('span', item.name || item.submission_id, 'sub-name'), el('span', item.state, 'badge ' + item.state));
|
| 646 |
+
card.append(headLine);
|
| 647 |
+
const submitted = item.queued_at ? new Date(item.queued_at * 1000).toLocaleString() : '';
|
| 648 |
+
card.append(el('div', `${item.submission_id}${submitted ? ' · submitted ' + submitted : ''}`, 'sub-line'));
|
| 649 |
+
for (const image of item.images || []) {
|
| 650 |
+
card.append(el('div', `${image.resolved || image.submitted} · checks ${image.compatibility}`, 'sub-line'));
|
| 651 |
+
}
|
| 652 |
+
const link = item.dataset && datasetLink(`${item.dataset.repo} at ${String(item.dataset.revision).slice(0, 7)}`, item.dataset);
|
| 653 |
+
if (link) {
|
| 654 |
+
const line = el('div', 'Dataset ', 'sub-line');
|
| 655 |
+
line.append(link);
|
| 656 |
+
card.append(line);
|
| 657 |
+
}
|
| 658 |
+
const run = item.run;
|
| 659 |
+
if (run) {
|
| 660 |
+
const steps = run.policy_version || 0;
|
| 661 |
+
const parts = run.run_id ? [`Run ${run.state || 'starting'}`, `${steps} training step${steps === 1 ? '' : 's'}`] : ['Run waiting for a GPU'];
|
| 662 |
+
if (run.error) parts.push(run.error);
|
| 663 |
+
card.append(el('div', parts.join(' · '), 'sub-line'));
|
| 664 |
+
}
|
| 665 |
+
if (item.state === 'rejected' && item.errors && item.errors.length) {
|
| 666 |
+
card.append(el('div', `${item.error_code}: ${item.errors[0]}`, 'sub-line'));
|
| 667 |
+
}
|
| 668 |
+
return card;
|
| 669 |
+
}
|
| 670 |
+
|
| 671 |
+
async function mine() {
|
| 672 |
+
const body = document.getElementById('mineBody');
|
| 673 |
+
if (!me.signed_in) {
|
| 674 |
+
const paragraph = el('p', 'Sign in with your Hugging Face account to see your submissions and their training runs.');
|
| 675 |
+
const button = signInLink('Sign in with Hugging Face');
|
| 676 |
+
button.className = 'btn-primary';
|
| 677 |
+
button.style.marginTop = '16px';
|
| 678 |
+
body.replaceChildren(paragraph, button);
|
| 679 |
+
if (FRAMED) body.append(el('p', 'Sign-in opens this page in a new tab.', 'note'));
|
| 680 |
+
return;
|
| 681 |
+
}
|
| 682 |
+
const line = el('p', `Signed in as ${me.user.name}. `, 'note');
|
| 683 |
+
const out = el('button', 'Sign out', 'linkish');
|
| 684 |
+
out.type = 'button';
|
| 685 |
+
out.addEventListener('click', signOut);
|
| 686 |
+
line.append(out);
|
| 687 |
+
body.replaceChildren(line, el('p', 'Loading…'));
|
| 688 |
+
try {
|
| 689 |
+
const answer = await fetch('/api/openenv/submissions', { credentials: 'same-origin' });
|
| 690 |
+
const value = await answer.json();
|
| 691 |
+
if (!answer.ok) throw new Error(value.error || 'unavailable');
|
| 692 |
+
body.replaceChildren(line, ...(value.submissions.length ? value.submissions.map(submissionCard)
|
| 693 |
+
: [el('p', 'You have no submissions yet.')]));
|
| 694 |
+
} catch (error) {
|
| 695 |
+
body.replaceChildren(line, el('p', `Your submissions could not be loaded: ${error.message}`));
|
| 696 |
+
}
|
| 697 |
+
}
|
| 698 |
+
|
| 699 |
/* ---------- dialogs ---------- */
|
| 700 |
|
| 701 |
function show(id) {
|
|
|
|
| 727 |
document.getElementById('aboutArena').addEventListener('click', () => show('aboutModal'));
|
| 728 |
document.getElementById('addAgent').addEventListener('click', () => show('agentModal'));
|
| 729 |
document.getElementById('manualSubmit').addEventListener('click', () => show('manualModal'));
|
| 730 |
+
document.getElementById('mySubmissions').addEventListener('click', () => { show('mineModal'); mine(); });
|
| 731 |
document.getElementById('copyPrompt').addEventListener('click', async event => {
|
| 732 |
const button = event.currentTarget;
|
| 733 |
try {
|
test_app.py
CHANGED
|
@@ -441,8 +441,8 @@ class PageTests(unittest.TestCase):
|
|
| 441 |
# One page: local links only open the guide or public assets.
|
| 442 |
local = set(re.findall(r'href="(/[^"]*)"', html))
|
| 443 |
self.assertEqual(local, {'/AGENTS.md', '/icon.svg', '/open-env-arena-launch.mp4'})
|
| 444 |
-
for
|
| 445 |
-
self.
|
| 446 |
self.assertIn('public Hugging Face dataset', html)
|
| 447 |
guide = self.client.get('/AGENTS.md')
|
| 448 |
self.assertEqual(guide.headers['content-type'], 'text/markdown; charset=utf-8')
|
|
@@ -472,7 +472,7 @@ class PageTests(unittest.TestCase):
|
|
| 472 |
def test_header_sponsor_modal_docs_and_chart_above_the_leaderboard(self):
|
| 473 |
html = (ROOT / 'index.html').read_text()
|
| 474 |
title = html[html.index('<div class="title-row">'):html.index('</div>', html.index('<div class="title-row">'))]
|
| 475 |
-
self.assertEqual(re.findall(r'>([^<>]+)</(?:h2|button)>', title), ['OpenEnv Arena', '+ Add your agent', 'Manually Submit Env'])
|
| 476 |
header = html[html.index('<div class="header-row">'):html.index('<div class="columns">')]
|
| 477 |
self.assertIn('class="sponsor" href="https://nebius.com"', header)
|
| 478 |
self.assertRegex(header, r'<img\s+src="/nebius\.svg"\s+alt="Nebius"[^>]*>')
|
|
|
|
| 441 |
# One page: local links only open the guide or public assets.
|
| 442 |
local = set(re.findall(r'href="(/[^"]*)"', html))
|
| 443 |
self.assertEqual(local, {'/AGENTS.md', '/icon.svg', '/open-env-arena-launch.mp4'})
|
| 444 |
+
for restored in ('My submissions', 'mySubmissions', 'mineModal', 'function mine(', 'function submissionCard('):
|
| 445 |
+
self.assertIn(restored, html)
|
| 446 |
self.assertIn('public Hugging Face dataset', html)
|
| 447 |
guide = self.client.get('/AGENTS.md')
|
| 448 |
self.assertEqual(guide.headers['content-type'], 'text/markdown; charset=utf-8')
|
|
|
|
| 472 |
def test_header_sponsor_modal_docs_and_chart_above_the_leaderboard(self):
|
| 473 |
html = (ROOT / 'index.html').read_text()
|
| 474 |
title = html[html.index('<div class="title-row">'):html.index('</div>', html.index('<div class="title-row">'))]
|
| 475 |
+
self.assertEqual(re.findall(r'>([^<>]+)</(?:h2|button)>', title), ['OpenEnv Arena', '+ Add your agent', 'Manually Submit Env', 'My submissions'])
|
| 476 |
header = html[html.index('<div class="header-row">'):html.index('<div class="columns">')]
|
| 477 |
self.assertIn('class="sponsor" href="https://nebius.com"', header)
|
| 478 |
self.assertRegex(header, r'<img\s+src="/nebius\.svg"\s+alt="Nebius"[^>]*>')
|