anyscale 0.24.88__py3-none-any.whl → 0.25.5__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 +56 -0
- anyscale/_private/anyscale_client/anyscale_client.py +179 -28
- anyscale/_private/anyscale_client/common.py +109 -2
- anyscale/_private/anyscale_client/fake_anyscale_client.py +239 -1
- anyscale/_private/docgen/README.md +1 -1
- anyscale/_private/docgen/__main__.py +71 -21
- anyscale/_private/docgen/api.md +13 -20
- anyscale/_private/docgen/generator.py +3 -2
- anyscale/_private/docgen/models.md +4 -49
- anyscale/_private/workload/workload_config.py +21 -7
- anyscale/aggregated_instance_usage/__init__.py +1 -1
- anyscale/aggregated_instance_usage/commands.py +2 -4
- anyscale/aggregated_instance_usage/models.py +8 -8
- anyscale/client/README.md +25 -22
- anyscale/client/openapi_client/__init__.py +16 -14
- anyscale/client/openapi_client/api/default_api.py +1139 -959
- anyscale/client/openapi_client/models/__init__.py +16 -14
- anyscale/client/openapi_client/models/baseimagesenum.py +43 -1
- anyscale/client/openapi_client/models/{session_event_types.py → cloud_deployment_config.py} +35 -24
- anyscale/client/openapi_client/models/{platformfinetuningjob_response.py → clouddeploymentconfig_response.py} +11 -11
- anyscale/client/openapi_client/models/{log_level_types.py → cluster_event_source.py} +12 -7
- anyscale/client/openapi_client/models/{company_size.py → cluster_size.py} +10 -10
- anyscale/client/openapi_client/models/cluster_status_details.py +2 -1
- anyscale/client/openapi_client/models/{sessionevent_list_response.py → clusterevent_list_response.py} +15 -15
- anyscale/client/openapi_client/models/create_experimental_workspace.py +29 -1
- anyscale/client/openapi_client/models/create_notification_channel_record.py +29 -3
- anyscale/client/openapi_client/models/decorated_interactive_session.py +1 -57
- anyscale/client/openapi_client/models/decorated_job.py +1 -57
- anyscale/client/openapi_client/models/decorated_job_submission.py +1 -29
- anyscale/client/openapi_client/models/decorated_production_job.py +1 -29
- anyscale/client/openapi_client/models/decorated_session.py +1 -57
- anyscale/client/openapi_client/models/decorated_unified_job.py +1 -30
- anyscale/client/openapi_client/models/{resubmit_ft_job_request.py → describe_machine_pool_request.py} +21 -20
- anyscale/client/openapi_client/models/describe_machine_pool_response.py +123 -0
- anyscale/client/openapi_client/models/describemachinepoolresponse_response.py +121 -0
- anyscale/client/openapi_client/models/ha_jobs_sort_field.py +1 -2
- anyscale/client/openapi_client/models/internal_production_job.py +1 -29
- anyscale/client/openapi_client/models/jobs_sort_field.py +1 -2
- anyscale/client/openapi_client/models/machine_allocation_state.py +3 -1
- anyscale/client/openapi_client/models/machine_state_info.py +326 -0
- anyscale/client/openapi_client/models/{fine_tuning_job_status.py → notification_channel_slack_config.py} +34 -16
- anyscale/client/openapi_client/models/organization_marketing_questions.py +80 -54
- anyscale/client/openapi_client/models/request_state_info.py +210 -0
- anyscale/client/openapi_client/models/{platformfinetuningjob_list_response.py → scheduler_info.py} +43 -38
- anyscale/client/openapi_client/models/serve_deployment_fast_api_docs_status.py +123 -0
- anyscale/client/openapi_client/models/serve_deployment_state.py +2 -1
- anyscale/client/openapi_client/models/servedeploymentfastapidocsstatus_response.py +121 -0
- anyscale/client/openapi_client/models/sessions_sort_field.py +1 -2
- anyscale/client/openapi_client/models/supportedbaseimagesenum.py +43 -1
- anyscale/client/openapi_client/models/unified_job_sort_field.py +1 -2
- anyscale/client/openapi_client/models/update_cloud_collaborator.py +121 -0
- anyscale/client/openapi_client/models/usage_by_cluster.py +28 -1
- anyscale/client/openapi_client/models/usage_by_user.py +30 -3
- anyscale/client/openapi_client/models/workload_info.py +210 -0
- anyscale/cloud/__init__.py +83 -0
- anyscale/cloud/_private/cloud_sdk.py +25 -0
- anyscale/cloud/commands.py +45 -0
- anyscale/cloud/models.py +91 -0
- anyscale/cluster_compute.py +1 -1
- anyscale/commands/aggregated_instance_usage_commands.py +4 -4
- anyscale/commands/cloud_commands.py +87 -14
- anyscale/commands/command_examples.py +65 -0
- anyscale/commands/job_commands.py +15 -3
- anyscale/commands/machine_pool_commands.py +113 -1
- anyscale/commands/organization_invitation_commands.py +98 -0
- anyscale/commands/project_commands.py +52 -2
- anyscale/commands/resource_quota_commands.py +98 -11
- anyscale/commands/service_account_commands.py +65 -8
- anyscale/commands/service_commands.py +61 -1
- anyscale/commands/session_commands_hidden.py +5 -1
- anyscale/commands/user_commands.py +1 -1
- anyscale/commands/util.py +2 -2
- anyscale/commands/workspace_commands.py +1 -1
- anyscale/connect.py +1 -1
- anyscale/connect_utils/project.py +7 -4
- anyscale/controllers/cloud_controller.py +63 -30
- anyscale/controllers/cloud_functional_verification_controller.py +1 -1
- anyscale/controllers/cluster_controller.py +3 -11
- anyscale/controllers/compute_config_controller.py +1 -1
- anyscale/controllers/experimental_integrations_controller.py +1 -1
- anyscale/controllers/job_controller.py +8 -6
- anyscale/controllers/list_controller.py +2 -2
- anyscale/controllers/machine_pool_controller.py +12 -1
- anyscale/controllers/project_controller.py +4 -3
- anyscale/controllers/schedule_controller.py +1 -1
- anyscale/controllers/service_controller.py +1 -1
- anyscale/controllers/workspace_controller.py +1 -1
- anyscale/models/job_model.py +1 -1
- anyscale/organization_invitation/__init__.py +61 -0
- anyscale/organization_invitation/_private/organization_invitation_sdk.py +24 -0
- anyscale/organization_invitation/commands.py +84 -0
- anyscale/organization_invitation/models.py +45 -0
- anyscale/project/__init__.py +35 -0
- anyscale/project/_private/project_sdk.py +27 -0
- anyscale/project/commands.py +56 -0
- anyscale/project/models.py +91 -0
- anyscale/{project.py → project_utils.py} +3 -4
- anyscale/resource_quota/__init__.py +99 -0
- anyscale/resource_quota/_private/resource_quota_sdk.py +120 -0
- anyscale/resource_quota/commands.py +150 -0
- anyscale/resource_quota/models.py +303 -0
- anyscale/scripts.py +4 -0
- anyscale/sdk/anyscale_client/__init__.py +0 -5
- anyscale/sdk/anyscale_client/api/default_api.py +119 -150
- anyscale/sdk/anyscale_client/models/__init__.py +0 -5
- anyscale/sdk/anyscale_client/models/baseimagesenum.py +43 -1
- anyscale/sdk/anyscale_client/models/cluster_status_details.py +2 -1
- anyscale/sdk/anyscale_client/models/jobs_sort_field.py +1 -2
- anyscale/sdk/anyscale_client/models/supportedbaseimagesenum.py +43 -1
- anyscale/sdk/anyscale_client/sdk.py +1 -1
- anyscale/service/__init__.py +21 -0
- anyscale/service/_private/service_sdk.py +13 -0
- anyscale/service/commands.py +35 -0
- anyscale/service_account/__init__.py +88 -0
- anyscale/service_account/_private/service_account_sdk.py +101 -0
- anyscale/service_account/commands.py +147 -0
- anyscale/service_account/models.py +66 -0
- anyscale/shared_anyscale_utils/latest_ray_version.py +1 -1
- anyscale/shared_anyscale_utils/utils/id_gen.py +2 -0
- anyscale/user/__init__.py +1 -1
- anyscale/user/commands.py +1 -1
- anyscale/user/models.py +25 -15
- anyscale/util.py +23 -0
- anyscale/utils/cloud_utils.py +1 -1
- anyscale/version.py +1 -1
- anyscale/workspace_utils.py +1 -1
- {anyscale-0.24.88.dist-info → anyscale-0.25.5.dist-info}/METADATA +1 -5
- {anyscale-0.24.88.dist-info → anyscale-0.25.5.dist-info}/RECORD +134 -119
- anyscale/client/openapi_client/models/create_fine_tuning_hyperparameters.py +0 -156
- anyscale/client/openapi_client/models/create_fine_tuning_job_product_request.py +0 -353
- anyscale/client/openapi_client/models/finish_ft_job_request.py +0 -204
- anyscale/client/openapi_client/models/platform_fine_tuning_job.py +0 -577
- anyscale/client/openapi_client/models/session_event.py +0 -267
- anyscale/client/openapi_client/models/session_event_cause.py +0 -150
- anyscale/controllers/resource_quota_controller.py +0 -183
- anyscale/controllers/service_account_controller.py +0 -168
- anyscale/sdk/anyscale_client/models/log_level_types.py +0 -100
- anyscale/sdk/anyscale_client/models/session_event.py +0 -267
- anyscale/sdk/anyscale_client/models/session_event_cause.py +0 -150
- anyscale/sdk/anyscale_client/models/session_event_types.py +0 -111
- anyscale/sdk/anyscale_client/models/sessionevent_list_response.py +0 -147
- anyscale/utils/imports/azure.py +0 -14
- /anyscale/{cloud.py → cloud_utils.py} +0 -0
- {anyscale-0.24.88.dist-info → anyscale-0.25.5.dist-info}/LICENSE +0 -0
- {anyscale-0.24.88.dist-info → anyscale-0.25.5.dist-info}/NOTICE +0 -0
- {anyscale-0.24.88.dist-info → anyscale-0.25.5.dist-info}/WHEEL +0 -0
- {anyscale-0.24.88.dist-info → anyscale-0.25.5.dist-info}/entry_points.txt +0 -0
- {anyscale-0.24.88.dist-info → anyscale-0.25.5.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,147 @@
|
|
1
|
+
from typing import List, Optional
|
2
|
+
|
3
|
+
from anyscale._private.sdk import sdk_command
|
4
|
+
from anyscale.service_account._private.service_account_sdk import (
|
5
|
+
PrivateServiceAccountSDK,
|
6
|
+
)
|
7
|
+
from anyscale.service_account.models import ServiceAccount
|
8
|
+
|
9
|
+
|
10
|
+
_SERVICE_ACCOUNT_SDK_SINGLETON_KEY = "service_account_sdk"
|
11
|
+
|
12
|
+
_CREATE_EXAMPLE = """
|
13
|
+
import anyscale
|
14
|
+
|
15
|
+
api_key = anyscale.service_account.create(
|
16
|
+
name="my-service-account",
|
17
|
+
)
|
18
|
+
"""
|
19
|
+
|
20
|
+
_CREATE_DOCSTRINGS = {"name": "Name for the service account."}
|
21
|
+
|
22
|
+
_CREATE_API_KEY_EXAMPLE = """
|
23
|
+
import anyscale
|
24
|
+
|
25
|
+
api_key = anyscale.service_account.create_api_key(
|
26
|
+
name="my-service-account",
|
27
|
+
)
|
28
|
+
"""
|
29
|
+
|
30
|
+
_CREATE_API_KEY_DOCSTRINGS = {
|
31
|
+
"email": "Email of the service account to create the new key for.",
|
32
|
+
"name": "Name of the service account to create the new key for.",
|
33
|
+
}
|
34
|
+
|
35
|
+
_LIST_EXAMPLE = """
|
36
|
+
import anyscale
|
37
|
+
|
38
|
+
anyscale.service_account.list(
|
39
|
+
max_items=20,
|
40
|
+
)
|
41
|
+
"""
|
42
|
+
|
43
|
+
_LIST_DOCSTRINGS = {
|
44
|
+
"max_items": "Maximum number of items to return.",
|
45
|
+
}
|
46
|
+
|
47
|
+
_DELETE_EXAMPLE = """
|
48
|
+
import anyscale
|
49
|
+
|
50
|
+
anyscale.service_account.delete(
|
51
|
+
name="my-service-account",
|
52
|
+
)
|
53
|
+
"""
|
54
|
+
|
55
|
+
_DELETE_DOCSTRINGS = {
|
56
|
+
"email": "Email of the service account to delete.",
|
57
|
+
"name": "Name of the service account to delete.",
|
58
|
+
}
|
59
|
+
|
60
|
+
_ROTATE_API_KEYS_EXAMPLE = """
|
61
|
+
import anyscale
|
62
|
+
|
63
|
+
anyscale.service_account.rotate_api_keys(
|
64
|
+
name="my-service-account",
|
65
|
+
)
|
66
|
+
"""
|
67
|
+
|
68
|
+
_ROTATE_API_KEYS_DOCSTRINGS = {
|
69
|
+
"email": "Rotate API keys for the service account with this email.",
|
70
|
+
"name": "Rotate API keys for the service account with this name.",
|
71
|
+
}
|
72
|
+
|
73
|
+
|
74
|
+
@sdk_command(
|
75
|
+
_SERVICE_ACCOUNT_SDK_SINGLETON_KEY,
|
76
|
+
PrivateServiceAccountSDK,
|
77
|
+
doc_py_example=_CREATE_EXAMPLE,
|
78
|
+
arg_docstrings=_CREATE_DOCSTRINGS,
|
79
|
+
)
|
80
|
+
def create(name: str, *, _sdk: PrivateServiceAccountSDK) -> str:
|
81
|
+
"""Create a service account and return the API key.
|
82
|
+
"""
|
83
|
+
return _sdk.create(name)
|
84
|
+
|
85
|
+
|
86
|
+
@sdk_command(
|
87
|
+
_SERVICE_ACCOUNT_SDK_SINGLETON_KEY,
|
88
|
+
PrivateServiceAccountSDK,
|
89
|
+
doc_py_example=_CREATE_API_KEY_EXAMPLE,
|
90
|
+
arg_docstrings=_CREATE_API_KEY_DOCSTRINGS,
|
91
|
+
)
|
92
|
+
def create_api_key(
|
93
|
+
email: Optional[str] = None,
|
94
|
+
name: Optional[str] = None,
|
95
|
+
*,
|
96
|
+
_sdk: PrivateServiceAccountSDK
|
97
|
+
) -> str:
|
98
|
+
"""Create an API key for the service account and return the API key.
|
99
|
+
"""
|
100
|
+
return _sdk.create_api_key(email, name)
|
101
|
+
|
102
|
+
|
103
|
+
@sdk_command(
|
104
|
+
_SERVICE_ACCOUNT_SDK_SINGLETON_KEY,
|
105
|
+
PrivateServiceAccountSDK,
|
106
|
+
doc_py_example=_LIST_EXAMPLE,
|
107
|
+
arg_docstrings=_LIST_DOCSTRINGS,
|
108
|
+
)
|
109
|
+
def list( # noqa: A001
|
110
|
+
max_items: int = 20, *, _sdk: PrivateServiceAccountSDK
|
111
|
+
) -> List[ServiceAccount]:
|
112
|
+
"""List service accounts. """
|
113
|
+
return _sdk.list(max_items)
|
114
|
+
|
115
|
+
|
116
|
+
@sdk_command(
|
117
|
+
_SERVICE_ACCOUNT_SDK_SINGLETON_KEY,
|
118
|
+
PrivateServiceAccountSDK,
|
119
|
+
doc_py_example=_DELETE_EXAMPLE,
|
120
|
+
arg_docstrings=_DELETE_DOCSTRINGS,
|
121
|
+
)
|
122
|
+
def delete(
|
123
|
+
email: Optional[str] = None,
|
124
|
+
name: Optional[str] = None,
|
125
|
+
*,
|
126
|
+
_sdk: PrivateServiceAccountSDK
|
127
|
+
):
|
128
|
+
"""Delete a service account.
|
129
|
+
"""
|
130
|
+
return _sdk.delete(email, name)
|
131
|
+
|
132
|
+
|
133
|
+
@sdk_command(
|
134
|
+
_SERVICE_ACCOUNT_SDK_SINGLETON_KEY,
|
135
|
+
PrivateServiceAccountSDK,
|
136
|
+
doc_py_example=_ROTATE_API_KEYS_EXAMPLE,
|
137
|
+
arg_docstrings=_ROTATE_API_KEYS_DOCSTRINGS,
|
138
|
+
)
|
139
|
+
def rotate_api_keys(
|
140
|
+
email: Optional[str] = None,
|
141
|
+
name: Optional[str] = None,
|
142
|
+
*,
|
143
|
+
_sdk: PrivateServiceAccountSDK
|
144
|
+
) -> str:
|
145
|
+
"""Rotate all api keys of a service account and return the new API key.
|
146
|
+
"""
|
147
|
+
return _sdk.rotate_api_keys(email, name)
|
@@ -0,0 +1,66 @@
|
|
1
|
+
from dataclasses import dataclass, field
|
2
|
+
from datetime import datetime
|
3
|
+
|
4
|
+
from anyscale._private.models import ModelBase, ModelEnum
|
5
|
+
|
6
|
+
|
7
|
+
# TODO(cynthiakwu): Move this when we have organization collaborator sdk
|
8
|
+
class OrganizationPermissionLevel(ModelEnum):
|
9
|
+
OWNER = "OWNER"
|
10
|
+
COLLABORATOR = "COLLABORATOR"
|
11
|
+
|
12
|
+
__docstrings__ = {
|
13
|
+
OWNER: "Owner permission level for the organization",
|
14
|
+
COLLABORATOR: "Collaborator permission level for the organization",
|
15
|
+
}
|
16
|
+
|
17
|
+
|
18
|
+
@dataclass(frozen=True)
|
19
|
+
class ServiceAccount(ModelBase):
|
20
|
+
"""Service account
|
21
|
+
"""
|
22
|
+
|
23
|
+
__doc_py_example__ = """\
|
24
|
+
import anyscale
|
25
|
+
from anyscale.service_account.models import ServiceAccount
|
26
|
+
|
27
|
+
service_accounts: List[ServiceAccount] = anyscale.service_account.list()
|
28
|
+
"""
|
29
|
+
|
30
|
+
name: str = field(metadata={"docstring": "Name of the service account."})
|
31
|
+
|
32
|
+
def _validate_name(self, name: str):
|
33
|
+
if not isinstance(name, str):
|
34
|
+
raise TypeError("name must be a string.")
|
35
|
+
|
36
|
+
created_at: datetime = field(
|
37
|
+
metadata={"docstring": "The timestamp when this service account was created."}
|
38
|
+
)
|
39
|
+
|
40
|
+
def _validate_created_at(self, created_at: datetime):
|
41
|
+
if not isinstance(created_at, datetime):
|
42
|
+
raise TypeError("created_at must be a datetime.")
|
43
|
+
|
44
|
+
permission_level: OrganizationPermissionLevel = field(
|
45
|
+
metadata={
|
46
|
+
"docstring": "The organization permission level of the service account."
|
47
|
+
}
|
48
|
+
)
|
49
|
+
|
50
|
+
def _validate_permission_level(
|
51
|
+
self, permission_level: OrganizationPermissionLevel
|
52
|
+
) -> OrganizationPermissionLevel:
|
53
|
+
if isinstance(permission_level, str):
|
54
|
+
return OrganizationPermissionLevel.validate(permission_level)
|
55
|
+
elif isinstance(permission_level, OrganizationPermissionLevel):
|
56
|
+
return permission_level
|
57
|
+
else:
|
58
|
+
raise TypeError(
|
59
|
+
f"'permission_level' must be a 'OrganizationPermissionLevel' (it is {type(permission_level)})."
|
60
|
+
)
|
61
|
+
|
62
|
+
email: str = field(metadata={"docstring": "Email of the service account."})
|
63
|
+
|
64
|
+
def _validate_email(self, email: str):
|
65
|
+
if not isinstance(email, str):
|
66
|
+
raise TypeError("email must be a string.")
|
@@ -1,2 +1,2 @@
|
|
1
1
|
# AUTOGENERATED - modify shared_anyscale_util in root directory to make changes
|
2
|
-
LATEST_RAY_VERSION = "2.
|
2
|
+
LATEST_RAY_VERSION = "2.41.0"
|
@@ -111,7 +111,9 @@ class IDTypes(Enum):
|
|
111
111
|
instance_usage_budgets = "iub"
|
112
112
|
datasets = "dataset"
|
113
113
|
resource_quotas = "rsq"
|
114
|
+
resource_alerts = "rsa"
|
114
115
|
aggregated_instance_usage = "aiu"
|
116
|
+
readonly_collaborators = "rc"
|
115
117
|
|
116
118
|
|
117
119
|
_default_id_length: int = 26
|
anyscale/user/__init__.py
CHANGED
@@ -30,6 +30,6 @@ class UserSDK:
|
|
30
30
|
def admin_batch_create( # noqa: F811
|
31
31
|
self, admin_create_users: List[AdminCreateUser],
|
32
32
|
) -> List[AdminCreatedUser]:
|
33
|
-
"""Batch create users without email verification
|
33
|
+
"""Batch create, as an admin, users without email verification.
|
34
34
|
"""
|
35
35
|
return self._private_sdk.admin_batch_create(admin_create_users)
|
anyscale/user/commands.py
CHANGED
@@ -37,6 +37,6 @@ _ADMIN_BATCH_CREATE_ARG_DOCSTRINGS = {
|
|
37
37
|
def admin_batch_create(
|
38
38
|
admin_create_users: List[AdminCreateUser], *, _sdk: PrivateUserSDK
|
39
39
|
) -> List[AdminCreatedUser]:
|
40
|
-
"""Batch create users without email verification
|
40
|
+
"""Batch create, as an admin, users without email verification.
|
41
41
|
"""
|
42
42
|
return _sdk.admin_batch_create(admin_create_users)
|
anyscale/user/models.py
CHANGED
@@ -15,13 +15,13 @@ import anyscale
|
|
15
15
|
from anyscale.user.models import AdminCreateUser
|
16
16
|
|
17
17
|
admin_create_user = AdminCreateUser(
|
18
|
-
#
|
18
|
+
# First name of the user to be created.
|
19
19
|
name="name",
|
20
20
|
# Email of the user to be created.
|
21
21
|
email="test@anyscale.com",
|
22
22
|
# Password for the user account being created.
|
23
23
|
password="",
|
24
|
-
# Whether the user is an SSO user.
|
24
|
+
# Whether the user is an SSO user. SSO users can log in using SSO.
|
25
25
|
is_sso_user=False,
|
26
26
|
# Optional last name of the user to be created.
|
27
27
|
lastname="lastname",
|
@@ -29,7 +29,7 @@ admin_create_user = AdminCreateUser(
|
|
29
29
|
title="title",
|
30
30
|
)
|
31
31
|
"""
|
32
|
-
name: str = field(metadata={"docstring": "
|
32
|
+
name: str = field(metadata={"docstring": "First name of the user to be created."})
|
33
33
|
|
34
34
|
def _validate_name(self, name: str):
|
35
35
|
if not isinstance(name, str):
|
@@ -50,7 +50,9 @@ admin_create_user = AdminCreateUser(
|
|
50
50
|
raise TypeError("password must be a string.")
|
51
51
|
|
52
52
|
is_sso_user: bool = field(
|
53
|
-
metadata={
|
53
|
+
metadata={
|
54
|
+
"docstring": "Whether the user is an SSO user. SSO users can log in using SSO."
|
55
|
+
},
|
54
56
|
)
|
55
57
|
|
56
58
|
def _validate_is_sso_user(self, is_sso_user: bool):
|
@@ -86,13 +88,13 @@ import anyscale
|
|
86
88
|
from anyscale.user.models import AdminCreateUser
|
87
89
|
|
88
90
|
admin_create_user = AdminCreateUser(
|
89
|
-
#
|
91
|
+
# First name of the user to be created.
|
90
92
|
name="name",
|
91
93
|
# Email of the user to be created.
|
92
94
|
email="test@anyscale.com",
|
93
95
|
# Password for the user account being created.
|
94
96
|
password="",
|
95
|
-
# Whether the user is an SSO user.
|
97
|
+
# Whether the user is an SSO user. SSO users can log in using SSO.
|
96
98
|
is_sso_user=False,
|
97
99
|
# Optional last name of the user to be created.
|
98
100
|
lastname="lastname",
|
@@ -115,7 +117,7 @@ admin_create_users = AdminCreateUsers(
|
|
115
117
|
|
116
118
|
@dataclass(frozen=True)
|
117
119
|
class AdminCreatedUser(ModelBase):
|
118
|
-
"""User account created by an admin.
|
120
|
+
"""User account created by an admin that has organization collaborator permissions.
|
119
121
|
"""
|
120
122
|
|
121
123
|
__doc_py_example__ = """\
|
@@ -123,13 +125,13 @@ import anyscale
|
|
123
125
|
from anyscale.user.models import AdminCreatedUser
|
124
126
|
|
125
127
|
admin_create_user = AdminCreateUser(
|
126
|
-
#
|
128
|
+
# First name of the user to be created.
|
127
129
|
name="name",
|
128
130
|
# Email of the user to be created.
|
129
131
|
email="test@anyscale.com",
|
130
132
|
# Password for the user account being created.
|
131
133
|
password="",
|
132
|
-
# Whether the user is an SSO user.
|
134
|
+
# Whether the user is an SSO user. SSO users can log in using SSO.
|
133
135
|
is_sso_user=False,
|
134
136
|
# Optional last name of the user to be created.
|
135
137
|
lastname="lastname",
|
@@ -138,19 +140,25 @@ admin_create_user = AdminCreateUser(
|
|
138
140
|
)
|
139
141
|
admin_created_users: List[AdminCreatedUser] = anyscale.user.admin_batch_create([admin_create_user])
|
140
142
|
"""
|
141
|
-
user_id: str = field(
|
143
|
+
user_id: str = field(
|
144
|
+
metadata={"docstring": "ID of the user that has been created."}
|
145
|
+
)
|
142
146
|
|
143
147
|
def _validate_user_id(self, user_id: str):
|
144
148
|
if not isinstance(user_id, str):
|
145
149
|
raise TypeError("user_id must be a string.")
|
146
150
|
|
147
|
-
name: str = field(
|
151
|
+
name: str = field(
|
152
|
+
metadata={"docstring": "First name of the user that has been created."}
|
153
|
+
)
|
148
154
|
|
149
155
|
def _validate_name(self, name: str):
|
150
156
|
if not isinstance(name, str):
|
151
157
|
raise TypeError("name must be a string.")
|
152
158
|
|
153
|
-
email: str = field(
|
159
|
+
email: str = field(
|
160
|
+
metadata={"docstring": "Email of the user that has been created."}
|
161
|
+
)
|
154
162
|
|
155
163
|
def _validate_email(self, email: str):
|
156
164
|
if not isinstance(email, str):
|
@@ -165,7 +173,9 @@ admin_created_users: List[AdminCreatedUser] = anyscale.user.admin_batch_create([
|
|
165
173
|
raise TypeError("created_at must be a datetime.")
|
166
174
|
|
167
175
|
is_sso_user: bool = field(
|
168
|
-
metadata={
|
176
|
+
metadata={
|
177
|
+
"docstring": "Whether the user is an SSO user. SSO users can log in using SSO."
|
178
|
+
},
|
169
179
|
)
|
170
180
|
|
171
181
|
def _validate_is_sso_user(self, is_sso_user: bool):
|
@@ -174,7 +184,7 @@ admin_created_users: List[AdminCreatedUser] = anyscale.user.admin_batch_create([
|
|
174
184
|
|
175
185
|
lastname: Optional[str] = field(
|
176
186
|
default=None,
|
177
|
-
metadata={"docstring": "Optional last name of the user
|
187
|
+
metadata={"docstring": "Optional last name of the user that has been created."},
|
178
188
|
)
|
179
189
|
|
180
190
|
def _validate_lastname(self, lastname: Optional[str]):
|
@@ -183,7 +193,7 @@ admin_created_users: List[AdminCreatedUser] = anyscale.user.admin_batch_create([
|
|
183
193
|
|
184
194
|
title: Optional[str] = field(
|
185
195
|
default=None,
|
186
|
-
metadata={"docstring": "Optional title of the user
|
196
|
+
metadata={"docstring": "Optional title of the user that has been created."},
|
187
197
|
)
|
188
198
|
|
189
199
|
def _validate_title(self, title: Optional[str]):
|
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]:
|
@@ -1153,3 +1168,11 @@ T = TypeVar("T")
|
|
1153
1168
|
|
1154
1169
|
def _coerce_to_list(maybe_list: Union[T, List[T]]) -> List[T]:
|
1155
1170
|
return maybe_list if isinstance(maybe_list, list) else [maybe_list]
|
1171
|
+
|
1172
|
+
|
1173
|
+
def allow_optional_file_storage(api_client: Optional[ProductApi] = None) -> bool:
|
1174
|
+
if api_client is None:
|
1175
|
+
api_client = get_auth_api_client().api_client
|
1176
|
+
return api_client.check_is_feature_flag_on_api_v2_userinfo_check_is_feature_flag_on_get(
|
1177
|
+
"allow-optional-file-storage"
|
1178
|
+
).result.is_on
|
anyscale/utils/cloud_utils.py
CHANGED
@@ -20,7 +20,7 @@ from anyscale.client.openapi_client.models import (
|
|
20
20
|
CloudProviders,
|
21
21
|
CreateAnalyticsEvent,
|
22
22
|
)
|
23
|
-
from anyscale.
|
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.
|
1
|
+
__version__ = "0.25.5"
|
anyscale/workspace_utils.py
CHANGED
@@ -3,7 +3,7 @@ import os
|
|
3
3
|
from click import ClickException
|
4
4
|
import yaml
|
5
5
|
|
6
|
-
from anyscale.
|
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.
|
3
|
+
Version: 0.25.5
|
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
|
|