anyscale 0.26.50__py3-none-any.whl → 0.26.52__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.
Files changed (48) hide show
  1. anyscale/_private/anyscale_client/README.md +1 -1
  2. anyscale/_private/anyscale_client/anyscale_client.py +178 -46
  3. anyscale/_private/anyscale_client/common.py +61 -2
  4. anyscale/_private/anyscale_client/fake_anyscale_client.py +145 -8
  5. anyscale/_private/docgen/__main__.py +34 -23
  6. anyscale/_private/docgen/generator.py +15 -18
  7. anyscale/_private/docgen/models.md +4 -2
  8. anyscale/_private/workload/workload_sdk.py +103 -8
  9. anyscale/client/README.md +5 -0
  10. anyscale/client/openapi_client/__init__.py +1 -0
  11. anyscale/client/openapi_client/api/default_api.py +538 -0
  12. anyscale/client/openapi_client/models/__init__.py +1 -0
  13. anyscale/client/openapi_client/models/baseimagesenum.py +83 -1
  14. anyscale/client/openapi_client/models/cloud_resource.py +59 -3
  15. anyscale/client/openapi_client/models/cloud_resource_gcp.py +59 -3
  16. anyscale/client/openapi_client/models/clouddeployment_response.py +121 -0
  17. anyscale/client/openapi_client/models/create_cloud_resource.py +59 -3
  18. anyscale/client/openapi_client/models/create_cloud_resource_gcp.py +59 -3
  19. anyscale/client/openapi_client/models/object_storage.py +2 -2
  20. anyscale/client/openapi_client/models/ray_runtime_env_config.py +57 -1
  21. anyscale/client/openapi_client/models/supportedbaseimagesenum.py +80 -1
  22. anyscale/cloud/models.py +1 -1
  23. anyscale/commands/cloud_commands.py +73 -70
  24. anyscale/commands/command_examples.py +28 -40
  25. anyscale/commands/project_commands.py +377 -106
  26. anyscale/commands/workspace_commands_v2.py +62 -29
  27. anyscale/controllers/cloud_controller.py +91 -91
  28. anyscale/job/_private/job_sdk.py +38 -20
  29. anyscale/project/__init__.py +101 -1
  30. anyscale/project/_private/project_sdk.py +90 -2
  31. anyscale/project/commands.py +188 -1
  32. anyscale/project/models.py +198 -2
  33. anyscale/sdk/anyscale_client/models/baseimagesenum.py +83 -1
  34. anyscale/sdk/anyscale_client/models/ray_runtime_env_config.py +57 -1
  35. anyscale/sdk/anyscale_client/models/supportedbaseimagesenum.py +80 -1
  36. anyscale/service/_private/service_sdk.py +2 -1
  37. anyscale/shared_anyscale_utils/latest_ray_version.py +1 -1
  38. anyscale/util.py +3 -0
  39. anyscale/utils/cloud_utils.py +20 -0
  40. anyscale/utils/runtime_env.py +3 -1
  41. anyscale/version.py +1 -1
  42. {anyscale-0.26.50.dist-info → anyscale-0.26.52.dist-info}/METADATA +1 -1
  43. {anyscale-0.26.50.dist-info → anyscale-0.26.52.dist-info}/RECORD +48 -47
  44. {anyscale-0.26.50.dist-info → anyscale-0.26.52.dist-info}/WHEEL +0 -0
  45. {anyscale-0.26.50.dist-info → anyscale-0.26.52.dist-info}/entry_points.txt +0 -0
  46. {anyscale-0.26.50.dist-info → anyscale-0.26.52.dist-info}/licenses/LICENSE +0 -0
  47. {anyscale-0.26.50.dist-info → anyscale-0.26.52.dist-info}/licenses/NOTICE +0 -0
  48. {anyscale-0.26.50.dist-info → anyscale-0.26.52.dist-info}/top_level.txt +0 -0
@@ -112,7 +112,7 @@ class WorkloadSDK(BaseSDK):
112
112
 
113
113
  return new_runtime_envs
114
114
 
