refactor(lab): move execution to Worker and manage replay and transfer lifecycles
This commit is contained in:
@@ -6,7 +6,6 @@ from __future__ import annotations
|
||||
import argparse
|
||||
import hashlib
|
||||
import json
|
||||
import runpy
|
||||
import shutil
|
||||
from pathlib import Path
|
||||
from typing import Any, Final, cast
|
||||
@@ -21,6 +20,15 @@ from k1link.observatory.modular_composition import ModuleRegistry
|
||||
from k1link.observatory.modular_installed_package_steps import (
|
||||
MODULAR_PACKAGE_CONTRACT_SCHEMA,
|
||||
)
|
||||
from k1link.observatory.modular_model_assets import (
|
||||
DDRNET_ASSETS as _DDRNET_ASSETS,
|
||||
)
|
||||
from k1link.observatory.modular_model_assets import (
|
||||
EOMT_ASSETS as _EOMT_ASSETS,
|
||||
)
|
||||
from k1link.observatory.modular_model_assets import (
|
||||
RUNTIME_ASSET_RELATIVE_PATHS as _RUNTIME_ASSET_RELATIVE_PATHS,
|
||||
)
|
||||
from k1link.observatory.modular_result import MODULAR_RESULT_CONTRACT_SHA256
|
||||
from k1link.observatory.portable_run_definitions import (
|
||||
PORTABLE_RESULT_CONTRACT_SCHEMA,
|
||||
@@ -42,18 +50,6 @@ from k1link.observatory.portable_worker_runtime import (
|
||||
)
|
||||
from k1link.observatory.recorded_jobs import RecordedExecutorIdentity
|
||||
|
||||
_LEGACY_PROMOTION = runpy.run_path(
|
||||
str(
|
||||
Path(__file__).resolve().parents[1]
|
||||
/ "experiments/perception/worker/observatory_portable/promote_installed_lab_v1_package.py"
|
||||
)
|
||||
)
|
||||
_DDRNET_ASSETS = cast(tuple[tuple[str, str, str, int], ...], _LEGACY_PROMOTION["_DDRNET_ASSETS"])
|
||||
_EOMT_ASSETS = cast(tuple[tuple[str, str, str, int], ...], _LEGACY_PROMOTION["_EOMT_ASSETS"])
|
||||
_RUNTIME_ASSET_RELATIVE_PATHS = cast(
|
||||
dict[str, str], _LEGACY_PROMOTION["_RUNTIME_ASSET_RELATIVE_PATHS"]
|
||||
)
|
||||
|
||||
AUTHORITY: Final = {
|
||||
"commands_enabled": False,
|
||||
"actuation_allowed": False,
|
||||
@@ -137,7 +133,18 @@ def build(
|
||||
repository = Path(__file__).resolve().parents[1]
|
||||
base_registry_path = repository / "config" / "observatory-portable-run-definitions.json"
|
||||
base_document = json.loads(base_registry_path.read_text())
|
||||
base_definition = cast(dict[str, Any], base_document["definitions"][0])
|
||||
# Build from explicit current modules, never the old combined profile or row order.
|
||||
by_setup = {row["setup_id"]: row for row in base_document["definitions"]}
|
||||
base_definition = dict(by_setup["ai-segmentation-ddrnet-v1"])
|
||||
segmentation = [
|
||||
by_setup[key] for key in ("ai-segmentation-ddrnet-v1", "ai-segmentation-eomt-v1")
|
||||
]
|
||||
base_definition["components"] = list(
|
||||
{item["component_id"]: item for row in segmentation for item in row["components"]}.values()
|
||||
)
|
||||
base_definition["models"] = list(
|
||||
{item["release_id"]: item for row in segmentation for item in row["models"]}.values()
|
||||
)
|
||||
m49_definition = cast(
|
||||
dict[str, Any],
|
||||
next(
|
||||
|
||||
Reference in New Issue
Block a user