anyscale 0.26.51__py3-none-any.whl → 0.26.52__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 (46) hide show
  1. anyscale/_private/anyscale_client/README.md +1 -1
  2. anyscale/_private/anyscale_client/anyscale_client.py +178 -46
  3. anyscale/_private/anyscale_client/common.py +61 -2
  4. anyscale/_private/anyscale_client/fake_anyscale_client.py +145 -8
  5. anyscale/_private/docgen/__main__.py +34 -23
  6. anyscale/_private/docgen/generator.py +15 -18
  7. anyscale/_private/docgen/models.md +4 -2
  8. anyscale/_private/workload/workload_sdk.py +103 -8
  9. anyscale/client/README.md +3 -0
  10. anyscale/client/openapi_client/__init__.py +1 -0
  11. anyscale/client/openapi_client/api/default_api.py +249 -0
  12. anyscale/client/openapi_client/models/__init__.py +1 -0
  13. anyscale/client/openapi_client/models/baseimagesenum.py +83 -1
  14. anyscale/client/openapi_client/models/cloud_resource.py +59 -3
  15. anyscale/client/openapi_client/models/cloud_resource_gcp.py +59 -3
  16. anyscale/client/openapi_client/models/clouddeployment_response.py +121 -0
  17. anyscale/client/openapi_client/models/create_cloud_resource.py +59 -3
  18. anyscale/client/openapi_client/models/create_cloud_resource_gcp.py +59 -3
  19. anyscale/client/openapi_client/models/object_storage.py +2 -2
  20. anyscale/client/openapi_client/models/ray_runtime_env_config.py +57 -1
  21. anyscale/client/openapi_client/models/supportedbaseimagesenum.py +80 -1
  22. anyscale/cloud/models.py +1 -1
  23. anyscale/commands/cloud_commands.py +73 -70
  24. anyscale/commands/command_examples.py +28 -40
  25. anyscale/commands/project_commands.py +377 -106
  26. anyscale/controllers/cloud_controller.py +81 -86
  27. anyscale/job/_private/job_sdk.py +38 -20
  28. anyscale/project/__init__.py +101 -1
  29. anyscale/project/_private/project_sdk.py +90 -2
  30. anyscale/project/commands.py +188 -1
  31. anyscale/project/models.py +198 -2
  32. anyscale/sdk/anyscale_client/models/baseimagesenum.py +83 -1
  33. anyscale/sdk/anyscale_client/models/ray_runtime_env_config.py +57 -1
  34. anyscale/sdk/anyscale_client/models/supportedbaseimagesenum.py +80 -1
  35. anyscale/service/_private/service_sdk.py +2 -1
  36. anyscale/shared_anyscale_utils/latest_ray_version.py +1 -1
  37. anyscale/util.py +3 -0
  38. anyscale/utils/runtime_env.py +3 -1
  39. anyscale/version.py +1 -1
  40. {anyscale-0.26.51.dist-info → anyscale-0.26.52.dist-info}/METADATA +1 -1
  41. {anyscale-0.26.51.dist-info → anyscale-0.26.52.dist-info}/RECORD +46 -45
  42. {anyscale-0.26.51.dist-info → anyscale-0.26.52.dist-info}/WHEEL +0 -0
  43. {anyscale-0.26.51.dist-info → anyscale-0.26.52.dist-info}/entry_points.txt +0 -0
  44. {anyscale-0.26.51.dist-info → anyscale-0.26.52.dist-info}/licenses/LICENSE +0 -0
  45. {anyscale-0.26.51.dist-info → anyscale-0.26.52.dist-info}/licenses/NOTICE +0 -0
  46. {anyscale-0.26.51.dist-info → anyscale-0.26.52.dist-info}/top_level.txt +0 -0
@@ -267,71 +267,10 @@ def cloud_config_group() -> None:
267
267
  type=str,
268
268
  required=True,
269
269
  )
