torchx-nightly 2024.6.14__py3-none-any.whl → 2024.6.18__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.
Potentially problematic release.
This version of torchx-nightly might be problematic. Click here for more details.
- torchx/specs/api.py +18 -0
- {torchx_nightly-2024.6.14.dist-info → torchx_nightly-2024.6.18.dist-info}/METADATA +1 -1
- {torchx_nightly-2024.6.14.dist-info → torchx_nightly-2024.6.18.dist-info}/RECORD +7 -7
- {torchx_nightly-2024.6.14.dist-info → torchx_nightly-2024.6.18.dist-info}/LICENSE +0 -0
- {torchx_nightly-2024.6.14.dist-info → torchx_nightly-2024.6.18.dist-info}/WHEEL +0 -0
- {torchx_nightly-2024.6.14.dist-info → torchx_nightly-2024.6.18.dist-info}/entry_points.txt +0 -0
- {torchx_nightly-2024.6.14.dist-info → torchx_nightly-2024.6.18.dist-info}/top_level.txt +0 -0
torchx/specs/api.py
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
import copy
|
|
11
11
|
import json
|
|
12
12
|
import re
|
|
13
|
+
import typing
|
|
13
14
|
from dataclasses import asdict, dataclass, field
|
|
14
15
|
from datetime import datetime
|
|
15
16
|
from enum import Enum
|
|
@@ -189,8 +190,25 @@ class macros:
|
|
|
189
190
|
role = copy.deepcopy(role)
|
|
190
191
|
role.args = [self.substitute(arg) for arg in role.args]
|
|
191
192
|
role.env = {key: self.substitute(arg) for key, arg in role.env.items()}
|
|
193
|
+
role.metadata = self._apply_nested(role.metadata)
|
|
194
|
+
|
|
192
195
|
return role
|
|
193
196
|
|
|
197
|
+
def _apply_nested(self, d: typing.Dict[str, Any]) -> typing.Dict[str, Any]:
|
|
198
|
+
stack = [d]
|
|
199
|
+
while stack:
|
|
200
|
+
current_dict = stack.pop()
|
|
201
|
+
for k, v in current_dict.items():
|
|
202
|
+
if isinstance(v, dict):
|
|
203
|
+
stack.append(v)
|
|
204
|
+
elif isinstance(v, str):
|
|
205
|
+
current_dict[k] = self.substitute(v)
|
|
206
|
+
elif isinstance(v, list):
|
|
207
|
+
for i in range(len(v)):
|
|
208
|
+
if isinstance(v[i], str):
|
|
209
|
+
v[i] = self.substitute(v[i])
|
|
210
|
+
return d
|
|
211
|
+
|
|
194
212
|
def substitute(self, arg: str) -> str:
|
|
195
213
|
"""
|
|
196
214
|
substitute applies the values to the template arg.
|
|
@@ -83,7 +83,7 @@ torchx/schedulers/ray/__init__.py,sha256=fE0IHi1JJpxsNVBNzWNee2thrNXFFRhY94c80Rx
|
|
|
83
83
|
torchx/schedulers/ray/ray_common.py,sha256=pyNYFvTKVwdjDAeCBNbPwAWwVNmlLOJWExfn90XY8u8,610
|
|
84
84
|
torchx/schedulers/ray/ray_driver.py,sha256=Wl-1jldL8veVKzmYDEeR2va3JSlAjZpFE1h8HWE9YVE,12286
|
|
85
85
|
torchx/specs/__init__.py,sha256=vF-WUu_4NZP30lCtNYg0YVenY6wRQ8k7K36fOxqbOKc,5477
|
|
86
|
-
torchx/specs/api.py,sha256=
|
|
86
|
+
torchx/specs/api.py,sha256=1qmajrQcTKhVWDdsuWc57y2s0UYO1tD0p7XYg20cm5Q,35609
|
|
87
87
|
torchx/specs/builders.py,sha256=QDcQrnCO4bdSaiP0216XbCgTsnLutO_1_FW5jDiEIWI,9939
|
|
88
88
|
torchx/specs/file_linter.py,sha256=IeiomB1BgHUlT-ZsvGxar3llY63NOupfLBrOrD_---A,11860
|
|
89
89
|
torchx/specs/finder.py,sha256=MnwxG_UC4a-3X2wQ37ANEQR6D1TvriCLyuVYBh_-wuI,16249
|
|
@@ -113,9 +113,9 @@ torchx/workspace/__init__.py,sha256=FqN8AN4VhR1C_SBY10MggQvNZmyanbbuPuE-JCjkyUY,
|
|
|
113
113
|
torchx/workspace/api.py,sha256=1heBmPgB-W5Zf9gwViM7NrqvHpZlVYeMN7jpY8Qkytc,5479
|
|
114
114
|
torchx/workspace/dir_workspace.py,sha256=npNW_IjUZm_yS5r-8hrRkH46ndDd9a_eApT64m1S1T4,2268
|
|
115
115
|
torchx/workspace/docker_workspace.py,sha256=PFu2KQNVC-0p2aKJ-W_BKA9ZOmXdCY2ABEkCExp3udQ,10269
|
|
116
|
-
torchx_nightly-2024.6.
|
|
117
|
-
torchx_nightly-2024.6.
|
|
118
|
-
torchx_nightly-2024.6.
|
|
119
|
-
torchx_nightly-2024.6.
|
|
120
|
-
torchx_nightly-2024.6.
|
|
121
|
-
torchx_nightly-2024.6.
|
|
116
|
+
torchx_nightly-2024.6.18.dist-info/LICENSE,sha256=WVHfXhFC0Ia8LTKt_nJVYobdqTJVg_4J3Crrfm2A8KQ,1721
|
|
117
|
+
torchx_nightly-2024.6.18.dist-info/METADATA,sha256=oypt_fwq9wzJbR8VbKz8RI-wd47bO0PdDC9AQSaS0kA,6184
|
|
118
|
+
torchx_nightly-2024.6.18.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
119
|
+
torchx_nightly-2024.6.18.dist-info/entry_points.txt,sha256=3JYZFlX9aWzR-Gs_qsx1zq7mlqbFz6Mi9rQUULW8caI,170
|
|
120
|
+
torchx_nightly-2024.6.18.dist-info/top_level.txt,sha256=pxew3bc2gsiViS0zADs0jb6kC5v8o_Yy_85fhHj_J1A,7
|
|
121
|
+
torchx_nightly-2024.6.18.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|