anyscale 0.26.7__py3-none-any.whl → 0.26.9__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 (50) hide show
  1. anyscale/_private/anyscale_client/anyscale_client.py +17 -1
  2. anyscale/_private/anyscale_client/common.py +12 -2
  3. anyscale/_private/anyscale_client/fake_anyscale_client.py +20 -3
  4. anyscale/_private/docgen/__main__.py +4 -0
  5. anyscale/_private/docgen/models.md +11 -2
  6. anyscale/client/README.md +7 -23
  7. anyscale/client/openapi_client/__init__.py +5 -15
  8. anyscale/client/openapi_client/api/default_api.py +410 -1091
  9. anyscale/client/openapi_client/models/__init__.py +5 -15
  10. anyscale/client/openapi_client/models/baseimagesenum.py +135 -1
  11. anyscale/client/openapi_client/models/{jobslogs_response.py → cluster_state.py} +21 -34
  12. anyscale/client/openapi_client/models/describe_system_workload_response.py +226 -0
  13. anyscale/client/openapi_client/models/{interactivesessionlogs_response.py → describesystemworkloadresponse_response.py} +11 -11
  14. anyscale/client/openapi_client/models/job_details.py +27 -1
  15. anyscale/client/openapi_client/models/metric.py +29 -3
  16. anyscale/client/openapi_client/models/{timestampedlogsoutput_response.py → operator_metric_id.py} +49 -22
  17. anyscale/client/openapi_client/models/operator_metrics.py +83 -3
  18. anyscale/client/openapi_client/models/supportedbaseimagesenum.py +135 -1
  19. anyscale/client/openapi_client/models/{job_submissions_sort_field.py → system_workload_name.py} +6 -8
  20. anyscale/commands/command_examples.py +4 -0
  21. anyscale/commands/service_commands.py +62 -27
  22. anyscale/job/_private/job_sdk.py +1 -3
  23. anyscale/sdk/anyscale_client/__init__.py +1 -0
  24. anyscale/sdk/anyscale_client/models/__init__.py +1 -0
  25. anyscale/sdk/anyscale_client/models/baseimagesenum.py +135 -1
  26. anyscale/sdk/anyscale_client/models/cluster.py +60 -3
  27. anyscale/sdk/anyscale_client/models/supportedbaseimagesenum.py +135 -1
  28. anyscale/{client/openapi_client/models/job_status.py → sdk/anyscale_client/models/system_workload_name.py} +8 -14
  29. anyscale/service/__init__.py +19 -0
  30. anyscale/service/_private/service_sdk.py +26 -2
  31. anyscale/service/commands.py +48 -9
  32. anyscale/shared_anyscale_utils/latest_ray_version.py +1 -1
  33. anyscale/version.py +1 -1
  34. {anyscale-0.26.7.dist-info → anyscale-0.26.9.dist-info}/METADATA +1 -1
  35. {anyscale-0.26.7.dist-info → anyscale-0.26.9.dist-info}/RECORD +40 -49
  36. anyscale/client/openapi_client/models/decorated_job_submission.py +0 -547
  37. anyscale/client/openapi_client/models/decoratedjobsubmission_list_response.py +0 -147
  38. anyscale/client/openapi_client/models/decoratedjobsubmission_response.py +0 -121
  39. anyscale/client/openapi_client/models/interactive_session_logs.py +0 -152
  40. anyscale/client/openapi_client/models/jobs_logs.py +0 -152
  41. anyscale/client/openapi_client/models/jobs_logs_query_info.py +0 -181
  42. anyscale/client/openapi_client/models/jobslogsqueryinfo_response.py +0 -121
  43. anyscale/client/openapi_client/models/serve_deployment_logs.py +0 -152
  44. anyscale/client/openapi_client/models/servedeploymentlogs_response.py +0 -121
  45. anyscale/client/openapi_client/models/timestamped_logs_output.py +0 -148
  46. {anyscale-0.26.7.dist-info → anyscale-0.26.9.dist-info}/LICENSE +0 -0
  47. {anyscale-0.26.7.dist-info → anyscale-0.26.9.dist-info}/NOTICE +0 -0
  48. {anyscale-0.26.7.dist-info → anyscale-0.26.9.dist-info}/WHEEL +0 -0
  49. {anyscale-0.26.7.dist-info → anyscale-0.26.9.dist-info}/entry_points.txt +0 -0
  50. {anyscale-0.26.7.dist-info → anyscale-0.26.9.dist-info}/top_level.txt +0 -0
