Publish AI workspace source through the isolated runtime
This commit is contained in:
1 parent
03169bd0f6
commit
d1d14f0f77
21 files changed
+487
-68
No files matched your search
@@ -1,3 +1,4 @@
|
||||
param([switch]$EnableHosting)
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$projectRoot = [IO.Path]::GetFullPath((Join-Path $PSScriptRoot '../..'))
|
||||
$localDirectory = Join-Path $projectRoot '.runtime/local-cluster'
|
||||
@@ -27,11 +28,15 @@ foreach ($key in @('SANDBOX_TOKEN', 'RUNTIME_TOKEN')) {
|
||||
}
|
||||
$health = Invoke-RestMethod -Uri http://127.0.0.1:8090/health/ready -Headers @{Authorization = ('Bearer ' + $gatewayValues['SANDBOX_TOKEN'])} -TimeoutSec 10
|
||||
if (-not $health.ready) { throw 'Gateway Kubernetes readiness check failed.' }
|
||||
if ($EnableHosting) {
|
||||
$runtime = Invoke-RestMethod -Uri http://127.0.0.1:8090/runtime/source-ready -Headers @{Authorization = ('Bearer ' + $gatewayValues['RUNTIME_TOKEN'])} -TimeoutSec 10
|
||||
if (-not $runtime.ready) { throw 'Local source runtime is not configured. Deploy the updated gateway first.' }
|
||||
}
|
||||
$infra = @{app = @{
|
||||
'worker-enabled' = $true; 'worker-capacity' = 4
|
||||
'sandbox-url' = 'http://127.0.0.1:8090'; 'sandbox-token' = $gatewayValues['SANDBOX_TOKEN']
|
||||
'runtime-url' = 'http://127.0.0.1:8090'; 'runtime-token' = $gatewayValues['RUNTIME_TOKEN']
|
||||
'runtime-worker-enabled' = $false
|
||||
'runtime-worker-enabled' = [bool]$EnableHosting
|
||||
}}
|
||||
$infra | ConvertTo-Json -Depth 4 | Set-Content -LiteralPath (Join-Path $localDirectory 'preview-infrastructure.yml') -Encoding utf8
|
||||
Set-Content -LiteralPath $triggerFile -Value (Get-Date -Format o)
|
||||
|
||||
Reference in new issue
Block a user