Zeroconf reports system properties (#59)

* Zeroconf.found_clients() now returns dicts of clients, not just hostnames

* Adjustments to distributed_job_manager.py

* Undo config change

* Report system metrics (cpu, os, etc) via zeroconf_server.py

* Zeroconf.found_clients() now returns dicts of clients, not just hostnames

* Adjustments to distributed_job_manager.py

* Undo config change

* Zeroconf.found_clients() now returns dicts of clients, not just hostnames

* Adjustments to distributed_job_manager.py

* Undo config change

* Adjustments to distributed_job_manager.py

* Undo config change

* Rename ZeroconfServer.found_clients() to found_hostnames()
This commit is contained in:
2023-11-04 20:46:27 -05:00
committed by GitHub
parent d3b84c6212
commit 06a613fcc4
9 changed files with 38 additions and 33 deletions

View File

@@ -1,6 +1,7 @@
#!/usr/bin/env python3
import json
import logging
import multiprocessing
import os
import pathlib
import shutil
@@ -277,7 +278,7 @@ def snapshot():
@server.get('/api/_detected_clients')
def detected_clients():
# todo: dev/debug only. Should not ship this - probably.
return ZeroconfServer.found_clients()
return ZeroconfServer.found_hostnames()
# New version
@@ -548,6 +549,9 @@ def start_server():
logger.info(f"Starting Zordon Render Server - Hostname: '{server.config['HOSTNAME']}:'")
ZeroconfServer.configure("_zordon._tcp.local.", server.config['HOSTNAME'], server.config['PORT'])
ZeroconfServer.properties = {'system_cpu': current_system_cpu(), 'system_cpu_cores': multiprocessing.cpu_count(),
'system_os': current_system_os(),
'system_os_version': current_system_os_version()}
ZeroconfServer.start()
try: