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.
Files changed (75) 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 +42 -31
  6. anyscale/_private/docgen/generator.py +63 -28
  7. anyscale/_private/docgen/models.md +4 -2
  8. anyscale/_private/sdk/__init__.py +124 -1
  9. anyscale/_private/workload/workload_config.py +4 -6
  10. anyscale/_private/workload/workload_sdk.py +105 -12
  11. anyscale/client/README.md +13 -11
  12. anyscale/client/openapi_client/__init__.py +3 -3
  13. anyscale/client/openapi_client/api/default_api.py +512 -316
  14. anyscale/client/openapi_client/models/__init__.py +3 -3
  15. anyscale/client/openapi_client/models/aws_config.py +2 -2
  16. anyscale/client/openapi_client/models/baseimagesenum.py +158 -1
  17. anyscale/client/openapi_client/models/cloud_data_bucket_presigned_url_request.py +31 -3
  18. anyscale/client/openapi_client/models/cloud_deployment.py +37 -36
  19. anyscale/client/openapi_client/models/cloud_resource.py +59 -3
  20. anyscale/client/openapi_client/models/cloud_resource_gcp.py +59 -3
  21. anyscale/client/openapi_client/models/create_cloud_resource.py +59 -3
  22. anyscale/client/openapi_client/models/create_cloud_resource_gcp.py +59 -3
  23. anyscale/client/openapi_client/models/create_resource_notification.py +31 -3
  24. anyscale/client/openapi_client/models/{decorated_cloud_deployment.py → decorated_cloud_resource.py} +124 -96
  25. anyscale/client/openapi_client/models/{clouddeployment_list_response.py → decoratedcloudresource_list_response.py} +15 -15
  26. anyscale/client/openapi_client/models/{decoratedclouddeployment_response.py → decoratedcloudresource_response.py} +11 -11
  27. anyscale/client/openapi_client/models/file_storage.py +4 -4
  28. anyscale/client/openapi_client/models/gcp_config.py +2 -2
  29. anyscale/client/openapi_client/models/ha_job_error_types.py +9 -2
  30. anyscale/client/openapi_client/models/object_storage.py +4 -4
  31. anyscale/client/openapi_client/models/ray_runtime_env_config.py +57 -1
  32. anyscale/client/openapi_client/models/resource_alert_event_type.py +2 -1
  33. anyscale/client/openapi_client/models/resource_notification.py +29 -1
  34. anyscale/client/openapi_client/models/supportedbaseimagesenum.py +155 -1
  35. anyscale/client/openapi_client/models/workload_info.py +31 -3
  36. anyscale/client/openapi_client/models/workload_state_info.py +29 -1
  37. anyscale/cloud/models.py +40 -43
  38. anyscale/commands/cloud_commands.py +93 -88
  39. anyscale/commands/command_examples.py +37 -49
  40. anyscale/commands/exec_commands.py +12 -1
  41. anyscale/commands/list_commands.py +42 -12
  42. anyscale/commands/project_commands.py +399 -115
  43. anyscale/commands/schedule_commands.py +22 -11
  44. anyscale/commands/service_commands.py +11 -6
  45. anyscale/commands/util.py +94 -1
  46. anyscale/commands/workspace_commands.py +92 -38
  47. anyscale/compute_config/__init__.py +1 -1
  48. anyscale/compute_config/_private/compute_config_sdk.py +8 -11
  49. anyscale/compute_config/commands.py +3 -3
  50. anyscale/compute_config/models.py +30 -30
  51. anyscale/controllers/cloud_controller.py +361 -360
  52. anyscale/controllers/kubernetes_verifier.py +1 -1
  53. anyscale/job/_private/job_sdk.py +41 -23
  54. anyscale/job/models.py +1 -1
  55. anyscale/project/__init__.py +101 -1
  56. anyscale/project/_private/project_sdk.py +90 -2
  57. anyscale/project/commands.py +188 -1
  58. anyscale/project/models.py +198 -2
  59. anyscale/sdk/anyscale_client/models/baseimagesenum.py +158 -1
  60. anyscale/sdk/anyscale_client/models/ray_runtime_env_config.py +57 -1
  61. anyscale/sdk/anyscale_client/models/supportedbaseimagesenum.py +155 -1
  62. anyscale/service/_private/service_sdk.py +2 -1
  63. anyscale/shared_anyscale_utils/latest_ray_version.py +1 -1
  64. anyscale/util.py +3 -0
  65. anyscale/utils/runtime_env.py +3 -1
  66. anyscale/version.py +1 -1
  67. anyscale/workspace/commands.py +114 -23
  68. anyscale/workspace/models.py +3 -5
  69. {anyscale-0.26.51.dist-info → anyscale-0.26.53.dist-info}/METADATA +1 -1
  70. {anyscale-0.26.51.dist-info → anyscale-0.26.53.dist-info}/RECORD +75 -75
  71. {anyscale-0.26.51.dist-info → anyscale-0.26.53.dist-info}/WHEEL +0 -0
  72. {anyscale-0.26.51.dist-info → anyscale-0.26.53.dist-info}/entry_points.txt +0 -0
  73. {anyscale-0.26.51.dist-info → anyscale-0.26.53.dist-info}/licenses/LICENSE +0 -0
  74. {anyscale-0.26.51.dist-info → anyscale-0.26.53.dist-info}/licenses/NOTICE +0 -0
  75. {anyscale-0.26.51.dist-info → anyscale-0.26.53.dist-info}/top_level.txt +0 -0
@@ -13,9 +13,9 @@ from anyscale.aggregated_instance_usage.models import DownloadCSVFilters
13
13
  from anyscale.cloud.models import (
14
14
  AWSConfig,
15
15
  Cloud,
16
- CloudDeployment,
17
16
  CloudPermissionLevel,
18
17
  CloudProvider,
18
+ CloudResource,
19
19
  ComputeStack,
20
20
  CreateCloudCollaborator,
21
21
  FileStorage,
@@ -53,7 +53,7 @@ from anyscale.compute_config.models import (
53
53
  ComputeConfigVersion,
54
54
  HeadNodeConfig,
55
55
  MarketType,
56
- MultiDeploymentComputeConfig,
56
+ MultiResourceComputeConfig,
57
57
  WorkerNodeGroupConfig,
58
58
  )
59
59
  from anyscale.image.models import ImageBuild, ImageBuildStatus
@@ -69,7 +69,13 @@ from anyscale.job.models import (
69
69
  JobStatus,
70
70
  )
71
71
  from anyscale.organization_invitation.models import OrganizationInvitation
72
- from anyscale.project.models import CreateProjectCollaborator, ProjectPermissionLevel
72
+ from anyscale.project.models import (
73
+ CreateProjectCollaborator,
74
+ Project,
75
+ ProjectPermissionLevel,
76
+ ProjectSortField,
77
+ ProjectSortOrder,
78
+ )
73
79
  from anyscale.resource_quota.models import CreateResourceQuota, Quota, ResourceQuota
74
80
  from anyscale.schedule.models import ScheduleConfig, ScheduleState, ScheduleStatus
75
81
  from anyscale.service.models import (
@@ -110,25 +116,33 @@ ALL_MODULES = [
110
116
  title="Project",
111
117
  filename="project-api.md",
112
118
  cli_prefix="anyscale project",
113
- cli_commands=[project_commands.add_collaborators,],
119
+ cli_commands=[
120
+ project_commands.get,
121
+ project_commands.list,
122
+ project_commands.create,
123
+ project_commands.delete,
124
+ project_commands.get_default,
125
+ project_commands.add_collaborators,
126
+ ],
114
127
  sdk_prefix="anyscale.project",
115
- sdk_commands=[anyscale.project.add_collaborators,],
116
- models=[ProjectPermissionLevel, CreateProjectCollaborator],
117
- legacy_cli_commands=[project_commands.create, project_commands.list,],
118
- legacy_sdk_commands={
119
- "create_project": None,
120
- "delete_project": None,
121
- "get_default_project": None,
122
- "get_project": None,
123
- "search_projects": None,
124
- },
125
- legacy_sdk_models=[
126
- "CreateProject",
127
- "Project",
128
- "ProjectListResponse",
129
- "ProjectResponse",
130
- "ProjectsQuery",
128
+ sdk_commands=[
129
+ anyscale.project.get,
130
+ anyscale.project.list,
131
+ anyscale.project.create,
132
+ anyscale.project.delete,
133
+ anyscale.project.get_default,
134
+ anyscale.project.add_collaborators,
131
135
  ],
136
+ models=[
137
+ Project,
138
+ ProjectSortField,
139
+ ProjectSortOrder,
140
+ CreateProjectCollaborator,
141
+ ProjectPermissionLevel,
142
+ ],
143
+ legacy_cli_commands=[],
144
+ legacy_sdk_commands={},
145
+ legacy_sdk_models=[],
132
146
  ),
133
147
  Module(
134
148
  title="Job",
@@ -316,12 +330,11 @@ ALL_MODULES = [
316
330
  ],
317
331
  models=[
318
332
  ComputeConfig,
319
- MultiDeploymentComputeConfig,
333
+ MultiResourceComputeConfig,
320
334
  HeadNodeConfig,
321
335
  WorkerNodeGroupConfig,
322
336
  MarketType,
323
337
  CloudDeploymentSelector,
324
- MultiDeploymentComputeConfig,
325
338
  ComputeConfigVersion,
326
339
  ],
327
340
  legacy_sdk_commands={
@@ -435,10 +448,9 @@ ALL_MODULES = [
435
448
  cloud_commands.cloud_delete,
436
449
  cloud_commands.cloud_verify,
437
450
  cloud_commands.list_cloud,
438
- cloud_commands.cloud_deployment_create,
439
- cloud_commands.cloud_deployment_get,
440
- cloud_commands.cloud_deployment_update,
441
- cloud_commands.cloud_deployment_delete,
451
+ cloud_commands.cloud_resource_create,
452
+ cloud_commands.cloud_resource_delete,
453
+ cloud_commands.cloud_config_get,
442
454
  cloud_commands.cloud_config_update,
443
455
  cloud_commands.cloud_set_default,
444
456
  cloud_commands.add_collaborators,
@@ -457,7 +469,7 @@ ALL_MODULES = [
457
469
  Cloud,
458
470
  CloudPermissionLevel,
459
471
  CreateCloudCollaborator,
460
- CloudDeployment,
472
+ CloudResource,
461
473
  ComputeStack,
462
474
  CloudProvider,
463
475
  NetworkingMode,
@@ -469,10 +481,9 @@ ALL_MODULES = [
469
481
  KubernetesConfig,
470
482
  ],
471
483
  cli_command_group_prefix={
472
- cloud_commands.cloud_deployment_create: "deployment",
473
- cloud_commands.cloud_deployment_get: "deployment",
474
- cloud_commands.cloud_deployment_update: "deployment",
475
- cloud_commands.cloud_deployment_delete: "deployment",
484
+ cloud_commands.cloud_resource_create: "resource",
485
+ cloud_commands.cloud_resource_delete: "resource",
486
+ cloud_commands.cloud_config_get: "config",
476
487
  cloud_commands.cloud_config_update: "config",
477
488
  },
478
489
  legacy_sdk_commands={
@@ -15,8 +15,16 @@ from anyscale._private.docgen.generator_legacy import (
15
15
  LegacySDK,
16
16
  parse_legacy_sdks,
17
17
  )
18
- from anyscale._private.models.model_base import ModelBaseType, ModelEnumType
19
- from anyscale.commands.util import AnyscaleCommand, LegacyAnyscaleCommand
18
+ from anyscale._private.models.model_base import (
19
+ ModelBaseType,
20
+ ModelEnumType,
21
+ ResultIterator,
22
+ )
23
+ from anyscale.commands.util import (
24
+ AnyscaleCommand,
25
+ DeprecatedAnyscaleCommand,
26
+ LegacyAnyscaleCommand,
27
+ )
20
28
 
21
29
 
22
30
  ModelType = Union[ModelBaseType, ModelEnumType]
@@ -48,7 +56,7 @@ CUSTOMER_HOSTED_QUALIFIER = (
48
56
 
49
57
  def _escape_mdx_content(text: str) -> str:
50
58
  """Escape content for MDX compatibility.
51
-
59
+
52
60
  This function escapes angle brackets that could be interpreted as HTML tags
53
61
  by MDX, converting them to escaped versions.
54
62
  """
@@ -226,26 +234,19 @@ class MarkdownGenerator:
226
234
  if origin is Union:
227
235
  return " | ".join(self._model_type_to_string(arg) for arg in args)
228
236
 
229
- if origin is dict:
230
- arg_str = ", ".join([self._model_type_to_string(arg) for arg in args])
231
- if args:
232
- return f"Dict[{arg_str}]"
233
- else:
234
- return "Dict"
235
-
236
- if origin is list:
237
- arg_str = ", ".join([self._model_type_to_string(arg) for arg in args])
238
- if arg_str:
239
- return f"List[{arg_str}]"
240
- else:
241
- return "List"
237
+ origin_name_map = {
238
+ dict: "Dict",
239
+ list: "List",
240
+ tuple: "Tuple",
241
+ ResultIterator: "ResultIterator",
242
+ }
242
243
 
243
- if origin is tuple:
244
+ if origin in origin_name_map:
244
245
  arg_str = ", ".join([self._model_type_to_string(arg) for arg in args])
245
246
  if arg_str:
246
- return f"Tuple[{arg_str}]"
247
+ return f"{origin_name_map[origin]}[{arg_str}]"
247
248
  else:
248
- return "Tuple"
249
+ return origin_name_map[origin]
249
250
 
250
251
  raise NotImplementedError(f"Unhandled type: {t}")
251
252
 
@@ -304,13 +305,20 @@ class MarkdownGenerator:
304
305
  raise ValueError(
305
306
  f"Config model '{t.__name__}' is missing a '__doc_yaml_example__'."
306
307
  )
307
- if isinstance(t, AnyscaleCommand) and not cli_example:
308
+ if (
309
+ isinstance(
310
+ t, (AnyscaleCommand, DeprecatedAnyscaleCommand, LegacyAnyscaleCommand)
311
+ )
312
+ and not cli_example
313
+ ):
308
314
  raise ValueError(
309
315
  f"CLI command '{t.name}' is missing a '__doc_cli_example__'."
310
316
  )
311
317
  if (
312
318
  not isinstance(t, ModelBaseType)
313
- and not isinstance(t, AnyscaleCommand)
319
+ and not isinstance(
320
+ t, (AnyscaleCommand, DeprecatedAnyscaleCommand, LegacyAnyscaleCommand)
321
+ )
314
322
  and not py_example
315
323
  ):
316
324
  raise ValueError(
@@ -324,8 +332,10 @@ class MarkdownGenerator:
324
332
  try:
325
333
  yaml.safe_load(yaml_example)
326
334
  except Exception as e: # noqa: BLE001
335
+ # For CLI commands, use t.name; for SDK functions/models, use t.__name__
336
+ name = getattr(t, "name", getattr(t, "__name__", str(t)))
327
337
  raise ValueError(
328
- f"'{t.__name__}.__doc_yaml_example__' is not valid YAML syntax"
338
+ f"'{name}.__doc_yaml_example__' is not valid YAML syntax"
329
339
  ) from e
330
340
 
331
341
  yaml_example = yaml_example.strip("\n")
@@ -337,8 +347,10 @@ class MarkdownGenerator:
337
347
  try:
338
348
  ast.parse(py_example)
339
349
  except Exception as e: # noqa: BLE001
350
+ # For CLI commands, use t.name; for SDK functions/models, use t.__name__
351
+ name = getattr(t, "name", getattr(t, "__name__", str(t)))
340
352
  raise ValueError(
341
- f"'{t.__name__}.__doc_py_example__' is not valid Python syntax"
353
+ f"'{name}.__doc_py_example__' is not valid Python syntax"
342
354
  ) from e
343
355
 
344
356
  py_example = py_example.strip("\n")
@@ -416,7 +428,7 @@ class MarkdownGenerator:
416
428
 
417
429
  return md
418
430
 
419
- def _gen_markdown_for_cli_command(
431
+ def _gen_markdown_for_cli_command( # noqa: PLR0912
420
432
  self, c: click.Command, *, cli_prefix: str
421
433
  ) -> str:
422
434
  """Generate a markdown section for a CLI command.
@@ -441,9 +453,31 @@ class MarkdownGenerator:
441
453
  else:
442
454
  new_c = c.get_new_cli()
443
455
  new_cli_prefix = c.get_new_prefix()
444
- md += ":::warning\n"
445
- md += f"This command is deprecated. Upgrade to [{new_cli_prefix} {new_c.name}]({self._get_cli_anchor(new_c, new_cli_prefix)}). \n"
446
- md += ":::\n"
456
+ if new_c and new_cli_prefix:
457
+ md += ":::warning\n"
458
+ md += f"This command is deprecated. Upgrade to [{new_cli_prefix} {new_c.name}]({self._get_cli_anchor(new_c, new_cli_prefix)}). \n"
459
+ md += ":::\n"
460
+ elif isinstance(c, DeprecatedAnyscaleCommand):
461
+ md = f'### `{cli_prefix} {c.name}` <span class="label-h3 label-deprecated">Deprecated</span>\n'
462
+ md += ":::warning[Deprecated]\n"
463
+ # Build deprecation message similar to the command itself
464
+ parts = []
465
+ if hasattr(c, "__deprecation_message__") and c.__deprecation_message__:
466
+ parts.append(c.__deprecation_message__)
467
+ else:
468
+ parts.append(f"Command '{c.name}' is deprecated")
469
+
470
+ if hasattr(c, "__removal_date__") and c.__removal_date__:
471
+ date_str = c._format_removal_date(c.__removal_date__) # noqa: SLF001
472
+ if date_str:
473
+ parts.append(f"and will be removed on {date_str}")
474
+
475
+ if hasattr(c, "__alternative__") and c.__alternative__:
476
+ parts.append(f"Please {c.__alternative__}")
477
+
478
+ deprecation_msg = ". ".join(parts) + "."
479
+ md += deprecation_msg + "\n"
480
+ md += ":::\n"
447
481
  elif isinstance(c, AnyscaleCommand) and c.is_alpha:
448
482
  md = f'### `{cli_prefix} {c.name}` <span class="label-h3 label-alpha">Alpha</span>\n'
449
483
  md += ":::warning\n"
@@ -481,7 +515,8 @@ class MarkdownGenerator:
481
515
  md += "\n"
482
516
 
483
517
  should_have_example = not (
484
- isinstance(c, LegacyAnyscaleCommand) or cli_prefix in CLI_NO_EXAMPLES
518
+ isinstance(c, (LegacyAnyscaleCommand, DeprecatedAnyscaleCommand))
519
+ or cli_prefix in CLI_NO_EXAMPLES
485
520
  )
486
521
  has_cli_example = hasattr(c, "__doc_cli_example__")
487
522
  if should_have_example or has_cli_example: