Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Daytona Runtime #6863

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

idagelic
Copy link

End-user friendly description of the problem this fixes or functionality that this introduces

Adds support for a Daytona runtime to manage sandboxes. Daytona is a platform that provides a secure and elastic infrastructure for running AI-generated code.

To get started add the following environment variables:

RUNTIME = "daytona"

DAYTONA_API_KEY = <your_api_key> (get it here)

And optionally a DAYTONA_TARGET value that defaults to us but can be changed to eu

  • Include this change in the Release Notes. If checked, you must provide an end-user friendly description for your change below

Give a summary of what the PR does, explaining any non-trivial design decisions

Instead of the regular/local docker runtime, this PR allows setting the runtime to daytona and delegating the creation and management of the sandboxes OpenHands needs to run code from Docker to Daytona.

Daytona will ensure the availability of any OpenHands sandbox container runtime image starting from the one used in the release of this PR.

We also plan on improving the UX by adding a proxy functionality that will point the localhost port on the running machine to serve the preview URL used by Daytona to display any running apps in the form e.g. <port>-<workspace_id>.<node_id>.com. Feedback is appreciated.

Contributed by @jsrzic


Link of any specific issues this addresses

@enyst
Copy link
Collaborator

enyst commented Feb 20, 2025

Thank you for this contribution, nice to see!

Would you mind to add some log or screenshot to see a random example of use?

@idagelic
Copy link
Author

OH_log.txt
image

@enyst Thanks for the quick review - we'll take a look at the comments. Attached are the OH logs and a screenshot of the successfully executed prompt.

DaytonaRuntime.mp4

The video shows a separate prompt, where we tried also implementing the proxy mentioned in the description.

Instead of / in addition to the proxy - is there any way to add a tip for every LLM response containing "localhost:" which would let the user know to visit e.g. https://5000-sandbox123.node456.daytona.io instead of localhost? Another option is to try regex-ing the LLM response to replace the localhost URL with our preview URL, but I'm not sure if that would be feasible?

@rbren
Copy link
Collaborator

rbren commented Feb 20, 2025

This looks good to me! Engel has a couple good comments though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants