anyscale 0.26.31__py3-none-any.whl → 0.26.33__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 (53) hide show
  1. anyscale/_private/anyscale_client/anyscale_client.py +15 -0
  2. anyscale/_private/anyscale_client/common.py +12 -1
  3. anyscale/_private/anyscale_client/fake_anyscale_client.py +24 -0
  4. anyscale/_private/docgen/__main__.py +2 -0
  5. anyscale/_private/docgen/models.md +2 -2
  6. anyscale/api.py +22 -0
  7. anyscale/aws_iam_policies.py +0 -3
  8. anyscale/client/README.md +22 -1
  9. anyscale/client/openapi_client/__init__.py +17 -0
  10. anyscale/client/openapi_client/api/default_api.py +611 -157
  11. anyscale/client/openapi_client/models/__init__.py +17 -0
  12. anyscale/client/openapi_client/models/baseimagesenum.py +68 -1
  13. anyscale/client/openapi_client/models/cli_usage_payload.py +440 -0
  14. anyscale/client/openapi_client/models/cluster_operation.py +266 -0
  15. anyscale/client/openapi_client/models/cluster_operation_type.py +101 -0
  16. anyscale/client/openapi_client/models/clusteroperation_response.py +121 -0
  17. anyscale/client/openapi_client/models/commit_ledger_item_type.py +111 -0
  18. anyscale/client/openapi_client/models/commit_ledger_record_v2.py +207 -0
  19. anyscale/client/openapi_client/models/complexity_level.py +101 -0
  20. anyscale/client/openapi_client/models/credit_grant_record_v2.py +181 -0
  21. anyscale/client/openapi_client/models/credit_ledger_item_type.py +104 -0
  22. anyscale/client/openapi_client/models/credit_ledger_record_v2.py +207 -0
  23. anyscale/client/openapi_client/models/credit_record_commit_v2.py +410 -0
  24. anyscale/client/openapi_client/models/credit_record_credit_v2.py +410 -0
  25. anyscale/client/openapi_client/models/credit_type.py +100 -0
  26. anyscale/client/openapi_client/models/credits_v2.py +355 -0
  27. anyscale/client/openapi_client/models/operation_error.py +123 -0
  28. anyscale/client/openapi_client/models/operation_progress.py +123 -0
  29. anyscale/client/openapi_client/models/operation_result.py +150 -0
  30. anyscale/client/openapi_client/models/supportedbaseimagesenum.py +68 -1
  31. anyscale/client/openapi_client/models/workspace_template.py +115 -3
  32. anyscale/client/openapi_client/models/workspace_template_readme.py +59 -3
  33. anyscale/cloud/__init__.py +16 -0
  34. anyscale/cloud/_private/cloud_sdk.py +33 -0
  35. anyscale/cloud/commands.py +35 -0
  36. anyscale/commands/cloud_commands.py +35 -0
  37. anyscale/commands/command_examples.py +6 -0
  38. anyscale/commands/list_util.py +100 -38
  39. anyscale/integrations.py +0 -20
  40. anyscale/scripts.py +1 -0
  41. anyscale/sdk/anyscale_client/models/baseimagesenum.py +68 -1
  42. anyscale/sdk/anyscale_client/models/supportedbaseimagesenum.py +68 -1
  43. anyscale/shared_anyscale_utils/headers.py +4 -0
  44. anyscale/shared_anyscale_utils/latest_ray_version.py +1 -1
  45. anyscale/telemetry.py +424 -0
  46. anyscale/version.py +1 -1
  47. {anyscale-0.26.31.dist-info → anyscale-0.26.33.dist-info}/METADATA +1 -1
  48. {anyscale-0.26.31.dist-info → anyscale-0.26.33.dist-info}/RECORD +53 -35
  49. {anyscale-0.26.31.dist-info → anyscale-0.26.33.dist-info}/LICENSE +0 -0
  50. {anyscale-0.26.31.dist-info → anyscale-0.26.33.dist-info}/NOTICE +0 -0
  51. {anyscale-0.26.31.dist-info → anyscale-0.26.33.dist-info}/WHEEL +0 -0
  52. {anyscale-0.26.31.dist-info → anyscale-0.26.33.dist-info}/entry_points.txt +0 -0
  53. {anyscale-0.26.31.dist-info → anyscale-0.26.33.dist-info}/top_level.txt +0 -0
@@ -46,6 +46,7 @@ from anyscale.client.openapi_client.models import (
46
46
  CloudDataBucketPresignedUrlResponse,
47
47
  CloudDataBucketPresignedUrlScheme,
48
48
  CloudNameOptions,
49
+ ClusteroperationResponse,
49
50
  ComputeTemplate,
50
51
  ComputeTemplateConfig,
51
52
  ComputeTemplateQuery,
@@ -82,6 +83,7 @@ from anyscale.client.openapi_client.models import (
82
83
  SessionState,
83
84
  StartSessionOptions,
84
85
  StopSessionOptions,
86
+ SystemWorkloadName,
85
87
  WorkspaceDataplaneProxiedArtifacts,
86
88
  )
87
89
  from anyscale.client.openapi_client.models.create_schedule import CreateSchedule
@@ -596,6 +598,19 @@ class AnyscaleClient(AnyscaleClientInterface):
596
598
  cloud_id, collaborators
597
599
  )
598
600
 
601
+ @handle_api_exceptions
602
+ def terminate_system_cluster(self, cloud_id: str) -> ClusteroperationResponse:
603
+ return self._internal_api_client.terminate_system_cluster_api_v2_system_workload_cloud_id_terminate_post(
604
+ cloud_id
605
+ )
606
+
607
+ @handle_api_exceptions
608
+ def describe_system_workload_get_status(self, cloud_id: str) -> str:
609
+ res = self._internal_api_client.describe_system_workload_api_v2_system_workload_cloud_id_describe_post(
610
+ cloud_id, SystemWorkloadName.RAY_OBS_EVENTS_API_SERVICE, start_cluster=False
611
+ ).result
612
+ return res.status
613
+
599
614
  @handle_api_exceptions
