Skip to content

Commit deafd41

Browse files
d4l3kfacebook-github-bot
authored andcommitted
schedulers/local_scheduler: silence docker version output (#290)
Summary: 88a3f41 accidentally added some extra log spam from `docker version` this hides it. Pull Request resolved: #290 Test Plan: ``` tristanr@tristanr-arch2 ~/D/torchx (dockerquiet)> torchx run utils.echo 0.1.0rc2: Pulling from pytorch/torchx Digest: sha256:f97df7bd3d2137b3dcb6b85e14f4eef9c1c7cdd826d12508cc7cafb08bb2f704 Status: Image is up to date for ghcr.io/pytorch/torchx:0.1.0rc2 ghcr.io/pytorch/torchx:0.1.0rc2 local_docker://torchx/echo_484dcf48 torchx 2021-10-20 14:23:25 INFO Waiting for the app to finish... WARNING: IPv4 forwarding is disabled. Networking will not work. hello world torchx 2021-10-20 14:23:27 INFO Job finished: SUCCEEDED ``` Reviewed By: aivanou Differential Revision: D31809970 Pulled By: d4l3k fbshipit-source-id: cac5076e8cf9f5ca691fdefe1a31c07fe17b1e81
1 parent de8ac4d commit deafd41

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

torchx/schedulers/local_scheduler.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,14 @@ def __init__(self, cfg: RunConfig) -> None:
230230
@staticmethod
231231
def has_docker() -> bool:
232232
try:
233-
return subprocess.run(["docker", "version"]).returncode == 0
233+
return (
234+
subprocess.run(
235+
["docker", "version"],
236+
stdout=subprocess.DEVNULL,
237+
stderr=subprocess.DEVNULL,
238+
).returncode
239+
== 0
240+
)
234241
except FileNotFoundError:
235242
return False
236243

0 commit comments

Comments
 (0)