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

fix docker leak #4970

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion openhands/controller/agent_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
)
from openhands.events.serialization.event import truncate_content
from openhands.llm.llm import LLM
from openhands.runtime.utils.shutdown_listener import should_continue
from openhands.utils.shutdown_listener import should_continue

# note: RESUME is only available on web GUI
TRAFFIC_CONTROL_REMINDER = (
Expand Down
2 changes: 1 addition & 1 deletion openhands/events/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
from openhands.core.utils import json
from openhands.events.event import Event, EventSource
from openhands.events.serialization.event import event_from_dict, event_to_dict
from openhands.runtime.utils.shutdown_listener import should_continue
from openhands.storage import FileStore
from openhands.utils.async_utils import call_sync_from_async
from openhands.utils.shutdown_listener import should_continue


class EventStreamSubscriber(str, Enum):
Expand Down
2 changes: 1 addition & 1 deletion openhands/llm/async_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from openhands.core.exceptions import UserCancelledError
from openhands.core.logger import openhands_logger as logger
from openhands.llm.llm import LLM, LLM_RETRY_EXCEPTIONS
from openhands.runtime.utils.shutdown_listener import should_continue
from openhands.utils.shutdown_listener import should_continue


class AsyncLLM(LLM):
Expand Down
24 changes: 11 additions & 13 deletions openhands/runtime/__init__.py
Original file line number Diff line number Diff line change
@@ -1,37 +1,35 @@
from openhands.core.logger import openhands_logger as logger
from openhands.runtime.impl.e2b.sandbox import E2BBox
from openhands.runtime.impl.eventstream.eventstream_runtime import (
EventStreamRuntime,
)
from openhands.runtime.impl.modal.modal_runtime import ModalRuntime
from openhands.runtime.impl.remote.remote_runtime import RemoteRuntime
from openhands.runtime.impl.runloop.runloop_runtime import RunloopRuntime


def get_runtime_cls(name: str):
# Local imports to avoid circular imports
if name == 'eventstream':
from openhands.runtime.impl.eventstream.eventstream_runtime import (
EventStreamRuntime,
)

return EventStreamRuntime
elif name == 'e2b':
from openhands.runtime.impl.e2b.e2b_runtime import E2BRuntime

return E2BRuntime
return E2BBox
elif name == 'remote':
from openhands.runtime.impl.remote.remote_runtime import RemoteRuntime

return RemoteRuntime
elif name == 'modal':
logger.debug('Using ModalRuntime')
from openhands.runtime.impl.modal.modal_runtime import ModalRuntime

return ModalRuntime
elif name == 'runloop':
from openhands.runtime.impl.runloop.runloop_runtime import RunloopRuntime

return RunloopRuntime
else:
raise ValueError(f'Runtime {name} not supported')


__all__ = [
'E2BBox',
'RemoteRuntime',
'ModalRuntime',
'RunloopRuntime',
'EventStreamRuntime',
'get_runtime_cls',
]
2 changes: 1 addition & 1 deletion openhands/runtime/browser/browser_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

from openhands.core.exceptions import BrowserInitException
from openhands.core.logger import openhands_logger as logger
from openhands.runtime.utils.shutdown_listener import should_continue, should_exit
from openhands.utils.shutdown_listener import should_continue, should_exit
from openhands.utils.tenacity_stop import stop_if_should_exit

BROWSER_EVAL_GET_GOAL_ACTION = 'GET_EVAL_GOAL'
Expand Down
2 changes: 1 addition & 1 deletion openhands/runtime/builder/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from openhands.core.logger import openhands_logger as logger
from openhands.runtime.builder import RuntimeBuilder
from openhands.runtime.utils.request import send_request
from openhands.runtime.utils.shutdown_listener import (
from openhands.utils.shutdown_listener import (
should_continue,
sleep_if_should_continue,
)
Expand Down
2 changes: 1 addition & 1 deletion openhands/runtime/plugins/jupyter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from openhands.runtime.plugins.jupyter.execute_server import JupyterKernel
from openhands.runtime.plugins.requirement import Plugin, PluginRequirement
from openhands.runtime.utils import find_available_tcp_port
from openhands.runtime.utils.shutdown_listener import should_continue
from openhands.utils.shutdown_listener import should_continue


@dataclass
Expand Down
2 changes: 1 addition & 1 deletion openhands/runtime/utils/tenacity_stop.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from tenacity import RetryCallState
from tenacity.stop import stop_base

from openhands.runtime.utils.shutdown_listener import should_exit
from openhands.utils.shutdown_listener import should_exit


class stop_if_should_exit(stop_base):
Expand Down
2 changes: 1 addition & 1 deletion openhands/server/mock/listen.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from openhands.core.logger import openhands_logger as logger
from openhands.core.schema import ActionType
from openhands.runtime.utils.shutdown_listener import should_continue
from openhands.utils.shutdown_listener import should_continue

app = FastAPI()

Expand Down
2 changes: 1 addition & 1 deletion openhands/server/session/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
from openhands.events.serialization import event_from_dict, event_to_dict
from openhands.events.stream import EventStreamSubscriber
from openhands.llm.llm import LLM
from openhands.runtime.utils.shutdown_listener import should_continue
from openhands.server.session.agent_session import AgentSession
from openhands.storage.files import FileStore
from openhands.utils.shutdown_listener import should_continue


class Session:
Expand Down
2 changes: 1 addition & 1 deletion openhands/utils/tenacity_stop.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from tenacity import RetryCallState
from tenacity.stop import stop_base

from openhands.runtime.utils.shutdown_listener import should_exit
from openhands.utils.shutdown_listener import should_exit


class stop_if_should_exit(stop_base):
Expand Down
Loading