feat(autoupdate/compose): implement docker compose aware update logic#1875
feat(autoupdate/compose): implement docker compose aware update logic#1875spupuz wants to merge 16 commits intogetarcaneapp:mainfrom
Conversation
@kmendell these are failing cause are going in timeout... i don't know ho to solve them |
|
@kmendell let me know if you can do something |
kmendell
left a comment
There was a problem hiding this comment.
Few things i found, but im still confused on how this is different fomr the updater depends on. When the updater (currently) runs on a conatnier its copys its exact config, and then creates a new container with that exact config labels, networks, everything, so im not sure what this solves exactly.
frontend/src/routes/(app)/environments/[id]/components/JobsTab.svelte
Outdated
Show resolved
Hide resolved
|
@kmendell let me know if you can do something
Hi kmendell, that's a fair question. You're right that Arcane already attempts to clone the container config, but the new Compose-aware methodology is fundamentally different in terms of how and why it operates. The key differences are: Native Orchestration vs Manual Reconstruction: The current standalone methodology manually reconstructs a docker run command by inspecting the container. This is a "best-effort" reconstruction that can be fragile with complex configurations. The new methodology uses the native Docker Compose engine as the source of truth. By calling docker compose pull/up, we offload the orchestration complexity to Docker itself, which is significantly more robust. Selective & Intelligent Service Updates: While the standalone flow has a custom dependency sorter (in sorter.go), it's still a manual simulation. Using native Compose allows us to run docker compose up -d [services], letting Docker intelligently decide which containers actually need a restart based on image or config divergence. This prevents "blind" restarts of the entire chain if nothing has changed. Optimized Downtime: Standalone updates always follow a stop -> rm -> run cycle, causing guaranteed downtime. The Compose-aware flow uses RecreateDiverged logic, meaning Docker only recreates what is strictly necessary. For the background Auto-Updater, we've also added explicit SHA256 digest comparisons before pulling to minimize any unnecessary activity. Resource Integrity: Compose-managed networks, aliases, and volumes are managed more reliably by the native engine than by Arcane's manual reconstruction logic. This ensures that a project container always comes back up exactly as the user (or the project) defined it. In short: we are moving from Arcane simulating an update to Arcane delegating it to the official tool that manages the project. |
|
This pull request has merge conflicts. Please resolve the conflicts so the PR can stay up-to-date and reviewed. |
|
This pull request has merge conflicts. Please resolve the conflicts so the PR can stay up-to-date and reviewed. |
|
@kmendell i'm i supposed to do something or are you fixing the conflicts? |
|
yes youll have to fix the conflicts im too busy at the moment to do that and finish up the other stuff. |
- integrated useComposeUpdate in bulk update flow - removed emojis from notification messages - refactored JobsTab.svelte to use derived pattern - fixed indentation and frontend state bindings
63e3536 to
8024311
Compare
|
@kmendell i should have fixed the merge problems but still the E2E test are going long. |
|
This pull request has merge conflicts. Please resolve the conflicts so the PR can stay up-to-date and reviewed. |
|
This pull request has merge conflicts. Please resolve the conflicts so the PR can stay up-to-date and reviewed. |
…ve conflict in environment-settings.spec.ts

Container Update Flow: Logic and Scenarios
Arcane's new update architecture explicitly divides the update logic based on the nature of the container (Standalone vs Docker Compose) and acts intelligently to minimize downtime.
There are three main actors in this logic:
useComposeUpdateflag inLocal Docker -> Settings.Here is how the code behaves in various scenarios:
Scenario 1: Standalone Container (Non-Compose)
This is the traditional behavior, unaltered by the new logic.
com.docker.compose.projectlabel).docker stop [id]docker rm -f [id]docker run ...(Recreates the container parsing the original configuration).Scenario 2: Container belonging to a Compose Project
In this scenario, Arcane enters the
ComposeAwarebranch. The behavior depends on the global setting configured by the user.Sub-Scenario 2A:
useComposeUpdate = false(Disabled)The user has decided not to use native Docker Compose commands for updates.
Sub-Scenario 2B:
useComposeUpdate = true(Enabled)The user has enabled native updates. Arcane detects the project label.
If the Update is invoked by the "Auto-Update" Job (Background)
Arcane must prevent downtime and restart exclusively what is strictly necessary, and only if the remote image has a truly divergent hash.
UpdateProjectServices:web,db) is isolated from the affected container.docker compose pull [service_names...](updates the image only for the services needing the update).docker stop && docker rm(ordocker compose stop) on the single service to force its recreation, ensuring partial downtime only for the updating service.docker compose up -d [service_names...]to bring it back up, automatically reattaching it to networks/volumes and dependencies.If the Update is manually invoked by the "Redeploy/Update" button in the "Projects" UI
Arcane uses a brute force approach, since it expects the user to know what they are doing or they are explicitly forcing a reload of the entire project configuration, regardless of the Image Poller.
UpdateProjectServiceswithout service limitations.docker compose pull(downloads layers if there are new ones online for any service).docker compose up -d(Docker recreates only the containers whose configuration or image has mutated. The intact ones will remain Up without downtime).Resiliency of Auto-Update (Hash Checks)
The Auto-Update system prevents unnecessary downtime by implementing double security checks:
ApplyPendingmethod."status":"skipped", "error":"image already up to date"is registered, and the container remains alive and unchanged. The green checkmark ✅ appears in the Updates column.Disclaimer Greptiles Reviews use AI, make sure to check over its work.
To better help train Greptile on our codebase, if the comment is useful and valid Like the comment, if its not helpful or invalid Dislike
Greptile Summary
This PR implements Docker Compose-aware container updates by adding a new
useComposeUpdatesetting that enables nativedocker compose pull/stop/upcommands for compose project containers instead of standalone container restart logic.Key changes:
UpdateProjectServicesmethod to handle selective service updates within compose projectsUpdateSingleContainerandrestartContainersUsingOldIDsto detect compose containers and route them through project-based updates when the setting is enabledComposePullandComposeStophelper functions to support the compose update workflowpruneImageIDsWithInUseSetInternalmethod signature withnilsecond parameter (the method handles this gracefully)Minor issues:
updater_service.go(style)cmds.gofunctions (style)Confidence Score: 4/5
Important Files Changed
Last reviewed commit: 2354c8b