anyscale 0.26.66__py3-none-any.whl → 0.26.67__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/commands/cloud_commands.py +58 -0
- anyscale/commands/setup_k8s.py +1047 -0
- anyscale/controllers/cloud_controller.py +1 -0
- anyscale/controllers/kubernetes_verifier.py +8 -0
- anyscale/utils/cloudformation_utils.py +364 -0
- anyscale/version.py +1 -1
- {anyscale-0.26.66.dist-info → anyscale-0.26.67.dist-info}/METADATA +1 -1
- {anyscale-0.26.66.dist-info → anyscale-0.26.67.dist-info}/RECORD +13 -11
- {anyscale-0.26.66.dist-info → anyscale-0.26.67.dist-info}/WHEEL +0 -0
- {anyscale-0.26.66.dist-info → anyscale-0.26.67.dist-info}/entry_points.txt +0 -0
- {anyscale-0.26.66.dist-info → anyscale-0.26.67.dist-info}/licenses/LICENSE +0 -0
- {anyscale-0.26.66.dist-info → anyscale-0.26.67.dist-info}/licenses/NOTICE +0 -0
- {anyscale-0.26.66.dist-info → anyscale-0.26.67.dist-info}/top_level.txt +0 -0
@@ -23,6 +23,7 @@ from anyscale.client.openapi_client.models import (
|
|
23
23
|
from anyscale.client.openapi_client.models.compute_stack import ComputeStack
|
24
24
|
from anyscale.cloud.models import CreateCloudCollaborator, CreateCloudCollaborators
|
25
25
|
from anyscale.commands import command_examples
|
26
|
+
from anyscale.commands.setup_k8s import setup_kubernetes_cloud
|
26
27
|
from anyscale.commands.util import AnyscaleCommand, OptionPromptNull
|
27
28
|
from anyscale.controllers.cloud_controller import CloudController
|
28
29
|
from anyscale.util import (
|
@@ -127,6 +128,27 @@ def default_region(provider: str) -> str:
|
|
127
128
|
show_default=True,
|
128
129
|
)
|
129
130
|
@click.option("--name", "-n", help="Name of the cloud.", required=True, prompt="Name")
|
131
|
+
@click.option(
|
132
|
+
"--stack",
|
133
|
+
help="The compute stack to use (vm or k8s).",
|
134
|
+
required=False,
|
135
|
+
type=click.Choice(["vm", "k8s"], case_sensitive=False),
|
136
|
+
default="vm",
|
137
|
+
show_default=True,
|
138
|
+
)
|
139
|
+
@click.option(
|
140
|
+
"--cluster-name",
|
141
|
+
help="Kubernetes cluster name (required for k8s stack).",
|
142
|
+
required=False,
|
143
|
+
type=str,
|
144
|
+
)
|
145
|
+
@click.option(
|
146
|
+
"--namespace",
|
147
|
+
help="Kubernetes namespace for Anyscale operator (for k8s stack).",
|
148
|
+
required=False,
|
149
|
+
type=str,
|
150
|
+
default="anyscale-operator",
|
151
|
+
)
|
130
152
|
@click.option(
|
131
153
|
"--project-id",
|
132
154
|
help="Globally Unique project ID for GCP clouds (e.g., my-project-abc123)",
|
@@ -173,10 +195,22 @@ def default_region(provider: str) -> str:
|
|
173
195
|
show_default=True,
|
174
196
|
help="The type of shared storage to use for the cloud. Use 'object-storage' for cloud bucket-based storage (e.g., S3, GCS), or 'nfs' for network file systems.",
|
175
197
|
)
|
198
|
+
@click.option(
|
199
|
+
"--values-file",
|
200
|
+
help="Path to save the generated Helm values file (for k8s stack, default: auto-generated with timestamp).",
|
201
|
+
required=False,
|
202
|
+
type=str,
|
203
|
+
)
|
204
|
+
@click.option(
|
205
|
+
"--debug", is_flag=True, default=False, help="Enable debug logging.",
|
206
|
+
)
|
176
207
|
def setup_cloud( # noqa: PLR0913
|
177
208
|
provider: str,
|
178
209
|
region: str,
|
179
210
|
name: str,
|
211
|
+
stack: str,
|
212
|
+
cluster_name: Optional[str],
|
213
|
+
namespace: str,
|
180
214
|
project_id: str,
|
181
215
|
functional_verify: Optional[str],
|
182
216
|
anyscale_managed: bool, # noqa: ARG001
|
@@ -184,9 +218,33 @@ def setup_cloud( # noqa: PLR0913
|
|
184
218
|
yes: bool,
|
185
219
|
disable_auto_add_user: bool,
|
186
220
|
shared_storage: str,
|
221
|
+
values_file: Optional[str],
|
222
|
+
debug: bool,
|
187
223
|
) -> None:
|
188
224
|
# TODO (congding): remove `anyscale_managed` in the future, now keeping it for compatibility
|
189
225
|
|
226
|
+
# Handle Kubernetes stack
|
227
|
+
if stack == "k8s":
|
228
|
+
if not cluster_name:
|
229
|
+
raise click.ClickException(
|
230
|
+
"--cluster-name is required when using --stack=k8s"
|
231
|
+
)
|
232
|
+
|
233
|
+
setup_kubernetes_cloud(
|
234
|
+
provider=provider,
|
235
|
+
region=region,
|
236
|
+
name=name,
|
237
|
+
cluster_name=cluster_name,
|
238
|
+
namespace=namespace,
|
239
|
+
project_id=project_id,
|
240
|
+
functional_verify=bool(functional_verify),
|
241
|
+
yes=yes,
|
242
|
+
values_file=values_file,
|
243
|
+
debug=debug,
|
244
|
+
)
|
245
|
+
return
|
246
|
+
|
247
|
+
# Handle VM stack
|
190
248
|
# Convert string to enum for type safety
|
191
249
|
shared_storage_type = SharedStorageType(shared_storage)
|
192
250
|
if provider == "aws":
|