anyscale 0.24.87__py3-none-any.whl → 0.24.91__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 (120) hide show
  1. anyscale/__init__.py +56 -0
  2. anyscale/_private/anyscale_client/anyscale_client.py +158 -28
  3. anyscale/_private/anyscale_client/common.py +82 -0
  4. anyscale/_private/anyscale_client/fake_anyscale_client.py +193 -1
  5. anyscale/_private/docgen/README.md +1 -1
  6. anyscale/_private/docgen/__main__.py +74 -19
  7. anyscale/_private/docgen/api.md +0 -20
  8. anyscale/_private/docgen/generator.py +4 -2
  9. anyscale/_private/docgen/models.md +1 -46
  10. anyscale/_private/workload/workload_config.py +1 -1
  11. anyscale/aggregated_instance_usage/__init__.py +1 -1
  12. anyscale/aggregated_instance_usage/commands.py +2 -4
  13. anyscale/aggregated_instance_usage/models.py +8 -8
  14. anyscale/client/README.md +19 -23
  15. anyscale/client/openapi_client/__init__.py +13 -15
  16. anyscale/client/openapi_client/api/default_api.py +825 -962
  17. anyscale/client/openapi_client/models/__init__.py +13 -15
  18. anyscale/client/openapi_client/models/admin_create_user.py +255 -0
  19. anyscale/client/openapi_client/models/admin_created_user.py +281 -0
  20. anyscale/client/openapi_client/models/{sessionevent_list_response.py → admincreateduser_list_response.py} +15 -15
  21. anyscale/client/openapi_client/models/aggregated_usage_query.py +1 -29
  22. anyscale/client/openapi_client/models/{session_event_types.py → cloud_deployment_config.py} +35 -24
  23. anyscale/client/openapi_client/models/{platformfinetuningjob_response.py → clouddeploymentconfig_response.py} +11 -11
  24. anyscale/client/openapi_client/models/{company_size.py → cluster_size.py} +10 -10
  25. anyscale/client/openapi_client/models/cluster_status_details.py +2 -1
  26. anyscale/client/openapi_client/models/create_experimental_workspace.py +29 -1
  27. anyscale/client/openapi_client/models/{resubmit_ft_job_request.py → describe_machine_pool_request.py} +21 -20
  28. anyscale/client/openapi_client/models/describe_machine_pool_response.py +123 -0
  29. anyscale/client/openapi_client/models/{fine_tuning_job_status.py → describemachinepoolresponse_response.py} +34 -16
  30. anyscale/client/openapi_client/models/machine_allocation_state.py +3 -1
  31. anyscale/client/openapi_client/models/machine_state_info.py +326 -0
  32. anyscale/client/openapi_client/models/organization_marketing_questions.py +80 -54
  33. anyscale/client/openapi_client/models/request_state_info.py +210 -0
  34. anyscale/client/openapi_client/models/{platformfinetuningjob_list_response.py → scheduler_info.py} +43 -38
  35. anyscale/client/openapi_client/models/usage_by_cluster.py +28 -1
  36. anyscale/client/openapi_client/models/usage_by_user.py +30 -3
  37. anyscale/client/openapi_client/models/workload_info.py +210 -0
  38. anyscale/cloud/__init__.py +83 -0
  39. anyscale/cloud/_private/cloud_sdk.py +25 -0
  40. anyscale/cloud/commands.py +45 -0
  41. anyscale/cloud/models.py +91 -0
  42. anyscale/cluster_compute.py +1 -1
  43. anyscale/commands/aggregated_instance_usage_commands.py +4 -4
  44. anyscale/commands/cloud_commands.py +38 -2
  45. anyscale/commands/command_examples.py +67 -0
  46. anyscale/commands/job_commands.py +15 -3
  47. anyscale/commands/machine_pool_commands.py +113 -1
  48. anyscale/commands/organization_invitation_commands.py +98 -0
  49. anyscale/commands/project_commands.py +52 -2
  50. anyscale/commands/resource_quota_commands.py +98 -11
  51. anyscale/commands/service_commands.py +1 -1
  52. anyscale/commands/session_commands_hidden.py +5 -1
  53. anyscale/commands/user_commands.py +49 -0
  54. anyscale/commands/util.py +1 -1
  55. anyscale/commands/workspace_commands.py +1 -1
  56. anyscale/connect.py +1 -1
  57. anyscale/connect_utils/project.py +7 -4
  58. anyscale/controllers/cloud_controller.py +6 -6
  59. anyscale/controllers/cloud_functional_verification_controller.py +1 -1
  60. anyscale/controllers/cluster_controller.py +2 -2
  61. anyscale/controllers/compute_config_controller.py +1 -1
  62. anyscale/controllers/experimental_integrations_controller.py +1 -1
  63. anyscale/controllers/job_controller.py +8 -3
  64. anyscale/controllers/list_controller.py +2 -2
  65. anyscale/controllers/machine_pool_controller.py +12 -1
  66. anyscale/controllers/project_controller.py +4 -3
  67. anyscale/controllers/schedule_controller.py +1 -1
  68. anyscale/controllers/service_controller.py +1 -1
  69. anyscale/controllers/workspace_controller.py +1 -1
  70. anyscale/models/job_model.py +1 -1
  71. anyscale/organization_invitation/__init__.py +61 -0
  72. anyscale/organization_invitation/_private/organization_invitation_sdk.py +24 -0
  73. anyscale/organization_invitation/commands.py +84 -0
  74. anyscale/organization_invitation/models.py +45 -0
  75. anyscale/project/__init__.py +35 -0
  76. anyscale/project/_private/project_sdk.py +27 -0
  77. anyscale/project/commands.py +56 -0
  78. anyscale/project/models.py +91 -0
  79. anyscale/{project.py → project_utils.py} +3 -4
  80. anyscale/resource_quota/__init__.py +99 -0
  81. anyscale/resource_quota/_private/resource_quota_sdk.py +111 -0
  82. anyscale/resource_quota/commands.py +150 -0
  83. anyscale/resource_quota/models.py +303 -0
  84. anyscale/scripts.py +6 -0
  85. anyscale/sdk/anyscale_client/__init__.py +0 -5
  86. anyscale/sdk/anyscale_client/api/default_api.py +0 -150
  87. anyscale/sdk/anyscale_client/models/__init__.py +0 -5
  88. anyscale/sdk/anyscale_client/models/cluster_status_details.py +2 -1
  89. anyscale/sdk/anyscale_client/sdk.py +1 -1
  90. anyscale/user/__init__.py +35 -0
  91. anyscale/user/_private/user_sdk.py +32 -0
  92. anyscale/user/commands.py +42 -0
  93. anyscale/user/models.py +201 -0
  94. anyscale/util.py +15 -0
  95. anyscale/utils/cloud_utils.py +1 -1
  96. anyscale/version.py +1 -1
  97. anyscale/workspace_utils.py +1 -1
  98. {anyscale-0.24.87.dist-info → anyscale-0.24.91.dist-info}/METADATA +1 -5
  99. {anyscale-0.24.87.dist-info → anyscale-0.24.91.dist-info}/RECORD +105 -92
  100. anyscale/client/openapi_client/models/create_fine_tuning_hyperparameters.py +0 -156
  101. anyscale/client/openapi_client/models/create_fine_tuning_job_product_request.py +0 -353
  102. anyscale/client/openapi_client/models/finish_ft_job_request.py +0 -204
  103. anyscale/client/openapi_client/models/log_level_types.py +0 -100
  104. anyscale/client/openapi_client/models/paging_context.py +0 -172
  105. anyscale/client/openapi_client/models/platform_fine_tuning_job.py +0 -577
  106. anyscale/client/openapi_client/models/session_event.py +0 -267
  107. anyscale/client/openapi_client/models/session_event_cause.py +0 -150
  108. anyscale/controllers/resource_quota_controller.py +0 -183
  109. anyscale/sdk/anyscale_client/models/log_level_types.py +0 -100
  110. anyscale/sdk/anyscale_client/models/session_event.py +0 -267
  111. anyscale/sdk/anyscale_client/models/session_event_cause.py +0 -150
  112. anyscale/sdk/anyscale_client/models/session_event_types.py +0 -111
  113. anyscale/sdk/anyscale_client/models/sessionevent_list_response.py +0 -147
  114. anyscale/utils/imports/azure.py +0 -14
  115. /anyscale/{cloud.py → cloud_utils.py} +0 -0
  116. {anyscale-0.24.87.dist-info → anyscale-0.24.91.dist-info}/LICENSE +0 -0
  117. {anyscale-0.24.87.dist-info → anyscale-0.24.91.dist-info}/NOTICE +0 -0
  118. {anyscale-0.24.87.dist-info → anyscale-0.24.91.dist-info}/WHEEL +0 -0
  119. {anyscale-0.24.87.dist-info → anyscale-0.24.91.dist-info}/entry_points.txt +0 -0
  120. {anyscale-0.24.87.dist-info → anyscale-0.24.91.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,201 @@
1
+ from dataclasses import dataclass, field
2
+ from datetime import datetime
3
+ from typing import Any, Dict, List, Optional
4
+
5
+ from anyscale._private.models import ModelBase
6
+
7
+
8
+ @dataclass(frozen=True)
9
+ class AdminCreateUser(ModelBase):
10
+ """User to be created by an admin.
11
+ """
12
+
13
+ __doc_py_example__ = """\
14
+ import anyscale
15
+ from anyscale.user.models import AdminCreateUser
16
+
17
+ admin_create_user = AdminCreateUser(
18
+ # First name of the user to be created.
19
+ name="name",
20
+ # Email of the user to be created.
21
+ email="test@anyscale.com",
22
+ # Password for the user account being created.
23
+ password="",
24
+ # Whether the user is an SSO user. SSO users can log in using SSO.
25
+ is_sso_user=False,
26
+ # Optional last name of the user to be created.
27
+ lastname="lastname",
28
+ # Optional title of the user to be created.
29
+ title="title",
30
+ )
31
+ """
32
+ name: str = field(metadata={"docstring": "First name of the user to be created."})
33
+
34
+ def _validate_name(self, name: str):
35
+ if not isinstance(name, str):
36
+ raise TypeError("name must be a string.")
37
+
38
+ email: str = field(metadata={"docstring": "Email of the user to be created."})
39
+
40
+ def _validate_email(self, email: str):
41
+ if not isinstance(email, str):
42
+ raise TypeError("email must be a string.")
43
+
44
+ password: Optional[str] = field(
45
+ metadata={"docstring": "Password for the user account being created."}
46
+ )
47
+
48
+ def _validate_password(self, password: Optional[str]):
49
+ if password is not None and not isinstance(password, str):
50
+ raise TypeError("password must be a string.")
51
+
52
+ is_sso_user: bool = field(
53
+ metadata={
54
+ "docstring": "Whether the user is an SSO user. SSO users can log in using SSO."
55
+ },
56
+ )
57
+
58
+ def _validate_is_sso_user(self, is_sso_user: bool):
59
+ if not isinstance(is_sso_user, bool):
60
+ raise TypeError("is_sso_user must be a boolean.")
61
+
62
+ lastname: Optional[str] = field(
63
+ default=None,
64
+ metadata={"docstring": "Optional last name of the user to be created."},
65
+ )
66
+
67
+ def _validate_lastname(self, lastname: Optional[str]):
68
+ if lastname is not None and not isinstance(lastname, str):
69
+ raise TypeError("lastname must be a string.")
70
+
71
+ title: Optional[str] = field(
72
+ default=None,
73
+ metadata={"docstring": "Optional title of the user to be created."},
74
+ )
75
+
76
+ def _validate_title(self, title: Optional[str]):
77
+ if title is not None and not isinstance(title, str):
78
+ raise TypeError("title must be a string.")
79
+
80
+
81
+ @dataclass(frozen=True)
82
+ class AdminCreateUsers(ModelBase):
83
+ """Users to be created by an admin.
84
+ """
85
+
86
+ __doc_py_example__ = """\
87
+ import anyscale
88
+ from anyscale.user.models import AdminCreateUser
89
+
90
+ admin_create_user = AdminCreateUser(
91
+ # First name of the user to be created.
92
+ name="name",
93
+ # Email of the user to be created.
94
+ email="test@anyscale.com",
95
+ # Password for the user account being created.
96
+ password="",
97
+ # Whether the user is an SSO user. SSO users can log in using SSO.
98
+ is_sso_user=False,
99
+ # Optional last name of the user to be created.
100
+ lastname="lastname",
101
+ # Optional title of the user to be created.
102
+ title="title",
103
+ )
104
+ admin_create_users = AdminCreateUsers(
105
+ # Users to be created by an admin.
106
+ create_users=[admin_create_user]
107
+ )
108
+ """
109
+ create_users: List[Dict[str, Any]] = field(
110
+ metadata={"docstring": "Users to be created by an admin."}
111
+ )
112
+
113
+ def _validate_create_users(self, create_users: List[Dict[str, Any]]):
114
+ if not isinstance(create_users, list):
115
+ raise TypeError("create_users must be a list.")
116
+
117
+
118
+ @dataclass(frozen=True)
119
+ class AdminCreatedUser(ModelBase):
120
+ """User account created by an admin that has organization collaborator permissions.
121
+ """
122
+
123
+ __doc_py_example__ = """\
124
+ import anyscale
125
+ from anyscale.user.models import AdminCreatedUser
126
+
127
+ admin_create_user = AdminCreateUser(
128
+ # First name of the user to be created.
129
+ name="name",
130
+ # Email of the user to be created.
131
+ email="test@anyscale.com",
132
+ # Password for the user account being created.
133
+ password="",
134
+ # Whether the user is an SSO user. SSO users can log in using SSO.
135
+ is_sso_user=False,
136
+ # Optional last name of the user to be created.
137
+ lastname="lastname",
138
+ # Optional title of the user to be created.
139
+ title="title",
140
+ )
141
+ admin_created_users: List[AdminCreatedUser] = anyscale.user.admin_batch_create([admin_create_user])
142
+ """
143
+ user_id: str = field(
144
+ metadata={"docstring": "ID of the user that has been created."}
145
+ )
146
+
147
+ def _validate_user_id(self, user_id: str):
148
+ if not isinstance(user_id, str):
149
+ raise TypeError("user_id must be a string.")
150
+
151
+ name: str = field(
152
+ metadata={"docstring": "First name of the user that has been created."}
153
+ )
154
+
155
+ def _validate_name(self, name: str):
156
+ if not isinstance(name, str):
157
+ raise TypeError("name must be a string.")
158
+
159
+ email: str = field(
160
+ metadata={"docstring": "Email of the user that has been created."}
161
+ )
162
+
163
+ def _validate_email(self, email: str):
164
+ if not isinstance(email, str):
165
+ raise TypeError("email must be a string.")
166
+
167
+ created_at: datetime = field(
168
+ metadata={"docstring": "The timestamp of when the user is created."}
169
+ )
170
+
171
+ def _validate_created_at(self, created_at: datetime):
172
+ if not isinstance(created_at, datetime):
173
+ raise TypeError("created_at must be a datetime.")
174
+
175
+ is_sso_user: bool = field(
176
+ metadata={
177
+ "docstring": "Whether the user is an SSO user. SSO users can log in using SSO."
178
+ },
179
+ )
180
+
181
+ def _validate_is_sso_user(self, is_sso_user: bool):
182
+ if not isinstance(is_sso_user, bool):
183
+ raise TypeError("is_sso_user must be a boolean.")
184
+
185
+ lastname: Optional[str] = field(
186
+ default=None,
187
+ metadata={"docstring": "Optional last name of the user that has been created."},
188
+ )
189
+
190
+ def _validate_lastname(self, lastname: Optional[str]):
191
+ if lastname is not None and not isinstance(lastname, str):
192
+ raise TypeError("lastname must be a string.")
193
+
194
+ title: Optional[str] = field(
195
+ default=None,
196
+ metadata={"docstring": "Optional title of the user that has been created."},
197
+ )
198
+
199
+ def _validate_title(self, title: Optional[str]):
200
+ if title is not None and not isinstance(title, str):
201
+ raise TypeError("title must be a string.")
anyscale/util.py CHANGED
@@ -44,6 +44,7 @@ from anyscale.client.openapi_client.models.cloud_analytics_event_cloud_resource
44
44
  from anyscale.client.openapi_client.models.decorated_compute_template import (
45
45
  DecoratedComputeTemplate,
46
46
  )
47
+ from anyscale.client.openapi_client.models.ha_job_states import HaJobStates
47
48
  from anyscale.client.openapi_client.models.user_info import UserInfo
48
49
  from anyscale.cluster_compute import get_cluster_compute_from_name
49
50
  import anyscale.conf
@@ -986,6 +987,20 @@ def validate_job_config_dict(
986
987
  )
987
988
 
988
989
 
990
+ def validate_list_jobs_state_filter(ctx, param, value) -> List[str]: # noqa: ARG001
991
+ """
992
+ Validate the job state filter for list jobs CLI method
993
+ """
994
+ if not value:
995
+ return []
996
+ for each_value in value:
997
+ if each_value.upper() not in HaJobStates.allowable_values:
998
+ raise click.ClickException(
999
+ f"{each_value} is not a valid value for {param.opts[0]}. Allowed values: {', '.join(HaJobStates.allowable_values)}"
1000
+ )
1001
+ return [each_value.upper() for each_value in value]
1002
+
1003
+
989
1004
  def get_cluster_model_for_current_workspace(
990
1005
  anyscale_api_client: BaseApi,
991
1006
  ) -> Optional[Cluster]:
@@ -20,7 +20,7 @@ from anyscale.client.openapi_client.models import (
20
20
  CloudProviders,
21
21
  CreateAnalyticsEvent,
22
22
  )
23
- from anyscale.cloud import get_cloud_id_and_name
23
+ from anyscale.cloud_utils import get_cloud_id_and_name
24
24
  from anyscale.shared_anyscale_utils.utils.collections import flatten
25
25
 
26
26
 
anyscale/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.24.87"
1
+ __version__ = "0.24.91"
@@ -3,7 +3,7 @@ import os
3
3
  from click import ClickException
4
4
  import yaml
5
5
 
6
- from anyscale.project import ANYSCALE_PROJECT_FILE, find_project_root
6
+ from anyscale.project_utils import ANYSCALE_PROJECT_FILE, find_project_root
7
7
 
8
8
 
9
9
  def write_workspace_id_to_disk(workspace_id: str, directory: str) -> None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: anyscale
3
- Version: 0.24.87
3
+ Version: 0.24.91
4
4
  Summary: Command Line Interface for Anyscale
5
5
  Author: Anyscale Inc.
6
6
  License: AS License
@@ -47,7 +47,6 @@ Requires-Dist: google-cloud-filestore; extra == "backend"
47
47
  Requires-Dist: google-cloud-storage; extra == "backend"
48
48
  Requires-Dist: google-cloud-redis; extra == "backend"
49
49
  Requires-Dist: google-cloud-certificate-manager; extra == "backend"
50
- Requires-Dist: azure-storage-blob; extra == "backend"
51
50
  Provides-Extra: gcp
52
51
  Requires-Dist: protobuf<4; python_version < "3.11" and extra == "gcp"
53
52
  Requires-Dist: google-api-python-client; extra == "gcp"
@@ -58,8 +57,6 @@ Requires-Dist: google-cloud-filestore; extra == "gcp"
58
57
  Requires-Dist: google-cloud-storage; extra == "gcp"
59
58
  Requires-Dist: google-cloud-redis; extra == "gcp"
60
59
  Requires-Dist: google-cloud-certificate-manager; extra == "gcp"
61
- Provides-Extra: azure
62
- Requires-Dist: azure-storage-blob; extra == "azure"
63
60
  Provides-Extra: all
64
61
  Requires-Dist: ray>=1.4.0; extra == "all"
65
62
  Requires-Dist: protobuf<4; python_version < "3.11" and extra == "all"
@@ -71,7 +68,6 @@ Requires-Dist: google-cloud-filestore; extra == "all"
71
68
  Requires-Dist: google-cloud-storage; extra == "all"
72
69
  Requires-Dist: google-cloud-redis; extra == "all"
73
70
  Requires-Dist: google-cloud-certificate-manager; extra == "all"
74
- Requires-Dist: azure-storage-blob; extra == "all"
75
71
 
76
72
  # Anyscale
77
73