600
615
  def create_compute_config(
601
616
  self, config: ComputeTemplateConfig, *, name: Optional[str] = None
@@ -8,6 +8,7 @@ from anyscale.client.openapi_client.models import (
8
8
  AdminCreateUser,
9
9
  AnyscaleServiceAccount,
10
10
  Cloud,
11
+ ClusteroperationResponse,
11
12
  ComputeTemplateConfig,
12
13
  CreateCloudCollaborator,
13
14
  CreateExperimentalWorkspace,
@@ -54,7 +55,7 @@ from anyscale.utils.workspace_notification import WorkspaceNotification
54
55
  # Maybe just make it part of the release process to update it, or fetch the
55
56
  # default builds and get the latest one. The best thing to do is probably
56
57
  # to populate this in the backend.
57
- DEFAULT_RAY_VERSION = "2.47.0" # RAY_RELEASE_UPDATE: update to latest version.
58
+ DEFAULT_RAY_VERSION = "2.47.1" # RAY_RELEASE_UPDATE: update to latest version.
58
59
  DEFAULT_PYTHON_VERSION = "py311"
59
60
  RUNTIME_ENV_PACKAGE_FORMAT = "pkg_{content_hash}.zip"
60
61
 
@@ -175,6 +176,16 @@ class AnyscaleClientInterface(ABC):
175
176
  """Batch add collaborators to a cloud."""
176
177
  raise NotImplementedError
177
178
 
179
+ @abstractmethod
180
+ def terminate_system_cluster(self, cloud_id: str) -> ClusteroperationResponse:
181
+ """Terminate the system cluster for the provided cloud ID."""
182
+ raise NotImplementedError
183
+
184
+ @abstractmethod
185
+ def describe_system_workload_get_status(self, cloud_id: str) -> str:
186
+ """Get the status of the system cluster for the provided cloud ID."""
187
+ raise NotImplementedError
188
+
178
189
  @abstractmethod
179
190
  def create_compute_config(
180
191
  self, config: ComputeTemplateConfig, *, name: Optional[str] = None
@@ -19,6 +19,9 @@ from anyscale.client.openapi_client.models import (
19
19
  AnyscaleServiceAccount,
20
20
  Cloud,
21
21
  CloudProviders,
22
+ ClusterOperation,
23
+ ClusteroperationResponse,
24
+ ClusterState,
22
25
  ComputeTemplateConfig,
23
26
  CreateCloudCollaborator,
24
27
  CreateExperimentalWorkspace,
@@ -177,6 +180,7 @@ class FakeAnyscaleClient(AnyscaleClientInterface):
177
180
  self._organization_collaborators: List[OrganizationCollaborator] = []
178
181
  self._organization_invitations: Dict[str, OrganizationInvitation] = {}
179
182
  self._resource_quotas: Dict[str, ResourceQuota] = {}
183
+ self._system_cluster_status: Dict[str, str] = {}
180
184
 
181
185
  # Cloud ID -> Cloud.
182
186
  self._clouds: Dict[str, Cloud] = {
@@ -369,6 +373,7 @@ class FakeAnyscaleClient(AnyscaleClientInterface):
369
373
 
370
374
  def add_cloud(self, cloud: Cloud):
371
375
  self._clouds[cloud.id] = cloud
376
+ self._system_cluster_status[cloud.id] = ClusterState.RUNNING
372
377
 
373
378
  def get_cloud(self, *, cloud_id: str) -> Optional[Cloud]:
374
379
  return self._clouds.get(cloud_id, None)
@@ -401,6 +406,25 @@ class FakeAnyscaleClient(AnyscaleClientInterface):
401
406
  else:
402
407
  self._cloud_collaborators[cloud_id].extend(collaborators)
403
408
 
409
+ def terminate_system_cluster(
410
+ self, cloud_id: str
411
+ ) -> Optional[ClusteroperationResponse]:
412
+ self._system_cluster_status[cloud_id] = ClusterState.TERMINATING
413
+ return ClusteroperationResponse(
414
+ result=ClusterOperation(
415
+ id="sop_123",
416
+ completed=False,
417
+ progress=None,
418
+ result=None,
419
+ cluster_id="fake-system-cluster-id",
420
+ cluster_operation_type="terminate",
421
+ )
422
+ )
423
+
424
+ def describe_system_workload_get_status(self, cloud_id: str) -> str:
425
+ self._system_cluster_status[cloud_id] = ClusterState.TERMINATED
426
+ return self._system_cluster_status[cloud_id]
427
+
404
428
  def add_compute_config(self, compute_config: DecoratedComputeTemplate) -> int:
405
429
  compute_config.version = (
406
430
  len(self._compute_config_name_to_ids[compute_config.name]) + 1
@@ -436,12 +436,14 @@ ALL_MODULES = [
436
436
  cloud_commands.add_collaborators,
437
437
  cloud_commands.get_cloud,
438
438
  cloud_commands.get_default_cloud,
439
+ cloud_commands.terminate_system_cluster,
439
440
  ],
440
441
  sdk_prefix="anyscale.cloud",
441
442
  sdk_commands=[
442
443
  anyscale.cloud.add_collaborators,
443
444
  anyscale.cloud.get,
444
445
  anyscale.cloud.get_default,
446
+ anyscale.cloud.terminate_system_cluster,
445
447
  ],
446
448
  models=[
447
449
  CloudPermissionLevel,