Compare commits
1
Commits
1.0.7
...
2ba35f6d12
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2ba35f6d12 |
No files matched your search
@@ -39,7 +39,7 @@ L’installateur Linux est servi par Central avec son superviseur. Il installe l
|
||||
|
||||
Sous Windows, copiez la commande PowerShell générée dans l’IHM pour le site, en mode processus utilisateur ou service Windows. Elle télécharge le script depuis Central et applique `ExecutionPolicy Bypass` à la session PowerShell courante uniquement; elle ne change pas la stratégie persistante de la machine. L’installation comme service exige une session PowerShell élevée. Une stratégie imposée par une stratégie de groupe peut toujours interdire l’exécution.
|
||||
|
||||
Pour un Agent Docker, le Compose généré par l’IHM contient le dépôt, le digest et la clé publique issus des métadonnées de release vérifiées par Central. Le parcours CPU est sélectionné par défaut. Le parcours CUDA est proposé quand la release fournit l’image GPU signée; il demande aussi le NVIDIA Container Toolkit sur l’hôte. Aucun fichier de clé n’est à créer manuellement. L’Agent refuse la mise à jour si la signature manque, si le digest d’image diffère du manifeste signé, ou si le registre ne fournit pas l’image au digest annoncé. Les Agents configurés sur CUDA continuent de sélectionner l’image GPU pendant les mises à jour.
|
||||
Pour un Agent Docker, le Compose et les commandes `docker run` générés par l’IHM installent le dépôt d’image avec le tag `latest`; Compose et `docker run` vérifient le registre au démarrage. Le parcours CPU est sélectionné par défaut. Le parcours CUDA est proposé quand la release fournit l’image GPU signée; il demande aussi le NVIDIA Container Toolkit sur l’hôte. Aucun fichier de clé n’est à créer manuellement. Pour les mises à jour déclenchées ensuite par Central, l’Agent vérifie la signature et le digest d’image du manifeste signé avant de remplacer le conteneur. Les Agents configurés sur CUDA continuent de sélectionner l’image GPU pendant les mises à jour.
|
||||
|
||||
## Rotation
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# Docker Compose deployment
|
||||
|
||||
The required stack is PostgreSQL and Heimdall Central. The Agent is deployed
|
||||
separately on each camera-network host; the Central UI supplies a
|
||||
digest-pinned Agent Compose file for each site. RustFS, ntfy, Ollama, TURN,
|
||||
separately on each camera-network host; the Central UI supplies an Agent
|
||||
Compose file using the `latest` tag for each site. RustFS, ntfy, Ollama, TURN,
|
||||
Redis and scheduled backups have separate Compose files and can be left out.
|
||||
|
||||
## Central and database
|
||||
@@ -135,11 +135,13 @@ in [`skills/deployment-guide-acceptance/SKILL.md`](../skills/deployment-guide-ac
|
||||
## Agent
|
||||
|
||||
Prefer the Compose shown in the Central UI's site installation panel. It uses
|
||||
the image reference and digest from Central's verified release manifest and
|
||||
includes the site token, public Central URL, Agent name and release public key.
|
||||
Save it as `docker-compose.yml`, then run `docker compose up -d`. The generated
|
||||
Compose contains the pinned trust key; no separate PEM file is required. Do
|
||||
not substitute a mutable image tag for the digest.
|
||||
the Agent image's `latest` tag and includes the site token, public Central URL,
|
||||
Agent name and release public key. Compose uses `pull_policy: always` so an
|
||||
explicit `docker compose up` checks for the latest image. Save it as
|
||||
`docker-compose.yml`, then run `docker compose up -d`. The generated Compose
|
||||
contains the pinned trust key; no separate PEM file is required. Updates
|
||||
dispatched later by Central continue to verify the digest in the signed release
|
||||
manifest before replacing the running container.
|
||||
|
||||
The Agent Compose is generated by Central's UI for the selected site; there is
|
||||
no production Agent Compose in this repository. For local development only,
|
||||
|
||||
+1
-1
@@ -281,7 +281,7 @@ Lancer
|
||||
└──────────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
Docker Compose affiche le YAML comme une étape « Configuration », suivie des commandes pour démarrer et vérifier l'Agent. Chaque bloc a une copie intégrée en haut à droite; après copie, l'icône devient une coche. Les commandes d'installation restent masquées tant que la release signée correspondante n'est pas disponible. Docker exige aussi une référence d'image vérifiée par digest. En cas d'indisponibilité, le panneau montre une alerte explicite à la place des commandes.
|
||||
Docker Compose affiche le YAML comme une étape « Configuration », suivie des commandes pour démarrer et vérifier l'Agent. Chaque bloc a une copie intégrée en haut à droite; après copie, l'icône devient une coche. Les commandes d'installation restent masquées tant que la release signée correspondante n'est pas disponible. Docker exige aussi les métadonnées d'image vérifiées de la release, puis installe l'image publiée avec le tag `latest`; les remplacements déclenchés par Central restent vérifiés par digest signé. En cas d'indisponibilité, le panneau montre une alerte explicite à la place des commandes.
|
||||
|
||||
### États — Détail Site
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ Windows, copiez la commande affichée sur l’hôte distant : elle télécharge
|
||||
script depuis le Central et l’exécute avec les identifiants propres à ce site.
|
||||
L’installation Linux peut créer un service systemd; l’installation Windows
|
||||
peut créer un service Windows (PowerShell administrateur requis). Pour Docker,
|
||||
utilisez le Compose généré par l’IHM, épinglé au digest signé. Aucun fichier de
|
||||
utilisez le Compose généré par l’IHM, qui suit le tag `latest`. Aucun fichier de
|
||||
clé ni Compose de production ne doit être copié depuis le dépôt. Voir le
|
||||
[guide de signature et de mise à jour Agent](docs/agent-release-signing.md).
|
||||
Le Compose Docker monte le socket Docker de l’hôte pour permettre les mises à
|
||||
|
||||
@@ -45,7 +45,7 @@ For installer, Compose, image, and documentation work that can proceed independe
|
||||
|
||||
## Acceptance
|
||||
|
||||
Run `bash -n install/install-server.sh`, validate PowerShell syntax when `pwsh` is available, and run `docker compose config --quiet` for both the installer output and `docker/docker-compose.prod.yml`. Exercise a first install and a second run against an isolated temporary directory: confirm secrets and nondefault `.env` values are byte-for-byte unchanged, the old Compose is backed up, missing new variables are added once, and no volume removal command appears. For the Site Install UI, assert generated CPU/GPU Compose and `docker run` references use the signed `image@sha256:` digest, mount `/var/run/docker.sock`, and pass the socket group to the non-root Agent (`DOCKER_GID` in Compose; detected socket GID for Linux `docker run`). Then follow `skills/compose-disposable-recipe/SKILL.md` with a unique project, generated credentials, isolated ports/volumes, and an EXIT cleanup trap installed before build/start. Never connect the recipe to a deployed Docker daemon or production data.
|
||||
Run `bash -n install/install-server.sh`, validate PowerShell syntax when `pwsh` is available, and run `docker compose config --quiet` for both the installer output and `docker/docker-compose.prod.yml`. Exercise a first install and a second run against an isolated temporary directory: confirm secrets and nondefault `.env` values are byte-for-byte unchanged, the old Compose is backed up, missing new variables are added once, and no volume removal command appears. For the Site Install UI, assert generated CPU/GPU Compose and `docker run` references use the corresponding `:latest` Agent image, Compose sets `pull_policy: always`, Docker Run commands set `--pull always`, all paths mount `/var/run/docker.sock`, and the non-root Agent receives the socket group (`DOCKER_GID` in Compose; detected socket GID for Linux `docker run`). Keep signed digest validation for updates dispatched by Central. Then follow `skills/compose-disposable-recipe/SKILL.md` with a unique project, generated credentials, isolated ports/volumes, and an EXIT cleanup trap installed before build/start. Never connect the recipe to a deployed Docker daemon or production data.
|
||||
|
||||
When a runtime Dockerfile changes for OS security updates, source-build and health-check the corresponding Central/Agent image, then scan its saved image archive with the pinned Trivy version and the same `HIGH,CRITICAL` severities used by CI. Record the finding IDs and fixed package versions; do not hide a nonzero scan behind application acceptance.
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ Heimdall's connected Penpot file is part of the UI source of truth. Whenever a c
|
||||
|
||||
## Installer design reference
|
||||
|
||||
The installer should follow the interaction hierarchy represented by `site-agent-installer-ui/SKILL.md`: platform choices, platform-specific method choices, optional configuration, then titled command cards with deliberate copy controls. For the current Agent installer, keep the design aligned with supported Linux, Windows, and Docker options, release signing/update-key gates, digest-pinned Docker image requirements, and the actual command builders. Keep desktop and mobile layouts, plus release-unavailable states, represented. Update the existing installer frame and any relevant variations in the connected file on every behavior or layout change.
|
||||
The installer should follow the interaction hierarchy represented by `site-agent-installer-ui/SKILL.md`: platform choices, platform-specific method choices, optional configuration, then titled command cards with deliberate copy controls. For the current Agent installer, keep the design aligned with supported Linux, Windows, and Docker options, release signing/update-key gates, Docker installation from the `latest` image tag, signed digest validation for updates dispatched by Central, and the actual command builders. Keep desktop and mobile layouts, plus release-unavailable states, represented. Update the existing installer frame and any relevant variations in the connected file on every behavior or layout change.
|
||||
|
||||
## Acceptance evidence
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ Keep the site Agent installer in `src/Heimdall.Web/Components/SiteInstallPanel.r
|
||||
|
||||
- Offer only Heimdall-supported platforms: Linux, Windows, and Docker. Keep method choices mapped in `AvailableMethods` and reset to that platform's sensible default in `SelectOperatingSystem`.
|
||||
- Keep generated command content in the existing builders and `Commands` projection. Platform selection controls the builders; do not duplicate generated commands in markup.
|
||||
- Native install commands require a latest signed release with update key, signed manifest, signature, and Agent archive assets. Docker commands additionally require a digest-pinned image reference and update key. Preserve these gates so the panel never offers a nonfunctional installer.
|
||||
- Native install commands require a latest signed release with update key, signed manifest, signature, and Agent archive assets. Docker commands additionally require verified CPU/GPU image metadata and the update key, but install the corresponding published `:latest` image. Generated Compose uses `pull_policy: always`; generated Docker Run commands use `--pull always`. Preserve signed digest validation for Agent updates dispatched later by Central.
|
||||
- Treat site tokens and generated configuration as secrets: show them only in the authenticated site's installer view and copy only after a deliberate click. Do not log generated content.
|
||||
- For live installer verification, use the authenticated Orca browser session. Check for the dedicated Heimdall login only in the user secret store at `~/.config/heimdall/credentials.json`; never put account passwords in this skill, repository config, shell arguments, or Orca `fill` commands. The file fallback is owner-only (`0700` directory, `0600` file) and base64-encoded, not encrypted. If it is absent, provide the user-run masked helper `~/.local/bin/store-heimdall-credentials`; do not report the credentials as persisted until that helper succeeds. If Orca has no safe autofill path, ask the user to enter the password in the visible browser.
|
||||
- Keep all visible strings in `SharedResources.resx`, `SharedResources.en.resx`, and `SharedResources.fr.resx`.
|
||||
|
||||
@@ -246,15 +246,15 @@ else if (_method == "windows-service")
|
||||
release?.Assets.Count > 0;
|
||||
if (!string.IsNullOrWhiteSpace(release?.ContainerImage) &&
|
||||
!string.IsNullOrWhiteSpace(release.ContainerImageDigest))
|
||||
_agentImageReference = $"{release.ContainerImage}@{release.ContainerImageDigest}";
|
||||
_agentImageReference = LatestImageReference(release.ContainerImage);
|
||||
if (!string.IsNullOrWhiteSpace(release?.ContainerImageGpu) &&
|
||||
!string.IsNullOrWhiteSpace(release.ContainerImageGpuDigest))
|
||||
_agentGpuImageReference = $"{release.ContainerImageGpu}@{release.ContainerImageGpuDigest}";
|
||||
_agentGpuImageReference = LatestImageReference(release.ContainerImageGpu);
|
||||
_updatePublicKeyPem = release?.UpdatePublicKeyPem;
|
||||
}
|
||||
catch
|
||||
{
|
||||
// Native installers fetch signed release metadata directly; Docker needs a verified image reference and key.
|
||||
// Native installers fetch signed release metadata directly; Docker needs verified image metadata and key.
|
||||
}
|
||||
finally
|
||||
{
|
||||
@@ -262,6 +262,14 @@ else if (_method == "windows-service")
|
||||
}
|
||||
}
|
||||
|
||||
private static string LatestImageReference(string image)
|
||||
{
|
||||
var lastSlash = image.LastIndexOf('/');
|
||||
var lastColon = image.LastIndexOf(':');
|
||||
var repository = lastColon > lastSlash ? image[..lastColon] : image;
|
||||
return $"{repository}:latest";
|
||||
}
|
||||
|
||||
private string ComposeYaml
|
||||
{
|
||||
get
|
||||
@@ -277,6 +285,7 @@ else if (_method == "windows-service")
|
||||
services:
|
||||
heimdall-agent:
|
||||
image: {{image}}
|
||||
pull_policy: always
|
||||
container_name: heimdall-agent-{{safeName}}
|
||||
restart: unless-stopped
|
||||
user: "1654:1654"
|
||||
@@ -307,6 +316,7 @@ else if (_method == "windows-service")
|
||||
|
||||
agent-state-init:
|
||||
image: {{image}}
|
||||
pull_policy: always
|
||||
user: "0:0"
|
||||
entrypoint: ["chown", "-R", "1654:1654", "/state"]
|
||||
volumes:
|
||||
@@ -337,7 +347,7 @@ else if (_method == "windows-service")
|
||||
var name = "heimdall-agent-" + Slugify(SiteName);
|
||||
var volume = "heimdall-agent-state-" + Slugify(SiteName);
|
||||
var image = _useGpuImage ? _agentGpuImageReference : _agentImageReference;
|
||||
return $"docker run -d --name {name} --restart unless-stopped --network host --user 1654:1654 " +
|
||||
return $"docker run --pull always -d --name {name} --restart unless-stopped --network host --user 1654:1654 " +
|
||||
(_useGpuImage ? "--gpus all " : "") +
|
||||
"--group-add \"$(stat -c '%g' /var/run/docker.sock)\" " +
|
||||
"-v /var/run/docker.sock:/var/run/docker.sock " +
|
||||
@@ -370,7 +380,7 @@ else if (_method == "windows-service")
|
||||
var name = "heimdall-agent-" + Slugify(SiteName);
|
||||
var volume = "heimdall-agent-state-" + Slugify(SiteName);
|
||||
var image = _useGpuImage ? _agentGpuImageReference : _agentImageReference;
|
||||
var args = new List<string> { "run", "-d", "--name", name, "--restart", "unless-stopped", "--user", "1654:1654", "--publish", "127.0.0.1:8081:8080", "--group-add", "0", "-v", "/var/run/docker.sock:/var/run/docker.sock" };
|
||||
var args = new List<string> { "run", "--pull", "always", "-d", "--name", name, "--restart", "unless-stopped", "--user", "1654:1654", "--publish", "127.0.0.1:8081:8080", "--group-add", "0", "-v", "/var/run/docker.sock:/var/run/docker.sock" };
|
||||
if (_useGpuImage) args.AddRange(["--gpus", "all"]);
|
||||
args.AddRange([
|
||||
"-e", "Agent__CentralUrl=" + CentralUrl,
|
||||
|
||||
@@ -4078,7 +4078,7 @@
|
||||
<value>Check</value>
|
||||
</data>
|
||||
<data name="SiteInstallPanel_DockerUpdateNote" xml:space="preserve">
|
||||
<value>Container updates use Docker or Kubernetes. Heimdall pins each image to its signed digest. Docker mode mounts the host Docker socket, giving the Agent broad control of that host. On Linux, before Compose, set DOCKER_GID to the socket GID: export DOCKER_GID="$(stat -c '%g' /var/run/docker.sock)".</value>
|
||||
<value>Docker installation uses the latest image. Updates dispatched by Central verify the signed digest before replacing the Agent. Docker mode mounts the host Docker socket, giving the Agent broad control of that host. On Linux, before Compose, set DOCKER_GID to the socket GID: export DOCKER_GID="$(stat -c '%g' /var/run/docker.sock)".</value>
|
||||
</data>
|
||||
<data name="SiteInstallPanel_WindowsConsoleNote" xml:space="preserve">
|
||||
<value>The Agent starts in the background so you can check it from this PowerShell session. Choose Windows Service to restart it after logoff or reboot.</value>
|
||||
|
||||
@@ -4078,7 +4078,7 @@
|
||||
<value>Vérifier</value>
|
||||
</data>
|
||||
<data name="SiteInstallPanel_DockerUpdateNote" xml:space="preserve">
|
||||
<value>Les mises à jour des conteneurs passent par Docker ou Kubernetes. Heimdall épingle chaque image sur son digest signé. Le mode Docker monte le socket Docker de l’hôte, ce qui donne à l’Agent un contrôle étendu sur cet hôte. Sous Linux, avant Compose, définissez DOCKER_GID avec le GID du socket : export DOCKER_GID="$(stat -c '%g' /var/run/docker.sock)".</value>
|
||||
<value>L’installation Docker utilise l’image latest. Les mises à jour déclenchées par Central vérifient le digest signé avant de remplacer l’Agent. Le mode Docker monte le socket Docker de l’hôte, ce qui donne à l’Agent un contrôle étendu sur cet hôte. Sous Linux, avant Compose, définissez DOCKER_GID avec le GID du socket : export DOCKER_GID="$(stat -c '%g' /var/run/docker.sock)".</value>
|
||||
</data>
|
||||
<data name="SiteInstallPanel_WindowsConsoleNote" xml:space="preserve">
|
||||
<value>L’Agent démarre en arrière-plan pour permettre la vérification depuis cette console. Le mode Service Windows le relance après fermeture de session ou redémarrage.</value>
|
||||
|
||||
@@ -4078,7 +4078,7 @@
|
||||
<value>Check</value>
|
||||
</data>
|
||||
<data name="SiteInstallPanel_DockerUpdateNote" xml:space="preserve">
|
||||
<value>Container updates use Docker or Kubernetes. Heimdall pins each image to its signed digest. Docker mode mounts the host Docker socket, giving the Agent broad control of that host. On Linux, before Compose, set DOCKER_GID to the socket GID: export DOCKER_GID="$(stat -c '%g' /var/run/docker.sock)".</value>
|
||||
<value>Docker installation uses the latest image. Updates dispatched by Central verify the signed digest before replacing the Agent. Docker mode mounts the host Docker socket, giving the Agent broad control of that host. On Linux, before Compose, set DOCKER_GID to the socket GID: export DOCKER_GID="$(stat -c '%g' /var/run/docker.sock)".</value>
|
||||
</data>
|
||||
<data name="SiteInstallPanel_WindowsConsoleNote" xml:space="preserve">
|
||||
<value>The Agent starts in the background so you can check it from this PowerShell session. Choose Windows Service to restart it after logoff or reboot.</value>
|
||||
|
||||
@@ -82,7 +82,8 @@ public class SiteDetailTests : PageTestBase
|
||||
cut.Markup.ShouldContain("Agent__SiteToken");
|
||||
cut.Markup.ShouldContain("Régénérer");
|
||||
var compose = cut.Find("pre code").TextContent;
|
||||
compose.ShouldContain("registry.example/heimdall-agent@sha256:");
|
||||
compose.ShouldContain("image: registry.example/heimdall-agent:latest");
|
||||
compose.ShouldContain("pull_policy: always");
|
||||
compose.ShouldContain("network_mode: host");
|
||||
compose.ShouldContain("Agent__CentralUrl: \"http://localhost\"");
|
||||
compose.ShouldContain("Agent__SiteToken: \"tok-detail-42\"");
|
||||
@@ -93,6 +94,9 @@ public class SiteDetailTests : PageTestBase
|
||||
compose.ShouldNotContain("ollama");
|
||||
var agent = GetAgentService(ParseCompose(compose));
|
||||
agent.Children.ShouldNotContainKey(new YamlScalarNode("deploy"));
|
||||
((YamlScalarNode)agent.Children[new YamlScalarNode("image")]).Value
|
||||
.ShouldBe("registry.example/heimdall-agent:latest");
|
||||
((YamlScalarNode)agent.Children[new YamlScalarNode("pull_policy")]).Value.ShouldBe("always");
|
||||
var volumes = (YamlSequenceNode)agent.Children[new YamlScalarNode("volumes")];
|
||||
volumes.Children.Select(node => ((YamlScalarNode)node).Value)
|
||||
.ShouldContain("/var/run/docker.sock:/var/run/docker.sock");
|
||||
@@ -143,14 +147,16 @@ public class SiteDetailTests : PageTestBase
|
||||
cut.WaitForAssertion(() =>
|
||||
{
|
||||
var compose = cut.Find("pre code").TextContent;
|
||||
compose.ShouldContain("image: registry.example/heimdall-agent-gpu@sha256:" + new string('b', 64));
|
||||
compose.ShouldContain("image: registry.example/heimdall-agent-gpu:latest");
|
||||
compose.ShouldContain("pull_policy: always");
|
||||
compose.ShouldContain("Agent__InferenceExecutionProvider: CUDA");
|
||||
compose.ShouldContain("driver: nvidia");
|
||||
compose.ShouldContain("capabilities: [gpu]");
|
||||
compose.ShouldContain("\n deploy:\n resources:\n reservations:");
|
||||
var agent = GetAgentService(ParseCompose(compose));
|
||||
((YamlScalarNode)agent.Children[new YamlScalarNode("image")]).Value.ShouldBe(
|
||||
"registry.example/heimdall-agent-gpu@sha256:" + new string('b', 64));
|
||||
"registry.example/heimdall-agent-gpu:latest");
|
||||
((YamlScalarNode)agent.Children[new YamlScalarNode("pull_policy")]).Value.ShouldBe("always");
|
||||
var deploy = (YamlMappingNode)agent.Children[new YamlScalarNode("deploy")];
|
||||
var resources = (YamlMappingNode)deploy.Children[new YamlScalarNode("resources")];
|
||||
var reservations = (YamlMappingNode)resources.Children[new YamlScalarNode("reservations")];
|
||||
@@ -165,7 +171,8 @@ public class SiteDetailTests : PageTestBase
|
||||
var run = commands[1];
|
||||
run.ShouldContain("--gpus all");
|
||||
run.ShouldContain("Agent__InferenceExecutionProvider=CUDA");
|
||||
run.ShouldContain("registry.example/heimdall-agent-gpu@sha256:" + new string('b', 64));
|
||||
run.ShouldContain("--pull always");
|
||||
run.ShouldContain("registry.example/heimdall-agent-gpu:latest");
|
||||
run.ShouldContain("--group-add \"$(stat -c '%g' /var/run/docker.sock)\"");
|
||||
run.ShouldContain("-v /var/run/docker.sock:/var/run/docker.sock");
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user