feat(telemetry): add bounded native pipeline lifecycle
This commit is contained in:
@@ -3,7 +3,8 @@ param(
|
||||
[string]$Version = "1.38.4",
|
||||
[string]$ExpectedSha256 = "6c7878ec319471ac85b82443baec2f3fa5dbcf1b6e2da5d5cd2cbb60fff2bb45",
|
||||
[string]$ConfigurationTemplate = "$PSScriptRoot\mission-core-windows.conf.tmpl",
|
||||
[string]$PipelineCollector = "$PSScriptRoot\Get-NdcMissionCorePipelineTelemetry.ps1"
|
||||
[string]$PipelineCollector = "$PSScriptRoot\Get-NdcMissionCorePipelineTelemetry.ps1",
|
||||
[string]$PipelineJournal = "D:\NDC_MISSIONCORE\runtime\derived\.perception-persistent-publish\pipeline-telemetry.jsonl"
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
@@ -41,6 +42,26 @@ if (-not (Test-Path -LiteralPath $ConfigurationTemplate -PathType Leaf)) {
|
||||
if (-not (Test-Path -LiteralPath $PipelineCollector -PathType Leaf)) {
|
||||
throw "Pipeline collector not found: $PipelineCollector"
|
||||
}
|
||||
$journalParent = Get-Item -LiteralPath (
|
||||
Resolve-Path -LiteralPath (Split-Path $PipelineJournal -Parent)
|
||||
).Path -Force
|
||||
if (
|
||||
-not $journalParent.PSIsContainer -or
|
||||
($journalParent.Attributes -band [IO.FileAttributes]::ReparsePoint) -or
|
||||
[IO.Path]::GetPathRoot($journalParent.FullName).TrimEnd("\") -ine "D:"
|
||||
) {
|
||||
throw "Pipeline journal parent must be a real D: directory"
|
||||
}
|
||||
if (-not (Test-Path -LiteralPath $PipelineJournal)) {
|
||||
New-Item -ItemType File -Path $PipelineJournal | Out-Null
|
||||
}
|
||||
$journal = Get-Item -LiteralPath $PipelineJournal -Force
|
||||
if (
|
||||
$journal.PSIsContainer -or
|
||||
($journal.Attributes -band [IO.FileAttributes]::ReparsePoint)
|
||||
) {
|
||||
throw "Pipeline journal must be a regular file"
|
||||
}
|
||||
|
||||
$temporaryRoot = Join-Path $env:TEMP "ndc-mission-core-telegraf-$([Guid]::NewGuid().ToString('N'))"
|
||||
$archivePath = Join-Path $temporaryRoot "telegraf.zip"
|
||||
@@ -121,6 +142,7 @@ try {
|
||||
StartType = $service.StartType.ToString()
|
||||
Configuration = $configurationPath
|
||||
PipelineCollector = $collectorPath
|
||||
PipelineJournal = $PipelineJournal
|
||||
Sha256 = $actualSha256
|
||||
} | ConvertTo-Json -Compress
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user