You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by ra...@apache.org on 2024/02/19 14:11:23 UTC

(arrow) branch main updated: MINOR: [Archery] Output full Docker progress when --debug is passed (#40129)

This is an automated email from the ASF dual-hosted git repository.

raulcd pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/main by this push:
     new d1e852f4d8 MINOR: [Archery] Output full Docker progress when --debug is passed (#40129)
d1e852f4d8 is described below

commit d1e852f4d804d741422c258b8bdd0cb4ce7925b6
Author: Antoine Pitrou <an...@python.org>
AuthorDate: Mon Feb 19 15:11:16 2024 +0100

    MINOR: [Archery] Output full Docker progress when --debug is passed (#40129)
    
    Authored-by: Antoine Pitrou <an...@python.org>
    Signed-off-by: Raúl Cumplido <ra...@gmail.com>
---
 dev/archery/archery/cli.py         | 2 +-
 dev/archery/archery/docker/cli.py  | 3 ++-
 dev/archery/archery/docker/core.py | 7 ++++++-
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/dev/archery/archery/cli.py b/dev/archery/archery/cli.py
index 0ad3eee14d..32921afb2e 100644
--- a/dev/archery/archery/cli.py
+++ b/dev/archery/archery/cli.py
@@ -63,7 +63,7 @@ def archery(ctx, debug, pdb, quiet):
     if debug:
         logger.setLevel(logging.DEBUG)
 
-    ctx.debug = debug
+    ctx.obj['debug'] = debug
 
     if pdb:
         import pdb
diff --git a/dev/archery/archery/docker/cli.py b/dev/archery/archery/docker/cli.py
index 42caecd742..162f73ec0f 100644
--- a/dev/archery/archery/docker/cli.py
+++ b/dev/archery/archery/docker/cli.py
@@ -64,7 +64,8 @@ def docker(ctx, src, dry_run):
 
     # take the docker-compose parameters like PYTHON, PANDAS, UBUNTU from the
     # environment variables to keep the usage similar to docker-compose
-    compose = DockerCompose(config_path, params=os.environ)
+    compose = DockerCompose(config_path, params=os.environ,
+                            debug=ctx.obj.get('debug', False))
     if dry_run:
         _mock_compose_calls(compose)
     ctx.obj['compose'] = compose
diff --git a/dev/archery/archery/docker/core.py b/dev/archery/archery/docker/core.py
index b0e9d32552..184d980875 100644
--- a/dev/archery/archery/docker/core.py
+++ b/dev/archery/archery/docker/core.py
@@ -164,11 +164,12 @@ class Docker(Command):
 class DockerCompose(Command):
 
     def __init__(self, config_path, dotenv_path=None, compose_bin=None,
-                 params=None):
+                 params=None, debug=False):
         compose_bin = default_bin(compose_bin, 'docker-compose')
         self.config = ComposeConfig(config_path, dotenv_path, compose_bin,
                                     params)
         self.bin = compose_bin
+        self.debug = debug
         self.pull_memory = set()
 
     def clear_pull_memory(self):
@@ -296,6 +297,8 @@ class DockerCompose(Command):
                 self._execute_docker("buildx", "build", *args)
             elif using_docker:
                 # better for caching
+                if self.debug:
+                    args.append("--progress=plain")
                 for k, v in service['build'].get('args', {}).items():
                     args.extend(['--build-arg', '{}={}'.format(k, v)])
                 for img in cache_from:
@@ -307,6 +310,8 @@ class DockerCompose(Command):
                 ])
                 self._execute_docker("build", *args)
             else:
+                if self.debug:
+                    args.append("--progress=plain")
                 self._execute_compose("build", *args, service['name'])
 
         service = self.config.get(service_name)