All-Hands-AI / OpenHands

🙌 OpenHands: Code Less, Make More
https://all-hands.dev
MIT License
33.27k stars 3.81k forks source link

feat: Add docker_runtime based on EventStream #4588

Open qiangli opened 5 hours ago

qiangli commented 5 hours ago

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