anyscale 0.26.46__py3-none-any.whl → 0.26.48__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 (73) hide show
  1. anyscale/__init__.py +0 -7
  2. anyscale/_private/anyscale_client/anyscale_client.py +1 -208
  3. anyscale/_private/anyscale_client/common.py +0 -55
  4. anyscale/_private/anyscale_client/fake_anyscale_client.py +19 -46
  5. anyscale/_private/docgen/__main__.py +24 -45
  6. anyscale/_private/docgen/generator.py +32 -16
  7. anyscale/_private/docgen/generator_legacy.py +58 -6
  8. anyscale/_private/docgen/models.md +3 -2
  9. anyscale/_private/workload/workload_config.py +16 -8
  10. anyscale/_private/workload/workload_sdk.py +22 -5
  11. anyscale/client/README.md +4 -1
  12. anyscale/client/openapi_client/__init__.py +2 -1
  13. anyscale/client/openapi_client/api/default_api.py +253 -4
  14. anyscale/client/openapi_client/models/__init__.py +2 -1
  15. anyscale/client/openapi_client/models/{alert_type.py → alert_issue_type.py} +8 -20
  16. anyscale/client/openapi_client/models/baseimagesenum.py +1 -2
  17. anyscale/client/openapi_client/models/cloud.py +31 -3
  18. anyscale/client/openapi_client/models/cloud_deployment.py +30 -3
  19. anyscale/client/openapi_client/models/cloud_with_cloud_resource.py +29 -1
  20. anyscale/client/openapi_client/models/cloud_with_cloud_resource_gcp.py +29 -1
  21. anyscale/client/openapi_client/models/dataset_metrics.py +6 -6
  22. anyscale/client/openapi_client/models/dataset_state.py +2 -1
  23. anyscale/client/openapi_client/models/describe_system_workload_response.py +32 -6
  24. anyscale/client/openapi_client/models/experimental_workspace.py +29 -1
  25. anyscale/client/openapi_client/models/experimental_workspaces_sort_field.py +2 -1
  26. anyscale/client/openapi_client/models/operator_metrics.py +8 -9
  27. anyscale/client/openapi_client/models/operator_status.py +102 -0
  28. anyscale/client/openapi_client/models/organization_usage_alert.py +20 -20
  29. anyscale/client/openapi_client/models/supportedbaseimagesenum.py +1 -2
  30. anyscale/cloud/models.py +330 -0
  31. anyscale/commands/cloud_commands.py +132 -43
  32. anyscale/commands/command_examples.py +54 -134
  33. anyscale/commands/compute_config_commands.py +7 -11
  34. anyscale/compute_config/__init__.py +2 -16
  35. anyscale/compute_config/_private/compute_config_sdk.py +27 -17
  36. anyscale/compute_config/commands.py +14 -44
  37. anyscale/compute_config/models.py +49 -26
  38. anyscale/controllers/cloud_controller.py +289 -171
  39. anyscale/controllers/cloud_file_storage_utils.py +204 -0
  40. anyscale/controllers/kubernetes_verifier.py +1567 -0
  41. anyscale/job/_private/job_sdk.py +17 -8
  42. anyscale/job/models.py +1 -1
  43. anyscale/scripts.py +0 -2
  44. anyscale/sdk/anyscale_client/models/baseimagesenum.py +1 -2
  45. anyscale/sdk/anyscale_client/models/cloud.py +31 -3
  46. anyscale/sdk/anyscale_client/models/supportedbaseimagesenum.py +1 -2
  47. anyscale/shared_anyscale_utils/utils/id_gen.py +1 -0
  48. anyscale/version.py +1 -1
  49. anyscale/workspace/models.py +14 -7
  50. {anyscale-0.26.46.dist-info → anyscale-0.26.48.dist-info}/METADATA +1 -1
  51. {anyscale-0.26.46.dist-info → anyscale-0.26.48.dist-info}/RECORD +56 -70
  52. anyscale/commands/llm/dataset_commands.py +0 -269
  53. anyscale/commands/llm/group.py +0 -15
  54. anyscale/commands/llm/models_commands.py +0 -123
  55. anyscale/controllers/llm/__init__.py +0 -0
  56. anyscale/controllers/llm/models_controller.py +0 -144
  57. anyscale/llm/__init__.py +0 -2
  58. anyscale/llm/dataset/__init__.py +0 -2
  59. anyscale/llm/dataset/_private/__init__.py +0 -0
  60. anyscale/llm/dataset/_private/docs.py +0 -63
  61. anyscale/llm/dataset/_private/models.py +0 -71
  62. anyscale/llm/dataset/_private/sdk.py +0 -147
  63. anyscale/llm/model/__init__.py +0 -2
  64. anyscale/llm/model/_private/models_sdk.py +0 -62
  65. anyscale/llm/model/commands.py +0 -93
  66. anyscale/llm/model/models.py +0 -171
  67. anyscale/llm/model/sdk.py +0 -62
  68. anyscale/llm/sdk.py +0 -27
  69. {anyscale-0.26.46.dist-info → anyscale-0.26.48.dist-info}/WHEEL +0 -0
  70. {anyscale-0.26.46.dist-info → anyscale-0.26.48.dist-info}/entry_points.txt +0 -0
  71. {anyscale-0.26.46.dist-info → anyscale-0.26.48.dist-info}/licenses/LICENSE +0 -0
  72. {anyscale-0.26.46.dist-info → anyscale-0.26.48.dist-info}/licenses/NOTICE +0 -0
  73. {anyscale-0.26.46.dist-info → anyscale-0.26.48.dist-info}/top_level.txt +0 -0
@@ -1,5 +1,5 @@
1
1
  import re
2
- from typing import List, Tuple
2
+ from typing import Dict, List, Tuple
3
3
 
4
4
 
5
5
  ANYSCALE_SDK_INTRO = """\
@@ -18,6 +18,57 @@ sdk = AnyscaleSDK()
18
18
  """
19
19
 
20
20
 
21
+ def _build_model_to_module_mapping() -> Dict[str, str]:
22
+ """Build mapping from model name (lowercase) to module filename.
23
+
24
+ This dynamically discovers the mapping from ALL_MODULES configuration,
25
+ eliminating the need for hardcoded constants.
26
+ """
27
+ # Import here to avoid circular imports
28
+ from anyscale._private.docgen.__main__ import ALL_MODULES
29
+
30
+ model_name_to_file = {}
31
+
32
+ for module in ALL_MODULES:
33
+ # Current models (Python types)
34
+ for model_type in module.models:
35
+ model_name_to_file[model_type.__name__.lower()] = module.filename
36
+
37
+ # Legacy models (strings)
38
+ if module.legacy_sdk_models:
39
+ for model_name in module.legacy_sdk_models:
40
+ model_name_to_file[model_name.lower()] = module.filename
41
+
42
+ return model_name_to_file
43
+
44
+
45
+ def _transform_legacy_links(text: str) -> str:
46
+ """Transform legacy model links to include proper cross-module references."""
47
+ # Build the mapping dynamically
48
+ model_mapping = _build_model_to_module_mapping()
49
+
50
+ def replace_link(match):
51
+ model_name = match.group(1)
52
+ if model_name in model_mapping:
53
+ module_file = model_mapping[model_name]
54
+ return f"({module_file}#{model_name}-legacy)"
55
+ else:
56
+ # Fallback for unmapped models (stay in same file)
57
+ return f"(#{model_name}-legacy)"
58
+
59
+ # Transform links from (#modelname) to proper cross-module references
60
+ text = re.sub(r"\(#([a-z]+)\)", replace_link, text)
61
+
62
+ # Transform workspace command references to point to workspaces.md
63
+ text = re.sub(
64
+ r"\(#anyscale-workspace_v2-([a-z]+)\)",
65
+ r"(workspaces.md#anyscale-workspace_v2-\1)",
66
+ text,
67
+ )
68
+
69
+ return text
70
+
71
+
21
72
  class LegacySDK:
22
73
  def __init__(self, name: str, docstring: str):
23
74
  self.name = name
@@ -35,9 +86,10 @@ class LegacySDK:
35
86
  if line.startswith("### "):
36
87
  name = line[4:]
37
88
  else:
38
- docstring += (
39
- re.sub("\\(./models.md#([a-z]+)\\)", "(#\\1-legacy)", line) + "\n"
40
- )
89
+ # First transform ./models.md links, then transform local links
90
+ line = re.sub(r"\(./models\.md#([a-z]+)\)", r"(#\1-legacy)", line)
91
+ line = _transform_legacy_links(line)
92
+ docstring += line + "\n"
41
93
 
42
94
  return cls(name=name, docstring=docstring.strip())
43
95
 
@@ -50,7 +102,7 @@ class LegacyModel:
50
102
  @classmethod
51
103
  def from_md(cls, md: str) -> "LegacyModel":
52
104
  """
53
- Convert a blob of markdown into a LegacySDK object.
105
+ Convert a blob of markdown into a LegacyModel object.
54
106
  """
55
107
  name = ""
56
108
  docstring = ""
@@ -59,7 +111,7 @@ class LegacyModel:
59
111
  if line.startswith("## "):
60
112
  name = line[3:]
61
113
  else:
62
- docstring += re.sub("\\(#([a-z]+)\\)", "(#\\1-legacy)", line) + "\n"
114
+ docstring += _transform_legacy_links(line) + "\n"
63
115
 
64
116
  return cls(name=name, docstring=docstring.strip())
65
117