anyscale 0.26.47__py3-none-any.whl → 0.26.48__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- anyscale/__init__.py +0 -7
- anyscale/_private/anyscale_client/anyscale_client.py +1 -208
- anyscale/_private/anyscale_client/common.py +0 -55
- anyscale/_private/anyscale_client/fake_anyscale_client.py +19 -46
- anyscale/_private/docgen/__main__.py +24 -45
- anyscale/_private/docgen/generator.py +32 -16
- anyscale/_private/docgen/generator_legacy.py +58 -6
- anyscale/_private/docgen/models.md +3 -2
- anyscale/_private/workload/workload_config.py +16 -8
- anyscale/_private/workload/workload_sdk.py +22 -5
- anyscale/client/README.md +4 -1
- anyscale/client/openapi_client/__init__.py +2 -1
- anyscale/client/openapi_client/api/default_api.py +253 -4
- anyscale/client/openapi_client/models/__init__.py +2 -1
- anyscale/client/openapi_client/models/{alert_type.py → alert_issue_type.py} +8 -20
- anyscale/client/openapi_client/models/baseimagesenum.py +1 -2
- anyscale/client/openapi_client/models/cloud.py +31 -3
- anyscale/client/openapi_client/models/cloud_deployment.py +30 -3
- anyscale/client/openapi_client/models/cloud_with_cloud_resource.py +29 -1
- anyscale/client/openapi_client/models/cloud_with_cloud_resource_gcp.py +29 -1
- anyscale/client/openapi_client/models/dataset_metrics.py +6 -6
- anyscale/client/openapi_client/models/dataset_state.py +2 -1
- anyscale/client/openapi_client/models/describe_system_workload_response.py +32 -6
- anyscale/client/openapi_client/models/experimental_workspace.py +29 -1
- anyscale/client/openapi_client/models/experimental_workspaces_sort_field.py +2 -1
- anyscale/client/openapi_client/models/operator_metrics.py +8 -9
- anyscale/client/openapi_client/models/operator_status.py +102 -0
- anyscale/client/openapi_client/models/organization_usage_alert.py +20 -20
- anyscale/client/openapi_client/models/supportedbaseimagesenum.py +1 -2
- anyscale/cloud/models.py +330 -0
- anyscale/commands/cloud_commands.py +132 -43
- anyscale/commands/command_examples.py +54 -134
- anyscale/commands/compute_config_commands.py +7 -11
- anyscale/compute_config/__init__.py +2 -16
- anyscale/compute_config/_private/compute_config_sdk.py +27 -17
- anyscale/compute_config/commands.py +14 -44
- anyscale/compute_config/models.py +49 -26
- anyscale/controllers/cloud_controller.py +289 -171
- anyscale/controllers/cloud_file_storage_utils.py +204 -0
- anyscale/controllers/kubernetes_verifier.py +1567 -0
- anyscale/job/_private/job_sdk.py +17 -8
- anyscale/job/models.py +1 -1
- anyscale/scripts.py +0 -2
- anyscale/sdk/anyscale_client/models/baseimagesenum.py +1 -2
- anyscale/sdk/anyscale_client/models/cloud.py +31 -3
- anyscale/sdk/anyscale_client/models/supportedbaseimagesenum.py +1 -2
- anyscale/shared_anyscale_utils/utils/id_gen.py +1 -0
- anyscale/version.py +1 -1
- anyscale/workspace/models.py +14 -7
- {anyscale-0.26.47.dist-info → anyscale-0.26.48.dist-info}/METADATA +1 -1
- {anyscale-0.26.47.dist-info → anyscale-0.26.48.dist-info}/RECORD +56 -70
- anyscale/commands/llm/dataset_commands.py +0 -269
- anyscale/commands/llm/group.py +0 -15
- anyscale/commands/llm/models_commands.py +0 -123
- anyscale/controllers/llm/__init__.py +0 -0
- anyscale/controllers/llm/models_controller.py +0 -144
- anyscale/llm/__init__.py +0 -2
- anyscale/llm/dataset/__init__.py +0 -2
- anyscale/llm/dataset/_private/__init__.py +0 -0
- anyscale/llm/dataset/_private/docs.py +0 -63
- anyscale/llm/dataset/_private/models.py +0 -71
- anyscale/llm/dataset/_private/sdk.py +0 -147
- anyscale/llm/model/__init__.py +0 -2
- anyscale/llm/model/_private/models_sdk.py +0 -62
- anyscale/llm/model/commands.py +0 -93
- anyscale/llm/model/models.py +0 -171
- anyscale/llm/model/sdk.py +0 -62
- anyscale/llm/sdk.py +0 -27
- {anyscale-0.26.47.dist-info → anyscale-0.26.48.dist-info}/WHEEL +0 -0
- {anyscale-0.26.47.dist-info → anyscale-0.26.48.dist-info}/entry_points.txt +0 -0
- {anyscale-0.26.47.dist-info → anyscale-0.26.48.dist-info}/licenses/LICENSE +0 -0
- {anyscale-0.26.47.dist-info → anyscale-0.26.48.dist-info}/licenses/NOTICE +0 -0
- {anyscale-0.26.47.dist-info → anyscale-0.26.48.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,204 @@
|
|
1
|
+
"""
|
2
|
+
Cloud File Storage Utilities
|
3
|
+
|
4
|
+
Common functions for verifying AWS EFS and GCP Filestore resources
|
5
|
+
across different cloud verification contexts.
|
6
|
+
"""
|
7
|
+
|
8
|
+
from typing import Dict, Optional
|
9
|
+
|
10
|
+
import boto3
|
11
|
+
|
12
|
+
from anyscale.cli_logger import BlockLogger
|
13
|
+
from anyscale.client.openapi_client.models.cloud_deployment import CloudDeployment
|
14
|
+
from anyscale.client.openapi_client.models.cloud_providers import CloudProviders
|
15
|
+
from anyscale.client.openapi_client.models.file_storage import FileStorage
|
16
|
+
from anyscale.util import _get_aws_efs_mount_target_ip
|
17
|
+
|
18
|
+
|
19
|
+
class GCPFilestoreInfo:
|
20
|
+
"""Container for GCP Filestore information"""
|
21
|
+
|
22
|
+
def __init__(
|
23
|
+
self,
|
24
|
+
filestore_id: str,
|
25
|
+
exists: bool,
|
26
|
+
mount_target_ip: Optional[str] = None,
|
27
|
+
root_dir: Optional[str] = None,
|
28
|
+
details: Optional[Dict] = None,
|
29
|
+
):
|
30
|
+
self.filestore_id = filestore_id
|
31
|
+
self.exists = exists
|
32
|
+
self.mount_target_ip = mount_target_ip
|
33
|
+
self.root_dir = root_dir
|
34
|
+
self.details = details or {}
|
35
|
+
|
36
|
+
|
37
|
+
def _get_gcp_client_factory(logger, cloud_deployment: CloudDeployment):
|
38
|
+
"""Helper function to get GCP client factory."""
|
39
|
+
from anyscale.cli_logger import CloudSetupLogger
|
40
|
+
from anyscale.utils.gcp_utils import get_google_cloud_client_factory
|
41
|
+
|
42
|
+
gcp_config = cloud_deployment.gcp_config or {}
|
43
|
+
project_id = gcp_config.get("project_id")
|
44
|
+
|
45
|
+
if not project_id:
|
46
|
+
raise ValueError("No GCP project_id found in cloud deployment config")
|
47
|
+
|
48
|
+
# Create GCP client factory - need to handle logger type mismatch
|
49
|
+
if isinstance(logger, CloudSetupLogger):
|
50
|
+
return get_google_cloud_client_factory(logger, project_id), project_id
|
51
|
+
else:
|
52
|
+
# Create a CloudSetupLogger wrapper for compatibility
|
53
|
+
cloud_setup_logger = CloudSetupLogger()
|
54
|
+
return (
|
55
|
+
get_google_cloud_client_factory(cloud_setup_logger, project_id),
|
56
|
+
project_id,
|
57
|
+
)
|
58
|
+
|
59
|
+
|
60
|
+
def _get_detailed_filestore_config(
|
61
|
+
factory, vpc_name: Optional[str], filestore_id: str, logger: BlockLogger
|
62
|
+
):
|
63
|
+
"""Helper function to get detailed filestore configuration."""
|
64
|
+
if not vpc_name:
|
65
|
+
return None, None
|
66
|
+
|
67
|
+
try:
|
68
|
+
from anyscale.cli_logger import CloudSetupLogger
|
69
|
+
from anyscale.utils import gcp_utils
|
70
|
+
|
71
|
+
cloud_setup_logger = CloudSetupLogger()
|
72
|
+
filestore_config = gcp_utils.get_gcp_filestore_config_from_full_name(
|
73
|
+
factory, vpc_name, filestore_id, cloud_setup_logger
|
74
|
+
)
|
75
|
+
if filestore_config:
|
76
|
+
return filestore_config.mount_target_ip, filestore_config.root_dir
|
77
|
+
except (ImportError, AttributeError, KeyError) as e:
|
78
|
+
logger.warning(f"Could not retrieve detailed filestore config: {e}")
|
79
|
+
|
80
|
+
return None, None
|
81
|
+
|
82
|
+
|
83
|
+
def get_gcp_filestore_info(
|
84
|
+
filestore_id: str,
|
85
|
+
cloud_deployment: CloudDeployment,
|
86
|
+
logger: Optional[BlockLogger] = None,
|
87
|
+
) -> GCPFilestoreInfo:
|
88
|
+
"""
|
89
|
+
Common function to fetch GCP Filestore information.
|
90
|
+
|
91
|
+
Args:
|
92
|
+
filestore_id: The GCP Filestore instance ID
|
93
|
+
cloud_deployment: CloudDeployment object containing GCP config
|
94
|
+
logger: Optional logger for output
|
95
|
+
|
96
|
+
Returns:
|
97
|
+
GCPFilestoreInfo object containing Filestore details and existence status
|
98
|
+
"""
|
99
|
+
if logger is None:
|
100
|
+
logger = BlockLogger()
|
101
|
+
|
102
|
+
try:
|
103
|
+
from anyscale.cli_logger import CloudSetupLogger
|
104
|
+
from anyscale.gcp_verification import GCPLogger, verify_filestore
|
105
|
+
|
106
|
+
# Get GCP config and client factory
|
107
|
+
factory, project_id = _get_gcp_client_factory(logger, cloud_deployment)
|
108
|
+
|
109
|
+
gcp_config = cloud_deployment.gcp_config or {}
|
110
|
+
vpc_name = gcp_config.get("vpc_name")
|
111
|
+
|
112
|
+
if not vpc_name:
|
113
|
+
logger.warning("No VPC name found - may affect connectivity checks")
|
114
|
+
|
115
|
+
# Create GCP logger for filestore verification
|
116
|
+
gcp_logger = GCPLogger(CloudSetupLogger(), project_id, None, True)
|
117
|
+
|
118
|
+
# Use existing filestore verification logic
|
119
|
+
region = cloud_deployment.region or ""
|
120
|
+
verification_result = verify_filestore(
|
121
|
+
factory=factory,
|
122
|
+
file_store_instance_name=filestore_id,
|
123
|
+
vpc_name=vpc_name,
|
124
|
+
cloud_region=region,
|
125
|
+
logger=gcp_logger,
|
126
|
+
strict=False,
|
127
|
+
)
|
128
|
+
|
129
|
+
# Try to get detailed filestore config if available
|
130
|
+
mount_target_ip, root_dir = _get_detailed_filestore_config(
|
131
|
+
factory, vpc_name, filestore_id, logger
|
132
|
+
)
|
133
|
+
|
134
|
+
if verification_result:
|
135
|
+
logger.info(f"GCP Filestore {filestore_id} exists and is accessible")
|
136
|
+
return GCPFilestoreInfo(
|
137
|
+
filestore_id=filestore_id,
|
138
|
+
exists=True,
|
139
|
+
mount_target_ip=mount_target_ip,
|
140
|
+
root_dir=root_dir,
|
141
|
+
)
|
142
|
+
else:
|
143
|
+
logger.error(f"GCP Filestore {filestore_id} verification failed")
|
144
|
+
return GCPFilestoreInfo(filestore_id=filestore_id, exists=False)
|
145
|
+
|
146
|
+
except ImportError as e:
|
147
|
+
logger.warning(f"GCP verification dependencies not available: {e}")
|
148
|
+
# Don't fail verification if GCP deps are missing
|
149
|
+
return GCPFilestoreInfo(filestore_id=filestore_id, exists=True)
|
150
|
+
except (ValueError, AttributeError, KeyError) as e:
|
151
|
+
logger.error(f"Configuration error checking GCP Filestore {filestore_id}: {e}")
|
152
|
+
return GCPFilestoreInfo(filestore_id=filestore_id, exists=False)
|
153
|
+
|
154
|
+
|
155
|
+
def verify_file_storage_exists(
|
156
|
+
file_storage: FileStorage,
|
157
|
+
cloud_deployment: CloudDeployment,
|
158
|
+
logger: Optional[BlockLogger] = None,
|
159
|
+
) -> bool:
|
160
|
+
"""
|
161
|
+
Generic function to verify file storage exists based on cloud provider.
|
162
|
+
|
163
|
+
Args:
|
164
|
+
file_storage: File storage configuration object
|
165
|
+
cloud_deployment: CloudDeployment object
|
166
|
+
logger: Optional logger for output
|
167
|
+
|
168
|
+
Returns:
|
169
|
+
bool: True if file storage exists, False otherwise
|
170
|
+
"""
|
171
|
+
if logger is None:
|
172
|
+
logger = BlockLogger()
|
173
|
+
|
174
|
+
file_storage_id = getattr(file_storage, "file_storage_id", None)
|
175
|
+
if not file_storage_id:
|
176
|
+
logger.warning("No file_storage_id provided - skipping existence check")
|
177
|
+
return True
|
178
|
+
|
179
|
+
provider_value = (
|
180
|
+
getattr(cloud_deployment.provider, "value", str(cloud_deployment.provider))
|
181
|
+
if cloud_deployment.provider
|
182
|
+
else None
|
183
|
+
)
|
184
|
+
|
185
|
+
if provider_value == CloudProviders.AWS:
|
186
|
+
region = cloud_deployment.region
|
187
|
+
if not region:
|
188
|
+
logger.error("No region found for AWS EFS verification")
|
189
|
+
return False
|
190
|
+
|
191
|
+
boto3_session = boto3.Session(region_name=region)
|
192
|
+
return _get_aws_efs_mount_target_ip(boto3_session, file_storage_id) is not None
|
193
|
+
|
194
|
+
elif provider_value == CloudProviders.GCP:
|
195
|
+
filestore_info = get_gcp_filestore_info(
|
196
|
+
file_storage_id, cloud_deployment, logger
|
197
|
+
)
|
198
|
+
return filestore_info.exists
|
199
|
+
|
200
|
+
else:
|
201
|
+
logger.warning(
|
202
|
+
f"File storage existence check not supported for provider: {provider_value}"
|
203
|
+
)
|
204
|
+
return True
|