Skip to content

Commit

Permalink
Add environment field to sandboxes (#2187)
Browse files Browse the repository at this point in the history
  • Loading branch information
howard36 authored Sep 4, 2024
1 parent 372ab53 commit 1c72b1e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modal/sandbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions modal_proto/api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 1c72b1e

Please sign in to comment.