-
Notifications
You must be signed in to change notification settings - Fork 1.8k
feat(runtimes): unify cleanup for all runtimes #3775
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
feat(runtimes): unify cleanup for all runtimes #3775
Conversation
- Add cleanup() and stop() to BaseRuntime; stop() calls cleanup() and returns self - Add __enter__/__exit__ to BaseRuntime so any runtime can be used with 'with' - DaytonaRuntime: rename _cleanup to cleanup(), stop() and __del__ call cleanup() - RemoteHttpRuntime: rename _cleanup to cleanup(), stop() and __del__ and atexit use cleanup() - DockerRuntime: add cleanup(remove=...) with stop/remove logic; stop(remove=...) calls cleanup() - LLMGuardRuntime: add no-op cleanup() Closes camel-ai#3733
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
waleedalzarooni
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work @MkDev11,
Just a quick point to iron out before merging!
bytecii
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Left some comments. Also maybe we can add some unit tests?
… add base runtime tests
Wendong-Fan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @MkDev11 's contribution! some minor pre-commit issue need to be fixed, i will merge this PR first then would do enhance in another pr
cool, also can you please review my pr |
Closes #3733
Description
Unifies cleanup for all runtimes (Fixes #3733).
cleanup(), defaultstop()(callscleanup()and returnsself), and__enter__/__exit__so any runtime can be used withwith runtime:._cleanup()tocleanup();stop()and__del__callcleanup()._cleanup()tocleanup();stop(),__del__, andatexitusecleanup().cleanup(remove=None)with stop/remove logic;stop(remove=None)callscleanup().cleanup().All runtimes now share a single cleanup contract and support context-manager usage.
Checklist
Fixes #issue-numberin the PR description (required)pyproject.tomlanduv lock