feat(perception): qualify inline temporal stability
This commit is contained in:
@@ -9,6 +9,7 @@ param(
|
||||
[Parameter(Mandatory = $true)] [string]$ValidFovRoot,
|
||||
[Parameter(Mandatory = $true)] [string]$ProjectionPackRoot,
|
||||
[Parameter(Mandatory = $true)] [string]$PackageRoot,
|
||||
[string]$StabilityProfilePath = "",
|
||||
[switch]$PreflightOnly,
|
||||
[switch]$PersistentService,
|
||||
[switch]$TokenStdin,
|
||||
@@ -84,6 +85,10 @@ $liveProfile = Resolve-DFile $LiveProfilePath "LAB E15 live profile"
|
||||
$e14Profile = Resolve-DFile $E14ProfilePath "Accepted E14 profile"
|
||||
$detectorProfile = Resolve-DFile $DetectorProfilePath "Detector profile"
|
||||
$semanticProfile = Resolve-DFile $SemanticProfilePath "Semantic profile"
|
||||
$stabilityProfile = $null
|
||||
if ($StabilityProfilePath) {
|
||||
$stabilityProfile = Resolve-DFile $StabilityProfilePath "LAB E23 stability profile"
|
||||
}
|
||||
$validFov = Resolve-DDirectory $ValidFovRoot "Valid-FOV root"
|
||||
$projectionPack = Resolve-DDirectory $ProjectionPackRoot "E15 projection pack"
|
||||
$package = Resolve-DDirectory $PackageRoot "Mission Core package root"
|
||||
@@ -97,6 +102,9 @@ foreach ($path in @($liveProfile, $e14Profile, $detectorProfile, $semanticProfil
|
||||
throw "Runner and profiles must share one immutable mount"
|
||||
}
|
||||
}
|
||||
if ($stabilityProfile -and (Split-Path $stabilityProfile -Parent) -ne $runnerRoot) {
|
||||
throw "Runner and LAB E23 stability profile must share one immutable mount"
|
||||
}
|
||||
foreach ($dependency in @(
|
||||
"e10_fusion_runtime.py",
|
||||
"e15_shadow_runtime.py",
|
||||
@@ -115,6 +123,9 @@ foreach ($dependency in @(
|
||||
if (-not (Test-Path -LiteralPath (Join-Path $package "k1link\compute\live_perception.py") -PathType Leaf)) {
|
||||
throw "Mission Core package mount lacks live perception synchronization"
|
||||
}
|
||||
if (-not (Test-Path -LiteralPath (Join-Path $package "k1link\compute\inline_temporal.py") -PathType Leaf)) {
|
||||
throw "Mission Core package mount lacks inline temporal state"
|
||||
}
|
||||
|
||||
$job = Get-Content -LiteralPath (Join-Path $jobDirectory "job.json") -Raw | ConvertFrom-Json
|
||||
if (
|
||||
@@ -130,6 +141,17 @@ if (
|
||||
[bool]$live.authority.navigation_or_safety_accepted -or
|
||||
$live.transport.pyav_version -ne "18.0.0"
|
||||
) { throw "LAB E15 replay-shadow authority contract changed" }
|
||||
if ($stabilityProfile) {
|
||||
$stability = Get-Content -LiteralPath $stabilityProfile -Raw | ConvertFrom-Json
|
||||
if (
|
||||
$stability.schema_version -ne "missioncore.e23-inline-temporal-profile/v1" -or
|
||||
$stability.mode -ne "inline-shadow-qualification" -or
|
||||
$stability.stage -ne "warm-worker-after-fusion-before-result-publication" -or
|
||||
$stability.source.calibration_sha256 -ne $live.source.calibration_sha256 -or
|
||||
[bool]$stability.authority.commands_enabled -or
|
||||
[bool]$stability.authority.navigation_or_safety_accepted
|
||||
) { throw "LAB E23 inline temporal authority contract changed" }
|
||||
}
|
||||
$projection = Get-Content -LiteralPath (Join-Path $projectionPack "manifest.json") -Raw | ConvertFrom-Json
|
||||
if (
|
||||
$projection.schema_version -ne "missioncore.e15-live-projection-pack/v1" -or
|
||||
@@ -137,6 +159,12 @@ if (
|
||||
$projection.identity.calibration_slot -ne "camera_1" -or
|
||||
$projection.identity.calibration_sha256 -ne $live.source.calibration_sha256
|
||||
) { throw "LAB E15 projection pack binding changed" }
|
||||
$packageManifest = Get-Content -LiteralPath (Join-Path $package "manifest.json") -Raw | ConvertFrom-Json
|
||||
if (
|
||||
$packageManifest.schema_version -ne "missioncore.e15-worker-package/v1" -or
|
||||
$packageManifest.package_id -ne (Split-Path $package -Leaf) -or
|
||||
$packageManifest.identity_sha256 -notmatch "^[a-f0-9]{64}$"
|
||||
) { throw "LAB E15 worker package manifest changed" }
|
||||
$mediaManifest = Get-Content -LiteralPath (Join-Path $mediaRuntime "manifest.json") -Raw | ConvertFrom-Json
|
||||
if (
|
||||
$mediaManifest.schema_version -ne "missioncore.e15-media-runtime/v1" -or
|
||||
@@ -165,6 +193,7 @@ $liveProfileName = Split-Path $liveProfile -Leaf
|
||||
$e14ProfileName = Split-Path $e14Profile -Leaf
|
||||
$detectorProfileName = Split-Path $detectorProfile -Leaf
|
||||
$semanticProfileName = Split-Path $semanticProfile -Leaf
|
||||
$stabilityProfileName = if ($stabilityProfile) { Split-Path $stabilityProfile -Leaf } else { $null }
|
||||
$projectionMount = "/" + (Split-Path $projectionPack -Leaf)
|
||||
$packageMount = "/" + (Split-Path $package -Leaf)
|
||||
$orchestratorSha256 = (Get-FileHash -LiteralPath $PSCommandPath -Algorithm SHA256).Hash.ToLowerInvariant()
|
||||
@@ -200,6 +229,11 @@ $commonRunnerArgs = @(
|
||||
"--environment", "/environment",
|
||||
"--worker-package", $packageMount
|
||||
)
|
||||
if ($stabilityProfileName) {
|
||||
$commonRunnerArgs += @(
|
||||
"--stability-profile", ("/runner/{0}" -f $stabilityProfileName)
|
||||
)
|
||||
}
|
||||
|
||||
if ($PersistentService) {
|
||||
if ($PreflightOnly -or $TokenStdin) {
|
||||
@@ -214,6 +248,14 @@ if ($PersistentService) {
|
||||
throw "Persistent output root must be a direct child of its guarded D: parent"
|
||||
}
|
||||
$runnerSha256 = (Get-FileHash -LiteralPath $runner -Algorithm SHA256).Hash.ToLowerInvariant()
|
||||
$liveProfileSha256 = (Get-FileHash -LiteralPath $liveProfile -Algorithm SHA256).Hash.ToLowerInvariant()
|
||||
$e14ProfileSha256 = (Get-FileHash -LiteralPath $e14Profile -Algorithm SHA256).Hash.ToLowerInvariant()
|
||||
$detectorProfileSha256 = (Get-FileHash -LiteralPath $detectorProfile -Algorithm SHA256).Hash.ToLowerInvariant()
|
||||
$semanticProfileSha256 = (Get-FileHash -LiteralPath $semanticProfile -Algorithm SHA256).Hash.ToLowerInvariant()
|
||||
$stabilityProfileSha256 = if ($stabilityProfile) {
|
||||
(Get-FileHash -LiteralPath $stabilityProfile -Algorithm SHA256).Hash.ToLowerInvariant()
|
||||
}
|
||||
else { "none" }
|
||||
$existingContainerId = docker ps -a --filter ("name=^{0}$" -f $PersistentContainer) --format "{{.ID}}"
|
||||
Assert-LastExitCode "Persistent worker container lookup"
|
||||
if ($existingContainerId) {
|
||||
@@ -221,7 +263,14 @@ if ($PersistentService) {
|
||||
Assert-LastExitCode "Persistent worker label inspection"
|
||||
if (
|
||||
$labels.'missioncore.role' -ne "perception-persistent-worker" -or
|
||||
$labels.'missioncore.runner.sha256' -ne $runnerSha256
|
||||
$labels.'missioncore.runner.sha256' -ne $runnerSha256 -or
|
||||
$labels.'missioncore.live.sha256' -ne $liveProfileSha256 -or
|
||||
$labels.'missioncore.e14.sha256' -ne $e14ProfileSha256 -or
|
||||
$labels.'missioncore.detector.sha256' -ne $detectorProfileSha256 -or
|
||||
$labels.'missioncore.semantic.sha256' -ne $semanticProfileSha256 -or
|
||||
$labels.'missioncore.stability.sha256' -ne $stabilityProfileSha256 -or
|
||||
$labels.'missioncore.worker-package.identity' -ne $packageManifest.identity_sha256 -or
|
||||
$labels.'missioncore.projection.identity' -ne $projection.identity_sha256
|
||||
) { throw "Existing persistent worker has a different immutable identity" }
|
||||
$running = docker inspect --format "{{.State.Running}}" $PersistentContainer
|
||||
Assert-LastExitCode "Persistent worker state inspection"
|
||||
@@ -258,6 +307,13 @@ if ($PersistentService) {
|
||||
"run", "--detach", "--name", $PersistentContainer,
|
||||
"--label", "missioncore.role=perception-persistent-worker",
|
||||
"--label", ("missioncore.runner.sha256={0}" -f $runnerSha256),
|
||||
"--label", ("missioncore.live.sha256={0}" -f $liveProfileSha256),
|
||||
"--label", ("missioncore.e14.sha256={0}" -f $e14ProfileSha256),
|
||||
"--label", ("missioncore.detector.sha256={0}" -f $detectorProfileSha256),
|
||||
"--label", ("missioncore.semantic.sha256={0}" -f $semanticProfileSha256),
|
||||
"--label", ("missioncore.stability.sha256={0}" -f $stabilityProfileSha256),
|
||||
"--label", ("missioncore.worker-package.identity={0}" -f $packageManifest.identity_sha256),
|
||||
"--label", ("missioncore.projection.identity={0}" -f $projection.identity_sha256),
|
||||
"--gpus", "all", "--network", ("container:{0}" -f $TritonContainer),
|
||||
"--read-only", "--security-opt", "no-new-privileges:true", "--cap-drop", "ALL",
|
||||
"--pids-limit", "512", "--shm-size", "4g",
|
||||
|
||||
Reference in New Issue
Block a user