anyscale 0.26.47__py3-none-any.whl → 0.26.49__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/__init__.py +0 -7
- anyscale/_private/anyscale_client/README.md +115 -0
- anyscale/_private/anyscale_client/anyscale_client.py +12 -213
- anyscale/_private/anyscale_client/common.py +0 -55
- anyscale/_private/anyscale_client/fake_anyscale_client.py +19 -46
- anyscale/_private/docgen/__main__.py +32 -47
- anyscale/_private/docgen/generator.py +32 -16
- anyscale/_private/docgen/generator_legacy.py +58 -6
- anyscale/_private/docgen/models.md +3 -2
- anyscale/_private/workload/workload_config.py +16 -8
- anyscale/_private/workload/workload_sdk.py +24 -7
- anyscale/client/README.md +10 -2
- anyscale/client/openapi_client/__init__.py +6 -2
- anyscale/client/openapi_client/api/default_api.py +558 -8
- anyscale/client/openapi_client/models/__init__.py +6 -2
- anyscale/client/openapi_client/models/{alert_type.py → alert_issue_type.py} +8 -20
- anyscale/client/openapi_client/models/baseimagesenum.py +1 -2
- anyscale/client/openapi_client/models/cloud.py +31 -3
- anyscale/client/openapi_client/models/cloud_deployment.py +30 -3
- anyscale/client/openapi_client/models/cloud_with_cloud_resource.py +29 -1
- anyscale/client/openapi_client/models/cloud_with_cloud_resource_gcp.py +29 -1
- anyscale/client/openapi_client/models/dataset_metrics.py +6 -6
- anyscale/client/openapi_client/models/dataset_state.py +2 -1
- anyscale/client/openapi_client/models/decorated_cloud_deployment.py +481 -0
- anyscale/client/openapi_client/models/decoratedclouddeployment_response.py +121 -0
- anyscale/client/openapi_client/models/describe_system_workload_response.py +32 -6
- anyscale/client/openapi_client/models/experimental_workspace.py +29 -1
- anyscale/client/openapi_client/models/experimental_workspaces_sort_field.py +2 -1
- anyscale/client/openapi_client/models/metrics_query_response.py +121 -0
- anyscale/client/openapi_client/models/{clouddeployment_response.py → metricsqueryresponse_response.py} +11 -11
- anyscale/client/openapi_client/models/operator_metrics.py +8 -9
- anyscale/client/openapi_client/models/operator_status.py +102 -0
- anyscale/client/openapi_client/models/organization_usage_alert.py +20 -20
- anyscale/client/openapi_client/models/supportedbaseimagesenum.py +1 -2
- anyscale/cloud/models.py +330 -0
- anyscale/commands/cloud_commands.py +136 -44
- anyscale/commands/command_examples.py +54 -134
- anyscale/commands/compute_config_commands.py +7 -11
- anyscale/compute_config/__init__.py +2 -16
- anyscale/compute_config/_private/compute_config_sdk.py +27 -17
- anyscale/compute_config/commands.py +14 -44
- anyscale/compute_config/models.py +49 -26
- anyscale/controllers/cloud_controller.py +289 -171
- anyscale/controllers/cloud_file_storage_utils.py +204 -0
- anyscale/controllers/kubernetes_verifier.py +1570 -0
- anyscale/job/_private/job_sdk.py +17 -8
- anyscale/job/models.py +1 -1
- anyscale/scripts.py +0 -2
- anyscale/sdk/anyscale_client/models/baseimagesenum.py +1 -2
- anyscale/sdk/anyscale_client/models/cloud.py +31 -3
- anyscale/sdk/anyscale_client/models/supportedbaseimagesenum.py +1 -2
- anyscale/shared_anyscale_utils/headers.py +3 -0
- anyscale/shared_anyscale_utils/utils/id_gen.py +1 -0
- anyscale/version.py +1 -1
- anyscale/workspace/models.py +14 -7
- {anyscale-0.26.47.dist-info → anyscale-0.26.49.dist-info}/METADATA +1 -1
- {anyscale-0.26.47.dist-info → anyscale-0.26.49.dist-info}/RECORD +62 -73
- anyscale/commands/llm/dataset_commands.py +0 -269
- anyscale/commands/llm/group.py +0 -15
- anyscale/commands/llm/models_commands.py +0 -123
- anyscale/controllers/llm/__init__.py +0 -0
- anyscale/controllers/llm/models_controller.py +0 -144
- anyscale/llm/__init__.py +0 -2
- anyscale/llm/dataset/__init__.py +0 -2
- anyscale/llm/dataset/_private/__init__.py +0 -0
- anyscale/llm/dataset/_private/docs.py +0 -63
- anyscale/llm/dataset/_private/models.py +0 -71
- anyscale/llm/dataset/_private/sdk.py +0 -147
- anyscale/llm/model/__init__.py +0 -2
- anyscale/llm/model/_private/models_sdk.py +0 -62
- anyscale/llm/model/commands.py +0 -93
- anyscale/llm/model/models.py +0 -171
- anyscale/llm/model/sdk.py +0 -62
- anyscale/llm/sdk.py +0 -27
- {anyscale-0.26.47.dist-info → anyscale-0.26.49.dist-info}/WHEEL +0 -0
- {anyscale-0.26.47.dist-info → anyscale-0.26.49.dist-info}/entry_points.txt +0 -0
- {anyscale-0.26.47.dist-info → anyscale-0.26.49.dist-info}/licenses/LICENSE +0 -0
- {anyscale-0.26.47.dist-info → anyscale-0.26.49.dist-info}/licenses/NOTICE +0 -0
- {anyscale-0.26.47.dist-info → anyscale-0.26.49.dist-info}/top_level.txt +0 -0
@@ -11,11 +11,19 @@ from anyscale import scripts
|
|
11
11
|
from anyscale._private.docgen.generator import MarkdownGenerator, Module
|
12
12
|
from anyscale.aggregated_instance_usage.models import DownloadCSVFilters
|
13
13
|
from anyscale.cloud.models import (
|
14
|
+
AWSConfig,
|
14
15
|
Cloud,
|
16
|
+
CloudDeployment,
|
15
17
|
CloudPermissionLevel,
|
16
18
|
CloudProvider,
|
17
19
|
ComputeStack,
|
18
20
|
CreateCloudCollaborator,
|
21
|
+
FileStorage,
|
22
|
+
GCPConfig,
|
23
|
+
KubernetesConfig,
|
24
|
+
NetworkingMode,
|
25
|
+
NFSMountTarget,
|
26
|
+
ObjectStorage,
|
19
27
|
)
|
20
28
|
from anyscale.commands import (
|
21
29
|
aggregated_instance_usage_commands,
|
@@ -39,9 +47,8 @@ from anyscale.commands import (
|
|
39
47
|
workspace_commands,
|
40
48
|
workspace_commands_v2,
|
41
49
|
)
|
42
|
-
from anyscale.commands.llm import dataset_commands, models_commands
|
43
50
|
from anyscale.compute_config.models import (
|
44
|
-
CloudDeployment,
|
51
|
+
CloudDeployment as CloudDeploymentSelector,
|
45
52
|
ComputeConfig,
|
46
53
|
ComputeConfigVersion,
|
47
54
|
HeadNodeConfig,
|
@@ -61,12 +68,6 @@ from anyscale.job.models import (
|
|
61
68
|
JobState,
|
62
69
|
JobStatus,
|
63
70
|
)
|
64
|
-
from anyscale.llm.dataset._private.models import Dataset
|
65
|
-
from anyscale.llm.model.models import (
|
66
|
-
DeletedFineTunedModel,
|
67
|
-
FineTunedModel,
|
68
|
-
FineTuningType,
|
69
|
-
)
|
70
71
|
from anyscale.organization_invitation.models import OrganizationInvitation
|
71
72
|
from anyscale.project.models import CreateProjectCollaborator, ProjectPermissionLevel
|
72
73
|
from anyscale.resource_quota.models import CreateResourceQuota, Quota, ResourceQuota
|
@@ -315,10 +316,11 @@ ALL_MODULES = [
|
|
315
316
|
],
|
316
317
|
models=[
|
317
318
|
ComputeConfig,
|
319
|
+
MultiDeploymentComputeConfig,
|
318
320
|
HeadNodeConfig,
|
319
321
|
WorkerNodeGroupConfig,
|
320
322
|
MarketType,
|
321
|
-
|
323
|
+
CloudDeploymentSelector,
|
322
324
|
MultiDeploymentComputeConfig,
|
323
325
|
ComputeConfigVersion,
|
324
326
|
],
|
@@ -433,7 +435,10 @@ ALL_MODULES = [
|
|
433
435
|
cloud_commands.cloud_delete,
|
434
436
|
cloud_commands.cloud_verify,
|
435
437
|
cloud_commands.list_cloud,
|
436
|
-
cloud_commands.
|
438
|
+
cloud_commands.cloud_deployment_create,
|
439
|
+
cloud_commands.cloud_deployment_get,
|
440
|
+
cloud_commands.cloud_deployment_update,
|
441
|
+
cloud_commands.cloud_deployment_delete,
|
437
442
|
cloud_commands.cloud_config_update,
|
438
443
|
cloud_commands.cloud_set_default,
|
439
444
|
cloud_commands.add_collaborators,
|
@@ -449,13 +454,27 @@ ALL_MODULES = [
|
|
449
454
|
anyscale.cloud.terminate_system_cluster,
|
450
455
|
],
|
451
456
|
models=[
|
457
|
+
Cloud,
|
452
458
|
CloudPermissionLevel,
|
453
459
|
CreateCloudCollaborator,
|
454
|
-
|
460
|
+
CloudDeployment,
|
455
461
|
ComputeStack,
|
456
462
|
CloudProvider,
|
457
|
-
|
458
|
-
|
463
|
+
NetworkingMode,
|
464
|
+
ObjectStorage,
|
465
|
+
FileStorage,
|
466
|
+
NFSMountTarget,
|
467
|
+
AWSConfig,
|
468
|
+
GCPConfig,
|
469
|
+
KubernetesConfig,
|
470
|
+
],
|
471
|
+
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",
|
476
|
+
cloud_commands.cloud_config_update: "config",
|
477
|
+
},
|
459
478
|
legacy_sdk_commands={
|
460
479
|
# limited support, no replacement yet
|
461
480
|
"get_cloud": None,
|
@@ -582,40 +601,6 @@ ALL_MODULES = [
|
|
582
601
|
"UpdateCluster",
|
583
602
|
],
|
584
603
|
),
|
585
|
-
Module(
|
586
|
-
title="LLM Model",
|
587
|
-
filename="llm_models.md",
|
588
|
-
cli_prefix="anyscale llm model",
|
589
|
-
cli_commands=[
|
590
|
-
models_commands.get_model,
|
591
|
-
models_commands.list_models,
|
592
|
-
models_commands.delete_model,
|
593
|
-
],
|
594
|
-
sdk_prefix="anyscale.llm.model",
|
595
|
-
sdk_commands=[
|
596
|
-
anyscale.llm.model.get,
|
597
|
-
anyscale.llm.model.list,
|
598
|
-
anyscale.llm.model.delete,
|
599
|
-
],
|
600
|
-
models=[FineTunedModel, FineTuningType, DeletedFineTunedModel],
|
601
|
-
),
|
602
|
-
Module(
|
603
|
-
title="LLM Dataset",
|
604
|
-
filename="llm_dataset.md",
|
605
|
-
cli_prefix="anyscale llm dataset",
|
606
|
-
cli_commands=[
|
607
|
-
dataset_commands.get_dataset,
|
608
|
-
dataset_commands.upload_dataset,
|
609
|
-
dataset_commands.download_dataset,
|
610
|
-
],
|
611
|
-
sdk_prefix="anyscale.llm.dataset",
|
612
|
-
sdk_commands=[
|
613
|
-
anyscale.llm.dataset.get,
|
614
|
-
anyscale.llm.dataset.upload,
|
615
|
-
anyscale.llm.dataset.download,
|
616
|
-
],
|
617
|
-
models=[Dataset],
|
618
|
-
),
|
619
604
|
Module(
|
620
605
|
title="Resource quotas",
|
621
606
|
filename="resource-quotas.md",
|
@@ -46,6 +46,20 @@ CUSTOMER_HOSTED_QUALIFIER = (
|
|
46
46
|
)
|
47
47
|
|
48
48
|
|
49
|
+
def _escape_mdx_content(text: str) -> str:
|
50
|
+
"""Escape content for MDX compatibility.
|
51
|
+
|
52
|
+
This function escapes angle brackets that could be interpreted as HTML tags
|
53
|
+
by MDX, converting them to escaped versions.
|
54
|
+
"""
|
55
|
+
import re
|
56
|
+
|
57
|
+
# Escape angle brackets that look like HTML tags but are meant as literal text
|
58
|
+
# This pattern matches <word> or <word-with-hyphens> but not actual markdown/HTML
|
59
|
+
text = re.sub(r"<([a-zA-Z][a-zA-Z0-9\-]*?)>", r"\\<\1\\>", text)
|
60
|
+
return text
|
61
|
+
|
62
|
+
|
49
63
|
@dataclass
|
50
64
|
class Module:
|
51
65
|
title: str
|
@@ -276,12 +290,13 @@ class MarkdownGenerator:
|
|
276
290
|
- __doc_py_example__ (required in sdks)
|
277
291
|
- __doc_cli_example__ (required for models and cli commands)
|
278
292
|
"""
|
293
|
+
skip_py_example: bool = getattr(t, "__skip_py_example__", False)
|
279
294
|
yaml_example: Optional[str] = getattr(t, "__doc_yaml_example__", None)
|
280
295
|
py_example: Optional[str] = getattr(t, "__doc_py_example__", None)
|
281
296
|
cli_example: Optional[str] = getattr(t, "__doc_cli_example__", None)
|
282
297
|
|
283
298
|
if isinstance(t, ModelBaseType):
|
284
|
-
if not py_example:
|
299
|
+
if not skip_py_example and not py_example:
|
285
300
|
raise ValueError(
|
286
301
|
f"Model '{t.__name__}' is missing a '__doc_py_example__'."
|
287
302
|
)
|
@@ -370,24 +385,25 @@ class MarkdownGenerator:
|
|
370
385
|
f"Model '{t.__name__}' is missing a docstring for field '{field.name}'"
|
371
386
|
)
|
372
387
|
|
373
|
-
md += f"- **`{field.name}` ({self._model_type_to_string(field.type)})**: {docstring}\n"
|
388
|
+
md += f"- **`{field.name}` ({self._model_type_to_string(field.type)})**: {_escape_mdx_content(docstring)}\n"
|
374
389
|
|
375
390
|
customer_hosted_only = field.metadata.get("customer_hosted_only", False)
|
376
391
|
if customer_hosted_only:
|
377
392
|
md += f" - {CUSTOMER_HOSTED_QUALIFIER}\n"
|
378
393
|
md += "\n\n"
|
379
394
|
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
395
|
+
if not getattr(t, "__skip_py_example__", False):
|
396
|
+
md += "#### Python Methods\n\n"
|
397
|
+
md += "```python\n"
|
398
|
+
if t.__name__.endswith("Config"):
|
399
|
+
# Only include constructor docs for config models.
|
400
|
+
md += f"def __init__(self, **fields) -> {t.__name__}\n"
|
401
|
+
md += ' """Construct a model with the provided field values set."""\n\n'
|
402
|
+
md += f"def options(self, **fields) -> {t.__name__}\n"
|
403
|
+
md += ' """Return a copy of the model with the provided field values overwritten."""\n\n'
|
404
|
+
md += "def to_dict(self) -> Dict[str, Any]\n"
|
405
|
+
md += ' """Return a dictionary representation of the model."""\n'
|
406
|
+
md += "```\n"
|
391
407
|
|
392
408
|
md += self._gen_example_tabs(t)
|
393
409
|
elif isinstance(t, ModelEnumType):
|
@@ -545,7 +561,7 @@ class MarkdownGenerator:
|
|
545
561
|
md += ":::warning[Limited support]\n"
|
546
562
|
md += "This command is not actively maintained. Use with caution.\n"
|
547
563
|
md += ":::\n"
|
548
|
-
md += legacy_sdk.docstring + "\n"
|
564
|
+
md += _escape_mdx_content(legacy_sdk.docstring) + "\n"
|
549
565
|
|
550
566
|
return md
|
551
567
|
|
@@ -555,7 +571,7 @@ class MarkdownGenerator:
|
|
555
571
|
The sections will be:
|
556
572
|
- All fields and their types
|
557
573
|
"""
|
558
|
-
md = f"### `{legacy_model.name}` <span class='label-h3 label-legacy'>Legacy</span
|
559
|
-
md += legacy_model.docstring + "\n"
|
574
|
+
md = f"### `{legacy_model.name}` <span class='label-h3 label-legacy'>Legacy</span> {{#{legacy_model.name.lower()}-legacy}}\n"
|
575
|
+
md += _escape_mdx_content(legacy_model.docstring) + "\n"
|
560
576
|
|
561
577
|
return md
|
@@ -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
|
-
|
39
|
-
|
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
|
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 +=
|
114
|
+
docstring += _transform_legacy_links(line) + "\n"
|
63
115
|
|
64
116
|
return cls(name=name, docstring=docstring.strip())
|
65
117
|
|