Stop containers after each task to reduce RAM usage#81
Open
Stop containers after each task to reduce RAM usage#81
Conversation
This implements the approach suggested in issue #79: stop containers immediately after each task completes, then start them again for the next task. This ensures only one running container per dev name (queue) at any time, significantly reducing RAM usage when multiple repos are in play. Changes: - Add STOP_CONTAINER_AFTER_TASK config option (default: true) - Modify container pool to stop containers after task completion - Add stop_container_after_task to status endpoint cleanup_settings - Update documentation in CLAUDE.md - Add comprehensive tests for the new functionality The new default behavior (stop_container_after_task=true) means: - Container is started when a task begins - Container is stopped and cleaned up immediately after task completes - Next task on same queue starts a fresh container - Only one running container per dev name at any time Legacy behavior can be restored by setting STOP_CONTAINER_AFTER_TASK=false, which keeps containers running with idle timeout-based cleanup. Closes #79
This allows the stop-after-task workflow to preserve workspaces for faster container restarts. When remove_workspace=False, containers are stopped but workspaces are kept on disk for reuse. Adds tests for the new cleanup behavior.
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
STOP_CONTAINER_AFTER_TASKconfig option (default: true)Changes
STOP_CONTAINER_AFTER_TASKconfig option inconfig.pystop_container_after_taskto status endpoint cleanup_settingsBehavior
New default behavior (stop_container_after_task=true):
Legacy behavior can be restored by setting
STOP_CONTAINER_AFTER_TASK=false, which keeps containers running with idle timeout-based cleanup.Test plan
Closes #79