115
- def override_and_upload_local_dirs(
115
+ def override_and_upload_local_dirs_single_deployment( # noqa: PLR0912
116
116
  self,
117
117
  runtime_envs: List[Dict[str, Any]],
118
118
  *,
@@ -122,7 +122,7 @@ class WorkloadSDK(BaseSDK):
122
122
  autopopulate_in_workspace: bool = True,
123
123
  additional_py_modules: Optional[List[str]] = None,
124
124
  py_executable_override: Optional[str] = None,
125
- has_multiple_cloud_deployments: bool = False,
125
+ cloud_deployment: Optional[str] = None,
126
126
  ) -> List[Dict[str, Any]]:
127
127
  """Returns modified runtime_envs with all local dirs converted to remote URIs.
128
128
 
@@ -142,15 +142,13 @@ class WorkloadSDK(BaseSDK):
142
142
  if target in local_path_to_uri:
143
143
  return local_path_to_uri[target]
144
144
 
145
- if has_multiple_cloud_deployments:
146
- self.logger.warning(
147
- "For compute configurations with multiple cloud deployments, local directories will only be uploaded to the object storage of the primary cloud deployment."
148
- )
149
-
150
145
  self.logger.info(f"Uploading local dir '{target}' to cloud storage.")
151
146
  assert cloud_id is not None
152
147
  uri = self._client.upload_local_dir_to_cloud_storage(
153
- target, cloud_id=cloud_id, excludes=excludes,
148
+ target,
149
+ cloud_id=cloud_id,
150
+ excludes=excludes,
151
+ cloud_deployment=cloud_deployment,
154
152
  )
155
153
  local_path_to_uri[target] = uri
156
154
  return uri
@@ -192,6 +190,103 @@ class WorkloadSDK(BaseSDK):
192
190
 
193
191
  return new_runtime_envs
194
192
 
193
+ def override_and_upload_local_dirs_multi_deployment( # noqa: PLR0912
194
+ self,
195
+ runtime_envs: List[Dict[str, Any]],
196
+ *,
197
+ working_dir_override: Optional[str],
198
+ excludes_override: Optional[List[str]],
199
+ cloud_deployments: List[Optional[str]],
200
+ cloud_id: Optional[str] = None,
201
+ autopopulate_in_workspace: bool = True,
202
+ additional_py_modules: Optional[List[str]] = None,
203
+ py_executable_override: Optional[str] = None,
204
+ ) -> List[Dict[str, Any]]:
205
+ """Returns modified runtime_envs with all local dirs converted to remote bucket paths,
206
+ stored in the "relative_working_dir" and "relative_py_modules" fields.
207
+
208
+ The precedence for overrides is: explicit overrides passed in > fields in the existing
209
+ runtime_envs > workspace defaults (if `autopopulate_in_workspace == True`).
210
+
211
+ Each unique local directory across these fields will be uploaded once to cloud storage,
212
+ then all occurrences of it in the config will be replaced with the corresponding remote URI.
213
+ """
214
+ new_runtime_envs = copy.deepcopy(runtime_envs)
215
+
216
+ local_path_to_bucket_path: Dict[str, str] = {}
217
+
218
+ def _upload_dir_memoized(target: str, *, excludes: Optional[List[str]]) -> str:
219
+ if target in local_path_to_bucket_path:
220
+ return local_path_to_bucket_path[target]
221
+
222
+ self.logger.info(
223
+ f"Uploading local dir '{target}' to object storage for all {len(cloud_deployments)} cloud deployments in the compute config."
224
+ )
225
+ assert cloud_id is not None
226
+ bucket_path = self._client.upload_local_dir_to_cloud_storage_multi_deployment(
227
+ target,
228
+ cloud_id=cloud_id,
229
+ excludes=excludes,
230
+ cloud_deployments=cloud_deployments,
231
+ )
232
+ local_path_to_bucket_path[target] = bucket_path
233
+ return bucket_path
234
+
235
+ for runtime_env in new_runtime_envs:
236
+ # Extend, don't overwrite, excludes if it's provided.
237
+ if excludes_override is not None:
238
+ existing_excludes = runtime_env.get("excludes", None) or []
239
+ runtime_env["excludes"] = existing_excludes + excludes_override
240
+
241
+ final_excludes = runtime_env.get("excludes", [])
242
+
243
+ new_working_dir = None
244
+ if working_dir_override is not None:
245
+ new_working_dir = working_dir_override
246
+ elif "working_dir" in runtime_env:
247
+ new_working_dir = runtime_env["working_dir"]
248
+ elif autopopulate_in_workspace and self._client.inside_workspace():
249
+ new_working_dir = "."
250
+
251
+ if new_working_dir is not None:
252
+ if is_dir_remote_uri(new_working_dir):
253
+ runtime_env["working_dir"] = new_working_dir
254
+ else:
255
+ runtime_env["relative_working_dir"] = _upload_dir_memoized(
256
+ new_working_dir, excludes=final_excludes
257
+ )
258
+ runtime_env.pop("working_dir", None)
259
+
260
+ if additional_py_modules:
261
+ existing_py_modules = runtime_env.get("py_modules", [])
262
+ runtime_env["py_modules"] = existing_py_modules + additional_py_modules
263
+
264
+ final_py_modules = runtime_env.get("py_modules", None)
265
+ if final_py_modules is not None:
266
+ py_modules = [
267
+ py_module
268
+ for py_module in final_py_modules
269
+ if is_dir_remote_uri(py_module)
270
+ ]
271
+ if len(py_modules) > 0:
272
+ runtime_env["py_modules"] = py_modules
273
+ else:
274
+ # If there are no py_modules, remove the field.
275
+ runtime_env.pop("py_modules", None)
276
+
277
+ relative_py_modules = [
278
+ _upload_dir_memoized(py_module, excludes=final_excludes)
279
+ for py_module in final_py_modules
280
+ if not is_dir_remote_uri(py_module)
281
+ ]
282
+ if len(relative_py_modules) > 0:
283
+ runtime_env["relative_py_modules"] = relative_py_modules
284
+
285
+ if py_executable_override:
286
+ runtime_env["py_executable"] = py_executable_override
287
+
288
+ return new_runtime_envs
289
+
195
290
  def _resolve_compute_config_id(
196
291
  self,
197
292
  compute_config: Union[str, ComputeConfigType, None],
anyscale/client/README.md CHANGED
@@ -209,9 +209,12 @@ Class | Method | HTTP request | Description
209
209
  *DefaultApi* | [**get_job_logs_download_v2_api_v2_logs_job_logs_download_v2_job_id_get**](docs/DefaultApi.md#get_job_logs_download_v2_api_v2_logs_job_logs_download_v2_job_id_get) | **GET** /api/v2/logs/job_logs_download_v2/{job_id} | Get Job Logs Download V2
210
210
  *DefaultApi* | [**get_job_queue_api_v2_job_queues_job_queue_id_get**](docs/DefaultApi.md#get_job_queue_api_v2_job_queues_job_queue_id_get) | **GET** /api/v2/job_queues/{job_queue_id} | Get Job Queue
211
211
  *DefaultApi* | [**get_jobs_api_v2_dataset_runs_jobs_get**](docs/DefaultApi.md#get_jobs_api_v2_dataset_runs_jobs_get) | **GET** /api/v2/dataset_runs/jobs | Get Jobs
212
+ *DefaultApi* | [**get_latest_cloud_deployment_api_v2_sessions_cluster_id_latest_cloud_deployment_get**](docs/DefaultApi.md#get_latest_cloud_deployment_api_v2_sessions_cluster_id_latest_cloud_deployment_get) | **GET** /api/v2/sessions/{cluster_id}/latest_cloud_deployment | Get Latest Cloud Deployment
212
213
  *DefaultApi* | [**get_lb_resource_api_v2_clouds_with_cloud_resource_gcp_router_cloud_id_get_lb_resource_post**](docs/DefaultApi.md#get_lb_resource_api_v2_clouds_with_cloud_resource_gcp_router_cloud_id_get_lb_resource_post) | **POST** /api/v2/clouds_with_cloud_resource_gcp_router/{cloud_id}/get_lb_resource | Get Lb Resource
214
+ *DefaultApi* | [**get_lb_resource_api_v2_clouds_with_cloud_resource_router_cloud_id_get_lb_resource_post**](docs/DefaultApi.md#get_lb_resource_api_v2_clouds_with_cloud_resource_router_cloud_id_get_lb_resource_post) | **POST** /api/v2/clouds_with_cloud_resource_router/{cloud_id}/get_lb_resource | Get Lb Resource
213
215
  *DefaultApi* | [**get_log_files_api_v2_logs_get_log_files_post**](docs/DefaultApi.md#get_log_files_api_v2_logs_get_log_files_post) | **POST** /api/v2/logs/get_log_files | Get Log Files
214
216
  *DefaultApi* | [**get_manage_billing_url_api_v2_organization_billing_manage_billing_url_get**](docs/DefaultApi.md#get_manage_billing_url_api_v2_organization_billing_manage_billing_url_get) | **GET** /api/v2/organization_billing/manage_billing_url | Get Manage Billing Url
217
+ *DefaultApi* | [**get_metric_names_api_v2_metrics_names_get**](docs/DefaultApi.md#get_metric_names_api_v2_metrics_names_get) | **GET** /api/v2/metrics/names | Get Metric Names
215
218
  *DefaultApi* | [**get_metronome_customer_info_api_v2_metronome_customer_info_organization_id_get**](docs/DefaultApi.md#get_metronome_customer_info_api_v2_metronome_customer_info_organization_id_get) | **GET** /api/v2/metronome_customer_info/{organization_id} | Get Metronome Customer Info
216
219
  *DefaultApi* | [**get_metronome_embedded_usage_dashboard_api_v2_organization_billing_metronome_embedded_dashboard_url_dashboard_type_get**](docs/DefaultApi.md#get_metronome_embedded_usage_dashboard_api_v2_organization_billing_metronome_embedded_dashboard_url_dashboard_type_get) | **GET** /api/v2/organization_billing/metronome_embedded_dashboard_url/{dashboard_type} | Get Metronome Embedded Usage Dashboard
217
220
  *DefaultApi* | [**get_metronome_embedded_usage_dashboard_by_organization_api_v2_organization_billing_organization_id_metronome_embedded_dashboard_url_dashboard_type_get**](docs/DefaultApi.md#get_metronome_embedded_usage_dashboard_by_organization_api_v2_organization_billing_organization_id_metronome_embedded_dashboard_url_dashboard_type_get) | **GET** /api/v2/organization_billing/{organization_id}/metronome_embedded_dashboard_url/{dashboard_type} | Get Metronome Embedded Usage Dashboard By Organization
@@ -308,6 +311,7 @@ Class | Method | HTTP request | Description
308
311
  *DefaultApi* | [**put_workspace_proxied_dataplane_artifacts_api_v2_experimental_workspaces_workspace_id_proxied_dataplane_artifacts_put**](docs/DefaultApi.md#put_workspace_proxied_dataplane_artifacts_api_v2_experimental_workspaces_workspace_id_proxied_dataplane_artifacts_put) | **PUT** /api/v2/experimental_workspaces/{workspace_id}/proxied_dataplane_artifacts | Put Workspace Proxied Dataplane Artifacts
309
312
  *DefaultApi* | [**put_workspace_wandb_run_details_api_v2_integrations_workspace_wandb_run_details_workspace_id_put**](docs/DefaultApi.md#put_workspace_wandb_run_details_api_v2_integrations_workspace_wandb_run_details_workspace_id_put) | **PUT** /api/v2/integrations/workspace_wandb_run_details/{workspace_id} | Put Workspace Wandb Run Details
310
313
  *DefaultApi* | [**query_aggregated_logs_api_v2_logs_query_aggregated_logs_get**](docs/DefaultApi.md#query_aggregated_logs_api_v2_logs_query_aggregated_logs_get) | **GET** /api/v2/logs/query_aggregated_logs | Query Aggregated Logs
314
+ *DefaultApi* | [**query_api_v2_logs_query_get**](docs/DefaultApi.md#query_api_v2_logs_query_get) | **GET** /api/v2/logs/query | Query
311
315
  *DefaultApi* | [**query_api_v2_metrics_query_get**](docs/DefaultApi.md#query_api_v2_metrics_query_get) | **GET** /api/v2/metrics/query | Query
312
316
  *DefaultApi* | [**query_range_api_v2_metrics_query_range_get**](docs/DefaultApi.md#query_range_api_v2_metrics_query_range_get) | **GET** /api/v2/metrics/query_range | Query Range
313
317
  *DefaultApi* | [**receive_cli_usage_api_v2_cli_usage_post**](docs/DefaultApi.md#receive_cli_usage_api_v2_cli_usage_post) | **POST** /api/v2/cli_usage/ | Receive Cli Usage
@@ -486,6 +490,7 @@ Class | Method | HTTP request | Description
486
490
  - [ClouddatabucketpresigneduploadinfoResponse](docs/ClouddatabucketpresigneduploadinfoResponse.md)
487
491
  - [ClouddatabucketpresignedurlresponseResponse](docs/ClouddatabucketpresignedurlresponseResponse.md)
488
492
  - [ClouddeploymentListResponse](docs/ClouddeploymentListResponse.md)
493
+ - [ClouddeploymentResponse](docs/ClouddeploymentResponse.md)
489
494
  - [ClouddeploymentconfigResponse](docs/ClouddeploymentconfigResponse.md)
490
495
  - [CloudoverviewdashboardResponse](docs/CloudoverviewdashboardResponse.md)
491
496
  - [CloudregionandzonesResponse](docs/CloudregionandzonesResponse.md)
@@ -130,6 +130,7 @@ from openapi_client.models.cloudcollaborator_list_response import Cloudcollabora
130
130
  from openapi_client.models.clouddatabucketpresigneduploadinfo_response import ClouddatabucketpresigneduploadinfoResponse
131
131
  from openapi_client.models.clouddatabucketpresignedurlresponse_response import ClouddatabucketpresignedurlresponseResponse
132
132
  from openapi_client.models.clouddeployment_list_response import ClouddeploymentListResponse
133
+ from openapi_client.models.clouddeployment_response import ClouddeploymentResponse
133
134
  from openapi_client.models.clouddeploymentconfig_response import ClouddeploymentconfigResponse
134
135
  from openapi_client.models.cloudoverviewdashboard_response import CloudoverviewdashboardResponse
135
136
  from openapi_client.models.cloudregionandzones_response import CloudregionandzonesResponse