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

Factor out ActionExecutionClient #5796

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

Conversation

rbren
Copy link
Collaborator

@rbren rbren commented Dec 25, 2024

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

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

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

This should be a straight refactor, but it's a little heavy. There's a TON of shared logic between all the different runtimes that just send HTTP requests to the ActionExecutionServer. This tries to factor all that out into a common place

There are probably some minor differences wrt retry logic and error handling, but I've tried to keep them the same


Link of any specific issues this addresses


To run this PR locally, use the following command:

docker run -it --rm   -p 3000:3000   -v /var/run/docker.sock:/var/run/docker.sock   --add-host host.docker.internal:host-gateway   -e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:73063c8-nikolaik   --name openhands-app-73063c8   docker.all-hands.dev/all-hands-ai/openhands:73063c8

@enyst
Copy link
Collaborator

enyst commented Dec 25, 2024

Can we add the change in this PR to the documentation, e.g. in the runtime README?

@enyst enyst requested a review from xingyaoww December 25, 2024 20:19
status_callback,
attach_to_existing,
headless_mode,
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most thing LGTM! Do we keep the LogStreamer log in the client or still in each runtime implementation?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh does the LogStreamer use the API now, instead of docker logs? If so we can centralize it!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like no--we need different log logic for docker, remote, modal, etc.

Mostly it seems like LogStreamer is a convenience when running locally, so only DockerRuntime has it for now. I removed the Modal and Runloop implementations since they're unused and hard to maintain

@rbren
Copy link
Collaborator Author

rbren commented Dec 26, 2024

@xingyaoww lmk if you have any other concerns!

Copy link
Collaborator

@xingyaoww xingyaoww left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM!

@@ -49,7 +49,7 @@ class AppConfig:
default_agent: str = OH_DEFAULT_AGENT
sandbox: SandboxConfig = field(default_factory=SandboxConfig)
security: SecurityConfig = field(default_factory=SecurityConfig)
runtime: str = 'eventstream'
runtime: str = 'docker'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we do a global replace in evaluation folder as well?

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