Files
NODEDC_MISSION_CORE/simulation/ai-polygon/Prepare-IsaacRuntime.ps1
T

39 lines
2.1 KiB
PowerShell

param([switch]$Extract)
$ErrorActionPreference = 'Stop'
$ProgressPreference = 'SilentlyContinue'
# Additive workstation package; never changes Docker, drivers, PATH or services.
$root = 'D:\NDC_MISSIONCORE\runtime\simulation'
$archive = Join-Path $root 'isaac-sim-standalone-6.1.0-windows-x86_64.zip'
$target = Join-Path $root 'isaac-sim-6.1.0'
$url = 'https://downloads.isaacsim.nvidia.com/isaac-sim-standalone-6.1.0-windows-x86_64.zip'
$vendorMd5 = 'a07968e980072c9ca27b2166443e2d89'
New-Item -ItemType Directory -Force $root | Out-Null
if ((Get-PSDrive D).Free -lt 60GB) { throw 'Isaac preparation requires 60 GiB free on D:' }
if (!(Test-Path $archive)) {
& curl.exe --fail --location --retry 3 --connect-timeout 20 --max-time 7200 --continue-at - --output "$archive.part" $url
if ($LASTEXITCODE -ne 0) { throw 'Download interrupted; partial archive retained for resume.' }
if ((Get-FileHash "$archive.part" -Algorithm MD5).Hash.ToLower() -ne $vendorMd5) {
throw 'Archive does not match the NVIDIA download-page checksum.'
}
Move-Item "$archive.part" $archive
}
if ((Get-FileHash $archive -Algorithm MD5).Hash.ToLower() -ne $vendorMd5) { throw 'Archive checksum changed.' }
if ($Extract -and !(Test-Path (Join-Path $target 'python.bat'))) {
if (Test-Path $target) { throw 'Incomplete target exists; inspect it before resuming extraction.' }
New-Item -ItemType Directory $target | Out-Null
& tar.exe -xf $archive -C $target
if ($LASTEXITCODE -ne 0) { throw 'Extraction failed; files retained for diagnosis.' }
}
[ordered]@{
schema_version = 'missioncore.ai-polygon-isaac-preparation/v1'
prepared_at = [DateTime]::UtcNow.ToString('o')
source_url = $url
vendor_md5 = $vendorMd5
sha256 = (Get-FileHash $archive -Algorithm SHA256).Hash.ToLower()
byte_length = (Get-Item $archive).Length
target = $target
extracted = (Test-Path (Join-Path $target 'python.bat'))
launched = $false
} | ConvertTo-Json | Set-Content -Encoding UTF8 (Join-Path $root 'isaac-6.1.0-preparation.json')
Get-Content (Join-Path $root 'isaac-6.1.0-preparation.json')