From 1c72b1ef253c82af418ecd6f7bcc09634e36902e Mon Sep 17 00:00:00 2001 From: Howard Halim Date: Wed, 4 Sep 2024 10:41:49 -0400 Subject: [PATCH] Add environment field to sandboxes (#2187) --- modal/sandbox.py | 4 +++- modal_proto/api.proto | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/modal/sandbox.py b/modal/sandbox.py index e1775370e..a2a3ae178 100644 --- a/modal/sandbox.py +++ b/modal/sandbox.py @@ -132,7 +132,9 @@ async def _load(self: _Sandbox, resolver: Resolver, _existing_object_id: Optiona ) # Note - `resolver.app_id` will be `None` for app-less sandboxes - create_req = api_pb2.SandboxCreateRequest(app_id=resolver.app_id, definition=definition) + create_req = api_pb2.SandboxCreateRequest( + app_id=resolver.app_id, definition=definition, environment_name=resolver.environment_name + ) create_resp = await retry_transient_errors(resolver.client.stub.SandboxCreate, create_req) sandbox_id = create_resp.sandbox_id diff --git a/modal_proto/api.proto b/modal_proto/api.proto index ef7de5eac..ebb70d3de 100644 --- a/modal_proto/api.proto +++ b/modal_proto/api.proto @@ -1782,6 +1782,7 @@ message Sandbox { message SandboxCreateRequest { string app_id = 1 [ (modal.options.audit_target_attr) = true ]; Sandbox definition = 2; + string environment_name = 3; } message SandboxCreateResponse {