Skip to content

Commit

Permalink
appengine: Remove app only from runtime part
Browse files Browse the repository at this point in the history
Remove app components only from the runtime part, i.e. docker store and
compose project in the appengine->remove() call, and leave its content
in the OCI/blob store as it can be needed during rollback or if a given
app is listed in the `reset_apps`.
After successful update unused blobs are removed from the blob stores,
which guarantees proper app removal if it is not listed in `reset_apps`.

Signed-off-by: Mike Sul <[email protected]>
  • Loading branch information
mike-sul committed Jul 16, 2024
1 parent 64a64f1 commit ecbd4fe
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/composeapp/appengine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ AppEngine::Result AppEngine::fetch(const App& app) {

void AppEngine::remove(const App& app) {
try {
// Remove app from the store. Skip blob pruning because unused blobs will be pruned in the `prune` call
// after all non-target apps are removed.
exec(boost::format{"%s --store %s --compose %s rm %s --prune=false --quiet"} % composectl_cmd_ % storeRoot() %
installRoot() % app.name,
"failed to remove app");
// Make sure app is stopped before trying to uninstall it
// "App removal" in this context refers to deleting app images from the Docker store
// and removing the app compose project (app uninstall).
// Unused app blobs will be removed from the blob store via the prune() method,
// provided they are not utilized by any other app(s).
// Note: Ensure the app is stopped before attempting to uninstall it.

exec(boost::format{"%s --store %s --compose %s stop %s"} % composectl_cmd_ % storeRoot() % installRoot() % app.name,
"failed to stop app");
// Uninstall app, it only removes the app compose/project directory, docker store pruning is in the `prune` call
Expand Down

0 comments on commit ecbd4fe

Please sign in to comment.