torchx-nightly 2024.4.11__py3-none-any.whl → 2024.4.12__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/workspace/docker_workspace.py +23 -2
- {torchx_nightly-2024.4.11.dist-info → torchx_nightly-2024.4.12.dist-info}/METADATA +1 -1
- {torchx_nightly-2024.4.11.dist-info → torchx_nightly-2024.4.12.dist-info}/RECORD +7 -7
- {torchx_nightly-2024.4.11.dist-info → torchx_nightly-2024.4.12.dist-info}/LICENSE +0 -0
- {torchx_nightly-2024.4.11.dist-info → torchx_nightly-2024.4.12.dist-info}/WHEEL +0 -0
- {torchx_nightly-2024.4.11.dist-info → torchx_nightly-2024.4.12.dist-info}/entry_points.txt +0 -0
- {torchx_nightly-2024.4.11.dist-info → torchx_nightly-2024.4.12.dist-info}/top_level.txt +0 -0
|
@@ -18,6 +18,7 @@ from typing import Dict, IO, Iterable, Mapping, Optional, TextIO, Tuple, TYPE_CH
|
|
|
18
18
|
import fsspec
|
|
19
19
|
|
|
20
20
|
import torchx
|
|
21
|
+
from docker.errors import BuildError
|
|
21
22
|
from torchx.specs import AppDef, CfgVal, Role, runopts
|
|
22
23
|
from torchx.workspace.api import walk_workspace, WorkspaceMixin
|
|
23
24
|
|
|
@@ -93,6 +94,12 @@ class DockerWorkspaceMixin(WorkspaceMixin[Dict[str, Tuple[str, str]]]):
|
|
|
93
94
|
type_=str,
|
|
94
95
|
help="(remote jobs) the image repository to use when pushing patched images, must have push access. Ex: example.com/your/container",
|
|
95
96
|
)
|
|
97
|
+
opts.add(
|
|
98
|
+
"quiet",
|
|
99
|
+
type_=bool,
|
|
100
|
+
default=False,
|
|
101
|
+
help="whether to suppress verbose output for image building. Defaults to ``False``.",
|
|
102
|
+
)
|
|
96
103
|
return opts
|
|
97
104
|
|
|
98
105
|
def build_workspace_and_update_role(
|
|
@@ -121,7 +128,7 @@ class DockerWorkspaceMixin(WorkspaceMixin[Dict[str, Tuple[str, str]]]):
|
|
|
121
128
|
f"failed to pull image {role.image}, falling back to local: {e}"
|
|
122
129
|
)
|
|
123
130
|
log.info("Building workspace docker image (this may take a while)...")
|
|
124
|
-
|
|
131
|
+
build_events = self._docker_client.api.build(
|
|
125
132
|
fileobj=context,
|
|
126
133
|
custom_context=True,
|
|
127
134
|
dockerfile=TORCHX_DOCKERFILE,
|
|
@@ -131,12 +138,26 @@ class DockerWorkspaceMixin(WorkspaceMixin[Dict[str, Tuple[str, str]]]):
|
|
|
131
138
|
},
|
|
132
139
|
pull=False,
|
|
133
140
|
rm=True,
|
|
141
|
+
decode=True,
|
|
134
142
|
labels={
|
|
135
143
|
self.LABEL_VERSION: torchx.__version__,
|
|
136
144
|
},
|
|
137
145
|
)
|
|
146
|
+
image_id = None
|
|
147
|
+
for event in build_events:
|
|
148
|
+
if message := event.get("stream"):
|
|
149
|
+
if not cfg.get("quiet", False):
|
|
150
|
+
message = message.strip("\r\n").strip("\n")
|
|
151
|
+
if message:
|
|
152
|
+
log.info(message)
|
|
153
|
+
if aux := event.get("aux"):
|
|
154
|
+
image_id = aux["ID"]
|
|
155
|
+
if error := event.get("error"):
|
|
156
|
+
raise BuildError(reason=error, build_log=None)
|
|
138
157
|
if len(old_imgs) == 0 or role.image not in old_imgs:
|
|
139
|
-
|
|
158
|
+
assert image_id, "image id was not found"
|
|
159
|
+
role.image = image_id
|
|
160
|
+
|
|
140
161
|
finally:
|
|
141
162
|
context.close()
|
|
142
163
|
|
|
@@ -111,10 +111,10 @@ torchx/util/types.py,sha256=ynRZWRhmyLboRmz6XcCcu8617YhMh63NPC_6ysysyx8,7379
|
|
|
111
111
|
torchx/workspace/__init__.py,sha256=FqN8AN4VhR1C_SBY10MggQvNZmyanbbuPuE-JCjkyUY,798
|
|
112
112
|
torchx/workspace/api.py,sha256=1heBmPgB-W5Zf9gwViM7NrqvHpZlVYeMN7jpY8Qkytc,5479
|
|
113
113
|
torchx/workspace/dir_workspace.py,sha256=npNW_IjUZm_yS5r-8hrRkH46ndDd9a_eApT64m1S1T4,2268
|
|
114
|
-
torchx/workspace/docker_workspace.py,sha256
|
|
115
|
-
torchx_nightly-2024.4.
|
|
116
|
-
torchx_nightly-2024.4.
|
|
117
|
-
torchx_nightly-2024.4.
|
|
118
|
-
torchx_nightly-2024.4.
|
|
119
|
-
torchx_nightly-2024.4.
|
|
120
|
-
torchx_nightly-2024.4.
|
|
114
|
+
torchx/workspace/docker_workspace.py,sha256=PFu2KQNVC-0p2aKJ-W_BKA9ZOmXdCY2ABEkCExp3udQ,10269
|
|
115
|
+
torchx_nightly-2024.4.12.dist-info/LICENSE,sha256=WVHfXhFC0Ia8LTKt_nJVYobdqTJVg_4J3Crrfm2A8KQ,1721
|
|
116
|
+
torchx_nightly-2024.4.12.dist-info/METADATA,sha256=8ADv0FZxglMyQO_9Z2iaUS0TwyPPFycpMch4US2cLxs,6053
|
|
117
|
+
torchx_nightly-2024.4.12.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
118
|
+
torchx_nightly-2024.4.12.dist-info/entry_points.txt,sha256=3JYZFlX9aWzR-Gs_qsx1zq7mlqbFz6Mi9rQUULW8caI,170
|
|
119
|
+
torchx_nightly-2024.4.12.dist-info/top_level.txt,sha256=pxew3bc2gsiViS0zADs0jb6kC5v8o_Yy_85fhHj_J1A,7
|
|
120
|
+
torchx_nightly-2024.4.12.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|