-
Notifications
You must be signed in to change notification settings - Fork 44.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Re-use Docker container for code execution
- Create a unique container name based on agent ID - Check if the container with the name exists, otherwise create a new container - If the container is not running, start it; otherwise, restart it - Execute the code in the container - Return the output of the code execution This change enables reusing the same container for consecutive code execution commands, allowing for iterative changes to the execution environment. Note: This change also includes handling the case where the Docker image is not found locally by pulling it from Docker Hub. The image used in this case is "python:3-alpine".
- Loading branch information
Showing
1 changed file
with
54 additions
and
37 deletions.
There are no files selected for viewing
This file contains 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