Skip to content

Commit 16af58e

Browse files
committed
fix test case: add rock auth to sandbox info
1 parent 14531e3 commit 16af58e

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

rock/sandbox/sandbox_manager.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,6 @@ async def create_session(self, request: CreateSessionRequest) -> CreateBashSessi
149149
await self._update_expire_time(request.sandbox_id)
150150
return await self._deployment_service.async_ray_get(sandbox_actor.create_session.remote(request))
151151

152-
async def execute(self, command: Command) -> CommandResponse:
153-
sandbox_actor = await self._deployment_service.async_ray_get_actor(command.sandbox_id)
154-
if sandbox_actor is None:
155-
raise Exception(f"sandbox {command.sandbox_id} not found to execute")
156-
await self._update_expire_time(command.sandbox_id)
157-
return await self._deployment_service.async_ray_get(sandbox_actor.execute.remote(command))
158-
159152
@monitor_sandbox_operation()
160153
async def run_in_session(self, action: Action) -> BashObservation:
161154
sandbox_actor = await self._deployment_service.async_ray_get_actor(action.sandbox_id)
@@ -164,6 +157,13 @@ async def run_in_session(self, action: Action) -> BashObservation:
164157
await self._update_expire_time(action.sandbox_id)
165158
return await self._deployment_service.async_ray_get(sandbox_actor.run_in_session.remote(action))
166159

160+
async def execute(self, command: Command) -> CommandResponse:
161+
sandbox_actor = await self._deployment_service.async_ray_get_actor(command.sandbox_id)
162+
if sandbox_actor is None:
163+
raise Exception(f"sandbox {command.sandbox_id} not found to execute")
164+
await self._update_expire_time(command.sandbox_id)
165+
return await self._deployment_service.async_ray_get(sandbox_actor.execute.remote(command))
166+
167167
async def _is_expired(self, sandbox_id):
168168
timeout_dict = await self._redis_provider.json_get(timeout_sandbox_key(sandbox_id), "$")
169169
if timeout_dict is None or len(timeout_dict) == 0:

rock/sandbox/service/deployment_service.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ async def submit(self, config: DockerDeploymentConfig, user_info: dict) -> Sandb
9292
user_id = user_info.get("user_id", "default")
9393
experiment_id = user_info.get("experiment_id", "default")
9494
namespace = user_info.get("namespace", "default")
95+
rock_authorization = user_info.get("rock_authorization", "default")
9596
sandbox_actor.start.remote()
9697
sandbox_actor.set_user_id.remote(user_id)
9798
sandbox_actor.set_experiment_id.remote(experiment_id)
@@ -101,6 +102,7 @@ async def submit(self, config: DockerDeploymentConfig, user_info: dict) -> Sandb
101102
sandbox_info["experiment_id"] = experiment_id
102103
sandbox_info["namespace"] = namespace
103104
sandbox_info["state"] = State.PENDING
105+
sandbox_info["rock_authorization"] = rock_authorization
104106
return sandbox_info
105107

106108
async def creator_actor(self, config: DockerDeploymentConfig):

0 commit comments

Comments
 (0)