implement persistent docker containers #6
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.
@satra The below is AI-generated (as you can guess - but I reviewed it carefully) - but I'm human in this paragraph :). This adds a new persistent docker container mode, as you were describing in #5, but the old method of running commands in a container is still there - and is the default. We'll need to decide on whether to remove that or not given this persistent docker functionality.
Summary
This PR implements persistent Docker container functionality to address the issue where installations and changes made inside containers were lost between command executions. Previously, each
execute_commandcall created a new temporary container with the--rmflag, causing anypip installor other modifications to be forgotten.Changes
New Docker Management Commands
minicline docker start [image] [--name container-name]- Start a persistent Docker containerminicline docker stop <container-name>- Stop and remove a persistent containerminicline docker list- List all minicline containersminicline perform-task --docker <container-name>- Execute tasks using an existing persistent containerImplementation Details
New
DockerManagerclass (minicline/docker_manager.py)CLI Integration (
minicline/cli.py)dockercommand group withstart,stop, andlistsubcommands--dockeroption toperform-taskcommandCore Functionality Updates
perform_task()incore.pyto acceptdocker_containerparameterexecute_command()intools/execute_command.pyto support persistent containersDocumentation (
README.md)Example Usage
Benefits