mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 05:48:36 +08:00
Fixes for docker nested runtime (#9634)
This commit is contained in:
parent
8d16567428
commit
9331f5e8a7
@ -497,12 +497,10 @@ class DockerNestedConversationManager(ConversationManager):
|
||||
env_vars['SESSION_API_KEY'] = self._get_session_api_key_for_conversation(sid)
|
||||
# We need to be able to specify the nested conversation id within the nested runtime
|
||||
env_vars['ALLOW_SET_CONVERSATION_ID'] = '1'
|
||||
env_vars['WORKSPACE_BASE'] = '/workspace'
|
||||
env_vars['SANDBOX_CLOSE_DELAY'] = '0'
|
||||
env_vars['SKIP_DEPENDENCY_CHECK'] = '1'
|
||||
env_vars['INITIAL_NUM_WARM_SERVERS'] = '1'
|
||||
|
||||
# Set up mounted volume for conversation directory within workspace
|
||||
# TODO: Check if we are using the standard event store and file store
|
||||
volumes: list[str | None]
|
||||
if not config.sandbox.volumes:
|
||||
volumes = []
|
||||
@ -510,9 +508,17 @@ class DockerNestedConversationManager(ConversationManager):
|
||||
volumes = [v.strip() for v in config.sandbox.volumes.split(',')]
|
||||
conversation_dir = get_conversation_dir(sid, user_id)
|
||||
|
||||
volumes.append(
|
||||
f'{config.file_store_path}/{conversation_dir}:/root/.openhands/file_store/{conversation_dir}:rw'
|
||||
)
|
||||
# Set up mounted volume for conversation directory within workspace
|
||||
if config.file_store == 'local':
|
||||
# Resolve ~ from path as the docker container does not work otherwise
|
||||
file_store_path = os.path.realpath(
|
||||
os.path.expanduser(config.file_store_path)
|
||||
)
|
||||
|
||||
volumes.append(
|
||||
f'{file_store_path}/{conversation_dir}:/root/.openhands/{conversation_dir}:rw'
|
||||
)
|
||||
|
||||
config.sandbox.volumes = ','.join([v for v in volumes if v is not None])
|
||||
if not config.sandbox.runtime_container_image:
|
||||
config.sandbox.runtime_container_image = self._runtime_container_image
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user