anyscale 0.26.51__py3-none-any.whl → 0.26.53__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/README.md +1 -1
- anyscale/_private/anyscale_client/anyscale_client.py +178 -46
- anyscale/_private/anyscale_client/common.py +61 -2
- anyscale/_private/anyscale_client/fake_anyscale_client.py +145 -8
- anyscale/_private/docgen/__main__.py +42 -31
- anyscale/_private/docgen/generator.py +63 -28
- anyscale/_private/docgen/models.md +4 -2
- anyscale/_private/sdk/__init__.py +124 -1
- anyscale/_private/workload/workload_config.py +4 -6
- anyscale/_private/workload/workload_sdk.py +105 -12
- anyscale/client/README.md +13 -11
- anyscale/client/openapi_client/__init__.py +3 -3
- anyscale/client/openapi_client/api/default_api.py +512 -316
- anyscale/client/openapi_client/models/__init__.py +3 -3
- anyscale/client/openapi_client/models/aws_config.py +2 -2
- anyscale/client/openapi_client/models/baseimagesenum.py +158 -1
- anyscale/client/openapi_client/models/cloud_data_bucket_presigned_url_request.py +31 -3
- anyscale/client/openapi_client/models/cloud_deployment.py +37 -36
- anyscale/client/openapi_client/models/cloud_resource.py +59 -3
- anyscale/client/openapi_client/models/cloud_resource_gcp.py +59 -3
- anyscale/client/openapi_client/models/create_cloud_resource.py +59 -3
- anyscale/client/openapi_client/models/create_cloud_resource_gcp.py +59 -3
- anyscale/client/openapi_client/models/create_resource_notification.py +31 -3
- anyscale/client/openapi_client/models/{decorated_cloud_deployment.py → decorated_cloud_resource.py} +124 -96
- anyscale/client/openapi_client/models/{clouddeployment_list_response.py → decoratedcloudresource_list_response.py} +15 -15
- anyscale/client/openapi_client/models/{decoratedclouddeployment_response.py → decoratedcloudresource_response.py} +11 -11
- anyscale/client/openapi_client/models/file_storage.py +4 -4
- anyscale/client/openapi_client/models/gcp_config.py +2 -2
- anyscale/client/openapi_client/models/ha_job_error_types.py +9 -2
- anyscale/client/openapi_client/models/object_storage.py +4 -4
- anyscale/client/openapi_client/models/ray_runtime_env_config.py +57 -1
- anyscale/client/openapi_client/models/resource_alert_event_type.py +2 -1
- anyscale/client/openapi_client/models/resource_notification.py +29 -1
- anyscale/client/openapi_client/models/supportedbaseimagesenum.py +155 -1
- anyscale/client/openapi_client/models/workload_info.py +31 -3
- anyscale/client/openapi_client/models/workload_state_info.py +29 -1
- anyscale/cloud/models.py +40 -43
- anyscale/commands/cloud_commands.py +93 -88
- anyscale/commands/command_examples.py +37 -49
- anyscale/commands/exec_commands.py +12 -1
- anyscale/commands/list_commands.py +42 -12
- anyscale/commands/project_commands.py +399 -115
- anyscale/commands/schedule_commands.py +22 -11
- anyscale/commands/service_commands.py +11 -6
- anyscale/commands/util.py +94 -1
- anyscale/commands/workspace_commands.py +92 -38
- anyscale/compute_config/__init__.py +1 -1
- anyscale/compute_config/_private/compute_config_sdk.py +8 -11
- anyscale/compute_config/commands.py +3 -3
- anyscale/compute_config/models.py +30 -30
- anyscale/controllers/cloud_controller.py +361 -360
- anyscale/controllers/kubernetes_verifier.py +1 -1
- anyscale/job/_private/job_sdk.py +41 -23
- anyscale/job/models.py +1 -1
- anyscale/project/__init__.py +101 -1
- anyscale/project/_private/project_sdk.py +90 -2
- anyscale/project/commands.py +188 -1
- anyscale/project/models.py +198 -2
- anyscale/sdk/anyscale_client/models/baseimagesenum.py +158 -1
- anyscale/sdk/anyscale_client/models/ray_runtime_env_config.py +57 -1
- anyscale/sdk/anyscale_client/models/supportedbaseimagesenum.py +155 -1
- anyscale/service/_private/service_sdk.py +2 -1
- anyscale/shared_anyscale_utils/latest_ray_version.py +1 -1
- anyscale/util.py +3 -0
- anyscale/utils/runtime_env.py +3 -1
- anyscale/version.py +1 -1
- anyscale/workspace/commands.py +114 -23
- anyscale/workspace/models.py +3 -5
- {anyscale-0.26.51.dist-info → anyscale-0.26.53.dist-info}/METADATA +1 -1
- {anyscale-0.26.51.dist-info → anyscale-0.26.53.dist-info}/RECORD +75 -75
- {anyscale-0.26.51.dist-info → anyscale-0.26.53.dist-info}/WHEEL +0 -0
- {anyscale-0.26.51.dist-info → anyscale-0.26.53.dist-info}/entry_points.txt +0 -0
- {anyscale-0.26.51.dist-info → anyscale-0.26.53.dist-info}/licenses/LICENSE +0 -0
- {anyscale-0.26.51.dist-info → anyscale-0.26.53.dist-info}/licenses/NOTICE +0 -0
- {anyscale-0.26.51.dist-info → anyscale-0.26.53.dist-info}/top_level.txt +0 -0
@@ -9,7 +9,10 @@ import yaml
|
|
9
9
|
import anyscale
|
10
10
|
from anyscale.cli_logger import BlockLogger
|
11
11
|
from anyscale.commands import command_examples
|
12
|
-
from anyscale.commands.util import
|
12
|
+
from anyscale.commands.util import (
|
13
|
+
AnyscaleCommand,
|
14
|
+
DeprecatedAnyscaleCommand,
|
15
|
+
)
|
13
16
|
from anyscale.controllers.schedule_controller import ScheduleController
|
14
17
|
from anyscale.schedule.models import JobConfig, ScheduleConfig, ScheduleState
|
15
18
|
|
@@ -94,9 +97,11 @@ def apply(config_file: str, name: Optional[str],) -> None:
|
|
94
97
|
|
95
98
|
@schedule_cli.command(
|
96
99
|
name="create",
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
+
help="[DEPRECATED - use 'apply' instead] Create a schedule.",
|
101
|
+
cls=DeprecatedAnyscaleCommand,
|
102
|
+
removal_date="2025-10-01",
|
103
|
+
deprecation_message="`anyscale schedule create` has been deprecated",
|
104
|
+
alternative="use `anyscale schedule apply` instead",
|
100
105
|
)
|
101
106
|
@click.argument("schedule_config_file", required=True)
|
102
107
|
@click.option(
|
@@ -108,13 +113,15 @@ def apply(config_file: str, name: Optional[str],) -> None:
|
|
108
113
|
def create(
|
109
114
|
schedule_config_file: str, name: Optional[str], description: Optional[str],
|
110
115
|
) -> None:
|
111
|
-
"""
|
116
|
+
"""Create or Update a Schedule.
|
117
|
+
|
118
|
+
DEPRECATED: This command will be removed on 2025-10-01.
|
119
|
+
Use 'anyscale schedule apply' instead.
|
112
120
|
|
113
121
|
This function accepts 1 argument, a path to a YAML config file that defines this schedule.
|
114
122
|
|
115
123
|
Note: if a schedule with the name exists in the specified project, it will be updated instead.
|
116
124
|
"""
|
117
|
-
log.warning("DEPRECATED: Use `anyscale schedule apply` instead.")
|
118
125
|
job_controller = ScheduleController()
|
119
126
|
job_controller.apply(
|
120
127
|
schedule_config_file, name, description,
|
@@ -123,9 +130,11 @@ def create(
|
|
123
130
|
|
124
131
|
@schedule_cli.command(
|
125
132
|
name="update",
|
126
|
-
|
127
|
-
|
128
|
-
|
133
|
+
help="[DEPRECATED - use 'apply' instead] Update a schedule.",
|
134
|
+
cls=DeprecatedAnyscaleCommand,
|
135
|
+
removal_date="2025-10-01",
|
136
|
+
deprecation_message="`anyscale schedule update` has been deprecated",
|
137
|
+
alternative="use `anyscale schedule apply` instead",
|
129
138
|
)
|
130
139
|
@click.argument("schedule_config_file", required=True)
|
131
140
|
@click.option(
|
@@ -137,11 +146,13 @@ def create(
|
|
137
146
|
def update(
|
138
147
|
schedule_config_file: str, name: Optional[str], description: Optional[str],
|
139
148
|
) -> None:
|
140
|
-
"""
|
149
|
+
"""Create or Update a Schedule.
|
150
|
+
|
151
|
+
DEPRECATED: This command will be removed on 2025-10-01.
|
152
|
+
Use 'anyscale schedule apply' instead.
|
141
153
|
|
142
154
|
This function accepts 1 argument, a path to a YAML config file that defines this schedule.
|
143
155
|
"""
|
144
|
-
log.warning("DEPRECATED: Use `anyscale schedule apply` instead.")
|
145
156
|
job_controller = ScheduleController()
|
146
157
|
job_controller.apply(
|
147
158
|
schedule_config_file, name, description,
|
@@ -22,7 +22,7 @@ from anyscale.commands.list_util import (
|
|
22
22
|
from anyscale.commands.util import (
|
23
23
|
AnyscaleCommand,
|
24
24
|
convert_kv_strings_to_dict,
|
25
|
-
|
25
|
+
DeprecatedAnyscaleCommand,
|
26
26
|
override_env_vars,
|
27
27
|
)
|
28
28
|
from anyscale.controllers.service_controller import ServiceController
|
@@ -565,10 +565,11 @@ def controller_logs(
|
|
565
565
|
|
566
566
|
@service_cli.command(
|
567
567
|
name="rollout",
|
568
|
-
help="Roll out a service.",
|
569
|
-
cls=
|
570
|
-
|
571
|
-
|
568
|
+
help="[DEPRECATED - use 'deploy' instead] Roll out a service.",
|
569
|
+
cls=DeprecatedAnyscaleCommand,
|
570
|
+
removal_date="2025-10-01",
|
571
|
+
deprecation_message="`anyscale service rollout` has been deprecated",
|
572
|
+
alternative="use `anyscale service deploy` instead",
|
572
573
|
)
|
573
574
|
@click.option(
|
574
575
|
"-f",
|
@@ -626,7 +627,11 @@ def rollout( # noqa: PLR0913
|
|
626
627
|
in_place: bool,
|
627
628
|
no_auto_complete_rollout: bool,
|
628
629
|
):
|
629
|
-
"""Start or update a service rollout to a new version.
|
630
|
+
"""Start or update a service rollout to a new version.
|
631
|
+
|
632
|
+
DEPRECATED: This command will be removed on 2025-10-01.
|
633
|
+
Use 'anyscale service deploy' instead.
|
634
|
+
"""
|
630
635
|
if in_place:
|
631
636
|
if rollout_strategy is not None:
|
632
637
|
raise click.ClickException(
|
anyscale/commands/util.py
CHANGED
@@ -1,9 +1,16 @@
|
|
1
1
|
from copy import deepcopy
|
2
|
-
from
|
2
|
+
from datetime import date, datetime
|
3
|
+
import sys
|
4
|
+
from typing import Dict, Optional, Tuple, TypeVar
|
3
5
|
|
4
6
|
import click
|
7
|
+
import colorama
|
5
8
|
|
6
9
|
from anyscale._private.workload import WorkloadConfig
|
10
|
+
from anyscale.cli_logger import BlockLogger
|
11
|
+
|
12
|
+
|
13
|
+
logger = BlockLogger()
|
7
14
|
|
8
15
|
|
9
16
|
class AnyscaleCommand(click.Command):
|
@@ -151,3 +158,89 @@ def override_env_vars(config: T, overrides: Dict[str, str]) -> T:
|
|
151
158
|
final_env_vars = deepcopy(config.env_vars) if config.env_vars else {}
|
152
159
|
final_env_vars.update(overrides)
|
153
160
|
return config.options(env_vars=final_env_vars)
|
161
|
+
|
162
|
+
|
163
|
+
class DeprecatedAnyscaleCommand(click.Command):
|
164
|
+
"""
|
165
|
+
DeprecatedAnyscaleCommand is a subclass of click.Command that shows deprecation warnings.
|
166
|
+
|
167
|
+
Similar to LegacyAnyscaleCommand but focuses on deprecation with dates and alternatives.
|
168
|
+
"""
|
169
|
+
|
170
|
+
def __init__(self, *args, **kwargs):
|
171
|
+
self.__removal_date__ = kwargs.pop("removal_date", None)
|
172
|
+
self.__deprecation_message__ = kwargs.pop("deprecation_message", None)
|
173
|
+
self.__alternative__ = kwargs.pop("alternative", None)
|
174
|
+
super().__init__(*args, **kwargs)
|
175
|
+
|
176
|
+
def get_help(self, ctx):
|
177
|
+
"""Override get_help to show deprecation warning when help is displayed."""
|
178
|
+
self._show_deprecation_warning()
|
179
|
+
return super().get_help(ctx)
|
180
|
+
|
181
|
+
def invoke(self, ctx):
|
182
|
+
"""Override invoke to show deprecation warning before executing."""
|
183
|
+
self._show_deprecation_warning()
|
184
|
+
return super().invoke(ctx)
|
185
|
+
|
186
|
+
def _show_deprecation_warning(self):
|
187
|
+
"""Show the deprecation warning."""
|
188
|
+
|
189
|
+
# Visual separator for attention
|
190
|
+
print("\n" + "=" * 80, file=sys.stderr)
|
191
|
+
print(
|
192
|
+
f"{colorama.Style.BRIGHT}{colorama.Fore.YELLOW}⚠️ DEPRECATION WARNING ⚠️{colorama.Style.RESET_ALL}",
|
193
|
+
file=sys.stderr,
|
194
|
+
)
|
195
|
+
print("=" * 80, file=sys.stderr)
|
196
|
+
|
197
|
+
# Build deprecation message
|
198
|
+
base_msg = (
|
199
|
+
self.__deprecation_message__
|
200
|
+
if self.__deprecation_message__
|
201
|
+
else f"Command '{self.name}' is deprecated"
|
202
|
+
)
|
203
|
+
|
204
|
+
# Removal date information with grammar-aware connector
|
205
|
+
date_msg = None
|
206
|
+
if self.__removal_date__:
|
207
|
+
date_str = self._format_removal_date(self.__removal_date__)
|
208
|
+
if date_str:
|
209
|
+
ends_with_punct = base_msg.strip().endswith((".", "!", "?"))
|
210
|
+
if ends_with_punct:
|
211
|
+
date_msg = f"It will be removed on {date_str}"
|
212
|
+
else:
|
213
|
+
date_msg = f"and will be removed on {date_str}"
|
214
|
+
|
215
|
+
# Alternative suggestion
|
216
|
+
alternative_msg = None
|
217
|
+
if self.__alternative__:
|
218
|
+
alternative_msg = f"\n\n➡️ {colorama.Style.BRIGHT}Please {self.__alternative__}{colorama.Style.RESET_ALL}"
|
219
|
+
|
220
|
+
main_line_parts = [part for part in (base_msg, date_msg) if part]
|
221
|
+
deprecation_msg = " ".join(main_line_parts)
|
222
|
+
if alternative_msg:
|
223
|
+
deprecation_msg += alternative_msg
|
224
|
+
|
225
|
+
# Logger warning but also print directly for visibility
|
226
|
+
print(
|
227
|
+
f"\n{colorama.Fore.YELLOW}{deprecation_msg}{colorama.Style.RESET_ALL}",
|
228
|
+
file=sys.stderr,
|
229
|
+
)
|
230
|
+
print("=" * 80 + "\n", file=sys.stderr)
|
231
|
+
|
232
|
+
def _format_removal_date(self, removal_date) -> Optional[str]:
|
233
|
+
"""Format the removal date for display."""
|
234
|
+
try:
|
235
|
+
if isinstance(removal_date, str):
|
236
|
+
parsed_date = datetime.strptime(removal_date, "%Y-%m-%d").date()
|
237
|
+
elif isinstance(removal_date, datetime):
|
238
|
+
parsed_date = removal_date.date()
|
239
|
+
elif isinstance(removal_date, date):
|
240
|
+
parsed_date = removal_date
|
241
|
+
else:
|
242
|
+
return None
|
243
|
+
|
244
|
+
return parsed_date.strftime("%Y-%m-%d")
|
245
|
+
except (ValueError, AttributeError):
|
246
|
+
return str(removal_date)
|
@@ -11,8 +11,7 @@ from anyscale.cli_logger import BlockLogger
|
|
11
11
|
from anyscale.client.openapi_client.models.execute_interactive_command_options import (
|
12
12
|
ExecuteInteractiveCommandOptions,
|
13
13
|
)
|
14
|
-
from anyscale.commands import
|
15
|
-
from anyscale.commands.util import LegacyAnyscaleCommand
|
14
|
+
from anyscale.commands.util import DeprecatedAnyscaleCommand, LegacyAnyscaleCommand
|
16
15
|
from anyscale.controllers.cluster_controller import ClusterController
|
17
16
|
from anyscale.controllers.workspace_controller import WorkspaceController
|
18
17
|
from anyscale.project_utils import find_project_root
|
@@ -34,10 +33,11 @@ def workspace_cli() -> None:
|
|
34
33
|
|
35
34
|
@workspace_cli.command(
|
36
35
|
name="create",
|
37
|
-
help="Create a workspace on Anyscale.",
|
38
|
-
cls=
|
39
|
-
|
40
|
-
|
36
|
+
help="[DEPRECATED - use 'workspace_v2 create' instead] Create a workspace on Anyscale.",
|
37
|
+
cls=DeprecatedAnyscaleCommand,
|
38
|
+
removal_date="2025-10-01",
|
39
|
+
deprecation_message="The workspace v1 CLI is being replaced",
|
40
|
+
alternative="use 'anyscale workspace_v2 create' instead",
|
41
41
|
)
|
42
42
|
@click.option(
|
43
43
|
"--name", "-n", required=True, help="Name of the workspace to create.",
|
@@ -85,6 +85,11 @@ def create( # noqa: PLR0913
|
|
85
85
|
ray_version: str,
|
86
86
|
compute_config_id: str,
|
87
87
|
) -> None:
|
88
|
+
"""Create a workspace on Anyscale.
|
89
|
+
|
90
|
+
DEPRECATED: This command will be removed on 2025-10-01.
|
91
|
+
Use 'anyscale workspace_v2 create' instead.
|
92
|
+
"""
|
88
93
|
if cluster_env_build_id is None and docker is None:
|
89
94
|
raise click.ClickException(
|
90
95
|
"Please specify one of `--docker` or `--cluster-env-build-id`."
|
@@ -121,15 +126,21 @@ def create( # noqa: PLR0913
|
|
121
126
|
|
122
127
|
@workspace_cli.command(
|
123
128
|
name="start",
|
124
|
-
help="Start an existing workspace on Anyscale.",
|
125
|
-
cls=
|
126
|
-
|
127
|
-
|
129
|
+
help="[DEPRECATED - use 'workspace_v2 start' instead] Start an existing workspace on Anyscale.",
|
130
|
+
cls=DeprecatedAnyscaleCommand,
|
131
|
+
removal_date="2025-10-01",
|
132
|
+
deprecation_message="The workspace v1 CLI is being replaced",
|
133
|
+
alternative="use 'anyscale workspace_v2 start' instead",
|
128
134
|
)
|
129
135
|
@click.option(
|
130
136
|
"--name", "-n", required=True, help="Name of existing workspace to start.",
|
131
137
|
)
|
132
138
|
def start(name: str) -> None:
|
139
|
+
"""Start an existing workspace on Anyscale.
|
140
|
+
|
141
|
+
DEPRECATED: This command will be removed on 2025-10-01.
|
142
|
+
Use 'anyscale workspace_v2 start' instead.
|
143
|
+
"""
|
133
144
|
cluster_controller = ClusterController()
|
134
145
|
|
135
146
|
workspace = get_workspace_from_name(name)
|
@@ -154,15 +165,21 @@ def start(name: str) -> None:
|
|
154
165
|
|
155
166
|
@workspace_cli.command(
|
156
167
|
name="terminate",
|
157
|
-
help="Terminate a workspace on Anyscale.",
|
158
|
-
cls=
|
159
|
-
|
160
|
-
|
168
|
+
help="[DEPRECATED - use 'workspace_v2 terminate' instead] Terminate a workspace on Anyscale.",
|
169
|
+
cls=DeprecatedAnyscaleCommand,
|
170
|
+
removal_date="2025-10-01",
|
171
|
+
deprecation_message="The workspace v1 CLI is being replaced",
|
172
|
+
alternative="use 'anyscale workspace_v2 terminate' instead",
|
161
173
|
)
|
162
174
|
@click.option(
|
163
175
|
"--name", "-n", required=True, help="Name of existing workspace to terminate.",
|
164
176
|
)
|
165
177
|
def terminate(name: str) -> None:
|
178
|
+
"""Terminate a workspace on Anyscale.
|
179
|
+
|
180
|
+
DEPRECATED: This command will be removed on 2025-10-01.
|
181
|
+
Use 'anyscale workspace_v2 terminate' instead.
|
182
|
+
"""
|
166
183
|
cluster_controller = ClusterController()
|
167
184
|
workspace = get_workspace_from_name(name)
|
168
185
|
cluster_id = workspace.cluster_id
|
@@ -179,9 +196,11 @@ def terminate(name: str) -> None:
|
|
179
196
|
|
180
197
|
@workspace_cli.command(
|
181
198
|
name="clone",
|
182
|
-
help="Clone a workspace on Anyscale.",
|
183
|
-
cls=
|
184
|
-
|
199
|
+
help="[DEPRECATED - use workspace_v2 clone functionality instead] Clone a workspace on Anyscale.",
|
200
|
+
cls=DeprecatedAnyscaleCommand,
|
201
|
+
removal_date="2025-10-01",
|
202
|
+
deprecation_message="The workspace v1 CLI is being replaced",
|
203
|
+
alternative="use workspace_v2 clone functionality instead",
|
185
204
|
)
|
186
205
|
@click.option(
|
187
206
|
"--name", "-n", required=True, help="Name of existing workspace to clone.",
|
@@ -190,8 +209,10 @@ def terminate(name: str) -> None:
|
|
190
209
|
"--verbose", "-v", required=False, is_flag=True, default=False, help="Verbose mode"
|
191
210
|
)
|
192
211
|
def clone(name: str, verbose: bool) -> None:
|
193
|
-
"""
|
194
|
-
|
212
|
+
"""Clone the workspace to a local dir whose name is the name of the workspace.
|
213
|
+
|
214
|
+
DEPRECATED: This command will be removed on 2025-10-01.
|
215
|
+
Use workspace_v2 clone functionality instead.
|
195
216
|
"""
|
196
217
|
_check_local()
|
197
218
|
|
@@ -207,13 +228,24 @@ def clone(name: str, verbose: bool) -> None:
|
|
207
228
|
_do_pull(pull_git_state=True, verbose=verbose)
|
208
229
|
|
209
230
|
|
210
|
-
@workspace_cli.command(
|
231
|
+
@workspace_cli.command(
|
232
|
+
name="activate",
|
233
|
+
help="[DEPRECATED - no longer needed] Activate a workspace.",
|
234
|
+
cls=DeprecatedAnyscaleCommand,
|
235
|
+
removal_date="2025-10-01",
|
236
|
+
deprecation_message="The workspace v1 activate command is no longer needed",
|
237
|
+
alternative="use workspace_v2 commands which don't require activation",
|
238
|
+
)
|
211
239
|
@click.argument(
|
212
240
|
"name", required=True, default=None,
|
213
241
|
)
|
214
242
|
def activate(name: str) -> None:
|
215
243
|
"""Activate a workspace.
|
216
244
|
|
245
|
+
DEPRECATED: This command will be removed on 2025-10-01.
|
246
|
+
The workspace v1 activate command is no longer needed.
|
247
|
+
Use workspace_v2 commands which don't require activation.
|
248
|
+
|
217
249
|
If the current directory is already a part of a workspace, change the workspace.
|
218
250
|
Else, setup a new workspace rooted at the current directory
|
219
251
|
|
@@ -239,10 +271,11 @@ def activate(name: str) -> None:
|
|
239
271
|
|
240
272
|
@workspace_cli.command(
|
241
273
|
name="pull",
|
242
|
-
help="Pull files from a workspace on Anyscale.",
|
243
|
-
cls=
|
244
|
-
|
245
|
-
|
274
|
+
help="[DEPRECATED - use 'workspace_v2 pull' instead] Pull files from a workspace on Anyscale.",
|
275
|
+
cls=DeprecatedAnyscaleCommand,
|
276
|
+
removal_date="2025-10-01",
|
277
|
+
deprecation_message="The workspace v1 CLI is being replaced",
|
278
|
+
alternative="use 'anyscale workspace_v2 pull' instead",
|
246
279
|
)
|
247
280
|
@click.option(
|
248
281
|
"--pull-git-state",
|
@@ -252,6 +285,11 @@ def activate(name: str) -> None:
|
|
252
285
|
help="Also pull git state. This will add additional overhead.",
|
253
286
|
)
|
254
287
|
def pull(pull_git_state) -> None:
|
288
|
+
"""Pull files from a workspace on Anyscale.
|
289
|
+
|
290
|
+
DEPRECATED: This command will be removed on 2025-10-01.
|
291
|
+
Use 'anyscale workspace_v2 pull' instead.
|
292
|
+
"""
|
255
293
|
_check_local()
|
256
294
|
_check_workspace()
|
257
295
|
_do_pull(pull_git_state)
|
@@ -259,10 +297,11 @@ def pull(pull_git_state) -> None:
|
|
259
297
|
|
260
298
|
@workspace_cli.command(
|
261
299
|
name="push",
|
262
|
-
help="Push files to a workspace on Anyscale.",
|
263
|
-
cls=
|
264
|
-
|
265
|
-
|
300
|
+
help="[DEPRECATED - use 'workspace_v2 push' instead] Push files to a workspace on Anyscale.",
|
301
|
+
cls=DeprecatedAnyscaleCommand,
|
302
|
+
removal_date="2025-10-01",
|
303
|
+
deprecation_message="The workspace v1 CLI is being replaced",
|
304
|
+
alternative="use 'anyscale workspace_v2 push' instead",
|
266
305
|
)
|
267
306
|
@click.option(
|
268
307
|
"--push-git-state",
|
@@ -272,6 +311,11 @@ def pull(pull_git_state) -> None:
|
|
272
311
|
help="Also push git state. This is currently unoptimized and will be very slow.",
|
273
312
|
)
|
274
313
|
def push(push_git_state) -> None:
|
314
|
+
"""Push files to a workspace on Anyscale.
|
315
|
+
|
316
|
+
DEPRECATED: This command will be removed on 2025-10-01.
|
317
|
+
Use 'anyscale workspace_v2 push' instead.
|
318
|
+
"""
|
275
319
|
_check_local()
|
276
320
|
_check_workspace()
|
277
321
|
_do_push(push_git_state)
|
@@ -279,10 +323,11 @@ def push(push_git_state) -> None:
|
|
279
323
|
|
280
324
|
@workspace_cli.command(
|
281
325
|
name="run",
|
282
|
-
help="Run a command in a workspace, syncing files first if needed.",
|
283
|
-
cls=
|
284
|
-
|
285
|
-
|
326
|
+
help="[DEPRECATED - use 'workspace_v2 run_command' instead] Run a command in a workspace, syncing files first if needed.",
|
327
|
+
cls=DeprecatedAnyscaleCommand,
|
328
|
+
removal_date="2025-10-01",
|
329
|
+
deprecation_message="The workspace v1 CLI is being replaced",
|
330
|
+
alternative="use 'anyscale workspace_v2 run_command' instead",
|
286
331
|
)
|
287
332
|
@click.argument("command", required=True)
|
288
333
|
@click.option(
|
@@ -310,6 +355,11 @@ def push(push_git_state) -> None:
|
|
310
355
|
help="Whether to skip pushing files prior to running the command.",
|
311
356
|
)
|
312
357
|
def run(command: str, web_terminal: bool, as_job: bool, no_push: bool,) -> None:
|
358
|
+
"""Run a command in a workspace, syncing files first if needed.
|
359
|
+
|
360
|
+
DEPRECATED: This command will be removed on 2025-10-01.
|
361
|
+
Use 'anyscale workspace_v2 run_command' instead.
|
362
|
+
"""
|
313
363
|
_check_local()
|
314
364
|
_check_workspace()
|
315
365
|
if as_job:
|
@@ -337,17 +387,20 @@ def run(command: str, web_terminal: bool, as_job: bool, no_push: bool,) -> None:
|
|
337
387
|
|
338
388
|
@workspace_cli.command(
|
339
389
|
name="ssh",
|
340
|
-
help="ssh into a workspace, you can also pass args to the ssh command. E.g. 'anyscale workspace ssh -- -L 8888:localhost:8888",
|
341
|
-
cls=
|
342
|
-
|
343
|
-
|
390
|
+
help="[DEPRECATED - use 'workspace_v2 ssh' instead] ssh into a workspace, you can also pass args to the ssh command. E.g. 'anyscale workspace ssh -- -L 8888:localhost:8888",
|
391
|
+
cls=DeprecatedAnyscaleCommand,
|
392
|
+
removal_date="2025-10-01",
|
393
|
+
deprecation_message="The workspace v1 CLI is being replaced",
|
394
|
+
alternative="use 'anyscale workspace_v2 ssh' instead",
|
344
395
|
)
|
345
396
|
@click.argument(
|
346
397
|
"args", nargs=-1, required=False, type=click.UNPROCESSED,
|
347
398
|
)
|
348
399
|
def ssh(args: Tuple[str]) -> None:
|
349
|
-
"""
|
350
|
-
|
400
|
+
"""ssh into a running workspace.
|
401
|
+
|
402
|
+
DEPRECATED: This command will be removed on 2025-10-01.
|
403
|
+
Use 'anyscale workspace_v2 ssh' instead.
|
351
404
|
"""
|
352
405
|
_check_local()
|
353
406
|
|
@@ -364,6 +417,7 @@ def list_command() -> None:
|
|
364
417
|
workspace_controller.list()
|
365
418
|
|
366
419
|
|
420
|
+
# TODO(vigneshka): Migrate to v2 if there is usage, then deprecate
|
367
421
|
@workspace_cli.command(name="cp", cls=LegacyAnyscaleCommand, is_limited_support=True)
|
368
422
|
@click.argument(
|
369
423
|
"remote_path",
|
@@ -20,7 +20,7 @@ from anyscale.compute_config.models import (
|
|
20
20
|
ComputeConfigVersion,
|
21
21
|
HeadNodeConfig,
|
22
22
|
MarketType,
|
23
|
-
|
23
|
+
MultiResourceComputeConfig,
|
24
24
|
WorkerNodeGroupConfig,
|
25
25
|
)
|
26
26
|
from anyscale.sdk.anyscale_client.models import ClusterComputeConfig
|
@@ -148,7 +148,7 @@ class PrivateComputeConfigSDK(BaseSDK):
|
|
148
148
|
flags["max_resources"] = compute_config.max_resources
|
149
149
|
|
150
150
|
return CloudDeploymentComputeConfig(
|
151
|
-
cloud_deployment=compute_config.
|
151
|
+
cloud_deployment=compute_config.cloud_resource,
|
152
152
|
allowed_azs=compute_config.zones,
|
153
153
|
head_node_type=self._convert_head_node_config_to_api_model(
|
154
154
|
compute_config.head_node,
|
@@ -180,7 +180,7 @@ class PrivateComputeConfigSDK(BaseSDK):
|
|
180
180
|
"The latest version tag will be generated and returned."
|
181
181
|
)
|
182
182
|
|
183
|
-
if isinstance(compute_config,
|
183
|
+
if isinstance(compute_config, MultiResourceComputeConfig):
|
184
184
|
return self.create_multi_deployment_compute_config(
|
185
185
|
compute_config, name=name
|
186
186
|
)
|
@@ -226,10 +226,7 @@ class PrivateComputeConfigSDK(BaseSDK):
|
|
226
226
|
return full_name, compute_config_id
|
227
227
|
|
228
228
|
def create_multi_deployment_compute_config(
|
229
|
-
self,
|
230
|
-
compute_config: MultiDeploymentComputeConfig,
|
231
|
-
*,
|
232
|
-
name: Optional[str] = None,
|
229
|
+
self, compute_config: MultiResourceComputeConfig, *, name: Optional[str] = None,
|
233
230
|
) -> Tuple[str, str]:
|
234
231
|
"""Register the provided multi-deployment compute config and return its internal ID."""
|
235
232
|
# Returns the default cloud if user-provided cloud is not specified (`None`).
|
@@ -381,7 +378,7 @@ class PrivateComputeConfigSDK(BaseSDK):
|
|
381
378
|
|
382
379
|
return configs
|
383
380
|
|
384
|
-
def
|
381
|
+
def _convert_cloud_deployment_compute_config_api_model_to_single_resource_compute_config(
|
385
382
|
self, cloud_name: str, api_model: CloudDeploymentComputeConfig,
|
386
383
|
) -> ComputeConfig:
|
387
384
|
worker_nodes = None
|
@@ -416,7 +413,7 @@ class PrivateComputeConfigSDK(BaseSDK):
|
|
416
413
|
|
417
414
|
return ComputeConfig(
|
418
415
|
cloud=cloud_name,
|
419
|
-
|
416
|
+
cloud_resource=api_model.cloud_deployment,
|
420
417
|
zones=zones,
|
421
418
|
advanced_instance_config=api_model.advanced_configurations_json or None,
|
422
419
|
enable_cross_zone_scaling=enable_cross_zone_scaling,
|
@@ -443,7 +440,7 @@ class PrivateComputeConfigSDK(BaseSDK):
|
|
443
440
|
configs = None
|
444
441
|
if api_model_config.deployment_configs:
|
445
442
|
configs = [
|
446
|
-
self.
|
443
|
+
self._convert_cloud_deployment_compute_config_api_model_to_single_resource_compute_config(
|
447
444
|
cloud.name, config
|
448
445
|
)
|
449
446
|
for config in api_model_config.deployment_configs
|
@@ -458,7 +455,7 @@ class PrivateComputeConfigSDK(BaseSDK):
|
|
458
455
|
return ComputeConfigVersion(
|
459
456
|
name=f"{api_model.name}:{api_model.version}",
|
460
457
|
id=api_model.id,
|
461
|
-
config=
|
458
|
+
config=MultiResourceComputeConfig(cloud=cloud.name, configs=configs),
|
462
459
|
)
|
463
460
|
|
464
461
|
# If there are no deployment configs, this is a compute config for a single cloud deployment - parse the top-level fields.
|
@@ -34,10 +34,10 @@ single_deployment_compute_config = ComputeConfig(
|
|
34
34
|
)
|
35
35
|
full_name: str = anyscale.compute_config.create(single_deployment_compute_config, name="my-single-deployment-compute-config")
|
36
36
|
|
37
|
-
multi_deployment_compute_config =
|
37
|
+
multi_deployment_compute_config = MultiResourceComputeConfig(
|
38
38
|
configs=[
|
39
39
|
ComputeConfig(
|
40
|
-
|
40
|
+
cloud_resource="vm-aws-us-west-1",
|
41
41
|
head_node=HeadNodeConfig(
|
42
42
|
instance_type="m5.2xlarge",
|
43
43
|
),
|
@@ -50,7 +50,7 @@ multi_deployment_compute_config = MultiDeploymentComputeConfig(
|
|
50
50
|
],
|
51
51
|
),
|
52
52
|
ComputeConfig(
|
53
|
-
|
53
|
+
cloud_resource="vm-aws-us-west-2",
|
54
54
|
head_node=HeadNodeConfig(
|
55
55
|
instance_type="m5.2xlarge",
|
56
56
|
),
|