Skip to content

Commit

Permalink
Merge branch 'main' into deven/use_pyproject_toml
Browse files Browse the repository at this point in the history
  • Loading branch information
devennavani committed Feb 12, 2025
2 parents 3079ddd + d499c66 commit eca1414
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 6 deletions.
11 changes: 11 additions & 0 deletions modal/_location.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Copyright Modal Labs 2022
import modal_proto.api_pb2


def display_location(cloud_provider: "modal_proto.api_pb2.CloudProvider.V") -> str:
if cloud_provider == modal_proto.api_pb2.CLOUD_PROVIDER_GCP:
return "GCP (us-east1)"
elif cloud_provider == modal_proto.api_pb2.CLOUD_PROVIDER_AWS:
return "AWS (us-east-1)"
else:
return ""
4 changes: 3 additions & 1 deletion modal/cli/network_file_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from typer import Argument, Typer

import modal
from modal._location import display_location
from modal._output import OutputManager, ProgressHandler
from modal._utils.async_utils import synchronizer
from modal._utils.grpc_utils import retry_transient_errors
Expand All @@ -36,12 +37,13 @@ async def list_(env: Optional[str] = ENV_OPTION, json: Optional[bool] = False):
client.stub.SharedVolumeList, api_pb2.SharedVolumeListRequest(environment_name=env)
)
env_part = f" in environment '{env}'" if env else ""
column_names = ["Name", "Created at"]
column_names = ["Name", "Location", "Created at"]
rows = []
for item in response.items:
rows.append(
[
item.label,
display_location(item.cloud_provider),
timestamp_to_local(item.created_at, json),
]
)
Expand Down
13 changes: 9 additions & 4 deletions modal_proto/api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,12 @@ enum ClientType {
}

enum CloudProvider {
// No longer used by clients, but server needs it to parse old protos
CLOUD_PROVIDER_UNSPECIFIED = 0;
CLOUD_PROVIDER_AWS = 1;
CLOUD_PROVIDER_GCP = 2;
CLOUD_PROVIDER_AUTO = 3;
CLOUD_PROVIDER_OCI = 4;
reserved 5, 6, 7, 8; // now unused internal experimental values
}

enum DNSRecordType {
Expand Down Expand Up @@ -1181,7 +1185,7 @@ message Function {

uint32 task_idle_timeout_secs = 25; // To be replaced by autoscaler_settings.scaledown_period

optional CloudProvider cloud_provider = 26; // Deprecated
optional CloudProvider cloud_provider = 26; // Deprecated at some point

uint32 warm_pool_size = 27; // To be replaced by autoscaler_settings.min_containers

Expand Down Expand Up @@ -2231,7 +2235,7 @@ message Sandbox {
repeated string secret_ids = 4;

Resources resources = 5;
CloudProvider cloud_provider = 6; // Deprecated
CloudProvider cloud_provider = 6; // Deprecated at some point

uint32 timeout_secs = 7;

Expand Down Expand Up @@ -2553,7 +2557,7 @@ message SharedVolumeListItem {
string label = 1; // app name of object entity app
string shared_volume_id = 2;
double created_at = 3;
reserved 4;
CloudProvider cloud_provider = 4;
}

message SharedVolumeListRequest {
Expand All @@ -2568,6 +2572,7 @@ message SharedVolumeListResponse {
message SharedVolumeMount {
string mount_path = 1;
string shared_volume_id = 2;
CloudProvider cloud_provider = 3;
bool allow_cross_region = 4;
}

Expand Down
2 changes: 1 addition & 1 deletion modal_version/_version_generated.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright Modal Labs 2025

# Note: Reset this value to -1 whenever you make a minor `0.X` release of the client.
build_number = 42 # git: cbac803
build_number = 43 # git: fd25ea3

0 comments on commit eca1414

Please sign in to comment.