From 64c2a783d4ea69345f39deb1a6a7f9a9d16875d3 Mon Sep 17 00:00:00 2001 From: Shimada666 <649940882@qq.com> Date: Fri, 21 Jun 2024 16:09:26 +0800 Subject: [PATCH] Revert "Always pull sandbox image (#2538)" (#2560) This reverts commit 6dd24919448b6378a351f775049ab1b76d575eba. --- opendevin/runtime/docker/ssh_box.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/opendevin/runtime/docker/ssh_box.py b/opendevin/runtime/docker/ssh_box.py index 44b8197d84..04b8c10a86 100644 --- a/opendevin/runtime/docker/ssh_box.py +++ b/opendevin/runtime/docker/ssh_box.py @@ -348,18 +348,19 @@ class DockerSSHBox(Sandbox): ) # check the miniforge3 directory exist exit_code, logs = self.container.exec_run( - [ - '/bin/bash', - '-c', - '[ -d "/opendevin/miniforge3" ] && exit 0 || exit 1', - ], + ['/bin/bash', '-c', '[ -d "/opendevin/miniforge3" ] && exit 0 || exit 1'], workdir=self.sandbox_workspace_dir, environment=self._env, ) if exit_code != 0: - raise Exception( - f'An error occurred while checking if miniforge3 directory exists: {logs}' - ) + if exit_code == 1: + raise Exception( + f'OPENDEVIN_PYTHON_INTERPRETER is not usable. Please pull the latest Docker image: docker pull ghcr.io/opendevin/sandbox:main' + ) + else: + raise Exception( + f'An error occurred while checking if miniforge3 directory exists: {logs}' + ) # chown the miniforge3 exit_code, logs = self.container.exec_run( ['/bin/bash', '-c', 'chown -R opendevin:root /opendevin/miniforge3'],