anyscale 0.26.14__py3-none-any.whl → 0.26.15__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/_private/anyscale_client/fake_anyscale_client.py +1 -1
- anyscale/_private/models/model_base.py +5 -2
- anyscale/_private/utils/progress_util.py +2 -2
- anyscale/_private/workload/workload_sdk.py +4 -3
- anyscale/anyscale-cloud-setup.yaml +4 -0
- anyscale/client/README.md +4 -5
- anyscale/client/openapi_client/__init__.py +3 -4
- anyscale/client/openapi_client/api/default_api.py +158 -127
- anyscale/client/openapi_client/models/__init__.py +3 -4
- anyscale/client/openapi_client/models/task_exception_group_aggregate.py +28 -1
- anyscale/client/openapi_client/models/{taskexceptiongroupaggregate_list_response.py → task_exception_group_aggregate_response.py} +52 -25
- anyscale/client/openapi_client/models/task_function_name_group_aggregate.py +28 -1
- anyscale/client/openapi_client/models/{taskfunctionnamegroupaggregate_list_response.py → task_function_name_group_aggregate_response.py} +52 -25
- anyscale/client/openapi_client/models/task_job_group_aggregate.py +28 -1
- anyscale/client/openapi_client/models/{taskjobgroupaggregate_list_response.py → task_job_group_aggregate_response.py} +52 -25
- anyscale/client/openapi_client/models/task_table_row.py +19 -19
- anyscale/cloud_resource.py +1 -1
- anyscale/cloud_utils.py +6 -2
- anyscale/cluster_compute.py +4 -3
- anyscale/cluster_env.py +8 -5
- anyscale/compute_config/_private/compute_config_sdk.py +1 -1
- anyscale/connect_utils/prepare_cluster.py +14 -4
- anyscale/controllers/cloud_controller.py +2 -2
- anyscale/controllers/cloud_functional_verification_controller.py +4 -2
- anyscale/controllers/service_controller.py +1 -1
- anyscale/project_utils.py +4 -3
- anyscale/sdk/anyscale_client/sdk.py +4 -4
- anyscale/utils/connect_helpers.py +16 -3
- anyscale/utils/runtime_env.py +3 -1
- anyscale/version.py +1 -1
- anyscale/workspace/__init__.py +10 -5
- anyscale/workspace/_private/workspace_sdk.py +4 -4
- anyscale/workspace/commands.py +1 -1
- {anyscale-0.26.14.dist-info → anyscale-0.26.15.dist-info}/METADATA +1 -1
- {anyscale-0.26.14.dist-info → anyscale-0.26.15.dist-info}/RECORD +40 -41
- anyscale/client/openapi_client/models/buffer_registration.py +0 -285
- {anyscale-0.26.14.dist-info → anyscale-0.26.15.dist-info}/LICENSE +0 -0
- {anyscale-0.26.14.dist-info → anyscale-0.26.15.dist-info}/NOTICE +0 -0
- {anyscale-0.26.14.dist-info → anyscale-0.26.15.dist-info}/WHEEL +0 -0
- {anyscale-0.26.14.dist-info → anyscale-0.26.15.dist-info}/entry_points.txt +0 -0
- {anyscale-0.26.14.dist-info → anyscale-0.26.15.dist-info}/top_level.txt +0 -0
anyscale/cloud_utils.py
CHANGED
@@ -11,6 +11,7 @@ from anyscale.client.openapi_client.models import (
|
|
11
11
|
CreateCloudResource,
|
12
12
|
CreateCloudResourceGCP,
|
13
13
|
)
|
14
|
+
from anyscale.sdk.anyscale_client.api.default_api import DefaultApi as SDKDefaultApi
|
14
15
|
from anyscale.sdk.anyscale_client.models.cloud import Cloud
|
15
16
|
|
16
17
|
|
@@ -114,7 +115,8 @@ def get_cloud_resource_by_cloud_id(
|
|
114
115
|
|
115
116
|
|
116
117
|
def get_last_used_cloud(
|
117
|
-
project_id: Optional[str],
|
118
|
+
project_id: Optional[str],
|
119
|
+
anyscale_api_client: Optional[Union[DefaultApi, SDKDefaultApi]] = None,
|
118
120
|
) -> str:
|
119
121
|
"""Return the name of the cloud last used in the project.
|
120
122
|
|
@@ -161,7 +163,9 @@ def get_last_used_cloud(
|
|
161
163
|
return cast(str, cloud_name)
|
162
164
|
|
163
165
|
|
164
|
-
def get_all_clouds(
|
166
|
+
def get_all_clouds(
|
167
|
+
anyscale_api_client: Optional[Union[DefaultApi, SDKDefaultApi]] = None,
|
168
|
+
) -> List[Cloud]:
|
165
169
|
"""Fetches all Clouds the user has access to.
|
166
170
|
Returns:
|
167
171
|
List of all Clouds the user has access to.
|
anyscale/cluster_compute.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import re
|
2
|
-
from typing import Optional, Tuple
|
2
|
+
from typing import Optional, Tuple, Union
|
3
3
|
|
4
4
|
from anyscale.authenticate import get_auth_api_client
|
5
5
|
from anyscale.cli_logger import BlockLogger
|
@@ -10,6 +10,7 @@ from anyscale.sdk.anyscale_client import (
|
|
10
10
|
ComputeTemplateConfig,
|
11
11
|
CreateComputeTemplate,
|
12
12
|
)
|
13
|
+
from anyscale.sdk.anyscale_client.api.default_api import DefaultApi as SDKDefaultApi
|
13
14
|
from anyscale.sdk.anyscale_client.models.cluster_compute_config import (
|
14
15
|
ClusterComputeConfig,
|
15
16
|
)
|
@@ -27,7 +28,7 @@ def get_default_cluster_compute(
|
|
27
28
|
cloud_name: Optional[str],
|
28
29
|
project_id: Optional[str],
|
29
30
|
api_client: Optional[DefaultApi] = None,
|
30
|
-
anyscale_api_client: Optional[DefaultApi] = None,
|
31
|
+
anyscale_api_client: Optional[Union[DefaultApi, SDKDefaultApi]] = None,
|
31
32
|
) -> ComputeTemplate:
|
32
33
|
if api_client is None:
|
33
34
|
api_client = get_auth_api_client().api_client
|
@@ -134,7 +135,7 @@ def register_compute_template(
|
|
134
135
|
|
135
136
|
def get_selected_cloud_id_or_default(
|
136
137
|
api_client: Optional[DefaultApi] = None,
|
137
|
-
anyscale_api_client: Optional[DefaultApi] = None,
|
138
|
+
anyscale_api_client: Optional[Union[DefaultApi, SDKDefaultApi]] = None,
|
138
139
|
cluster_compute_id: Optional[str] = None,
|
139
140
|
cluster_compute_config: Optional[ClusterComputeConfig] = None,
|
140
141
|
cloud_id: Optional[str] = None,
|
anyscale/cluster_env.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import List, Optional
|
1
|
+
from typing import List, Optional, Union
|
2
2
|
|
3
3
|
import click
|
4
4
|
|
@@ -6,6 +6,7 @@ from anyscale.authenticate import get_auth_api_client
|
|
6
6
|
from anyscale.cli_logger import BlockLogger
|
7
7
|
from anyscale.client.openapi_client.api.default_api import DefaultApi
|
8
8
|
from anyscale.sdk.anyscale_client import ClusterEnvironmentBuild
|
9
|
+
from anyscale.sdk.anyscale_client.api.default_api import DefaultApi as SDKDefaultApi
|
9
10
|
from anyscale.shared_anyscale_utils.utils.byod import is_byod_id
|
10
11
|
from anyscale.util import get_endpoint, get_ray_and_py_version_for_default_cluster_env
|
11
12
|
|
@@ -15,7 +16,7 @@ log = BlockLogger()
|
|
15
16
|
|
16
17
|
def get_default_cluster_env_build(
|
17
18
|
api_client: Optional[DefaultApi] = None,
|
18
|
-
anyscale_api_client: Optional[DefaultApi] = None,
|
19
|
+
anyscale_api_client: Optional[Union[DefaultApi, SDKDefaultApi]] = None,
|
19
20
|
) -> ClusterEnvironmentBuild:
|
20
21
|
ray_version, py_version = get_ray_and_py_version_for_default_cluster_env()
|
21
22
|
|
@@ -38,7 +39,8 @@ def get_default_cluster_env_build(
|
|
38
39
|
|
39
40
|
|
40
41
|
def get_build_from_cluster_env_identifier(
|
41
|
-
cluster_env_identifier: str,
|
42
|
+
cluster_env_identifier: str,
|
43
|
+
anyscale_api_client: Optional[Union[DefaultApi, SDKDefaultApi]] = None,
|
42
44
|
) -> ClusterEnvironmentBuild:
|
43
45
|
"""
|
44
46
|
Get a build id from a cluster environment identifier of form `my_cluster_env:1` or
|
@@ -103,7 +105,8 @@ def get_build_from_cluster_env_identifier(
|
|
103
105
|
|
104
106
|
|
105
107
|
def get_cluster_env_from_name(
|
106
|
-
cluster_env_name: str,
|
108
|
+
cluster_env_name: str,
|
109
|
+
anyscale_api_client: Optional[Union[DefaultApi, SDKDefaultApi]] = None,
|
107
110
|
) -> ClusterEnvironmentBuild:
|
108
111
|
"""
|
109
112
|
Get id of the cluster env (not build) given the name.
|
@@ -123,7 +126,7 @@ def get_cluster_env_from_name(
|
|
123
126
|
|
124
127
|
def list_builds(
|
125
128
|
cluster_env_id: str,
|
126
|
-
anyscale_api_client: Optional[DefaultApi] = None,
|
129
|
+
anyscale_api_client: Optional[Union[DefaultApi, SDKDefaultApi]] = None,
|
127
130
|
max_items: Optional[int] = None,
|
128
131
|
) -> List[ClusterEnvironmentBuild]:
|
129
132
|
"""
|
@@ -154,7 +154,7 @@ class PrivateComputeConfigSDK(BaseSDK):
|
|
154
154
|
# `worker_nodes=None` uses the default serverless config, so this only happens if `worker_nodes`
|
155
155
|
# is explicitly set to an empty list.
|
156
156
|
# Returns the default cloud if user-provided cloud is not specified (`None`).
|
157
|
-
cloud_id = self.client.get_cloud_id(cloud_name=compute_config.cloud)
|
157
|
+
cloud_id = self.client.get_cloud_id(cloud_name=compute_config.cloud) # type: ignore
|
158
158
|
cloud = self.client.get_cloud(cloud_id=cloud_id)
|
159
159
|
if cloud is None:
|
160
160
|
raise RuntimeError(
|
@@ -275,11 +275,21 @@ class PrepareClusterBlock:
|
|
275
275
|
# Try to generate an auto-incrementing cluster name from the first 100 clusters.
|
276
276
|
# If there are more than 40 clusters with, we will generate a random name.
|
277
277
|
# If the name is already taken, we will re-try with a different random name.
|
278
|
-
|
279
|
-
|
280
|
-
|
278
|
+
used_names: List[str] = []
|
279
|
+
has_more = True
|
280
|
+
paging_token = None
|
281
|
+
while has_more:
|
282
|
+
resp = self.anyscale_api_client.search_clusters(
|
283
|
+
clusters_query={
|
284
|
+
"project_id": project_id,
|
285
|
+
"paging": {"count": 50, "paging_token": paging_token},
|
286
|
+
}
|
287
|
+
)
|
288
|
+
used_names.extend([c.name for c in resp.results])
|
289
|
+
paging_token = resp.metadata.next_paging_token
|
290
|
+
has_more = paging_token is not None
|
291
|
+
|
281
292
|
self.log.debug("-> Starting a new cluster")
|
282
|
-
used_names = [s.name for s in results]
|
283
293
|
for i in range(MAX_CLUSTERS):
|
284
294
|
name = f"cluster-{i}"
|
285
295
|
if name not in used_names:
|
@@ -3243,7 +3243,7 @@ class CloudController(BaseController):
|
|
3243
3243
|
*,
|
3244
3244
|
cloud_resource: Any,
|
3245
3245
|
edit_details: Dict[str, Optional[str]],
|
3246
|
-
gcp_filestore_config: GCPFileStoreConfig,
|
3246
|
+
gcp_filestore_config: Optional[GCPFileStoreConfig],
|
3247
3247
|
gcp_filestore_instance_id: Optional[str],
|
3248
3248
|
gcp_filestore_location: Optional[str],
|
3249
3249
|
gcp_utils,
|
@@ -3276,7 +3276,7 @@ class CloudController(BaseController):
|
|
3276
3276
|
cloud_id: str,
|
3277
3277
|
cloud_resource: Any,
|
3278
3278
|
edit_details: Dict[str, Optional[str]],
|
3279
|
-
gcp_filestore_config: GCPFileStoreConfig,
|
3279
|
+
gcp_filestore_config: Optional[GCPFileStoreConfig],
|
3280
3280
|
gcp_utils,
|
3281
3281
|
):
|
3282
3282
|
rollback_cmd = self._generate_rollback_command(
|
@@ -820,11 +820,13 @@ class CloudFunctionalVerificationController(BaseController):
|
|
820
820
|
)
|
821
821
|
|
822
822
|
confirmation_message.append(
|
823
|
-
"The instances will be terminated after verification.
|
823
|
+
"The instances will be terminated after verification."
|
824
824
|
)
|
825
825
|
|
826
|
+
self.log.info("\n".join(confirmation_message))
|
827
|
+
|
826
828
|
confirm(
|
827
|
-
"
|
829
|
+
"Continue?", yes,
|
828
830
|
)
|
829
831
|
|
830
832
|
verification_results: List[bool] = []
|
@@ -342,7 +342,7 @@ class ServiceController(BaseController):
|
|
342
342
|
def _overwrite_runtime_env_in_v2_ray_serve_config(self, config: ServiceConfig):
|
343
343
|
"""Modifies config in place."""
|
344
344
|
ray_serve_config = config.ray_serve_config
|
345
|
-
if "applications" in ray_serve_config:
|
345
|
+
if ray_serve_config is not None and "applications" in ray_serve_config:
|
346
346
|
for ray_serve_app_config in ray_serve_config["applications"]:
|
347
347
|
ray_serve_app_config["runtime_env"] = override_runtime_env_config(
|
348
348
|
runtime_env=ray_serve_app_config.get("runtime_env"),
|
anyscale/project_utils.py
CHANGED
@@ -14,6 +14,7 @@ from anyscale.cluster_compute import (
|
|
14
14
|
get_cluster_compute_from_name,
|
15
15
|
get_selected_cloud_id_or_default,
|
16
16
|
)
|
17
|
+
from anyscale.sdk.anyscale_client.api.default_api import DefaultApi as SDKDefaultApi
|
17
18
|
from anyscale.sdk.anyscale_client.models.cluster_compute_config import (
|
18
19
|
ClusterComputeConfig,
|
19
20
|
)
|
@@ -395,7 +396,7 @@ def get_and_validate_project_id(
|
|
395
396
|
project_name: Optional[str],
|
396
397
|
parent_cloud_id: Optional[str],
|
397
398
|
api_client: DefaultApi,
|
398
|
-
anyscale_api_client: DefaultApi,
|
399
|
+
anyscale_api_client: Union[DefaultApi, SDKDefaultApi],
|
399
400
|
) -> str:
|
400
401
|
project_name = project_name or os.environ.get(PROJECT_NAME_ENV_VAR)
|
401
402
|
if project_id:
|
@@ -421,7 +422,7 @@ def get_and_validate_project_id(
|
|
421
422
|
|
422
423
|
def get_default_project(
|
423
424
|
api_client: Optional[DefaultApi] = None,
|
424
|
-
anyscale_api_client: Optional[DefaultApi] = None,
|
425
|
+
anyscale_api_client: Optional[Union[DefaultApi, SDKDefaultApi]] = None,
|
425
426
|
parent_cloud_id: Optional[str] = None,
|
426
427
|
):
|
427
428
|
"""
|
@@ -448,7 +449,7 @@ def get_default_project(
|
|
448
449
|
|
449
450
|
|
450
451
|
def infer_project_id( # noqa PLR0913
|
451
|
-
anyscale_api_client: DefaultApi,
|
452
|
+
anyscale_api_client: Union[DefaultApi, SDKDefaultApi],
|
452
453
|
api_client: DefaultApi,
|
453
454
|
log: BlockLogger,
|
454
455
|
project_id: Optional[str],
|
@@ -68,7 +68,7 @@ def _upload_and_rewrite_working_dir_in_create_production_job(create_production_j
|
|
68
68
|
|
69
69
|
def _upload_and_rewrite_working_dir_ray_serve_config(
|
70
70
|
ray_serve_config: Optional[Dict[str, Any]]
|
71
|
-
) -> Dict[str, Any]:
|
71
|
+
) -> Optional[Dict[str, Any]]:
|
72
72
|
"""
|
73
73
|
If a local working_dir and upload_path are specified, this method
|
74
74
|
will upload the working_dir and rewrites the working_dir to the remote uri.
|
@@ -159,7 +159,7 @@ class AnyscaleSDK(DefaultApi): # type: ignore
|
|
159
159
|
poll_rate_seconds: int = 15,
|
160
160
|
timeout_seconds: Optional[int] = None,
|
161
161
|
log_output: bool = False,
|
162
|
-
) -> ClusterEnvironmentBuild:
|
162
|
+
) -> Optional[ClusterEnvironmentBuild]:
|
163
163
|
"""
|
164
164
|
Creates a new Cluster Environment and waits for build to complete.
|
165
165
|
|
@@ -199,7 +199,7 @@ class AnyscaleSDK(DefaultApi): # type: ignore
|
|
199
199
|
correct_base_image_name = get_correct_name_for_base_image_name(base_image_name)
|
200
200
|
if base_image_name != correct_base_image_name: # We need to make sure base_image_name after ray 2.7.0, before 2.8.0 have a optimized suffix
|
201
201
|
self.log.error(f"Starting from Ray version 2.7.0 and before version 2.8.0, you might be required to include the suffix 'optimized' in the base_image name for that specific Ray version. Try using {self.log.highlight(correct_base_image_name)}")
|
202
|
-
return
|
202
|
+
return # type: ignore
|
203
203
|
cluster_environment = self.create_cluster_environment(
|
204
204
|
create_cluster_environment
|
205
205
|
).result
|
@@ -224,7 +224,7 @@ class AnyscaleSDK(DefaultApi): # type: ignore
|
|
224
224
|
correct_base_image_name = get_correct_name_for_base_image_name(base_image_name)
|
225
225
|
if base_image_name != correct_base_image_name: # We need to make sure base_image_name after ray 2.7.0, before 2.8.0 have a optimized suffix
|
226
226
|
self.log.error(f"Starting from Ray version 2.7.0 and before version 2.8.0, you might be required to include the suffix 'optimized' in the base_image name for that specific Ray version. Try using {self.log.highlight(correct_base_image_name)}")
|
227
|
-
return
|
227
|
+
return # type: ignore
|
228
228
|
build = self.create_cluster_environment_build(
|
229
229
|
{
|
230
230
|
"cluster_environment_id": cluster_environment.id,
|
@@ -1,6 +1,16 @@
|
|
1
1
|
from dataclasses import dataclass
|
2
2
|
import inspect
|
3
|
-
from typing import
|
3
|
+
from typing import (
|
4
|
+
Any,
|
5
|
+
Callable,
|
6
|
+
Dict,
|
7
|
+
Generic,
|
8
|
+
List,
|
9
|
+
Optional,
|
10
|
+
TYPE_CHECKING,
|
11
|
+
TypeVar,
|
12
|
+
Union,
|
13
|
+
)
|
4
14
|
|
5
15
|
from anyscale.anyscale_pydantic import BaseModel
|
6
16
|
from anyscale.client.openapi_client.models.session import Session
|
@@ -8,6 +18,7 @@ from anyscale.sdk.anyscale_client.models.cluster import Cluster
|
|
8
18
|
|
9
19
|
|
10
20
|
if TYPE_CHECKING:
|
21
|
+
from anyscale.sdk.anyscale_client.api.default_api import DefaultApi
|
11
22
|
from anyscale.sdk.anyscale_client.sdk import AnyscaleSDK
|
12
23
|
|
13
24
|
|
@@ -48,7 +59,9 @@ def _multiclient_supported() -> bool:
|
|
48
59
|
return "_context_to_restore" in _context_params
|
49
60
|
|
50
61
|
|
51
|
-
def find_project_id(
|
62
|
+
def find_project_id(
|
63
|
+
sdk: Union["AnyscaleSDK", "DefaultApi"], project_name: str
|
64
|
+
) -> Optional[str]:
|
52
65
|
"""Return id if a project of a given name exists."""
|
53
66
|
resp = sdk.search_projects({"name": {"equals": project_name}})
|
54
67
|
if len(resp.results) > 0:
|
@@ -58,7 +71,7 @@ def find_project_id(sdk: "AnyscaleSDK", project_name: str) -> Optional[str]:
|
|
58
71
|
|
59
72
|
|
60
73
|
def get_cluster(
|
61
|
-
sdk: "AnyscaleSDK", project_id: str, session_name: str
|
74
|
+
sdk: Union["AnyscaleSDK", "DefaultApi"], project_id: str, session_name: str
|
62
75
|
) -> Optional[Session]:
|
63
76
|
"""Query Anyscale for the given cluster's metadata."""
|
64
77
|
clusters = sdk.search_clusters(
|
anyscale/utils/runtime_env.py
CHANGED
@@ -15,6 +15,7 @@ from typing import (
|
|
15
15
|
Optional,
|
16
16
|
Tuple,
|
17
17
|
TYPE_CHECKING,
|
18
|
+
Union,
|
18
19
|
)
|
19
20
|
from urllib.parse import urlparse
|
20
21
|
|
@@ -31,6 +32,7 @@ from anyscale.client.openapi_client.models.cloud_with_cloud_resource_gcp import
|
|
31
32
|
CloudWithCloudResourceGCP,
|
32
33
|
)
|
33
34
|
from anyscale.client.openapi_client.models.user_info import UserInfo
|
35
|
+
from anyscale.sdk.anyscale_client.api.default_api import DefaultApi as SDKDefaultApi
|
34
36
|
from anyscale.shared_anyscale_utils.aws import bucket_name_from_maybe_bucket_arn
|
35
37
|
from anyscale.util import is_anyscale_workspace
|
36
38
|
from anyscale.utils.ray_utils import zip_directory # type: ignore
|
@@ -221,7 +223,7 @@ def upload_and_rewrite_working_dir(
|
|
221
223
|
|
222
224
|
def override_runtime_env_config(
|
223
225
|
runtime_env: Optional[Dict[str, Any]],
|
224
|
-
anyscale_api_client: DefaultApi,
|
226
|
+
anyscale_api_client: Union[DefaultApi, SDKDefaultApi],
|
225
227
|
api_client: DefaultApi,
|
226
228
|
workload_type: Workload,
|
227
229
|
compute_config_id: Optional[str],
|
anyscale/version.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = "0.26.
|
1
|
+
__version__ = "0.26.15"
|
anyscale/workspace/__init__.py
CHANGED
@@ -40,7 +40,12 @@ from anyscale.workspace.commands import (
|
|
40
40
|
update,
|
41
41
|
wait,
|
42
42
|
)
|
43
|
-
from anyscale.workspace.models import
|
43
|
+
from anyscale.workspace.models import (
|
44
|
+
UpdateWorkspaceConfig,
|
45
|
+
Workspace,
|
46
|
+
WorkspaceConfig,
|
47
|
+
WorkspaceState,
|
48
|
+
)
|
44
49
|
|
45
50
|
|
46
51
|
class WorkspaceSDK:
|
@@ -58,12 +63,12 @@ class WorkspaceSDK:
|
|
58
63
|
@sdk_docs(
|
59
64
|
doc_py_example=_CREATE_EXAMPLE, arg_docstrings=_CREATE_ARG_DOCSTRINGS,
|
60
65
|
)
|
61
|
-
def create(self, config: WorkspaceConfig) -> str: # noqa: F811
|
66
|
+
def create(self, config: Optional[WorkspaceConfig]) -> str: # noqa: F811
|
62
67
|
"""Create a workspace.
|
63
68
|
|
64
69
|
Returns the id of the workspace.
|
65
70
|
"""
|
66
|
-
return self._private_sdk.create(config=config)
|
71
|
+
return self._private_sdk.create(config=config) # type: ignore
|
67
72
|
|
68
73
|
@sdk_docs(
|
69
74
|
doc_py_example=_START_EXAMPLE, arg_docstrings=_START_ARG_DOCSTRINGS,
|
@@ -248,11 +253,11 @@ class WorkspaceSDK:
|
|
248
253
|
doc_py_example=_UPDATE_EXAMPLE, arg_docstrings=_UPDATE_ARG_DOCSTRINGS,
|
249
254
|
)
|
250
255
|
def update( # noqa: F811
|
251
|
-
self, *, id: str = None, config:
|
256
|
+
self, *, id: str = None, config: UpdateWorkspaceConfig # noqa: A002
|
252
257
|
):
|
253
258
|
"""Update a workspace."""
|
254
259
|
self._private_sdk.update(
|
255
|
-
id=id, config=config,
|
260
|
+
id=id, config=config, # type: ignore
|
256
261
|
)
|
257
262
|
|
258
263
|
@sdk_docs(
|
@@ -113,7 +113,7 @@ class PrivateWorkspaceSDK(WorkloadSDK):
|
|
113
113
|
name = config.name
|
114
114
|
|
115
115
|
compute_config_id, cloud_id = self.resolve_compute_config_and_cloud_id(
|
116
|
-
compute_config=config.compute_config, cloud=config.cloud,
|
116
|
+
compute_config=config.compute_config, cloud=config.cloud, # type: ignore
|
117
117
|
)
|
118
118
|
|
119
119
|
project_id = self.client.get_project_id(
|
@@ -565,7 +565,7 @@ class PrivateWorkspaceSDK(WorkloadSDK):
|
|
565
565
|
)
|
566
566
|
|
567
567
|
def update(self, *, id: str, config: UpdateWorkspaceConfig) -> str: # noqa: A002
|
568
|
-
workspace = self.client.get_workspace(id=id)
|
568
|
+
workspace = self.client.get_workspace(id=id) # type: ignore
|
569
569
|
|
570
570
|
if not workspace:
|
571
571
|
raise ValueError(f"Workspace with id '{id}' was not found.")
|
@@ -581,7 +581,7 @@ class PrivateWorkspaceSDK(WorkloadSDK):
|
|
581
581
|
compute_config_id = None
|
582
582
|
if config.compute_config:
|
583
583
|
compute_config_id, _ = self.resolve_compute_config_and_cloud_id(
|
584
|
-
compute_config=config.compute_config, cloud=None,
|
584
|
+
compute_config=config.compute_config, cloud=None, # type: ignore
|
585
585
|
)
|
586
586
|
|
587
587
|
build_id = None
|
@@ -649,7 +649,7 @@ class PrivateWorkspaceSDK(WorkloadSDK):
|
|
649
649
|
) -> WorkspaceState:
|
650
650
|
return cast(
|
651
651
|
WorkspaceState,
|
652
|
-
self._BACKEND_SESSION_STATE_TO_WORKSPACE_STATE.get(
|
652
|
+
self._BACKEND_SESSION_STATE_TO_WORKSPACE_STATE.get( # type: ignore
|
653
653
|
state, WorkspaceState.UNKNOWN
|
654
654
|
),
|
655
655
|
)
|
anyscale/workspace/commands.py
CHANGED