File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -247,6 +247,9 @@ def __init__(
247
247
logger .info ('Detected initial session.' )
248
248
if not config .persist_sandbox or self .is_initial_session :
249
249
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 )
250
253
n_tries = 5
251
254
while n_tries > 0 :
252
255
try :
@@ -348,19 +351,18 @@ def setup_user(self):
348
351
)
349
352
# check the miniforge3 directory exist
350
353
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
+ ],
352
359
workdir = self .sandbox_workspace_dir ,
353
360
environment = self ._env ,
354
361
)
355
362
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
+ )
364
366
# chown the miniforge3
365
367
exit_code , logs = self .container .exec_run (
366
368
['/bin/bash' , '-c' , 'chown -R opendevin:root /opendevin/miniforge3' ],
You can’t perform that action at this time.
0 commit comments