xpk 0.5.0__py3-none-any.whl → 0.7.0__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.
- xpk/__init__.py +15 -0
- xpk/api/__init__.py +15 -0
- xpk/api/storage_crd.yaml +52 -0
- xpk/commands/__init__.py +15 -0
- xpk/commands/batch.py +131 -0
- xpk/commands/cluster.py +808 -0
- xpk/commands/cluster_gcluster.py +269 -0
- xpk/commands/common.py +44 -0
- xpk/commands/config.py +29 -0
- xpk/commands/info.py +243 -0
- xpk/commands/inspector.py +357 -0
- xpk/commands/job.py +199 -0
- xpk/commands/kind.py +283 -0
- xpk/commands/kjob_common.py +44 -0
- xpk/commands/run.py +128 -0
- xpk/commands/shell.py +140 -0
- xpk/commands/storage.py +267 -0
- xpk/commands/version.py +27 -0
- xpk/commands/workload.py +889 -0
- xpk/core/__init__.py +15 -0
- xpk/core/blueprint/__init__.py +15 -0
- xpk/core/blueprint/blueprint_definitions.py +62 -0
- xpk/core/blueprint/blueprint_generator.py +708 -0
- xpk/core/capacity.py +185 -0
- xpk/core/cluster.py +564 -0
- xpk/core/cluster_private.py +200 -0
- xpk/core/commands.py +356 -0
- xpk/core/config.py +179 -0
- xpk/core/docker_container.py +225 -0
- xpk/core/docker_image.py +210 -0
- xpk/core/docker_manager.py +308 -0
- xpk/core/docker_resources.py +350 -0
- xpk/core/filestore.py +251 -0
- xpk/core/gcloud_context.py +196 -0
- xpk/core/gcluster_manager.py +176 -0
- xpk/core/gcsfuse.py +50 -0
- xpk/core/kjob.py +444 -0
- xpk/core/kueue.py +358 -0
- xpk/core/monitoring.py +134 -0
- xpk/core/nap.py +361 -0
- xpk/core/network.py +377 -0
- xpk/core/nodepool.py +581 -0
- xpk/core/pathways.py +377 -0
- xpk/core/ray.py +222 -0
- xpk/core/remote_state/__init__.py +15 -0
- xpk/core/remote_state/fuse_remote_state.py +99 -0
- xpk/core/remote_state/remote_state_client.py +38 -0
- xpk/core/resources.py +238 -0
- xpk/core/scheduling.py +253 -0
- xpk/core/storage.py +581 -0
- xpk/core/system_characteristics.py +1432 -0
- xpk/core/vertex.py +105 -0
- xpk/core/workload.py +341 -0
- xpk/core/workload_decorators/__init__.py +15 -0
- xpk/core/workload_decorators/rdma_decorator.py +129 -0
- xpk/core/workload_decorators/storage_decorator.py +52 -0
- xpk/core/workload_decorators/tcpxo_decorator.py +190 -0
- xpk/main.py +75 -0
- xpk/parser/__init__.py +15 -0
- xpk/parser/batch.py +43 -0
- xpk/parser/cluster.py +662 -0
- xpk/parser/common.py +259 -0
- xpk/parser/config.py +49 -0
- xpk/parser/core.py +135 -0
- xpk/parser/info.py +64 -0
- xpk/parser/inspector.py +65 -0
- xpk/parser/job.py +147 -0
- xpk/parser/kind.py +95 -0
- xpk/parser/run.py +47 -0
- xpk/parser/shell.py +59 -0
- xpk/parser/storage.py +316 -0
- xpk/parser/validators.py +39 -0
- xpk/parser/version.py +23 -0
- xpk/parser/workload.py +726 -0
- xpk/templates/__init__.py +15 -0
- xpk/templates/storage.yaml +13 -0
- xpk/utils/__init__.py +15 -0
- xpk/utils/console.py +55 -0
- xpk/utils/file.py +82 -0
- xpk/utils/gcs_utils.py +125 -0
- xpk/utils/kubectl.py +57 -0
- xpk/utils/network.py +168 -0
- xpk/utils/objects.py +88 -0
- xpk/utils/templates.py +28 -0
- xpk/utils/validation.py +80 -0
- xpk/utils/yaml.py +30 -0
- {xpk-0.5.0.dist-info → xpk-0.7.0.dist-info}/METADATA +456 -32
- xpk-0.7.0.dist-info/RECORD +92 -0
- {xpk-0.5.0.dist-info → xpk-0.7.0.dist-info}/WHEEL +1 -1
- xpk-0.7.0.dist-info/entry_points.txt +2 -0
- xpk-0.5.0.dist-info/RECORD +0 -7
- xpk-0.5.0.dist-info/entry_points.txt +0 -2
- xpk.py +0 -7282
- {xpk-0.5.0.dist-info → xpk-0.7.0.dist-info}/LICENSE +0 -0
- {xpk-0.5.0.dist-info → xpk-0.7.0.dist-info}/top_level.txt +0 -0
xpk/utils/validation.py
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Copyright 2025 Google LLC
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
from ..core.commands import run_command_for_value
|
|
18
|
+
from .console import xpk_exit, xpk_print
|
|
19
|
+
from ..commands.config import xpk_cfg
|
|
20
|
+
from ..core.config import DEPENDENCIES_KEY
|
|
21
|
+
from ..commands.version import get_xpk_version
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
validation_commands = {
|
|
25
|
+
'kubectl': {
|
|
26
|
+
'command': 'kubectl --help',
|
|
27
|
+
'message': (
|
|
28
|
+
'`kubectl` not installed. Please follow'
|
|
29
|
+
' https://github.com/AI-Hypercomputer/xpk?tab=readme-ov-file#prerequisites'
|
|
30
|
+
' to install xpk prerequisites.'
|
|
31
|
+
),
|
|
32
|
+
},
|
|
33
|
+
'kjob': {
|
|
34
|
+
'command': 'kubectl kjob --help',
|
|
35
|
+
'message': (
|
|
36
|
+
'`kjobctl` not installed. Please follow'
|
|
37
|
+
' https://github.com/AI-Hypercomputer/xpk?tab=readme-ov-file#prerequisites'
|
|
38
|
+
' to install xpk prerequisites.'
|
|
39
|
+
),
|
|
40
|
+
},
|
|
41
|
+
'gcloud': {
|
|
42
|
+
'command': 'gcloud version',
|
|
43
|
+
'message': (
|
|
44
|
+
'`gcloud not installed. Please follow'
|
|
45
|
+
' https://github.com/AI-Hypercomputer/xpk?tab=readme-ov-file#prerequisites'
|
|
46
|
+
' to install xpk prerequisites.'
|
|
47
|
+
),
|
|
48
|
+
},
|
|
49
|
+
'docker': {
|
|
50
|
+
'command': 'docker version',
|
|
51
|
+
'message': (
|
|
52
|
+
'`docker` not installed. Please follow'
|
|
53
|
+
' https://github.com/AI-Hypercomputer/xpk?tab=readme-ov-file#prerequisites'
|
|
54
|
+
' to install xpk prerequisites.'
|
|
55
|
+
),
|
|
56
|
+
},
|
|
57
|
+
'kueuectl': {
|
|
58
|
+
'command': 'kubectl kueue --help',
|
|
59
|
+
'message': (
|
|
60
|
+
'`kueuectl` not installed. Please follow'
|
|
61
|
+
' https://github.com/AI-Hypercomputer/xpk?tab=readme-ov-file#prerequisites'
|
|
62
|
+
' to install xpk prerequisites.'
|
|
63
|
+
),
|
|
64
|
+
},
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def validate_dependencies():
|
|
69
|
+
deps_version = xpk_cfg.get(DEPENDENCIES_KEY)
|
|
70
|
+
xpk_version = get_xpk_version()
|
|
71
|
+
if deps_version is None or deps_version != xpk_version:
|
|
72
|
+
for name, check in validation_commands.items():
|
|
73
|
+
cmd, message = check['command'], check['message']
|
|
74
|
+
code, _ = run_command_for_value(
|
|
75
|
+
cmd, f'Validate {name} installation.', None
|
|
76
|
+
)
|
|
77
|
+
if code != 0:
|
|
78
|
+
xpk_print(message)
|
|
79
|
+
xpk_exit(code)
|
|
80
|
+
xpk_cfg.set(DEPENDENCIES_KEY, get_xpk_version())
|
xpk/utils/yaml.py
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Copyright 2024 Google LLC
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
import yaml
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class literal_string(str):
|
|
21
|
+
pass
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def literal_string_representer(
|
|
25
|
+
dumper: yaml.Dumper, data
|
|
26
|
+
) -> yaml.nodes.ScalarNode:
|
|
27
|
+
return dumper.represent_scalar('tag:yaml.org,2002:str', data, style='|')
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
yaml.add_representer(literal_string, literal_string_representer)
|