Stacks and commands
stack.ps1 is the one entry point for every stack. This page is the command reference; the
Viking deployment docs link here instead of repeating it. Get-Help <root>/stack.ps1 -Full
prints the same options from the script. Viking service specifics (what each stack needs) start at
the Viking bring-up checklist.
stack.ps1 [<stack>|all|<tool>] [<action>] [-Target <name>|all] [-Sync] [-Images build|ghcr|load]
[-Profile <p>[,<p>]] [-Service <svc>] [-Follow] [-Tail <n>] [-Force] [-Days <n>]
[-Root <path>] [-Cert <file> -Key <file> [-Chain <file>] [-PfxPassword <pw>]]
[-- <command for exec>]
With no arguments it runs list. A stack with no action runs status. The stack and the
action can come in either order: stack.ps1 viking-identity up and stack.ps1 up
viking-identity are the same (the Viking docs use the second form).
Stacks
Stack keys are kebab-case and are also the Run/<stack>/ folder name and the compose project
name. The registries are nornir-docker/deploy/stacks.psd1 and
<VIKING_REPO_ROOT_HOST>/deploy/stacks.psd1 (Viking stacks appear only when
VIKING_REPO_ROOT_HOST is set in host.env). stack.ps1 list prints both, with a
ThisHost column for the stacks in NORNIR_DOCKER_HOST_STACKS.
Stack |
Engine |
Host |
What it is |
|---|---|---|---|
|
script |
compute |
Build appliance container |
|
script |
compute, dev |
Mosquitto + build dashboard on 127.0.0.1:8087. Build dashboard (nornir-dashboard) |
|
script |
dev |
Programmer shell ( |
|
script |
dev |
Cursor self-hosted agent worker. Programmer shell and Cursor worker |
|
compose |
web |
nginx SNI passthrough on 443; ACME HTTP-01 webroot and https redirect on 80 |
|
compose |
web |
The single certificate renewer ( |
|
compose |
web |
Duende IdentityServer (OIDC issuer, WebApi, Management) |
|
compose |
web |
gRPC annotation service |
|
compose |
web |
gRPC section-correction service |
|
compose |
compute |
SAM2 segmentation gRPC servers (GPU); profile |
|
iis |
iis |
Legacy IIS sites behind |
The annotation gallery (gallery, gallery-tem, gallery-sem) is not a stack.ps1
stack: its compose file lives in the Sam2Trainer repository, and the proxy routes those names to
port 8442 on web. Start and update it from that repository.
all means the stacks in this host’s NORNIR_DOCKER_HOST_STACKS, in that order (down
runs in reverse). It stops at the first failure, except for status.
Stack actions
Action |
Compose stacks |
Script stacks ( |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
via the stack’s compose files, when it has them |
|
|
|
|
not supported |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
via the stack’s compose files, when it has them |
|
iis only: runs the Viking IIS deploy script ( |
not supported |
-Service defaults to the registry’s DefaultService. up, restart, rebuild,
build and config first check the stack’s required keys and secret files and stop with a
list of what is missing.
Examples:
stack.ps1 list
stack.ps1 viking-identity up
stack.ps1 viking-identity logs -Follow -Tail 500
stack.ps1 viking-annotation exec -Service <service> -- ls /app
stack.ps1 viking-segmentation up -Profile seg-v3
stack.ps1 all down
Tools
Command |
What it does |
|---|---|
|
Registered stacks, engines, and which ones this host runs. |
|
The targets in |
|
Checks the layout folders, |
|
Generates a random 32-byte URL-safe value for: every |
|
Installed certificate: key match, issuer, days left, intermediates, SAN coverage of every hostname, last renewal. |
|
One-shot |
|
Same, against |
|
Validates that the key matches, the certificate is currently valid and covers every
hostname (or |
|
Run on the dev box. |
|
Restarts running containers labelled |
|
On the IIS host: imports |
|
|
|
Lists |
Local and remote
Without -Target, everything runs on this machine. With -Target <name> (a key in
Run/_host/targets.psd1, a comma list, or all), stack.ps1 runs the same arguments on
each target over SSH, as pwsh -File <Root>/stack.ps1 .... The target uses its own layout and
env files; nothing from your machine’s Run/ is sent. Interactive actions (shell,
exec, logs -Follow) get a TTY (ssh -t).
Two commands are exceptions: tunnel opens SSH from this machine, and certs push runs
here, uses -From as the source and -Target as the destination list.
-SyncBefore running the command, for each checkout in the target’s
Repos: checks that your local branch is pushed (HEAD equals its upstream; stops otherwise) and warns about uncommitted changes, then runsgit pull --ff-onlyandgit submodule update --init --recursiveon the target. Push first;-Syncdeploys what is on the remote, not your working tree.-ImagesWhere the target’s images come from:
build(default): the target builds them (rebuildrunscompose build --pull).ghcr: beforeup,restartorrebuild, runspullon the target (GHCR login on the target required). Services that also have abuild:section are pulled only when their image names a registry.viking-segmentationdoes this whenSEGMENTATION_IMAGEis set in its run env; publish that image withdocker-push.ps1 -Images segmentation(Vikingdeployment/segmentation, “Prebuilt image”). Useup, notrebuild, becauserebuildbuilds again after the pull.load:docker saveeach image here anddocker loadit on the target over SSH; for hosts that cannot reach the registry. Images missing locally are skipped with a warning.
Examples:
stack.ps1 doctor -Target all
stack.ps1 viking-segmentation rebuild -Target compute -Sync
stack.ps1 all up -Target web -Sync -Images ghcr
stack.ps1 nornir-build shell -Target compute
stack.ps1 viking-identity logs -Follow -Target web
Where to run what
Task |
Run |
|---|---|
Deploy or update any server stack |
Dev box: |
Health of everything |
Dev box: |
Issue or renew a certificate |
Dev box: |
Distribute the certificate |
Dev box: |
Interactive volume build |
Dev box: |
Dashboard, debugger ports |
Dev box: |
Programmer shell, tests |
Dev box: |
Exit codes
A stack action exits with the docker or launcher exit code (0 on success).
allexits with the first failing stack’s code and stops there (statuskeeps going).doctorexits 1 when any check is[FAIL].With
-Target, the exit code is the last non-zero code from any target (0 when all succeed); a failing-Syncstops before the command runs.A configuration error (unknown stack, missing required key, unknown target) throws and exits 1.
nd-build: one nornir-build command in a container
nornir-docker/nd-build.ps1 (and nd-build.cmd) run the nornir-build CLI inside a
throwaway container with the current directory at /workspace, without the appliance’s CIFS
mounts or Work/ session:
.\nornir-docker\nd-build.ps1 -- --help
.\nornir-docker\nd-build.ps1 -Gpu -- <nornir-build arguments>
Default image nornir:dev; set NORNIR_DOCKER_IMAGE=nornir:prod for CPU-only or
nornir:cupy. NORNIR_DOCKER_GPU=1 equals -Gpu; NORNIR_DOCKER_EXTRA_ARGS adds
docker run arguments. It publishes to the dashboard when NORNIR_MQTT_HOST is set. The
compose equivalent:
docker compose -f nornir-docker/compose.yaml run --rm -v "$PWD:/workspace" -w /workspace nornir nornir-build --help