File tree Expand file tree Collapse file tree
openhands/runtime/impl/daytona Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import os
2- from daytona_sdk import Daytona , DaytonaConfig
2+ from daytona_sdk import CreateSandboxParams , Daytona , DaytonaConfig
33from dotenv import load_dotenv
44
55load_dotenv ()
66
7- daytona = Daytona (DaytonaConfig (api_key = os .getenv ('DAYTONA_ API_KEY' )))
8- sandbox_id = 'd58beaad-49d3-4bf0-ad0b-3d0cd40dcf3e'
9- sandbox = daytona .get_current_sandbox (sandbox_id )
7+ daytona = Daytona (DaytonaConfig (api_key = os .getenv ('DAYTONA_API_KEY' )))
8+ image = 'docker.all-hands.dev/all-hands-ai/runtime:0.40-nikolaik'
9+ image = 'ghcr.io/smartmanoj/kevin-sandbox:oh_v0.40.0_p3hl9v56jrfymbsz_y49eklt66h256yhr'
10+ if 1 :
11+ sandbox = daytona .create (
12+ CreateSandboxParams (
13+ image = image ,
14+ public = True ,
15+ env_vars = {
16+ 'DEBUG' : 'true' ,
17+ },
18+ )
19+ )
20+ else :
21+ sandbox_id = 'd58beaad-49d3-4bf0-ad0b-3d0cd40dcf3e'
22+ sandbox = daytona .get_current_sandbox (sandbox_id )
1023
1124def exec_command (command ):
12- while 1 :
13- command = input ('Enter command: ' )
14- response = sandbox .process .exec (
15- command , timeout = 10
16- )
17- print (response .result )
25+ response = sandbox .process .exec (
26+ command , timeout = 10
27+ )
28+ print (response .result )
1829
1930if __name__ == "__main__" :
2031 exec_command ('pwd' )
You can’t perform that action at this time.
0 commit comments