Allow -I or --identity= to pass a nickname for a machine

Display this information on machines list, individual machine page, and on the error log
This commit is contained in:
andrew committed 2023-06-21 00:25:23 -04:00
1 parent 000fcc17ba
commit 802553269a
5 files changed
+19 -1

No files matched your search

+6
View File
@@ -87,6 +87,7 @@ SYSTEM_MAC_ADDRESS = hex(uuid.getnode()).upper()[2:]
SYSTEM_LOGICAL_CORES = psutil.cpu_count(logical=True)
SYSTEM_PHYSICAL_CORES = psutil.cpu_count(logical=False)
SYSTEM_RAM_TOTAL_MB = psutil.virtual_memory().total // (1024 ** 2)
SYSTEM_MACHINE_NAME = 'None'
SYSTEM_MACHINE_ID = 'None'
SYSTEM_SECRET_TOKEN = 'None'
@@ -520,6 +521,7 @@ def server_configure_worker(arguments):
'physical_cores' : SYSTEM_PHYSICAL_CORES, # Physical cores, to differentiate hyperthreads
'ram_total_mb' : SYSTEM_RAM_TOTAL_MB, # Total RAM on the system, to avoid over assigning
'machine_id' : SYSTEM_MACHINE_ID, # Assigned value, or None. Will be replaced if wrong
'machine_name' : SYSTEM_MACHINE_NAME, # Optional pseudonym for the machine, otherwise None
'concurrency' : arguments.threads, # Threads to use to play games
'ncutechesses' : arguments.ncutechess, # Cutechess copies, usually equal to Socket count
'client_ver' : CLIENT_VERSION, # Version of the Client, which the server may reject
@@ -1060,6 +1062,7 @@ if __name__ == '__main__':
p.add_argument('-S', '--server' , help='Webserver Address' , required=True)
p.add_argument('-T', '--threads' , help='Total Threads' , required=True)
p.add_argument('-N', '--ncutechess' , help='Cutechess Copies' , required=True)
p.add_argument('-I', '--identity' , help='Machine pseudonym' , required=False)
# Optional arguments
p.add_argument('--syzygy', help='Syzygy WDL' , required=False)
@@ -1083,6 +1086,9 @@ if __name__ == '__main__':
if arguments.password is None:
arguments.password = os.environ['OPENBENCH_PASSWORD']
if arguments.identity:
SYSTEM_MACHINE_NAME = arguments.identity
if arguments.syzygy is not None:
SYZYGY_WDL_PATH = arguments.syzygy
+7
View File
@@ -201,6 +201,12 @@ def compilerBlock(machine):
def removePrefix(value, prefix):
return value.removeprefix(prefix)
def machine_name(machine_id):
try:
machine = OpenBench.models.Machine.objects.get(id=machine_id)
return machine.info['machine_name']
except: return 'None'
register = django.template.Library()
register.filter('oneDigitPrecision', oneDigitPrecision)
register.filter('twoDigitPrecision', twoDigitPrecision)
@@ -219,3 +225,4 @@ register.filter('testIdToTimeControl', testIdToTimeControl)
register.filter('cpuflagsBlock', cpuflagsBlock)
register.filter('compilerBlock', compilerBlock)
register.filter('removePrefix', removePrefix)
register.filter('machine_name', machine_name)
+3 -1
View File
@@ -8,8 +8,9 @@
<tr class="table-header">
<th>Date</th>
<th>Worker</th>
<th>#</th>
<th>User</th>
<th>Name</th>
<th>Test</th>
<th>Summary</th>
<th>Logs</th>
@@ -20,6 +21,7 @@
<td class="timestamp">{{event.created|date:'U'}}</td>
<td><a href="/machines/{{event.machine_id}}">{{event.machine_id}}</a></td>
<td>{{event.author|capfirst}}</td>
<td>{{event.machine_id|machine_name}}</td>
<td><a href="/test/{{event.test_id}}">{{event.test_id|testIdToPrettyName}}</a></td>
<td>{{event.summary}}</td>
+1
View File
@@ -13,6 +13,7 @@
<table class="test-config left-align wrappable" style="table-layout: auto; width: 100%;">
<tr><td class="td-label">User</td><td>{{machine.user.username}}</td></tr>
<tr><td class="td-label">Machine Name</td><td>{{machine.info.machine_name}}</td></tr>
<tr><td class="td-label">Client Version</td><td>{{machine.info.client_ver}}</td></tr>
<tr><td class="td-label">Python Version</td><td>{{machine.info.python_ver}}</td></tr>
<tr><td class="td-label">System Version</td><td>{{machine.info.os_name}} {{machine.info.os_ver}}</td></tr>
+2
View File
@@ -9,6 +9,7 @@
<tr class="table-header">
<th>#</th>
<th>User</th>
<th>Name</th>
<th>System</th>
<th>CPU</th>
<th>Workload</th>
@@ -20,6 +21,7 @@
<tr>
<td class="numeric"><a href="/machines/{{machine.id}}/">{{machine.id}}</a></td>
<td>{{machine.user.username|capfirst}}</td>
<td>{{machine.info.machine_name}}</td>
<td>{{machine.info.os_name}}</td>
<td>{{machine.info.cpu_name}}</td>
<td>