Repository navigation
feat: supervise user-defined workspace services - #921
Merged
Merged
Conversation
homelab-agent-bot
Bot
force-pushed
the
feat/supervised-workspace-services
branch
11 times, most recently
from
September 15, 2026 23:35
d1de790 to
497337c
Compare
Install Supervisor in the workspace image and expose a dynamic list of service commands through the template. Apply dotfiles before launching the unprivileged supervisor and resolve each command from JSON by index. Keep shell implementations in mounted scripts rather than HCL.
homelab-agent-bot
Bot
force-pushed
the
feat/supervised-workspace-services
branch
from
September 15, 2026 23:47
497337c to
d347b4e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
service_commandslist parameter, with one automatically restarted Supervisor program per commandsupervisord.conf; no shell or Terraform generates configuration for another toolDesign
flowchart LR Parameter[service_commands list] --> JSON[Coder environment JSON] Dotfiles[Chezmoi update or apply] -->|success| Launcher[Supervisor launcher] JSON --> Launcher Launcher --> P0[service-0] Launcher --> PN[service-N]Command text remains in JSON and each Supervisor process invokes a wrapper by list index. The static Supervisor configuration expands only the process count from the environment, avoiding interpolation of user commands into INI syntax. Supervisor and its children run as the existing unprivileged
coderuser; PID 1 remains the Coder agent.A failed Chezmoi run starts no services. With no dotfiles repository configured, the explicit no-op path completes before services start.
Verification
pre-commit run --all-filestofu validatetflint --config=../../../.tflint.hclshellcheck templates/kubernetes/homelab-workspace/script-*.shsandbox-dockerFor template-only changes,
test-templatecontinues to use the latest released image. For image changes,test-imagepasses its published branch image into the reusable template integration workflow. That workflow loads the existing image into Kind rather than rebuilding it, then runs two services: one deliberately exits to prove restart and one remains running to prove multiple commands become independent processes. Both record any pre-Chezmoi start. The assertions require no early-start marker, at least two invocations of the restarting service, the steady-service marker, and both Supervisor process statuses.The commit uses the required empty scope for an atomic image-plus-template feature.