feat(git-stacks): option to only start services that were already running - #1407
Open
EmirLogas wants to merge 4 commits into
Open
feat(git-stacks): option to only start services that were already running#1407EmirLogas wants to merge 4 commits into
EmirLogas wants to merge 4 commits into
Conversation
…ning Adds a per-stack deploy option plus a checkbox in the sync dialog. When enabled, a git sync brings up only the services that had a running container, so services stopped on purpose stay stopped instead of being started by the sync. - git_stacks.only_running_services column (SQLite + Postgres, migration 0011) - deployStack resolves the running services and passes them to compose; services no longer declared in the compose file are dropped so compose does not fail with "no such service" - a stack with containers but nothing running starts nothing; a stack with no containers yet still deploys everything - webhook/scheduled syncs use the saved setting, the dialog checkbox is a per-run override Closes Finsys#1246 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Might i suggest |
A limited sync left stopped services untouched, so they kept the previous definition until the next full deploy. They are now recreated with `docker compose create` after the `up`, picking up the new config and image while staying stopped. - new `create` compose operation, mirroring the deploy's --build/--pull - a fully stopped stack skips the `up` entirely but is still refreshed - a failed create never fails the deploy: Hawser agents that predate the operation reject it, and the running services are already up to date - services that never had a container are not created, only ones that exist and are stopped Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Author
|
Yes, recreating them so they pick up the update while staying stopped makes more sense. Thanks for catching that subtle detail, @Caedis. Implemented and pushed. |
main landed its own 0011 migration (pending_updates_semver), so this branch's migration is renumbered to 0012 and its snapshot regenerated on top of it: - 0011_add_git_stack_only_running_services.sql -> 0012_... - 0012_snapshot.json rebuilt from main's 0011 snapshot, prevId chained to it - journal keeps main's idx 11 and appends idx 12 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Proposed change
A compose file can define ten services while only five are running. Today "Sync from Git" brings all ten up, and the ones that were deliberately stopped have to be stopped again by hand.
This adds an option to bring up only the services that already had a running container. Services that are stopped stay stopped.
It is exposed in two places:
Behaviour:
docker compose up -d --remove-orphans <services>)A service that was running but is no longer declared in the compose file (renamed or deleted in the repo) is dropped from the list, so compose does not fail with
no such service. The progress log names the services it starts and the ones it skips.Hawser (remote agents): the compose request now carries a
serviceNamesfield. Agents that predate this field ignore it and still bring the whole stack up, so remote environments need matching agent support before the option takes effect there.Testing
Verified against a three-service git stack (
docker/awesome-compose,nextcloud-redis-mariadb) on a local socket environment:Limiting deploy to running services: db, redis, command ran asdocker compose -p nc-test -f ... up -d --remove-orphans db redis, and the stopped service stayed exited.svelte-checkreports no new errors or warnings from these files.Closes #1246
Type of change