KellenSunderland commented on a change in pull request #12276: [Don't
merge][Review] A solution to prevent zombie containers locally and in CI
URL: https://github.com/apache/incubator-mxnet/pull/12276#discussion_r211874543
##########
File path: ci/build.py
##########
@@ -312,31 +521,37 @@ def use_cache():
tag = get_docker_tag(platform=platform, registry=args.docker_registry)
if use_cache():
load_docker_cache(tag=tag, docker_registry=args.docker_registry)
- build_docker(platform, docker_binary, registry=args.docker_registry,
num_retries=num_docker_build_retires)
+ build_docker(platform, docker_binary, registry=args.docker_registry,
num_retries=args.docker_build_retries, use_cache=use_cache())
if args.build_only:
logging.warning("Container was just built. Exiting due to
build-only.")
return 0
+ ret = 0
if command:
- container_run(platform=platform, docker_binary=docker_binary,
shared_memory_size=shared_memory_size,
+ ret = container_run(platform=platform,
nvidia_runtime=args.nvidiadocker, shared_memory_size=shared_memory_size,
command=command,
docker_registry=args.docker_registry,
- local_ccache_dir=args.ccache_dir,
interactive=args.interactive)
+ local_ccache_dir=args.ccache_dir,
interactive=args.interactive, cleanup=cleanup)
elif args.print_docker_run:
- print(container_run(platform=platform,
docker_binary=docker_binary, shared_memory_size=shared_memory_size,
- command=[], dry_run=True,
docker_registry=args.docker_registry, local_ccache_dir=args.ccache_dir))
+ ret = container_run(platform=platform,
nvidia_runtime=args.nvidiadocker, shared_memory_size=shared_memory_size,
+ command=[], dry_run=True,
docker_registry=args.docker_registry,
+ local_ccache_dir=args.ccache_dir)
+ command=[]
elif args.interactive:
- container_run(platform=platform, docker_binary=docker_binary,
shared_memory_size=shared_memory_size,
+ ret = container_run(platform=platform,
nvidia_runtime=args.nvidiadocker, shared_memory_size=shared_memory_size,
command=command,
docker_registry=args.docker_registry,
- local_ccache_dir=args.ccache_dir,
interactive=args.interactive)
-
+ local_ccache_dir=args.ccache_dir,
interactive=args.interactive, cleanup=cleanup)
else:
# With no commands, execute a build function for the target
platform
assert not args.interactive, "when running with -i must provide a
command"
- cmd = ["/work/mxnet/ci/docker/runtime_functions.sh",
"build_{}".format(platform)]
- logging.info("No command specified, trying default build: %s", '
'.join(cmd))
- container_run(platform=platform, docker_binary=docker_binary,
shared_memory_size=shared_memory_size,
- command=cmd, docker_registry=args.docker_registry,
- local_ccache_dir=args.ccache_dir)
+ command = ["/work/mxnet/ci/docker/runtime_functions.sh",
"build_{}".format(platform)]
+ logging.info("No command specified, trying default build: %s", '
'.join(command))
+ ret = container_run(platform=platform,
nvidia_runtime=args.nvidiadocker, shared_memory_size=shared_memory_size,
+ command=command,
docker_registry=args.docker_registry,
+ local_ccache_dir=args.ccache_dir, cleanup=cleanup)
+
+ if ret != 0:
Review comment:
Do we return 0 on success?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services