fix(sandbox): mount_dir for ssh_box (#1333)

* fix mount_dir for ssh_box

* move logic to config.py
This commit is contained in:
Xingyao Wang 2024-04-25 00:10:14 +08:00 committed by GitHub
parent 2268529b75
commit e6ecbd5510
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View File

@ -134,6 +134,9 @@ def finalize_config():
parts = config[ConfigType.WORKSPACE_MOUNT_REWRITE].split(':')
config[ConfigType.WORKSPACE_MOUNT_PATH] = base.replace(parts[0], parts[1])
if config.get(ConfigType.WORKSPACE_MOUNT_PATH) is None:
config[ConfigType.WORKSPACE_MOUNT_PATH] = config.get(ConfigType.WORKSPACE_BASE)
finalize_config()

View File

@ -373,8 +373,8 @@ class DockerSSHBox(Sandbox):
)
)
mount_dir = config.get('WORKSPACE_MOUNT_PATH')
print('Mounting workspace directory: ', mount_dir)
mount_dir = config.get(ConfigType.WORKSPACE_MOUNT_PATH)
logger.info(f'Mounting workspace directory: {mount_dir}')
# start the container
self.container = self.docker_client.containers.run(
self.container_image,