Skip to content

Commit 6dd2491

Browse files
authored
Always pull sandbox image (#2538)
1 parent 0b74282 commit 6dd2491

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

opendevin/runtime/docker/ssh_box.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,9 @@ def __init__(
247247
logger.info('Detected initial session.')
248248
if not config.persist_sandbox or self.is_initial_session:
249249
logger.info('Creating new Docker container')
250+
# update the container image
251+
if self.container_image.endswith(':main'):
252+
self.docker_client.images.pull(self.container_image)
250253
n_tries = 5
251254
while n_tries > 0:
252255
try:
@@ -348,19 +351,18 @@ def setup_user(self):
348351
)
349352
# check the miniforge3 directory exist
350353
exit_code, logs = self.container.exec_run(
351-
['/bin/bash', '-c', '[ -d "/opendevin/miniforge3" ] && exit 0 || exit 1'],
354+
[
355+
'/bin/bash',
356+
'-c',
357+
'[ -d "/opendevin/miniforge3" ] && exit 0 || exit 1',
358+
],
352359
workdir=self.sandbox_workspace_dir,
353360
environment=self._env,
354361
)
355362
if exit_code != 0:
356-
if exit_code == 1:
357-
raise Exception(
358-
f'OPENDEVIN_PYTHON_INTERPRETER is not usable. Please pull the latest Docker image: docker pull ghcr.io/opendevin/sandbox:main'
359-
)
360-
else:
361-
raise Exception(
362-
f'An error occurred while checking if miniforge3 directory exists: {logs}'
363-
)
363+
raise Exception(
364+
f'An error occurred while checking if miniforge3 directory exists: {logs}'
365+
)
364366
# chown the miniforge3
365367
exit_code, logs = self.container.exec_run(
366368
['/bin/bash', '-c', 'chown -R opendevin:root /opendevin/miniforge3'],

0 commit comments

Comments
 (0)