@@ -995,13 +995,22 @@ class AnyscaleClient(AnyscaleClientInterface):
995
995
 
996
996
  @handle_api_exceptions
997
997
  def get_service(
998
- self, name: str, *, cloud: Optional[str], project: Optional[str]
998
+ self,
999
+ name: str,
1000
+ *,
1001
+ cloud: Optional[str],
1002
+ project: Optional[str],
1003
+ include_archived: bool = False,
999
1004
  ) -> Optional[ServiceModel]:
1000
1005
  # TODO(edoakes): this endpoint is very slow and there's no reason we should need
1001
1006
  # to use this complex list endpoint just to fetch a service by name.
1002
1007
  paging_token = None
1003
1008
  cloud_id = self.get_cloud_id(cloud_name=cloud)
1004
1009
  project_id = self.get_project_id(parent_cloud_id=cloud_id, name=project)
1010
+ archive_status = (
1011
+ ArchiveStatus.ALL if include_archived else ArchiveStatus.NOT_ARCHIVED
1012
+ )
1013
+
1005
1014
  service: Optional[ServiceModel] = None
1006
1015
  while True:
1007
1016
  resp = self._external_api_client.list_services(
@@ -1009,6 +1018,7 @@ class AnyscaleClient(AnyscaleClientInterface):
1009
1018
  name=name,
1010
1019
  count=self.LIST_ENDPOINT_COUNT,
1011
1020
  paging_token=paging_token,
1021
+ archive_status=archive_status,
1012
1022
  )
1013
1023
  for result in resp.results:
1014
1024
  if result.name == name:
@@ -1121,6 +1131,12 @@ class AnyscaleClient(AnyscaleClientInterface):
1121
1131
  result: ServiceModel = self._external_api_client.archive_service(service_id)
1122
1132
  return result
1123
1133
 
1134
+ @handle_api_exceptions
1135
+ def delete_service(self, service_id: str):
1136
+ self._internal_api_client.delete_service_api_v2_services_v2_service_id_delete(
1137
+ service_id
1138
+ )
1139
+
1124
1140
  @handle_api_exceptions
1125
1141
  def submit_job(self, model: CreateInternalProductionJob) -> InternalProductionJob:
