Skip to content

Commit

Permalink
Add protos for sandbox snapshots (#2774)
Browse files Browse the repository at this point in the history
* Add protos for sandbox snapshots

* move timeout

* sort

* sort
  • Loading branch information
thecodingwizard authored Jan 17, 2025
1 parent acda83f commit 4ec7a05
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions modal_proto/api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2223,6 +2223,13 @@ message Sandbox {
NetworkAccess network_access = 22;

optional string proxy_id = 23;

// Enable memory snapshots.
bool enable_memory_snapshot = 24;

// Used to pin gVisor version for memory-snapshottable sandboxes.
// This field is set by the server, not the client.
optional uint32 snapshot_version = 25;
}

message SandboxCreateRequest {
Expand Down Expand Up @@ -2287,6 +2294,16 @@ message SandboxListResponse {
repeated SandboxInfo sandboxes = 1;
}

message SandboxRestoreRequest {
string app_id = 1 [ (modal.options.audit_target_attr) = true ];
string snapshot_id = 2;
string environment_name = 3;
}

message SandboxRestoreResponse {
string sandbox_id = 1;
}

message SandboxSnapshotFsRequest {
string sandbox_id = 1;
float timeout = 2;
Expand All @@ -2299,6 +2316,23 @@ message SandboxSnapshotFsResponse {
ImageMetadata image_metadata = 3;
}

message SandboxSnapshotRequest {
string sandbox_id = 1;
}

message SandboxSnapshotResponse {
string snapshot_id = 1;
}

message SandboxSnapshotWaitRequest {
string snapshot_id = 1;
float timeout = 2;
}

message SandboxSnapshotWaitResponse {
GenericResult result = 1;
}

message SandboxStdinWriteRequest {
string sandbox_id = 1;
bytes input = 2;
Expand Down Expand Up @@ -2921,7 +2955,10 @@ service ModalClient {
rpc SandboxGetTaskId(SandboxGetTaskIdRequest) returns (SandboxGetTaskIdResponse); // needed for modal container exec
rpc SandboxGetTunnels(SandboxGetTunnelsRequest) returns (SandboxGetTunnelsResponse);
rpc SandboxList(SandboxListRequest) returns (SandboxListResponse);
rpc SandboxRestore(SandboxRestoreRequest) returns (SandboxRestoreResponse);
rpc SandboxSnapshot(SandboxSnapshotRequest) returns (SandboxSnapshotResponse);
rpc SandboxSnapshotFs(SandboxSnapshotFsRequest) returns (SandboxSnapshotFsResponse);
rpc SandboxSnapshotWait(SandboxSnapshotWaitRequest) returns (SandboxSnapshotWaitResponse);
rpc SandboxStdinWrite(SandboxStdinWriteRequest) returns (SandboxStdinWriteResponse);
rpc SandboxTagsSet(SandboxTagsSetRequest) returns (google.protobuf.Empty);
rpc SandboxTerminate(SandboxTerminateRequest) returns (SandboxTerminateResponse);
Expand Down

0 comments on commit 4ec7a05

Please sign in to comment.