Merge tune.html and test.html into workload.html
Always show a network, even if it is blank due to a non NNUE engine Redirect test/tune searches where the names are swapped
This commit is contained in:
1 parent
003148abbe
commit
f1626daad9
6 files changed
+277
-385
No files matched your search
@@ -260,6 +260,9 @@ def spsa_param_digest(workload):
|
||||
|
||||
return digest
|
||||
|
||||
def spsa_param_digest_headers(workload):
|
||||
return ['Name', 'Curr', 'Start', 'Min', 'Max', 'C', 'C_end', 'R', 'R_end']
|
||||
|
||||
def spsa_original_input(workload):
|
||||
|
||||
# Maintain the original order, if there was one
|
||||
@@ -366,6 +369,7 @@ def test_is_fischer(test):
|
||||
|
||||
|
||||
register.filter('spsa_param_digest', spsa_param_digest)
|
||||
register.filter('spsa_param_digest_headers', spsa_param_digest_headers)
|
||||
register.filter('spsa_original_input', spsa_original_input)
|
||||
register.filter('spsa_optimal_values', spsa_optimal_values)
|
||||
|
||||
|
||||
+7
-10
@@ -27,10 +27,11 @@ import django.contrib.auth
|
||||
import OpenBench.config
|
||||
import OpenBench.utils
|
||||
|
||||
from OpenBench.workloads.get_workload import get_workload
|
||||
from OpenBench.workloads.create_workload import create_workload
|
||||
from OpenBench.workloads.verify_workload import verify_workload
|
||||
from OpenBench.workloads.get_workload import get_workload
|
||||
from OpenBench.workloads.modify_workload import modify_workload
|
||||
from OpenBench.workloads.verify_workload import verify_workload
|
||||
from OpenBench.workloads.view_workload import view_workload
|
||||
|
||||
from OpenBench.config import OPENBENCH_CONFIG
|
||||
from OpenSite.settings import PROJECT_PATH
|
||||
@@ -464,11 +465,9 @@ def test(request, id, action=None):
|
||||
|
||||
# Verify that it is indeed a Test and not a Tune
|
||||
if test.test_mode != 'SPRT' and test.test_mode != 'GAMES':
|
||||
return redirect(request, '/index/', error='You are trying to view a Tune not Test')
|
||||
return redirect(request, '/tune/%d' % (id))
|
||||
|
||||
# Package everything up and display the test
|
||||
data = { 'test' : test, 'results': Result.objects.filter(test=test) }
|
||||
return render(request, 'test.html', data)
|
||||
return view_workload(request, test, 'TEST')
|
||||
|
||||
def tune(request, id, action=None):
|
||||
|
||||
@@ -482,11 +481,9 @@ def tune(request, id, action=None):
|
||||
|
||||
# Verify that it is indeed a Tune and not a Test
|
||||
if tune.test_mode == 'SPRT' or tune.test_mode == 'GAMES':
|
||||
return redirect(request, '/index/', error='You are trying to view a Test not Tune')
|
||||
return redirect(request, '/test/%d' % (id))
|
||||
|
||||
# Package everything up and display the Tune
|
||||
data = { 'test' : tune, 'results': Result.objects.filter(test=tune) }
|
||||
return render(request, 'tune.html', data)
|
||||
return view_workload(request, tune, 'TUNE')
|
||||
|
||||
def create_test(request):
|
||||
return create_workload(request, 'TEST')
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
||||
# #
|
||||
# OpenBench is a chess engine testing framework authored by Andrew Grant. #
|
||||
# <https://github.com/AndyGrant/OpenBench> <andrew@grantnet.us> #
|
||||
# #
|
||||
# OpenBench is free software: you can redistribute it and/or modify #
|
||||
# it under the terms of the GNU General Public License as published by #
|
||||
# the Free Software Foundation, either version 3 of the License, or #
|
||||
# (at your option) any later version. #
|
||||
# #
|
||||
# OpenBench is distributed in the hope that it will be useful, #
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
|
||||
# GNU General Public License for more details. #
|
||||
# #
|
||||
# You should have received a copy of the GNU General Public License #
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
|
||||
# #
|
||||
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
||||
|
||||
# Module serves a singular purpose, to invoke:
|
||||
# >>> view_workload(request, workload, type)
|
||||
#
|
||||
# A Workload can be a "TEST", which is an SPRT, or FIXED type.
|
||||
# A Workload can be a "TUNE", which is an SPSA tuning session
|
||||
|
||||
import OpenBench.views
|
||||
|
||||
from OpenBench.models import *
|
||||
|
||||
def view_workload(request, workload, workload_type):
|
||||
|
||||
assert workload_type in [ 'TEST', 'TUNE' ]
|
||||
|
||||
data = {
|
||||
'workload' : workload,
|
||||
'results' : Result.objects.filter(test=workload)
|
||||
}
|
||||
|
||||
if workload_type == 'TEST':
|
||||
data['type'] = workload_type
|
||||
data['dev_text'] = 'Dev'
|
||||
data['submit_endpoint'] = '/newTest/'
|
||||
|
||||
if workload_type == 'TUNE':
|
||||
data['type'] = workload_type
|
||||
data['dev_text'] = ''
|
||||
data['submit_endpoint'] = '/newTune/'
|
||||
|
||||
return OpenBench.views.render(request, 'workload.html', data)
|
||||
@@ -1,177 +0,0 @@
|
||||
{% extends "OpenBench/base.html" %}
|
||||
|
||||
{% load mytags %}
|
||||
{% load static %}
|
||||
|
||||
{% block style %}
|
||||
{% endblock %}
|
||||
|
||||
{% block scripts %}
|
||||
<script src="{% static 'copy_text.js' %}"></script>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div id="config" style="display: block; overflow-x: auto;">
|
||||
<table class="test-config left-align wrappable" style="table-layout: auto; width: 100%;">
|
||||
<tr><td class="td-label">Author</td><td>{{test.author|capfirst}}</td></tr>
|
||||
<tr><td class="td-label">Creation</td><td class="timestamp">{{test.creation|date:'U'}}</td></tr>
|
||||
<tr><td class="td-label">Dev Engine</td><td>{{test.dev_engine}}</td></tr>
|
||||
<tr><td class="td-label">Dev Source</td><td><a href="{{test.dev_repo}}">{{test.dev_repo}}</a></td></tr>
|
||||
<tr><td class="td-label">Dev Sha</td><td>{{test.dev.sha}}</td></tr>
|
||||
<tr><td class="td-label">Dev Branch</td><td class="branch_name">{{test.dev.name|prettyName}}</td></tr>
|
||||
<tr><td class="td-label">Dev Bench</td><td>{{test.dev.bench}}</td></tr>
|
||||
{% if test.dev_network %}
|
||||
<tr>
|
||||
<td class="td-label">Dev Network</td>
|
||||
<td><a href="{{test|network_download_link:'dev'}}">{{test.dev_netname}}</td>
|
||||
</tr> {% endif %}
|
||||
<tr><td class="td-label">Dev Options</td><td>{{test.dev_options}}</td></tr>
|
||||
<tr><td class="td-label">Dev Time</td><td>{{test.dev_time_control}}</td></tr>
|
||||
<tr><td class="td-label">Base Engine</td><td>{{test.base_engine}}</td></tr>
|
||||
<tr><td class="td-label">Base Source</td><td><a href="{{test.base_repo}}">{{test.base_repo}}</a></td></tr>
|
||||
<tr><td class="td-label">Base Sha</td><td>{{test.base.sha}}</td></tr>
|
||||
<tr><td class="td-label">Base Branch</td><td class="branch_name">{{test.base.name|prettyName}}</td></tr>
|
||||
<tr><td class="td-label">Base Bench</td><td>{{test.base.bench}}</td></tr>
|
||||
{% if test.base_network %}
|
||||
<tr>
|
||||
<td class="td-label">Base Network</td>
|
||||
<td><a href="{{test|network_download_link:'base'}}">{{test.base_netname}}</td>
|
||||
</tr> {% endif %}
|
||||
<tr><td class="td-label">Base Options</td><td>{{test.base_options}}</td></tr>
|
||||
<tr><td class="td-label">Base Time</td><td>{{test.base_time_control}}</td></tr>
|
||||
<tr><td class="td-label">Opening Book</td><td><a href="{{test|book_download_link}}">{{test.book_name}}</a></td></tr>
|
||||
<tr><td class="td-label">Upload PGNs</td><td>{{test.upload_pgns}}</td></tr>
|
||||
<tr><td class="td-label">Syzygy WDL</td><td>{{test.syzygy_wdl}}</td></tr>
|
||||
<tr><td class="td-label">Syzygy ADJ.</td><td>{{test.syzygy_adj}}</td></tr>
|
||||
<tr><td class="td-label">Win ADJ.</td><td>{{test.win_adj}}</td></tr>
|
||||
<tr><td class="td-label">Draw ADJ.</td><td>{{test.draw_adj}}</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="actions" class="ml-3">
|
||||
|
||||
<!-- Dev vs Base [Git Diff Link] -->
|
||||
<h4><a href="{{test|gitDiffLink}}">{{test|git_diff_text}}</a></h4>
|
||||
|
||||
<div class="anchor-container">
|
||||
<!-- Approve Button: For Admins, or Cross-approvers -->
|
||||
{% if not test.approved and profile.approver and profile.user.username != test.author %}
|
||||
<a class="anchorbutton btn-blue" href="/test/{{test.id}}/APPROVE">Approve</a>
|
||||
{% elif not test.approved and request.user.is_superuser %}
|
||||
<a class="anchorbutton btn-blue" href="/test/{{test.id}}/APPROVE">Approve</a>
|
||||
{% else %}
|
||||
<a class="anchorbutton btn-disabled">Approve</a>
|
||||
{% endif %}
|
||||
|
||||
<!-- Restart Button: For Approvers or Test Authors of finished tests -->
|
||||
{% if test.finished and profile.approver %}
|
||||
<a class="anchorbutton btn-yellow" href="/test/{{test.id}}/RESTART">Restart</a>
|
||||
{% elif test.finished and profile.user.username == test.author %}
|
||||
<a class="anchorbutton btn-yellow" href="/test/{{test.id}}/RESTART">Restart</a>
|
||||
{% elif test.finished %}
|
||||
<a class="anchorbutton btn-disabled">Restart</a>
|
||||
{% endif %}
|
||||
|
||||
<!-- Stop Button: For Approvers or Test Authors of active tests -->
|
||||
{% if not test.finished and profile.approver %}
|
||||
<a class="anchorbutton btn-yellow" href="/test/{{test.id}}/STOP">Stop</a>
|
||||
{% elif not test.finished and profile.user.username == test.author %}
|
||||
<a class="anchorbutton btn-yellow" href="/test/{{test.id}}/STOP">Stop</a>
|
||||
{% elif not test.finished %}
|
||||
<a class="anchorbutton btn-disabled">Stop</a>
|
||||
{% endif %}
|
||||
|
||||
<!-- Delete/Restore Button: For Approvers or Test Authors -->
|
||||
{% if profile.approver or profile.user.username == test.author %}
|
||||
{% if test.deleted %}
|
||||
<a class="anchorbutton btn-preset" href="/test/{{test.id}}/RESTORE">Restore</a>
|
||||
{% else %}
|
||||
<a class="anchorbutton btn-red" href="/test/{{test.id}}/DELETE">Delete</a>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% if test.deleted %}
|
||||
<a class="anchorbutton btn-disabled">Restore</a>
|
||||
{% else %}
|
||||
<a class="anchorbutton btn-disabled">Delete</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="anchor-container">
|
||||
<!-- Copy Button: Copy the current results statblock -->
|
||||
<a class="mt-1 anchorbutton btn-blue" onclick="copy_text('long-statblock', true)">
|
||||
Copy Stat Block
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{% if test.upload_pgns != 'FALSE' %}
|
||||
<div class="anchor-container">
|
||||
<!-- PGN Download Button -->
|
||||
<a class="mt-1 anchorbutton btn-blue" href="/api/pgns/{{test.id}}/">
|
||||
Download PGN Archive
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Elo, (SPRT/LRR if SPRT, otherwise CONF), Games -->
|
||||
<pre class="long-statblock" id="long-statblock">{{test|longStatBlock|linebreaksbr}}</pre>
|
||||
|
||||
<!-- Forum to modify the Priority or Throughput -->
|
||||
<form method="POST" action="/test/{{test.id}}/MODIFY">
|
||||
{% csrf_token %}
|
||||
<div class="form">
|
||||
<div class="col-full">
|
||||
<div class="row">
|
||||
<label>Priority</label><input value="{{test.priority}}" name="priority">
|
||||
</div>
|
||||
<div class="row">
|
||||
<label>Throughput</label><input value="{{test.throughput}}" name="throughput">
|
||||
</div>
|
||||
<div class="row">
|
||||
<label>Workload Size</label><input value="{{test.workload_size}}" name="workload_size">
|
||||
</div>
|
||||
<!-- Edit Button: For Approvers or Test Authors -->
|
||||
{% if profile.approver or profile.user.username == test.author %}
|
||||
<input class="anchorbutton btn-blue w-100" type="submit" name="submit" value="Modify">
|
||||
{% else %}
|
||||
<input class="anchorbutton btn-disabled w-100" type="submit" name="submit" value="Modify">
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div id="results" class="w-100 mt-3" style="float:left;">
|
||||
<table class="stripes wrappable">
|
||||
<tr class="table-header">
|
||||
<th>#</th>
|
||||
<th>User</th>
|
||||
<th>Updated</th>
|
||||
<th style="width: 45px">Games</th>
|
||||
<th style="width: 45px">Won</th>
|
||||
<th style="width: 45px">Lost</th>
|
||||
<th style="width: 45px">Drawn</th>
|
||||
<th style="width: 45px">Time</th>
|
||||
<th style="width: 45px">Crash</th>
|
||||
</tr>
|
||||
|
||||
{% for result in results %}
|
||||
<tr>
|
||||
<td><a href="/machines/{{result.machine.id}}">{{result.machine.id}}</a></td>
|
||||
<td>{{result.machine.user.username|capfirst}}</td>
|
||||
<td class="timestamp">{{result.updated|date:'U'}}</td>
|
||||
<td class="numeric">{{result.games}}</td>
|
||||
<td class="numeric">{{result.wins}}</td>
|
||||
<td class="numeric">{{result.losses}}</td>
|
||||
<td class="numeric">{{result.draws}}</td>
|
||||
<td class="numeric">{{result.timeloss}}</td>
|
||||
<td class="numeric">{{result.crashes}}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
@@ -1,198 +0,0 @@
|
||||
{% extends "OpenBench/base.html" %}
|
||||
|
||||
{% load mytags %}
|
||||
{% load static %}
|
||||
|
||||
{% block style %}
|
||||
{% endblock %}
|
||||
|
||||
{% block scripts %}
|
||||
<script src="{% static 'copy_text.js' %}"></script>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div id="config" style="display: block; overflow-x: auto;">
|
||||
<table class="test-config left-align wrappable" style="table-layout: auto; width: 100%;">
|
||||
<tr><td class="td-label">Author</td><td>{{test.author|capfirst}}</td></tr>
|
||||
<tr><td class="td-label">Creation</td><td class="timestamp">{{test.creation|date:'U'}}</td></tr>
|
||||
<tr><td class="td-label">Engine</td><td>{{test.dev_engine}}</td></tr>
|
||||
<tr><td class="td-label">Source</td><td><a href="{{test.dev_repo}}">{{test.dev_repo}}</a></td></tr>
|
||||
<tr><td class="td-label">Sha</td><td>{{test.dev.sha}}</td></tr>
|
||||
<tr><td class="td-label">Branch</td><td class="branch_name">{{test.dev.name|prettyName}}</td></tr>
|
||||
<tr><td class="td-label">Bench</td><td>{{test.dev.bench}}</td></tr>
|
||||
{% if test.dev_network %}
|
||||
<tr>
|
||||
<td class="td-label">Network</td>
|
||||
<td><a href="{{test|network_download_link:'dev'}}">{{test.dev_netname}}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
<tr><td class="td-label">Options</td><td>{{test.dev_options}}</td></tr>
|
||||
<tr><td class="td-label">Time</td><td>{{test.dev_time_control}}</td></tr>
|
||||
<tr><td class="td-label">Opening Book</td><td><a href="{{test|book_download_link}}">{{test.book_name}}</a></td></tr>
|
||||
<tr><td class="td-label">Syzygy WDL</td><td>{{test.syzygy_wdl}}</td></tr>
|
||||
<tr><td class="td-label">Syzygy ADJ.</td><td>{{test.syzygy_adj}}</td></tr>
|
||||
<tr><td class="td-label">Win ADJ.</td><td>{{test.win_adj}}</td></tr>
|
||||
<tr><td class="td-label">Draw ADJ.</td><td>{{test.draw_adj}}</td></tr>
|
||||
<tr><td class="td-label">Alpha</td><td>{{test.spsa.Alpha}}</td></tr>
|
||||
<tr><td class="td-label">Gamma</td><td>{{test.spsa.Gamma}}</td></tr>
|
||||
<tr><td class="td-label">A-Ratio</td><td>{{test.spsa.A_ratio}}</td></tr>
|
||||
<tr><td class="td-label">Reporting</td><td>{{test.spsa.reporting_type}}</td></tr>
|
||||
<tr><td class="td-label">Distribution</td><td>{{test.spsa.distribution_type}}</td></tr>
|
||||
<tr><td class="td-label">Pairs Per Point</td><td>{{test.workload_size}}</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="actions" class="ml-3">
|
||||
|
||||
<!-- Dev vs Base [Git Diff Link] -->
|
||||
<h4><a href="{{test|gitDiffLink}}">{{test|workload_pretty_name}}</a></h4>
|
||||
|
||||
<div class="anchor-container">
|
||||
<!-- Approve Button: For Admins, or Cross-approvers -->
|
||||
{% if not test.approved and profile.approver and profile.user.username != test.author %}
|
||||
<a class="anchorbutton btn-blue" href="/tune/{{test.id}}/APPROVE">Approve</a>
|
||||
{% elif not test.approved and request.user.is_superuser %}
|
||||
<a class="anchorbutton btn-blue" href="/tune/{{test.id}}/APPROVE">Approve</a>
|
||||
{% else %}
|
||||
<a class="anchorbutton btn-disabled">Approve</a>
|
||||
{% endif %}
|
||||
|
||||
<!-- Restart Button: For Approvers or Test Authors of finished tests -->
|
||||
{% if test.finished and profile.approver %}
|
||||
<a class="anchorbutton btn-yellow" href="/tune/{{test.id}}/RESTART">Restart</a>
|
||||
{% elif test.finished and profile.user.username == test.author %}
|
||||
<a class="anchorbutton btn-yellow" href="/tune/{{test.id}}/RESTART">Restart</a>
|
||||
{% elif test.finished %}
|
||||
<a class="anchorbutton btn-disabled">Restart</a>
|
||||
{% endif %}
|
||||
|
||||
<!-- Stop Button: For Approvers or Test Authors of active tests -->
|
||||
{% if not test.finished and profile.approver %}
|
||||
<a class="anchorbutton btn-yellow" href="/tune/{{test.id}}/STOP">Stop</a>
|
||||
{% elif not test.finished and profile.user.username == test.author %}
|
||||
<a class="anchorbutton btn-yellow" href="/tune/{{test.id}}/STOP">Stop</a>
|
||||
{% elif not test.finished %}
|
||||
<a class="anchorbutton btn-disabled">Stop</a>
|
||||
{% endif %}
|
||||
|
||||
<!-- Delete/Restore Button: For Approvers or Test Authors -->
|
||||
{% if profile.approver or profile.user.username == test.author %}
|
||||
{% if test.deleted %}
|
||||
<a class="anchorbutton btn-preset" href="/tune/{{test.id}}/RESTORE">Restore</a>
|
||||
{% else %}
|
||||
<a class="anchorbutton btn-red" href="/tune/{{test.id}}/DELETE">Delete</a>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% if test.deleted %}
|
||||
<a class="anchorbutton btn-disabled">Restore</a>
|
||||
{% else %}
|
||||
<a class="anchorbutton btn-disabled">Delete</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="anchor-container">
|
||||
<!-- Copies Raw SPSA Input from a hidden element -->
|
||||
<pre id="spsa-input" style="display: none">{{test|spsa_original_input}}</pre>
|
||||
<a class="mt-1 anchorbutton btn-blue" onclick="copy_text('spsa-input', false)">
|
||||
Copy SPSA Inputs
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="anchor-container">
|
||||
<!-- Copies SPSA Optimal Values from a hidden element -->
|
||||
<pre id="spsa-output" style="display: none">{{test|spsa_optimal_values}}</pre>
|
||||
<a class="mt-1 anchorbutton btn-blue" onclick="copy_text('spsa-output', false)">
|
||||
Copy SPSA Outputs
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!-- Elo, (SPRT/LRR if SPRT, otherwise CONF), Games -->
|
||||
<!-- For SPSA, # of Params, Iterations, and Games -->
|
||||
<pre class="long-statblock" id="long-statblock">{{test|shortStatBlock|linebreaksbr}}</pre>
|
||||
|
||||
<!-- Forum to modify the Priority or Throughput -->
|
||||
<form method="POST" action="/tune/{{test.id}}/MODIFY">
|
||||
{% csrf_token %}
|
||||
<div class="form">
|
||||
<div class="col-full">
|
||||
<div class="row">
|
||||
<label>Priority</label>
|
||||
<input value="{{test.priority}}" name="priority">
|
||||
</div>
|
||||
<div class="row">
|
||||
<label>Throughput</label>
|
||||
<input value="{{test.throughput}}" name="throughput">
|
||||
</div>
|
||||
|
||||
<!-- Edit Button: For Approvers or Test Authors -->
|
||||
{% if profile.approver or profile.user.username == test.author %}
|
||||
<input class="anchorbutton btn-blue w-100" type="submit" name="submit" value="Modify">
|
||||
{% else %}
|
||||
<input class="anchorbutton btn-disabled w-100" type="submit" name="submit" value="Modify">
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div id="parameters" class="w-100 mt-3" style="float:left;">
|
||||
<table class="stripes wrappable">
|
||||
<tr class="table-header">
|
||||
<th> Name </th>
|
||||
<th> Curr </th>
|
||||
<th> Start </th>
|
||||
<th> Min </th>
|
||||
<th> Max </th>
|
||||
<th> C </th>
|
||||
<th> C_end </th>
|
||||
<th> R </th>
|
||||
<th> R_end </th>
|
||||
</tr>
|
||||
|
||||
{% for row in test|spsa_param_digest %}
|
||||
<tr>
|
||||
{% for element in row %}
|
||||
{% if not forloop.first %}
|
||||
<td class='numeric'> {{ element }} </td>
|
||||
{% else %}
|
||||
<td> {{ element }} </td>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="results" class="w-100 mt-3" style="float:left;">
|
||||
<table class="stripes wrappable">
|
||||
<tr class="table-header">
|
||||
<th>#</th>
|
||||
<th>User</th>
|
||||
<th>Updated</th>
|
||||
<th style="width: 45px">Games</th>
|
||||
<th style="width: 45px">Won</th>
|
||||
<th style="width: 45px">Lost</th>
|
||||
<th style="width: 45px">Drawn</th>
|
||||
<th style="width: 45px">Time</th>
|
||||
<th style="width: 45px">Crash</th>
|
||||
</tr>
|
||||
|
||||
{% for result in results %}
|
||||
<tr>
|
||||
<td><a href="/machines/{{result.machine.id}}">{{result.machine.id}}</a></td>
|
||||
<td>{{result.machine.user.username|capfirst}}</td>
|
||||
<td class="timestamp">{{result.updated|date:'U'}}</td>
|
||||
<td class="numeric">{{result.games}}</td>
|
||||
<td class="numeric">{{result.wins}}</td>
|
||||
<td class="numeric">{{result.losses}}</td>
|
||||
<td class="numeric">{{result.draws}}</td>
|
||||
<td class="numeric">{{result.timeloss}}</td>
|
||||
<td class="numeric">{{result.crashes}}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,216 @@
|
||||
{% extends "OpenBench/base.html" %}
|
||||
|
||||
{% load mytags %}
|
||||
{% load static %}
|
||||
|
||||
{% block scripts %}
|
||||
<script src="{% static 'copy_text.js' %}"></script>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div id="config" style="display: block; overflow-x: auto;">
|
||||
<table class="test-config left-align wrappable" style="table-layout: auto; width: 100%;">
|
||||
|
||||
<tr><td class="td-label">Author</td><td>{{workload.author|capfirst}}</td></tr>
|
||||
<tr><td class="td-label">Creation</td><td class="timestamp">{{workload.creation|date:'U'}}</td></tr>
|
||||
|
||||
<!-- All of the Dev Engine ( or Sole Engine ) information -->
|
||||
<tr><td class="td-label">{{dev_text}} Engine</td><td>{{workload.dev_engine}}</td></tr>
|
||||
<tr><td class="td-label">{{dev_text}} Source</td><td><a href="{{workload.dev_repo}}">{{workload.dev_repo}}</a></td></tr>
|
||||
<tr><td class="td-label">{{dev_text}} Sha</td><td>{{workload.dev.sha}}</td></tr>
|
||||
<tr><td class="td-label">{{dev_text}} Branch</td><td class="branch_name">{{workload.dev.name|prettyName}}</td></tr>
|
||||
<tr><td class="td-label">{{dev_text}} Bench</td><td>{{workload.dev.bench}}</td></tr>
|
||||
<tr><td class="td-label">{{dev_text}} Network</td><td><a href="{{workload|network_download_link:'dev'}}">{{workload.dev_netname}}</td></tr>
|
||||
<tr><td class="td-label">{{dev_text}} Options</td><td>{{workload.dev_options}}</td></tr>
|
||||
<tr><td class="td-label">{{dev_text}} Time</td><td>{{workload.dev_time_control}}</td></tr>
|
||||
|
||||
<!-- All of the Base Engine information, which only exists for TESTs -->
|
||||
{% if type == "TEST" %}
|
||||
<tr><td class="td-label">Base Engine</td><td>{{workload.base_engine}}</td></tr>
|
||||
<tr><td class="td-label">Base Source</td><td><a href="{{workload.base_repo}}">{{workload.base_repo}}</a></td></tr>
|
||||
<tr><td class="td-label">Base Sha</td><td>{{workload.base.sha}}</td></tr>
|
||||
<tr><td class="td-label">Base Branch</td><td class="branch_name">{{workload.base.name|prettyName}}</td></tr>
|
||||
<tr><td class="td-label">Base Bench</td><td>{{workload.base.bench}}</td></tr>
|
||||
<tr><td class="td-label">Base Network</td><td><a href="{{workload|network_download_link:'base'}}">{{workload.base_netname}}</td></tr>
|
||||
<tr><td class="td-label">Base Options</td><td>{{workload.base_options}}</td></tr>
|
||||
<tr><td class="td-label">Base Time</td><td>{{workload.base_time_control}}</td></tr>
|
||||
{% endif %}
|
||||
|
||||
<tr><td class="td-label">Opening Book</td><td><a href="{{workload|book_download_link}}">{{workload.book_name}}</a></td></tr>
|
||||
<tr><td class="td-label">Upload PGNs</td><td>{{workload.upload_pgns}}</td></tr>
|
||||
<tr><td class="td-label">Syzygy WDL</td><td>{{workload.syzygy_wdl}}</td></tr>
|
||||
<tr><td class="td-label">Syzygy ADJ.</td><td>{{workload.syzygy_adj}}</td></tr>
|
||||
<tr><td class="td-label">Win ADJ.</td><td>{{workload.win_adj}}</td></tr>
|
||||
<tr><td class="td-label">Draw ADJ.</td><td>{{workload.draw_adj}}</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="actions" class="ml-3">
|
||||
|
||||
<!-- Dev vs Base [Git Diff Link] -->
|
||||
<h4><a href="{{workload|gitDiffLink}}">{{workload|git_diff_text}}</a></h4>
|
||||
|
||||
<div class="anchor-container">
|
||||
|
||||
<!-- Approve Button: For Admins, or Cross-approvers -->
|
||||
{% if not workload.approved and profile.approver and profile.user.username != workload.author %}
|
||||
<a class="anchorbutton btn-blue" href="/{{type|lower}}/{{workload.id}}/APPROVE">Approve</a>
|
||||
{% elif not workload.approved and request.user.is_superuser %}
|
||||
<a class="anchorbutton btn-blue" href="/{{type|lower}}/{{workload.id}}/APPROVE">Approve</a>
|
||||
{% else %}
|
||||
<a class="anchorbutton btn-disabled">Approve</a>
|
||||
{% endif %}
|
||||
|
||||
<!-- Restart Button: For Approvers or Workload Authors of finished workloads -->
|
||||
{% if workload.finished and profile.approver %}
|
||||
<a class="anchorbutton btn-yellow" href="/{{type|lower}}/{{workload.id}}/RESTART">Restart</a>
|
||||
{% elif workload.finished and profile.user.username == workload.author %}
|
||||
<a class="anchorbutton btn-yellow" href="/{{type|lower}}/{{workload.id}}/RESTART">Restart</a>
|
||||
{% elif workload.finished %}
|
||||
<a class="anchorbutton btn-disabled">Restart</a>
|
||||
{% endif %}
|
||||
|
||||
<!-- Stop Button: For Approvers or Workload Authors of active workloads -->
|
||||
{% if not workload.finished and profile.approver %}
|
||||
<a class="anchorbutton btn-yellow" href="/{{type|lower}}/{{workload.id}}/STOP">Stop</a>
|
||||
{% elif not workload.finished and profile.user.username == workload.author %}
|
||||
<a class="anchorbutton btn-yellow" href="/{{type|lower}}/{{workload.id}}/STOP">Stop</a>
|
||||
{% elif not workload.finished %}
|
||||
<a class="anchorbutton btn-disabled">Stop</a>
|
||||
{% endif %}
|
||||
|
||||
<!-- Delete/Restore Button: For Approvers or Workload Authors -->
|
||||
{% if profile.approver or profile.user.username == workload.author %}
|
||||
{% if workload.deleted %}
|
||||
<a class="anchorbutton btn-preset" href="/{{type|lower}}/{{workload.id}}/RESTORE">Restore</a>
|
||||
{% else %}
|
||||
<a class="anchorbutton btn-red" href="/{{type|lower}}/{{workload.id}}/DELETE">Delete</a>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% if workload.deleted %}
|
||||
<a class="anchorbutton btn-disabled">Restore</a>
|
||||
{% else %}
|
||||
<a class="anchorbutton btn-disabled">Delete</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<!-- Copy Button: Copy the current results statblock -->
|
||||
{% if type == "TEST" %}
|
||||
<div class="anchor-container">
|
||||
<a class="mt-1 anchorbutton btn-blue" onclick="copy_text('long-statblock', true)">Copy Stat Block</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- PGN Download Button -->
|
||||
{% if workload.upload_pgns != "FALSE" %}
|
||||
<div class="anchor-container">
|
||||
<a class="mt-1 anchorbutton btn-blue" href="/api/pgns/{{workload.id}}/">Download PGN Archive</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Copies Raw SPSA Input from a hidden element -->
|
||||
{% if type == "TUNE" %}
|
||||
<div class="anchor-container">
|
||||
<pre id="spsa-input" style="display: none">{{workload|spsa_original_input}}</pre>
|
||||
<a class="mt-1 anchorbutton btn-blue" onclick="copy_text('spsa-input', false)">Copy SPSA Inputs</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Copies SPSA Optimal Values from a hidden element -->
|
||||
{% if type == "TUNE" %}
|
||||
<div class="anchor-container">
|
||||
<pre id="spsa-output" style="display: none">{{workload|spsa_optimal_values}}</pre>
|
||||
<a class="mt-1 anchorbutton btn-blue" onclick="copy_text('spsa-output', false)">Copy SPSA Outputs</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Elo, (SPRT/LRR if SPRT, otherwise CONF), Games -->
|
||||
{% if type == "TEST" %}
|
||||
<pre class="long-statblock" id="long-statblock">{{workload|longStatBlock|linebreaksbr}}</pre>
|
||||
{% elif type == "TUNE" %}
|
||||
<pre class="long-statblock" id="long-statblock">{{workload|shortStatBlock|linebreaksbr}}</pre>
|
||||
{% endif %}
|
||||
|
||||
<!-- Forum to modify the Priority, Throughput, or (Tests only) Workload Size -->
|
||||
<form method="POST" action="/{{type|lower}}/{{workload.id}}/MODIFY">
|
||||
{% csrf_token %}
|
||||
<div class="form">
|
||||
<div class="col-full">
|
||||
|
||||
<div class="row"><label>Priority</label><input value="{{workload.priority}}" name="priority"></div>
|
||||
<div class="row"><label>Throughput</label><input value="{{workload.throughput}}" name="throughput"></div>
|
||||
|
||||
{% if type == "TEST" %}
|
||||
<div class="row"><label>Workload Size</label><input value="{{workload.workload_size}}" name="workload_size"></div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Edit Button: For Approvers or Test Authors -->
|
||||
{% if profile.approver or profile.user.username == workload.author %}
|
||||
<input class="anchorbutton btn-blue w-100" type="submit" name="submit" value="Modify">
|
||||
{% else %}
|
||||
<input class="anchorbutton btn-disabled w-100" type="submit" name="submit" value="Modify">
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- SPSA Paramater Summary, for Tunes -->
|
||||
{% if type == "TUNE" %}
|
||||
<div id="parameters" class="w-100 mt-3" style="float:left;">
|
||||
<table class="stripes wrappable">
|
||||
|
||||
<tr class="table-header">
|
||||
{% for header in workload|spsa_param_digest_headers %}
|
||||
<th> {{ header }} </th>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
|
||||
{% for row in workload|spsa_param_digest %}
|
||||
<tr>
|
||||
{% for element in row %}
|
||||
{% if not forloop.first %}
|
||||
<td class='numeric'> {{ element }} </td>
|
||||
{% else %}
|
||||
<td> {{ element }} </td>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div id="results" class="w-100 mt-3" style="float:left;">
|
||||
<table class="stripes wrappable">
|
||||
<tr class="table-header">
|
||||
<th>#</th>
|
||||
<th>User</th>
|
||||
<th>Updated</th>
|
||||
<th style="width: 45px">Games</th>
|
||||
<th style="width: 45px">Won</th>
|
||||
<th style="width: 45px">Lost</th>
|
||||
<th style="width: 45px">Drawn</th>
|
||||
<th style="width: 45px">Time</th>
|
||||
<th style="width: 45px">Crash</th>
|
||||
</tr>
|
||||
|
||||
{% for result in results %}
|
||||
<tr>
|
||||
<td><a href="/machines/{{result.machine.id}}">{{result.machine.id}}</a></td>
|
||||
<td>{{result.machine.user.username|capfirst}}</td>
|
||||
<td class="timestamp">{{result.updated|date:'U'}}</td>
|
||||
<td class="numeric">{{result.games}}</td>
|
||||
<td class="numeric">{{result.wins}}</td>
|
||||
<td class="numeric">{{result.losses}}</td>
|
||||
<td class="numeric">{{result.draws}}</td>
|
||||
<td class="numeric">{{result.timeloss}}</td>
|
||||
<td class="numeric">{{result.crashes}}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
Reference in new issue
Block a user