1126
1142
  job: InternalProductionJob = self._internal_api_client.create_job_api_v2_decorated_ha_jobs_create_post(
@@ -49,7 +49,7 @@ from anyscale.utils.workspace_notification import WorkspaceNotification
49
49
  # Maybe just make it part of the release process to update it, or fetch the
50
50
  # default builds and get the latest one. The best thing to do is probably
51
51
  # to populate this in the backend.
52
- DEFAULT_RAY_VERSION = "2.43.0" # RAY_RELEASE_UPDATE: update to latest version.
52
+ DEFAULT_RAY_VERSION = "2.44.1" # RAY_RELEASE_UPDATE: update to latest version.
53
53
  DEFAULT_PYTHON_VERSION = "py311"
54
54
  RUNTIME_ENV_PACKAGE_FORMAT = "pkg_{content_hash}.zip"
55
55
 
@@ -297,7 +297,12 @@ class AnyscaleClientInterface(ABC):
297
297
 
298
298
  @abstractmethod
299
299
  def get_service(
300
- self, name: str, *, cloud: Optional[str], project: Optional[str]
300
+ self,
301
+ name: str,
302
+ *,
303
+ cloud: Optional[str],
304
+ project: Optional[str],
305
+ include_archived=False,
301
306
  ) -> Optional[ServiceModel]:
302
307
  """Get a service by name. Filter by cloud and project.
303
308
 
@@ -371,6 +376,11 @@ class AnyscaleClientInterface(ABC):
371
376
  """Mark the service to be archived asynchronously."""
372
377
  raise NotImplementedError
373
378
 
379
+ @abstractmethod
380
+ def delete_service(self, service_id: str):
381
+ """Mark the service to be deleted asynchronously."""
382
+ raise NotImplementedError
383
+
374
384
  @abstractmethod
375
385
  def submit_job(self, model: CreateInternalProductionJob) -> InternalProductionJob:
376
386
  """Submit the job to run."""
@@ -145,6 +145,7 @@ class FakeAnyscaleClient(AnyscaleClientInterface):
145
145
  self._workspace_dependency_tracking_enabled: bool = False
146
146
  self._services: Dict[str, ServiceModel] = {}
147
147
  self._archived_services: Dict[str, ServiceModel] = {}
148
+ self._deleted_services: Dict[str, ServiceModel] = {}
148
149
  self._jobs: Dict[str, ProductionJob] = {}
149
150
  self._job_runs: Dict[str, List[APIJobRun]] = defaultdict(list)
150
151
  self._project_to_id: Dict[Optional[str] : Dict[Optional[str], str]] = {}
@@ -601,7 +602,12 @@ class FakeAnyscaleClient(AnyscaleClientInterface):
601
602
  self._services[model.id] = model
602
603
 
603
604
  def get_service(
604
- self, name: str, *, cloud: Optional[str], project: Optional[str]
605
+ self,
606
+ name: str,
607
+ *,
608
+ cloud: Optional[str],
609
+ project: Optional[str],
610
+ include_archived=False,
605
611
  ) -> Optional[ServiceModel]:
606
612
  cloud_id = self.get_cloud_id(cloud_name=cloud)
607
613
  cloud_project_dict = self._project_to_id.get(cloud_id, None)
@@ -614,6 +620,13 @@ class FakeAnyscaleClient(AnyscaleClientInterface):
614
620
  ):
615
621
  return service
616
622
 
623
+ if include_archived:
624
+ for service in self._archived_services.values():
625
+ if service.name == name and (
626
+ project_id is None or service.project_id == project_id
627
+ ):
628
+ return service
629
+
617
630
  return None
618
631
 
619
632
  def get_project(self, project_id: str) -> Optional[Project]:
@@ -780,8 +793,12 @@ class FakeAnyscaleClient(AnyscaleClientInterface):
780
793
  def archive_service(self, service_id: str):
781
794
  self._archived_services[service_id] = self._services.pop(service_id)
782
795
 
783
- def is_archived_service(self, service_id: str) -> bool:
784
- return service_id in self._archived_services
796
+ @property
797
+ def deleted_services(self) -> Dict[str, ServiceModel]:
798
+ return self._deleted_services
799
+
800
+ def delete_service(self, service_id: str):
801
+ self._deleted_services[service_id] = self._services.pop(service_id)
785
802
 
786
803
  @property
787
804
  def submitted_job(self) -> Optional[CreateInternalProductionJob]:
@@ -245,6 +245,8 @@ ALL_MODULES = [
245
245
  service_commands.wait,
246
246
  service_commands.rollback,
247
247
  service_commands.terminate,
248
+ service_commands.archive,
249
+ service_commands.delete,
248
250
  ],
249
251
  sdk_prefix="anyscale.service",
250
252
  sdk_commands=[
@@ -253,6 +255,8 @@ ALL_MODULES = [
253
255
  anyscale.service.wait,
254
256
  anyscale.service.rollback,
255
257
  anyscale.service.terminate,
258
+ anyscale.service.archive,
259
+ anyscale.service.delete,
256
260
  ],
257
261
  models=[
258
262
  ServiceConfig,