xpk 0.7.0__py3-none-any.whl → 0.7.2__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/commands/storage.py +24 -11
- xpk/core/config.py +1 -1
- xpk/core/pathways.py +14 -14
- xpk/parser/storage.py +10 -0
- {xpk-0.7.0.dist-info → xpk-0.7.2.dist-info}/METADATA +5 -2
- {xpk-0.7.0.dist-info → xpk-0.7.2.dist-info}/RECORD +10 -10
- {xpk-0.7.0.dist-info → xpk-0.7.2.dist-info}/WHEEL +1 -1
- {xpk-0.7.0.dist-info → xpk-0.7.2.dist-info}/entry_points.txt +0 -0
- {xpk-0.7.0.dist-info → xpk-0.7.2.dist-info/licenses}/LICENSE +0 -0
- {xpk-0.7.0.dist-info → xpk-0.7.2.dist-info}/top_level.txt +0 -0
xpk/commands/storage.py
CHANGED
|
@@ -16,6 +16,7 @@ limitations under the License.
|
|
|
16
16
|
|
|
17
17
|
from argparse import Namespace
|
|
18
18
|
|
|
19
|
+
import yaml
|
|
19
20
|
from kubernetes import client as k8s_client
|
|
20
21
|
from kubernetes.client import ApiClient
|
|
21
22
|
from kubernetes.client.rest import ApiException
|
|
@@ -72,9 +73,13 @@ def storage_create(args: Namespace) -> None:
|
|
|
72
73
|
filestore_client.create_instance(
|
|
73
74
|
vol=args.vol, size=args.size, tier=args.tier, network=filestore_network
|
|
74
75
|
)
|
|
75
|
-
manifest
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
if args.manifest is not None:
|
|
77
|
+
with open(args.manifest, "r", encoding="utf-8") as f:
|
|
78
|
+
manifest = list(yaml.safe_load_all(f))
|
|
79
|
+
else:
|
|
80
|
+
manifest = filestore_client.manifest(
|
|
81
|
+
args.name, args.vol, args.access_mode, filestore_network
|
|
82
|
+
)
|
|
78
83
|
|
|
79
84
|
k8s_api_client = setup_k8s_env(args)
|
|
80
85
|
create_storage_crds(k8s_api_client, args, manifest)
|
|
@@ -137,22 +142,30 @@ def storage_attach(args: Namespace) -> None:
|
|
|
137
142
|
xpk_print(f"Filestore instance {args.instance} does not exists.")
|
|
138
143
|
xpk_exit(1)
|
|
139
144
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
145
|
+
if args.manifest is not None:
|
|
146
|
+
with open(args.manifest, "r", encoding="utf-8") as f:
|
|
147
|
+
manifest = list(yaml.safe_load_all(f))
|
|
148
|
+
else:
|
|
149
|
+
filestore_network = get_cluster_network(args)
|
|
150
|
+
manifest = filestore_client.manifest(
|
|
151
|
+
args.name, args.vol, args.access_mode, filestore_network
|
|
152
|
+
)
|
|
144
153
|
|
|
145
154
|
else: # args.type == GCS_FUSE_TYPE:
|
|
146
|
-
if args.size is None:
|
|
155
|
+
if args.manifest is None and args.size is None:
|
|
147
156
|
xpk_print("--size is required when attaching gcsfuse storage.")
|
|
148
157
|
xpk_exit(1)
|
|
149
158
|
|
|
150
159
|
if args.bucket is None:
|
|
151
160
|
args.bucket = args.name
|
|
152
161
|
|
|
153
|
-
manifest
|
|
154
|
-
|
|
155
|
-
|
|
162
|
+
if args.manifest is not None:
|
|
163
|
+
with open(args.manifest, "r", encoding="utf-8") as f:
|
|
164
|
+
manifest = list(yaml.safe_load_all(f))
|
|
165
|
+
else:
|
|
166
|
+
manifest = gcsfuse.manifest(
|
|
167
|
+
name=args.name, bucket=args.bucket, size=args.size
|
|
168
|
+
)
|
|
156
169
|
|
|
157
170
|
k8s_api_client = setup_k8s_env(args)
|
|
158
171
|
create_storage_crds(k8s_api_client, args, manifest)
|
xpk/core/config.py
CHANGED
|
@@ -24,7 +24,7 @@ from ..utils.console import xpk_print
|
|
|
24
24
|
from .system_characteristics import AcceleratorType, SystemCharacteristics
|
|
25
25
|
|
|
26
26
|
# This is the version for XPK PyPI package
|
|
27
|
-
__version__ = 'v0.7.
|
|
27
|
+
__version__ = 'v0.7.2'
|
|
28
28
|
XPK_CURRENT_VERSION = __version__
|
|
29
29
|
XPK_CONFIG_FILE = os.path.expanduser('~/.config/xpk/config.yaml')
|
|
30
30
|
|
xpk/core/pathways.py
CHANGED
|
@@ -87,20 +87,20 @@ def get_pathways_sidecar_container(args) -> str:
|
|
|
87
87
|
str: yaml containing arguments for the Pathways sidecar container.
|
|
88
88
|
"""
|
|
89
89
|
yaml = """initContainers:
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
90
|
+
- name: remote-python-sidecar
|
|
91
|
+
image: {args.remote_python_sidecar_image}
|
|
92
|
+
imagePullPolicy: Always
|
|
93
|
+
securityContext:
|
|
94
|
+
privileged: true
|
|
95
|
+
volumeMounts:
|
|
96
|
+
- mountPath: /tmp # Shared volume mount with the main container.
|
|
97
|
+
name: shared-tmp
|
|
98
|
+
restartPolicy: Always
|
|
99
|
+
ports:
|
|
100
|
+
- containerPort: 50051
|
|
101
|
+
env:
|
|
102
|
+
- name: GRPC_SERVER_ADDRESS
|
|
103
|
+
value: '0.0.0.0:50051'"""
|
|
104
104
|
if args.use_pathways and args.remote_python_sidecar_image is not None:
|
|
105
105
|
return yaml.format(args=args)
|
|
106
106
|
else:
|
xpk/parser/storage.py
CHANGED
|
@@ -148,6 +148,11 @@ def add_storage_attach_parser(
|
|
|
148
148
|
'Optional Arguments',
|
|
149
149
|
'Optional arguments for storage create.',
|
|
150
150
|
)
|
|
151
|
+
opt_args.add_argument(
|
|
152
|
+
'--manifest',
|
|
153
|
+
type=str,
|
|
154
|
+
help='Path to manifest file containing volume definitions',
|
|
155
|
+
)
|
|
151
156
|
add_kind_cluster_arguments(opt_args)
|
|
152
157
|
|
|
153
158
|
|
|
@@ -238,6 +243,11 @@ def add_storage_create_parser(
|
|
|
238
243
|
help='Access mode of created filestore instance',
|
|
239
244
|
default='ReadWriteMany',
|
|
240
245
|
)
|
|
246
|
+
opt_args.add_argument(
|
|
247
|
+
'--manifest',
|
|
248
|
+
type=str,
|
|
249
|
+
help='Path to manifest file containing volume definitions',
|
|
250
|
+
)
|
|
241
251
|
|
|
242
252
|
add_kind_cluster_arguments(opt_args)
|
|
243
253
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: xpk
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.2
|
|
4
4
|
Summary: xpk helps Cloud developers to orchestrate training jobs on accelerators on GKE.
|
|
5
5
|
Author-email: XPK team <xpk-code-reviewers@google.com>
|
|
6
6
|
License: Apache-2.0
|
|
@@ -28,6 +28,7 @@ Requires-Dist: pylint>=2.6.0; extra == "dev"
|
|
|
28
28
|
Requires-Dist: pre-commit; extra == "dev"
|
|
29
29
|
Requires-Dist: pytest; extra == "dev"
|
|
30
30
|
Requires-Dist: docker==7.1.0; extra == "dev"
|
|
31
|
+
Dynamic: license-file
|
|
31
32
|
|
|
32
33
|
<!--
|
|
33
34
|
Copyright 2023 Google LLC
|
|
@@ -498,6 +499,7 @@ Parameters:
|
|
|
498
499
|
- `--readonly` - if set to true, workload can only read from storage.
|
|
499
500
|
- `--size` - size of the storage in Gb.
|
|
500
501
|
- `--bucket` - name of the storage bucket. If not set then the name of the storage is used as a bucket name.
|
|
502
|
+
- `--manifest` - path to the manifest file containing PersistentVolume and PresistentVolumeClaim definitions. If set, then values from manifest override the following parameters: `--size` and `--bucket`.
|
|
501
503
|
|
|
502
504
|
### Filestore
|
|
503
505
|
|
|
@@ -533,6 +535,7 @@ Commands `xpk storage create` and `xpk storage attach` with `--type=gcpfilestore
|
|
|
533
535
|
- `--access-mode` - access mode of the Filestore instance that will be created. Possible values are: `[ReadWriteOnce, ReadOnlyMany, ReadWriteMany]`
|
|
534
536
|
- `--vol` - file share name of the Filestore instance that will be created.
|
|
535
537
|
- `--instance` - the name of the Filestore instance. If not set then the name parameter is used as an instance name. Useful when connecting multiple volumes from the same Filestore instance.
|
|
538
|
+
- `--manifest` - path to the manifest file containing PersistentVolume, PresistentVolumeClaim and StorageClass definitions. If set, then values from manifest override the following parameters: `--access-mode`, `--size` and `--volume`.
|
|
536
539
|
|
|
537
540
|
### List attached storages
|
|
538
541
|
|
|
@@ -15,7 +15,7 @@ xpk/commands/kind.py,sha256=Vl3RT47kHCR0ORX9dK37HCiYtbmXJUCIAaq-QEbIclU,7578
|
|
|
15
15
|
xpk/commands/kjob_common.py,sha256=aR6k_6yacr76QZDQmdoPO0M4Tg6H7ZPooKUTnOVZwXY,1596
|
|
16
16
|
xpk/commands/run.py,sha256=-W32sfobmwxLNEQzBKFWgPs_UOWljRKjFyH-Unm9zsA,3853
|
|
17
17
|
xpk/commands/shell.py,sha256=ZODaPNSmWHOpW48eHEt35IoM4x-0GQUGaLjOxQ63QSY,4235
|
|
18
|
-
xpk/commands/storage.py,sha256=
|
|
18
|
+
xpk/commands/storage.py,sha256=oCo6iPHR9IL5IO7PjQrbB9_NDCjcCO3HYxMRuNpNqUU,8818
|
|
19
19
|
xpk/commands/version.py,sha256=CU4mb71r66U28krnPAopC6vBpdK-IGclsy5uNaQcgRY,824
|
|
20
20
|
xpk/commands/workload.py,sha256=N3hqe3tWuQMjGuk4DaiDoehgejYGYKwWXRygzJ58h-c,31710
|
|
21
21
|
xpk/core/__init__.py,sha256=YPwWBbgLAu7L-YlTVGB2r8ZV4TzypURMRBcehSHHlLY,561
|
|
@@ -23,7 +23,7 @@ xpk/core/capacity.py,sha256=pli6McSdPgGJxsBfJNVk5lCjehp1s1WI82ETAvJT1_I,5365
|
|
|
23
23
|
xpk/core/cluster.py,sha256=GPuasSTadvgmIb9Iw7giqw7FJDg0jEzIwbQLEkzjuvE,18352
|
|
24
24
|
xpk/core/cluster_private.py,sha256=J2-UZ6t5f-UNdcSkuUr2_f4xk6xyrMH9Muk56trBh4M,6657
|
|
25
25
|
xpk/core/commands.py,sha256=JiS4vJqWSLu8MKFBIKPBea9MKD2ZdpaQrziVQBqiDr4,10719
|
|
26
|
-
xpk/core/config.py,sha256=
|
|
26
|
+
xpk/core/config.py,sha256=qFYohiDizy4NRgsY8V-OraKVOCqzaObtiLizGaHRFfA,5659
|
|
27
27
|
xpk/core/docker_container.py,sha256=GvkCJ2S5UKn8uh3pZhRd3X7iS0-PsQpRO8l7QhywVGc,7604
|
|
28
28
|
xpk/core/docker_image.py,sha256=fEdpLQg1C205mMbLREy48WnhvNv2Nm4KQFX87B2CuiA,6624
|
|
29
29
|
xpk/core/docker_manager.py,sha256=_fE27tDCJPd9dUfswYoQMzZRMAMfxq6SxdFdOT-gzIQ,10566
|
|
@@ -38,7 +38,7 @@ xpk/core/monitoring.py,sha256=v9MvLzNfvJAVby_ehSlPe6PaO0_pf3shkXg5gd-UWm8,4338
|
|
|
38
38
|
xpk/core/nap.py,sha256=BNO0fnTpza310cAVwITYktj1SN9tXVT_kCnsufKzYOE,12136
|
|
39
39
|
xpk/core/network.py,sha256=kfvOJREHAm9JtGYdi6csnJeZNg81cjf5-5ECweZ6sWw,10478
|
|
40
40
|
xpk/core/nodepool.py,sha256=1aBZXvaXWEXf2YJXj7w3NDQiPTLJ8b6cmizVPzeoVSY,22002
|
|
41
|
-
xpk/core/pathways.py,sha256=
|
|
41
|
+
xpk/core/pathways.py,sha256=OHJOpf0qbKGECjYD31TUJ4rT5SDgs9-AOtLWMGjBqxQ,11615
|
|
42
42
|
xpk/core/ray.py,sha256=UxOpIc2enHi1fQ4h3KO8FH8bIyEMtYzGtPoeqJKGG4o,6337
|
|
43
43
|
xpk/core/resources.py,sha256=IXzvuA8saK6Xvv4MHTWYVeWJDR3MbH_RScd-Dp_qxlM,7669
|
|
44
44
|
xpk/core/scheduling.py,sha256=8BAg8YyftJULHeq-A5nmgpPYVjyEjbVjSG6cWYCAcX0,8348
|
|
@@ -68,7 +68,7 @@ xpk/parser/job.py,sha256=5RdE70rucGfrsn65l7Ho6RmO06mag1S0AO-3saVuXyw,4328
|
|
|
68
68
|
xpk/parser/kind.py,sha256=sgPCqNVrgmFLcOBEbhlaphwVXxMh_opP9ntCq4KPePE,2682
|
|
69
69
|
xpk/parser/run.py,sha256=oi_ksSyJ8Ooffe2EgoV_ecpmXEmNGVotjpIQH-HjufE,1481
|
|
70
70
|
xpk/parser/shell.py,sha256=VC8p-kz9XjJZW9DXZ-rnv41XnRDRpQRFywHpB5j7tfc,1970
|
|
71
|
-
xpk/parser/storage.py,sha256
|
|
71
|
+
xpk/parser/storage.py,sha256=2CLL7TW2rclAtxk0klQmouR-BWoLUcEYLa6ZvIkHRs0,9258
|
|
72
72
|
xpk/parser/validators.py,sha256=-NBZelvfwZRzjz-YUCreD8EzMLHll8PZM-d-MVm2PG4,1192
|
|
73
73
|
xpk/parser/version.py,sha256=eJo4PAbbmRQZulgKBs_ytbVgV9zAaaXeNzMMxmgFMVY,769
|
|
74
74
|
xpk/parser/workload.py,sha256=GNcJEOvldVHKZPIO6cXAIXMpyHq2M9kdOJ7CZP86saU,24177
|
|
@@ -84,9 +84,9 @@ xpk/utils/objects.py,sha256=OwMNxB4TGX21qnJPdZo2YBMPMbQPqOtHMh19QhoRNRY,2498
|
|
|
84
84
|
xpk/utils/templates.py,sha256=g8zgR1MxyJmTmzM_wnvH30FmcbgQMC47UQwBtLj8B9k,807
|
|
85
85
|
xpk/utils/validation.py,sha256=bSJApIY0Lk48I4EEQP08ZUvolXt_APpYXVGJXFQ_YLA,2711
|
|
86
86
|
xpk/utils/yaml.py,sha256=j8xuAJ9yAAwnQi6ozwZ-nMnDyDnc3xWkeBZMtSuP4RU,844
|
|
87
|
-
xpk-0.7.
|
|
88
|
-
xpk-0.7.
|
|
89
|
-
xpk-0.7.
|
|
90
|
-
xpk-0.7.
|
|
91
|
-
xpk-0.7.
|
|
92
|
-
xpk-0.7.
|
|
87
|
+
xpk-0.7.2.dist-info/licenses/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
|
|
88
|
+
xpk-0.7.2.dist-info/METADATA,sha256=rzXsUzC86TBMyfXBRMKTOHiwX_e_wA6V8Lb0giiylBw,63800
|
|
89
|
+
xpk-0.7.2.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
|
90
|
+
xpk-0.7.2.dist-info/entry_points.txt,sha256=mzEtiIesFkT1kmcTUVDA1o3uOhiniX6tIz2wmOlMu1M,38
|
|
91
|
+
xpk-0.7.2.dist-info/top_level.txt,sha256=aDe4N0jicmuWExx_6w0TxWQJaEuPSs9BnLU-3aF1GLo,4
|
|
92
|
+
xpk-0.7.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|