feat: Add docker_runtime based on EventStream #4588
+608
−0
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.
End-user friendly description of the problem this fixes or functionality that this introduces
Add a new DockerRuntime adapted from the existing EventStream (internal docker runtime)
Provided working example files for building and running custom sandbox using the DockerRuntime.
Give a summary of what the PR does, explaining any non-trivial design decisions
This PR introduces a new DockerRuntime with minimal modification to the existing code base for building custom sandboxes.
The new runtime could empower developers to build sandbox with any features that Docker supports without constraints and it would better fit developers' daily workflows.
The docker runtime supports local or remote sandbox over tcp (this is an out of the box feature of docker)
The code is adapted from the existing EventStream runtime. Although with much duplication, I see a different path for the future use cases, it is better to keep them separate/independent. This could evolve into a more generic solution for building custom sandboxes.
Instead of writing a new adapter for every possible cloud/remote services in the world such as E2b. Model ..., OpenHands could consider the approaches similar to AWS Lambda (or any FAAS), that is to provide a standard runtime that can be included in building custom images. https://docs.aws.amazon.com/lambda/latest/dg/runtimes-custom.html
Link of any specific issues this addresses