Skip to content

Commit a2c5bc1

Browse files
committed
Correct published proxy hash and capture complete Windows acquisition errors; exercise deployment inventory in CI
1 parent a0bb124 commit a2c5bc1

4 files changed

Lines changed: 53 additions & 5 deletions

File tree

‎.github/workflows/v100-cpu-validation.yml‎

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
- 'rlm/v100/**'
77
- 'tests/test_v100*'
88
- 'tools/*.ps1'
9+
- 'tools/managed-release.json'
10+
- 'tests/test_windows_release_integrity.py'
911
- '.github/workflows/v100-cpu-validation.yml'
1012
permissions:
1113
contents: read
@@ -30,7 +32,7 @@ jobs:
3032
env:
3133
PYTEST_DISABLE_PLUGIN_AUTOLOAD: '1'
3234
CUDA_VISIBLE_DEVICES: ''
33-
run: python -m pytest -q tests/test_v100*.py
35+
run: python -m pytest -q tests/test_v100*.py tests/test_windows_release_integrity.py
3436
powershell-parser:
3537
if: github.event.repository.private == false
3638
runs-on: windows-latest
@@ -51,3 +53,24 @@ jobs:
5153
}
5254
}
5355
if ($failures -gt 0) { throw 'PowerShell syntax errors detected.' }
56+
- uses: actions/setup-python@v5
57+
with:
58+
python-version: '3.11'
59+
- name: Capture complete native traceback under Windows PowerShell 5.1
60+
shell: powershell
61+
run: |
62+
$ErrorActionPreference = 'Stop'
63+
$python = (Get-Command python.exe).Source
64+
$log = Join-Path $env:TEMP 'synta-native-error-test.log'
65+
$fixture = Join-Path $env:TEMP 'synta-native-error-test.py'
66+
"raise RuntimeError('synta-traceback-sentinel')" | Set-Content -Encoding ASCII $fixture
67+
$source = Get-Content -Raw tools/bootstrap-synta-windows.ps1
68+
$start = $source.IndexOf('$previousErrorPolicy =')
69+
$end = $source.IndexOf('if ($acquisitionExit -ne 0)')
70+
if ($start -lt 0 -or $end -le $start) { throw 'Native capture block missing.' }
71+
$block = $source.Substring($start, $end - $start)
72+
$block = [regex]::Replace($block, '(?m)^ & \$python -c .*$', ' & $python $fixture *>> $log')
73+
. ([scriptblock]::Create($block))
74+
if ($acquisitionExit -ne 1) { throw 'Failed child process exit was lost.' }
75+
if ($ErrorActionPreference -ne 'Stop') { throw 'Caller error policy was not restored.' }
76+
if ((Get-Content -Raw $log) -notmatch 'RuntimeError: synta-traceback-sentinel') { throw 'Complete traceback was not captured.' }

‎tests/test_windows_release_integrity.py‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,22 @@
1111
ROOT = Path(__file__).resolve().parents[1]
1212

1313

14+
def test_every_release_file_downloads_with_its_published_hash(tmp_path, monkeypatch):
15+
manifest = json.loads((ROOT / "tools/managed-release.json").read_text())
16+
payloads = {}
17+
for name, expected in manifest["files"].items():
18+
content = (ROOT / name).read_bytes()
19+
assert hashlib.sha256(content).hexdigest() == expected, name
20+
payloads[name] = content
21+
module = bootstrap(monkeypatch)
22+
prefix = "https://raw.githubusercontent.com/Mantiee/rlm/" + "a" * 40 + "/"
23+
monkeypatch.setattr(module, "fetch", lambda url: payloads[url.removeprefix(prefix)])
24+
module.materialize(tmp_path, "a" * 40, manifest)
25+
for name, expected in manifest["files"].items():
26+
assert hashlib.sha256((tmp_path / name).read_bytes()).hexdigest() == expected
27+
assert json.loads((tmp_path / "release.json").read_text())["revision"] == "a" * 40
28+
29+
1430
def bootstrap(monkeypatch):
1531
monkeypatch.syspath_prepend(str(ROOT / "rlm/v100"))
1632
spec = importlib.util.spec_from_file_location(

‎tools/bootstrap-synta-windows.ps1‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,17 @@ $settings = New-ScheduledTaskSettingsSet -MultipleInstances IgnoreNew -Execution
3434
Register-ScheduledTask -TaskName 'Synta-Managed-Update' -Action $action -Trigger $trigger -Principal $identity -Settings $settings -Force | Out-Null
3535
# Repair serving in this console, independently of a previous model downloader.
3636
$bundle = Join-Path $root ("tools\managed-releases\" + $Revision)
37-
& $python -c 'import sys; from pathlib import Path; sys.path.insert(0,sys.argv[1]); from managed_bootstrap import release,materialize; rev,manifest=release(sys.argv[3]); materialize(Path(sys.argv[2]),rev,manifest)' $dir $bundle $Revision *>> $log
38-
if ($LASTEXITCODE -ne 0) {
37+
# Windows PowerShell 5.1 turns native stderr into error records. Capture the
38+
# complete traceback, restore the caller policy, then inspect the process exit.
39+
$previousErrorPolicy = $ErrorActionPreference
40+
try {
41+
$ErrorActionPreference = 'Continue'
42+
& $python -c 'import sys; from pathlib import Path; sys.path.insert(0,sys.argv[1]); from managed_bootstrap import release,materialize; rev,manifest=release(sys.argv[3]); materialize(Path(sys.argv[2]),rev,manifest)' $dir $bundle $Revision *>> $log
43+
$acquisitionExit = $LASTEXITCODE
44+
} finally {
45+
$ErrorActionPreference = $previousErrorPolicy
46+
}
47+
if ($acquisitionExit -ne 0) {
3948
Get-Content -LiteralPath $log -Tail 30
4049
throw "Release acquisition failed before helper changes. Inspect $log"
4150
}

‎tools/managed-release.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
"tools/start-rtx3090-helper.ps1": "f6797bddc2dfef068f2a1c0e760a6ae324192312ffa07c268bd813e64c4341b8",
2727
"tools/watch-rtx3090-helper.ps1": "cb2dadd98b4f1a4a6d5ddc269b33d15799351adcda26ba59c8e7c9a4fe03b547",
2828
"tools/update-synta-v89.sh": "7b0ae94ce1480d527ceadf79bac820f0e725ef1110b72ebeace9f87420389b36",
29-
"tools/bootstrap-synta-windows.ps1": "7603019cda1a268d1a82c098d891dd6a75f366d0dd5a5b06b3f5cf32eda1edc5",
29+
"tools/bootstrap-synta-windows.ps1": "423d397dcfad9ca18af8edc1b064e753a6568c811b07c02f4026ca939093dd10",
3030
"rlm/v100/autonomous_planning.py": "0b3781c2e275e5b078e6337c54cd2a65621c9c5a4ca4b28d886e94408c68b4fd",
31-
"rlm/v100/windows_resource_proxy.py": "d215cf1d9996628154a1579d94f2562790c53163f811604489cacdfd789e9a9c"
31+
"rlm/v100/windows_resource_proxy.py": "0e873414200e09e692c367294bf97739d0fcc7b1a367bed49562593a3a5ef00f"
3232
},
3333
"node3060_installer": "tools/bootstrap-synta-3060.sh"
3434
}

0 commit comments

Comments
 (0)