feat(heartbeat): add four-host HoloLake control console
This commit is contained in:
parent
92b3be6529
commit
5ca2c9d66f
39 changed files with 1784 additions and 27 deletions
|
|
@ -10,6 +10,7 @@ from pathlib import Path
|
|||
ROOT = Path("/Volumes/JZAO/HoloLake/persona-runtime/repo-012-main")
|
||||
OFFICE = ROOT / "eternal-lake-heart/heartbeat-core/office-building-current/offices/HB-OFFICE-HOLOLAKE-0001"
|
||||
COMPUTER = OFFICE / "smart-computer/office_computer.py"
|
||||
MULTIPATH_CONSOLE = ROOT / "server-tools/heartbeat-multipath-console/console.py"
|
||||
BRAIN = OFFICE / "brain/BRAIN-PACK.md"
|
||||
|
||||
|
||||
|
|
@ -20,12 +21,20 @@ def load_computer():
|
|||
return module
|
||||
|
||||
|
||||
def load_multipath_console():
|
||||
spec = importlib.util.spec_from_file_location("hololake_multipath_console", MULTIPATH_CONSOLE)
|
||||
module = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(module)
|
||||
return module
|
||||
|
||||
|
||||
def load(intent: str) -> dict:
|
||||
computer = load_computer()
|
||||
audit = computer.audit()
|
||||
if audit["outcome"] != "PASS":
|
||||
raise ValueError("HOLOLAKE_OFFICE_AUDIT_FAILED:" + ",".join(audit["errors"]))
|
||||
status = computer.status()
|
||||
multipath = load_multipath_console().status()
|
||||
return {
|
||||
"schema": "guanghu.hololake-development-brain-context/v1",
|
||||
"state": "HOLOLAKE_DEVELOPMENT_BRAIN_LOADED",
|
||||
|
|
@ -37,6 +46,7 @@ def load(intent: str) -> dict:
|
|||
"generation": status["generation"],
|
||||
"latest_evolution_node": status["latest_evolution_node"],
|
||||
"current_work": status["current_work"],
|
||||
"multipath_console": multipath,
|
||||
"repo012_head": status["repo012_head"],
|
||||
"next": status["next"],
|
||||
"brain_pack": str(BRAIN),
|
||||
|
|
@ -52,6 +62,7 @@ def markdown(value: dict) -> str:
|
|||
generation = value["generation"]
|
||||
current = value["current_work"]
|
||||
latest = value["latest_evolution_node"]
|
||||
multipath = value["multipath_console"]
|
||||
offices = ", ".join(value["office_board"]["offices"])
|
||||
return "\n".join([
|
||||
"# HoloLake开发脑已装载",
|
||||
|
|
@ -62,6 +73,7 @@ def markdown(value: dict) -> str:
|
|||
f"- 当前代际:`{generation['id']}` · {generation['name']}",
|
||||
f"- 最近演化:`{latest['date']}` · `{latest['node_id']}` · {latest['change']}",
|
||||
f"- 当前状态:`{current['state']}`",
|
||||
f"- 多路径主控台:`{multipath['console_id']}` · 已加入 {multipath['joined_hosts']}/{multipath['total_hosts']} · 有效事件 {multipath['event_count']}",
|
||||
f"- 当前产品模块:`{current['current_product_module']}` / 新代际编号:`{current['current_generation_module_numbering']}`",
|
||||
f"- 旧17模块:`VERIFIED_DONOR_FROZEN`",
|
||||
f"- REPO-012:`{value['repo012_head']}`",
|
||||
|
|
|
|||
Loading…
Reference in a new issue