Simplify lattice inference and hosted landing
This commit is contained in:
parent
3fa3be8dc9
commit
16c86d54aa
46 changed files with 1844 additions and 1492 deletions
61
scripts/run_hosted_gui.ps1
Normal file
61
scripts/run_hosted_gui.ps1
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
param(
|
||||
[string]$BindHost = "0.0.0.0",
|
||||
[int]$Port = 8000,
|
||||
[switch]$Reload,
|
||||
[ValidateSet("auto", "show", "hide")]
|
||||
[string]$QueueUI = "auto"
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$repoRoot = Split-Path -Parent $PSScriptRoot
|
||||
$python = Join-Path $repoRoot ".venv\Scripts\python.exe"
|
||||
if (-not (Test-Path $python)) {
|
||||
$python = "python"
|
||||
}
|
||||
|
||||
$previousHostedDemo = $env:REPIXELIZER_HOSTED_DEMO
|
||||
$previousShowQueuePanel = $env:REPIXELIZER_SHOW_QUEUE_PANEL
|
||||
|
||||
try {
|
||||
$env:REPIXELIZER_HOSTED_DEMO = "1"
|
||||
|
||||
if ($QueueUI -eq "show") {
|
||||
$env:REPIXELIZER_SHOW_QUEUE_PANEL = "1"
|
||||
} elseif ($QueueUI -eq "hide") {
|
||||
$env:REPIXELIZER_SHOW_QUEUE_PANEL = "0"
|
||||
} else {
|
||||
Remove-Item Env:\REPIXELIZER_SHOW_QUEUE_PANEL -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
$launcherArgs = @(
|
||||
(Join-Path $repoRoot "scripts\run_gui.py"),
|
||||
"--host", $BindHost,
|
||||
"--port", $Port,
|
||||
"--queue-ui", $QueueUI
|
||||
)
|
||||
|
||||
if ($Reload) {
|
||||
$launcherArgs += "--reload"
|
||||
}
|
||||
|
||||
Write-Host "Starting Repixelizer hosted GUI..."
|
||||
Write-Host " Hosted demo: $env:REPIXELIZER_HOSTED_DEMO"
|
||||
Write-Host " Bind: http://${BindHost}:${Port}"
|
||||
Write-Host " Python: $python"
|
||||
Write-Host ""
|
||||
|
||||
& $python @launcherArgs
|
||||
} finally {
|
||||
if ($null -eq $previousHostedDemo) {
|
||||
Remove-Item Env:\REPIXELIZER_HOSTED_DEMO -ErrorAction SilentlyContinue
|
||||
} else {
|
||||
$env:REPIXELIZER_HOSTED_DEMO = $previousHostedDemo
|
||||
}
|
||||
|
||||
if ($null -eq $previousShowQueuePanel) {
|
||||
Remove-Item Env:\REPIXELIZER_SHOW_QUEUE_PANEL -ErrorAction SilentlyContinue
|
||||
} else {
|
||||
$env:REPIXELIZER_SHOW_QUEUE_PANEL = $previousShowQueuePanel
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue