Ivan Dagelic ecd573febc
Daytona Runtime (#6863)
Signed-off-by: jsrzic <josip.srzic@gmail.com>
Signed-off-by: Ivan Dagelic <dagelic.ivan@gmail.com>
Co-authored-by: jsrzic <65179822+jsrzic@users.noreply.github.com>
2025-02-24 13:09:30 +01:00

42 lines
1.3 KiB
Python

from openhands.core.logger import openhands_logger as logger
from openhands.runtime.impl.daytona.daytona_runtime import DaytonaRuntime
from openhands.runtime.impl.docker.docker_runtime import (
DockerRuntime,
)
from openhands.runtime.impl.e2b.sandbox import E2BBox
from openhands.runtime.impl.local.local_runtime import LocalRuntime
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' or name == 'docker':
return DockerRuntime
elif name == 'e2b':
return E2BBox
elif name == 'remote':
return RemoteRuntime
elif name == 'modal':
logger.debug('Using ModalRuntime')
return ModalRuntime
elif name == 'runloop':
return RunloopRuntime
elif name == 'local':
return LocalRuntime
elif name == 'daytona':
return DaytonaRuntime
else:
raise ValueError(f'Runtime {name} not supported')
__all__ = [
'E2BBox',
'RemoteRuntime',
'ModalRuntime',
'RunloopRuntime',
'DockerRuntime',
'get_runtime_cls',
]