torchx-nightly 2024.4.11__py3-none-any.whl → 2024.4.13__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/builders.py CHANGED
@@ -18,8 +18,6 @@ from torchx.util.types import decode, decode_optional, get_argparse_param_type,
18
18
 
19
19
  from .api import AppDef, DeviceMount
20
20
 
21
- ENV_TORCHX_COMPONENT_ARGS = "TORCHX_COMPONENT_ARGS"
22
-
23
21
 
24
22
  def _create_args_parser(
25
23
  cmpnt_fn: Callable[..., AppDef],
@@ -136,7 +134,6 @@ def materialize_appdef(
136
134
  cmpnt_args: List[str],
137
135
  cmpnt_defaults: Optional[Dict[str, Any]] = None,
138
136
  config: Optional[Dict[str, Any]] = None,
139
- component_args_string: Optional[str] = None,
140
137
  ) -> AppDef:
141
138
  """
142
139
  Creates an application by running user defined ``app_fn``.
@@ -191,10 +188,6 @@ def materialize_appdef(
191
188
 
192
189
  appdef = cmpnt_fn(*function_args, *var_arg, **kwargs)
193
190
 
194
- if component_args_string:
195
- for role in appdef.roles:
196
- role.env[ENV_TORCHX_COMPONENT_ARGS] = component_args_string
197
-
198
191
  return appdef
199
192
 
200
193
 
@@ -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
- image, _ = self._docker_client.images.build(
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
- role.image = image.id
158
+ assert image_id, "image id was not found"
159
+ role.image = image_id
160
+
140
161
  finally:
141
162
  context.close()
142
163
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: torchx-nightly
3
- Version: 2024.4.11
3
+ Version: 2024.4.13
4
4
  Summary: TorchX SDK and Components
5
5
  Home-page: https://github.com/pytorch/torchx
6
6
  Author: TorchX Devs
@@ -83,7 +83,7 @@ torchx/schedulers/ray/ray_common.py,sha256=pyNYFvTKVwdjDAeCBNbPwAWwVNmlLOJWExfn9
83
83
  torchx/schedulers/ray/ray_driver.py,sha256=Wl-1jldL8veVKzmYDEeR2va3JSlAjZpFE1h8HWE9YVE,12286
84
84
  torchx/specs/__init__.py,sha256=vF-WUu_4NZP30lCtNYg0YVenY6wRQ8k7K36fOxqbOKc,5477
85
85
  torchx/specs/api.py,sha256=_euy2mCO-P7qQSxt_476GlePXEa_7H4BAzJQHX3fANY,34736
86
- torchx/specs/builders.py,sha256=UqNvVrJ3ZMbvv6qcfp1ZNxBpjcwQSvle29EVw1TMzUM,10178
86
+ torchx/specs/builders.py,sha256=QDcQrnCO4bdSaiP0216XbCgTsnLutO_1_FW5jDiEIWI,9939
87
87
  torchx/specs/file_linter.py,sha256=IeiomB1BgHUlT-ZsvGxar3llY63NOupfLBrOrD_---A,11860
88
88
  torchx/specs/finder.py,sha256=MnwxG_UC4a-3X2wQ37ANEQR6D1TvriCLyuVYBh_-wuI,16249
89
89
  torchx/specs/named_resources_aws.py,sha256=8jsbFZFTa1ZkdpZmBrqhVfSVuZonrXbADhTPmIRdtEQ,7743
@@ -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=-utUxu1DFVJ5nAXTERDxz4Rr8CzdKO7Tkqfzap1HvHo,9425
115
- torchx_nightly-2024.4.11.dist-info/LICENSE,sha256=WVHfXhFC0Ia8LTKt_nJVYobdqTJVg_4J3Crrfm2A8KQ,1721
116
- torchx_nightly-2024.4.11.dist-info/METADATA,sha256=FKvlFUTDFZvqLTi1kNR_qwj9wPsyxtBlEjTsd_FPD_Q,6053
117
- torchx_nightly-2024.4.11.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
118
- torchx_nightly-2024.4.11.dist-info/entry_points.txt,sha256=3JYZFlX9aWzR-Gs_qsx1zq7mlqbFz6Mi9rQUULW8caI,170
119
- torchx_nightly-2024.4.11.dist-info/top_level.txt,sha256=pxew3bc2gsiViS0zADs0jb6kC5v8o_Yy_85fhHj_J1A,7
120
- torchx_nightly-2024.4.11.dist-info/RECORD,,
114
+ torchx/workspace/docker_workspace.py,sha256=PFu2KQNVC-0p2aKJ-W_BKA9ZOmXdCY2ABEkCExp3udQ,10269
115
+ torchx_nightly-2024.4.13.dist-info/LICENSE,sha256=WVHfXhFC0Ia8LTKt_nJVYobdqTJVg_4J3Crrfm2A8KQ,1721
116
+ torchx_nightly-2024.4.13.dist-info/METADATA,sha256=Gqwinwo_BIR4uMjdP_BiTZ-FGiVI55kzI8mm51r0lJs,6053
117
+ torchx_nightly-2024.4.13.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
118
+ torchx_nightly-2024.4.13.dist-info/entry_points.txt,sha256=3JYZFlX9aWzR-Gs_qsx1zq7mlqbFz6Mi9rQUULW8caI,170
119
+ torchx_nightly-2024.4.13.dist-info/top_level.txt,sha256=pxew3bc2gsiViS0zADs0jb6kC5v8o_Yy_85fhHj_J1A,7
120
+ torchx_nightly-2024.4.13.dist-info/RECORD,,