270
- @click.option(
271
- "--file", "-f", help="YAML file containing the deployment spec.", required=True,
272
- )
273
- @click.option(
274
- "--skip-verification",
275
- is_flag=True,
276
- default=False,
277
- help="Skip cloud deployment verification.",
278
- )
279
- @click.option(
280
- "--yes", "-y", is_flag=True, default=False, help="Skip asking for confirmation."
281
- )
282
- def cloud_deployment_create(
283
- cloud: str, file: str, skip_verification: bool, yes: bool,
284
- ) -> None:
285
- try:
286
- CloudController().create_cloud_deployment(cloud, file, skip_verification, yes)
287
- except click.ClickException as e:
288
- print(e)
289
-
290
-
291
- @cloud_deployment_group.command(
292
- name="get",
293
- help="Get a cloud deployment for a cloud.",
294
- cls=AnyscaleCommand,
295
- example=command_examples.CLOUD_DEPLOYMENT_GET_EXAMPLE,
296
- is_alpha=True,
297
- )
298
- @click.option(
299
- "--cloud",
300
- help="The name of the cloud that the cloud deployment belongs to.",
301
- type=str,
302
- required=True,
303
- )
304
- @click.option(
305
- "--deployment",
306
- help="The name of the cloud deployment. If not provided, the primary cloud deployment will be returned.",
307
- type=str,
308
- required=False,
309
- )
310
- def cloud_deployment_get(cloud: str, deployment: Optional[str]) -> None:
311
- try:
312
- result = CloudController().get_cloud_deployment_dict_by_name(cloud, deployment)
313
- print(yaml.dump(result, sort_keys=False))
314
- except click.ClickException as e:
315
- print(e)
316
-
317
-
318
- @cloud_deployment_group.command(
319
- name="update",
320
- help="Update a cloud deployment in an existing cloud.",
321
- cls=AnyscaleCommand,
322
- example=command_examples.CLOUD_DEPLOYMENT_UPDATE_EXAMPLE,
323
- is_alpha=True,
324
- )
325
- @click.option(
326
- "--cloud",
327
- help="The name of the cloud that the cloud deployment belongs to.",
328
- type=str,
329
- required=True,
330
- )
331
270
  @click.option(
332
271
  "--file",
333
272
  "-f",
334
- help="Path to a YAML file defining the cloud deployment. Schema: https://docs.anyscale.com/reference/cloud-api#clouddeployment.", # TODO(janet): check link
273
+ help="Path to a YAML file defining the cloud deployment. Schema: https://docs.anyscale.com/reference/cloud/#clouddeployment.",
335
274
  required=True,
336
275
  )
