All-Hands-AI / OpenHands

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

(feat) do not re-build runtime when changes made does not affect the runtime client #3622

Closed xingyaoww closed 1 month ago

xingyaoww commented 2 months ago

What problem or use case are you trying to solve?

Right now the runtime build will check for the hash of the build folder, including (1) source-distribution of OpenHands project, (2) Dockerfile and dependencies (pyproject.toml, poetry.lock), and re-build the runtime container when hash changes.

See this code for detail: https://github.com/All-Hands-AI/OpenHands/blob/0cdeb83b17adeeef41b036a52a13fef6b9a3a8bf/openhands/runtime/utils/runtime_build.py#L148-L168

Describe the UX of the solution you'd like

We should build as infrequent as possible - not all changes in the "source-distribution of OpenHands project" require rebuilding a docker container: for example, tweaking the evaluation code shouldn't require re-build a container.

Ideally, we should track openhands/runtime/client/client.py and its dependencies / imports - and use these to calculate hash, instead of the source distribution, AND only re-build the docker if those changes.

Do you have thoughts on the technical implementation?

Describe alternatives you've considered

Additional context

cc @tobitege

tobitege commented 1 month ago

I'll try to address this with #3682