Package onboard K1 separately with a private portable installer
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
"""Local LAB composition; the onboard runtime does not import this module."""
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
from missioncore_plugin_sdk.v0alpha2 import RuntimePluginDescriptor
|
||||
|
||||
from k1link.web.plugin_runtime import DevicePluginRuntimeContribution, InProcessDevicePluginRuntime
|
||||
|
||||
from .camera import build_xgrids_k1_camera_router
|
||||
from .facade import (
|
||||
XGRIDS_K1_PLUGIN_ID,
|
||||
XGRIDS_K1_PLUGIN_VERSION,
|
||||
XgridsK1CompatibilityService,
|
||||
XgridsK1PluginFacade,
|
||||
_validate_installed_compatibility_profile,
|
||||
)
|
||||
from .live_perception_shadow import (
|
||||
build_live_perception_result_receiver,
|
||||
build_live_perception_shadow_router,
|
||||
)
|
||||
|
||||
|
||||
def build_xgrids_k1_plugin(repository_root: Path) -> DevicePluginRuntimeContribution:
|
||||
"""Manifest entrypoint for the reviewed XGRIDS compatibility adapter."""
|
||||
|
||||
from k1link.device_plugins.xgrids_k1 import build_xgrids_k1_observation
|
||||
from k1link.device_plugins.xgrids_k1.legacy_api import build_xgrids_k1_legacy_router
|
||||
|
||||
_validate_installed_compatibility_profile(repository_root)
|
||||
service = XgridsK1CompatibilityService(repository_root)
|
||||
adapter = XgridsK1PluginFacade(service)
|
||||
runtime = InProcessDevicePluginRuntime(
|
||||
adapter,
|
||||
RuntimePluginDescriptor(
|
||||
plugin_id=XGRIDS_K1_PLUGIN_ID,
|
||||
plugin_version=XGRIDS_K1_PLUGIN_VERSION,
|
||||
supported_host_api_versions=("missioncore.nodedc/v1alpha2",),
|
||||
action_ids=tuple(sorted(adapter.action_ids)),
|
||||
),
|
||||
close=service.close,
|
||||
)
|
||||
return DevicePluginRuntimeContribution(
|
||||
runtime=runtime,
|
||||
legacy_routers=(
|
||||
build_xgrids_k1_legacy_router(runtime),
|
||||
build_xgrids_k1_camera_router(
|
||||
service.camera_preview,
|
||||
XGRIDS_K1_PLUGIN_ID,
|
||||
),
|
||||
build_live_perception_shadow_router(
|
||||
service.live_perception_ingress,
|
||||
XGRIDS_K1_PLUGIN_ID,
|
||||
bearer_token=service._live_perception_token,
|
||||
result_receiver=build_live_perception_result_receiver(
|
||||
service.live_perception_ingress,
|
||||
service.runtime.publish_perception_frame,
|
||||
),
|
||||
),
|
||||
),
|
||||
observation=build_xgrids_k1_observation(repository_root),
|
||||
)
|
||||
@@ -31,7 +31,6 @@ from uuid import uuid4
|
||||
from bleak.exc import BleakDeviceNotFoundError, BleakError
|
||||
from missioncore_plugin_sdk.v0alpha2 import (
|
||||
RuntimeActionInvocation,
|
||||
RuntimePluginDescriptor,
|
||||
)
|
||||
from pydantic import (
|
||||
BaseModel,
|
||||
@@ -120,7 +119,6 @@ from k1link.device_plugins.xgrids_k1.camera import (
|
||||
CameraSourceId,
|
||||
CommittedCameraSegment,
|
||||
XgridsK1CameraGateway,
|
||||
build_xgrids_k1_camera_router,
|
||||
classify_camera_recording_health,
|
||||
)
|
||||
from k1link.device_plugins.xgrids_k1.connection_attempt import (
|
||||
@@ -155,8 +153,6 @@ from k1link.device_plugins.xgrids_k1.host_diagnostics import (
|
||||
host_diagnostic_for_reason,
|
||||
)
|
||||
from k1link.device_plugins.xgrids_k1.live_perception_shadow import (
|
||||
build_live_perception_result_receiver,
|
||||
build_live_perception_shadow_router,
|
||||
ensure_live_shadow_token,
|
||||
)
|
||||
from k1link.device_plugins.xgrids_k1.mqtt import validate_private_ipv4
|
||||
@@ -263,8 +259,6 @@ from k1link.web.device_lifecycle import (
|
||||
new_device_session_id,
|
||||
)
|
||||
from k1link.web.plugin_runtime import (
|
||||
DevicePluginRuntimeContribution,
|
||||
InProcessDevicePluginRuntime,
|
||||
PluginActionNotFoundError,
|
||||
PluginExecutionError,
|
||||
)
|
||||
@@ -35506,44 +35500,3 @@ def _validate_installed_compatibility_profile(repository_root: Path) -> None:
|
||||
XGRIDS_K1_COMPATIBILITY_PROFILE_ID
|
||||
):
|
||||
raise RuntimeError("XGRIDS compatibility profile identity does not match the runtime")
|
||||
|
||||
|
||||
def build_xgrids_k1_plugin(repository_root: Path) -> DevicePluginRuntimeContribution:
|
||||
"""Manifest entrypoint for the reviewed XGRIDS compatibility adapter."""
|
||||
|
||||
from k1link.device_plugins.xgrids_k1 import build_xgrids_k1_observation
|
||||
from k1link.device_plugins.xgrids_k1.legacy_api import build_xgrids_k1_legacy_router
|
||||
|
||||
_validate_installed_compatibility_profile(repository_root)
|
||||
service = XgridsK1CompatibilityService(repository_root)
|
||||
adapter = XgridsK1PluginFacade(service)
|
||||
runtime = InProcessDevicePluginRuntime(
|
||||
adapter,
|
||||
RuntimePluginDescriptor(
|
||||
plugin_id=XGRIDS_K1_PLUGIN_ID,
|
||||
plugin_version=XGRIDS_K1_PLUGIN_VERSION,
|
||||
supported_host_api_versions=("missioncore.nodedc/v1alpha2",),
|
||||
action_ids=tuple(sorted(adapter.action_ids)),
|
||||
),
|
||||
close=service.close,
|
||||
)
|
||||
return DevicePluginRuntimeContribution(
|
||||
runtime=runtime,
|
||||
legacy_routers=(
|
||||
build_xgrids_k1_legacy_router(runtime),
|
||||
build_xgrids_k1_camera_router(
|
||||
service.camera_preview,
|
||||
XGRIDS_K1_PLUGIN_ID,
|
||||
),
|
||||
build_live_perception_shadow_router(
|
||||
service.live_perception_ingress,
|
||||
XGRIDS_K1_PLUGIN_ID,
|
||||
bearer_token=service._live_perception_token,
|
||||
result_receiver=build_live_perception_result_receiver(
|
||||
service.live_perception_ingress,
|
||||
service.runtime.publish_perception_frame,
|
||||
),
|
||||
),
|
||||
),
|
||||
observation=build_xgrids_k1_observation(repository_root),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user