337
276
  @click.option(
@@ -343,11 +282,11 @@ def cloud_deployment_get(cloud: str, deployment: Optional[str]) -> None:
343
282
  @click.option(
344
283
  "--yes", "-y", is_flag=True, default=False, help="Skip asking for confirmation."
345
284
  )
346
- def cloud_deployment_update(
347
- cloud: str, file: str, skip_verification: bool, yes: bool
285
+ def cloud_deployment_create(
286
+ cloud: str, file: str, skip_verification: bool, yes: bool,
348
287
  ) -> None:
349
288
  try:
350
- CloudController().update_cloud_deployment(cloud, file, skip_verification, yes)
289
+ CloudController().create_cloud_deployment(cloud, file, skip_verification, yes)
351
290
  except click.ClickException as e:
352
291
  print(e)
353
292
 
@@ -382,10 +321,7 @@ def cloud_deployment_delete(cloud: str, deployment: str, yes: bool,) -> None:
382
321
 
383
322
 
384
323
  @cloud_cli.command(
385
- name="update",
386
- help=(
387
- "Update a managed cloud to the latest configuration. Only applicable for anyscale managed clouds."
388
- ),
324
+ name="update", help=("Update a cloud."),
389
325
  )
390
326
  @click.argument("cloud-name", required=False)
391
327
  @click.option(
@@ -422,6 +358,18 @@ def cloud_deployment_delete(cloud: str, deployment: str, yes: bool,) -> None:
422
358
  "are manually granted permissions to access the cloud. No existing cloud permissions are altered by specifying this flag."
423
359
  ),
424
360
  )
361
+ @click.option(
362
+ "--resources-file",
363
+ "-f",
364
+ help="EXPERIMENTAL: Path to a YAML file defining a list of cloud resources. Schema: https://docs.anyscale.com/reference/cloud/#clouddeployment.",
365
+ required=False,
366
+ )
367
+ @click.option(
368
+ "--skip-verification",
369
+ is_flag=True,
370
+ default=False,
371
+ help="Skip cloud resource verification.",
372
+ )
425
373
  def cloud_update( # noqa: PLR0913
426
374
  cloud_name: Optional[str],
427
375
  name: Optional[str],
@@ -430,12 +378,23 @@ def cloud_update( # noqa: PLR0913
430
378
  enable_head_node_fault_tolerance: bool,
431
379
  yes: bool,
432
380
  enable_auto_add_user: Optional[bool],
381
+ resources_file: Optional[str],
382
+ skip_verification: bool,
433
383
  ) -> None:
434
384
  if cloud_name and name and cloud_name != name:
435
385
  raise click.ClickException(
436
386
  "The positional argument CLOUD_NAME and the keyword argument --name "
437
387
  "were both provided. Please only provide one of these two arguments."
438
388
  )
389
+ if resources_file:
390
+ CloudController().update_cloud_deployments(
391
+ cloud_name=cloud_name or name,
392
+ cloud_id=cloud_id,
393
+ resources_file=resources_file,
394
+ skip_verification=skip_verification,
395
+ yes=yes,
396
+ )
397
+ return
439
398
  if enable_head_node_fault_tolerance and (enable_auto_add_user is not None):
440
399
  raise click.ClickException(
441
400
  "Please only specify either --enable-head-node-fault-tolerance or "
@@ -740,7 +699,7 @@ def cloud_config_update(
740
699
  )
741
700
  @click.option(
742
701
  "--cloud-storage-bucket-name",
743
- help="A fully qualified storage bucket name for cloud storage, e.g. s3://bucket-name, gs://bucket-name, or azure://bucket-name.",
702
+ help="A fully qualified storage bucket name for cloud storage, e.g. s3://bucket-name, gs://bucket-name, or abfss://bucket-name@account.dfs.core.windows.net.",
744
703
  required=False,
745
704
  type=str,
746
705
  )
@@ -769,6 +728,18 @@ def cloud_config_update(
769
728
  required=False,
770
729
  type=str,
771
730
  )
731
+ @click.option(
732
+ "--persistent-volume-claim",
733
+ help="For Kubernetes deployments only, the name of the persistent volume claim used to mount shared storage into pods. Mutually exclusive with NFS configurations.",
734
+ required=False,
735
+ type=str,
736
+ )
737
+ @click.option(
738
+ "--csi-ephemeral-volume-driver",
739
+ help="For Kubernetes deployments only, the CSI ephemeral volume driver used to mount shared storage into pods. Mutually exclusive with NFS configurations.",
740
+ required=False,
741
+ type=str,
742
+ )
772
743
  @click.option(
773
744
  "--memorystore-instance-name",
774
745
  help="Memorystore instance name for GCP clouds",
@@ -854,6 +825,8 @@ def register_cloud( # noqa: PLR0913, PLR0912, C901
854
825
  cloud_storage_bucket_region: Optional[str],
855
826
  nfs_mount_target: List[str],
856
827
  nfs_mount_path: str,
828
+ persistent_volume_claim: Optional[str],
829
+ csi_ephemeral_volume_driver: Optional[str],
857
830
  memorystore_instance_name: str,
858
831
  host_project_id: Optional[str],
859
832
  kubernetes_zones: Optional[str],
@@ -865,6 +838,30 @@ def register_cloud( # noqa: PLR0913, PLR0912, C901
865
838
  enable_auto_add_user: bool,
866
839
  ) -> None:
867
840
  missing_args: List[str] = []
841
+
842
+ # Validate K8S-only storage flags
843
+ if (
844
+ persistent_volume_claim or csi_ephemeral_volume_driver
845
+ ) and compute_stack != ComputeStack.K8S:
846
+ raise click.ClickException(
847
+ "--persistent-volume-claim and --csi-ephemeral-volume-driver are only supported with --compute-stack=k8s"
848
+ )
849
+
850
+ # Validate mutual exclusivity of storage configurations
851
+ storage_configs = []
852
+ if nfs_mount_target or nfs_mount_path:
853
+ storage_configs.append("NFS")
854
+ if persistent_volume_claim:
855
+ storage_configs.append("persistent volume claim")
856
+ if csi_ephemeral_volume_driver:
857
+ storage_configs.append("CSI ephemeral volume driver")
858
+
859
+ if len(storage_configs) > 1:
860
+ raise click.ClickException(
861
+ f"Storage configurations are mutually exclusive. Found: {', '.join(storage_configs)}. "
862
+ "Please specify only one of: --nfs-mount-target/--nfs-mount-path, --persistent-volume-claim, or --csi-ephemeral-volume-driver"
863
+ )
864
+
868
865
  if provider == "aws":
869
866
  if s3_bucket_id and not cloud_storage_bucket_name:
870
867
  cloud_storage_bucket_name = s3_bucket_id
@@ -927,6 +924,8 @@ def register_cloud( # noqa: PLR0913, PLR0912, C901
927
924
  skip_verifications=skip_verifications,
928
925
  auto_add_user=enable_auto_add_user,
929
926
  external_id=external_id,
927
+ persistent_volume_claim=persistent_volume_claim,
928
+ csi_ephemeral_volume_driver=csi_ephemeral_volume_driver,
930
929
  )
931
930
  elif provider == "gcp":
932
931
  if filestore_instance_id and not file_storage_id:
@@ -1039,6 +1038,8 @@ def register_cloud( # noqa: PLR0913, PLR0912, C901
1039
1038
  yes=yes,
1040
1039
  skip_verifications=skip_verifications,
1041
1040
  auto_add_user=enable_auto_add_user,
1041
+ persistent_volume_claim=persistent_volume_claim,
1042
+ csi_ephemeral_volume_driver=csi_ephemeral_volume_driver,
1042
1043
  )
1043
1044
  elif provider in ("azure", "generic"):
1044
1045
  # For the 'generic' provider type, for the time being, most fields are optional; only 'name', 'provider', and 'compute-stack' are required.
@@ -1060,6 +1061,8 @@ def register_cloud( # noqa: PLR0913, PLR0912, C901
1060
1061
  cloud_storage_bucket_region=cloud_storage_bucket_region,
1061
1062
  nfs_mount_targets=list(nfs_mount_target) if nfs_mount_target else [],
1062
1063
  nfs_mount_path=nfs_mount_path,
1064
+ persistent_volume_claim=persistent_volume_claim,
1065
+ csi_ephemeral_volume_driver=csi_ephemeral_volume_driver,
1063
1066
  kubernetes_zones=kubernetes_zones.split(",") if kubernetes_zones else [],
1064
1067
  anyscale_operator_iam_identity=anyscale_operator_iam_identity,
1065
1068
  )
@@ -498,6 +498,7 @@ $ anyscale organization-invitation delete --email test@anyscale.com
498
498
  (anyscale +0.6s) Organization invitation for test@anyscale.com deleted.
499
499
  """
500
500
 
501
+
501
502
  PROJECT_ADD_COLLABORATORS_EXAMPLE = """\
502
503
  $ anyscale project add-collaborators --cloud cloud_name --project project_name --users-file collaborators.yaml
503
504
  (anyscale +1.3s) Successfully added 3 collaborators to project project_name.
@@ -511,6 +512,32 @@ collaborators:
511
512
  permission_level: "owner"
512
513
  """
513
514
 
515
+
516
+ PROJECT_GET_EXAMPLE = """\
517
+ $ anyscale project get --id my-project-id
518
+ """
519
+
520
+
521
+ PROJECT_LIST_EXAMPLE = """\
522
+ $ anyscale project list --include-defaults --non-interactive --max-items 2
523
+ """
524
+
525
+
526
+ PROJECT_CREATE_EXAMPLE = """\
527
+ $ anyscale project create --name "my-project" --cloud "my-cloud-id"
528
+ """
529
+
530
+
531
+ PROJECT_DELETE_EXAMPLE = """\
532
+ $ anyscale project delete --id project-id
533
+ """
534
+
535
+
536
+ PROJECT_GET_DEFAULT_EXAMPLE = """\
537
+ $ anyscale project get-default --cloud my-cloud-id --json
538
+ """
539
+
540
+
514
541
  CLOUD_ADD_COLLABORATORS_EXAMPLE = """\
515
542
  $ anyscale cloud add-collaborators --cloud cloud_name --users-file collaborators.yaml
516
543
  (anyscale +1.3s) Successfully added 2 collaborators to cloud cloud_name.
@@ -522,6 +549,7 @@ collaborators:
522
549
  permission_level: "readonly"
523
550
  """
524
551
 
552
+
525
553
  CLOUD_DEPLOYMENT_CREATE_EXAMPLE = """\
526
554
  $ anyscale cloud deployment create --cloud my-cloud --file new-cloud-deployment.yaml
527
555
  Successfully created cloud deployment my-new-deployment in cloud my-cloud.
@@ -547,46 +575,6 @@ aws_config:
547
575
  memorydb_cluster_name: my-memorydb-cluster
548
576
  """
549
577
 
550
- CLOUD_DEPLOYMENT_GET_EXAMPLE = """\
551
- $ anyscale cloud deployment get --cloud my-cloud --deployment my-deployment
552
- name: my-deployment
553
- provider: AWS
554
- compute_stack: VM
555
- region: us-west-2
556
- networking_mode: PUBLIC
557
- object_storage:
558
- bucket_name: s3://my-bucket
559
- file_storage:
560
- file_storage_id: fs-123
561
- aws_config:
562
- vpc_id: vpc-123
563
- subnet_ids:
564
- - subnet-123
565
- security_group_ids:
566
- - sg-123
567
- anyscale_iam_role_id: arn:aws:iam::123456789012:role/anyscale-role-123
568
- cluster_iam_role_id: arn:aws:iam::123456789012:role/cluster-role-123
569
- memorydb_cluster_name: my-memorydb-cluster
570
- """
571
-
572
-
573
- CLOUD_DEPLOYMENT_UPDATE_EXAMPLE = """\
574
- $ anyscale cloud deployment update --cloud my-cloud --file updated-cloud-deployment.yaml
575
- Output
576
- (anyscale +3.7s) Detected the following changes:
577
- --- +++ @@ -15,9 +15,9 @@ file_storage_id: fs-123
578
- -name: my-cloud-deployment
579
- +name: my-updated-cloud-deployment
580
- networking_mode: PUBLIC
581
- object_storage:
582
- - bucket_name: s3://my-bucket
583
- + bucket_name: s3://my-updated-bucket
584
- provider: AWS
585
- Would you like to proceed with updating this cloud deployment? [y/N]: y
586
- (anyscale +10.2s) Successfully updated cloud deployment my-updated-cloud-deployment in cloud my-cloud.
587
- """
588
-
589
-
590
578
  CLOUD_DEPLOYMENT_DELETE_EXAMPLE = """\
591
579
  $ anyscale cloud deployment delete --cloud my-cloud --deployment my-deployment
592
580
  Output