You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/06/01 22:38:17 UTC

[GitHub] szha commented on a change in pull request #11018: [MXNET-454] Move distributed Docker cache from S3 to Docker Hub

szha commented on a change in pull request #11018: [MXNET-454] Move distributed Docker cache from S3 to Docker Hub
URL: https://github.com/apache/incubator-mxnet/pull/11018#discussion_r192530982
 
 

 ##########
 File path: ci/build.py
 ##########
 @@ -229,44 +228,55 @@ def script_name() -> str:
         list_platforms()
     elif args.platform:
         platform = args.platform
-        tag = get_docker_tag(platform)
-        if args.download_docker_cache:
-            import docker_cache
-            logging.info('Docker cache download is enabled')
-            docker_cache.load_docker_cache(bucket_name=args.docker_cache_bucket, docker_tag=tag)
-        build_docker(platform, docker_binary)
+        tag = get_docker_tag(platform=platform, registry=docker_registry)
+        if args.docker_registry:
+            try:
+                import docker_cache
+                logging.info('Docker cache download is enabled')
+                docker_cache.load_docker_cache(registry=args.docker_registry, docker_tag=tag)
+            except Exception:
+                logging.exception('Unable to retrieve Docker cache. Continue without...')
+        build_docker(platform, docker_binary, registry=docker_registry)
         if args.build_only:
             logging.warning("Container was just built. Exiting due to build-only.")
             return 0
 
         if command:
-            container_run(platform, docker_binary, shared_memory_size, command)
+            container_run(platform=platform, docker_binary=docker_binary, shared_memory_size=shared_memory_size,
+                          command=command, docker_registry=docker_registry)
         elif args.print_docker_run:
-            print(container_run(platform, docker_binary, shared_memory_size, [], True))
+            print(container_run(platform=platform, docker_binary=docker_binary, shared_memory_size=shared_memory_size,
+                                command=[], dry_run=True, docker_registry=docker_registry))
         elif args.into_container:
-            container_run(platform, docker_binary, shared_memory_size, [], False, True)
+            container_run(platform=platform, docker_binary=docker_binary, shared_memory_size=shared_memory_size,
+                          command=[], dry_run=False, into_container=True, docker_registry=docker_registry)
         else:
             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, docker_binary, shared_memory_size, cmd)
+            container_run(platform=platform, docker_binary=docker_binary, shared_memory_size=shared_memory_size,
+                          command=cmd, docker_registry=docker_registry)
 
     elif args.all:
         platforms = get_platforms()
         logging.info("Building for all architectures: {}".format(platforms))
         logging.info("Artifacts will be produced in the build/ directory.")
         for platform in platforms:
-            if args.download_docker_cache:
-                import docker_cache
-                tag = get_docker_tag(platform)
-                logging.info('Docker cache download is enabled')
-                docker_cache.load_docker_cache(bucket_name=args.docker_cache_bucket, docker_tag=tag)
+            if args.docker_registry:
 
 Review comment:
   Seems to be repeating line 231?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services