diff --git a/Client/Client.py b/Client/Client.py index 1122604..323768b 100644 --- a/Client/Client.py +++ b/Client/Client.py @@ -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 diff --git a/OpenBench/templatetags/mytags.py b/OpenBench/templatetags/mytags.py index f78b1e3..cf06f95 100644 --- a/OpenBench/templatetags/mytags.py +++ b/OpenBench/templatetags/mytags.py @@ -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) diff --git a/Templates/OpenBench/errors.html b/Templates/OpenBench/errors.html index 5a23ac0..3f5e542 100644 --- a/Templates/OpenBench/errors.html +++ b/Templates/OpenBench/errors.html @@ -8,8 +8,9 @@
| User | {{machine.user.username}} | ||||
| Machine Name | {{machine.info.machine_name}} | ||||
| Client Version | {{machine.info.client_ver}} | ||||
| Python Version | {{machine.info.python_ver}} | ||||
| System Version | {{machine.info.os_name}} {{machine.info.os_ver}} | ||||
| # | User | +Name | System | CPU | Workload | @@ -20,6 +21,7 @@
|---|---|---|---|---|---|
| {{machine.id}} | {{machine.user.username|capfirst}} | +{{machine.info.machine_name}} | {{machine.info.os_name}} | {{machine.info.cpu_name}} |