From 6462e2267c38627cf39bbf31a600b94e9a72b2a2 Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Mon, 19 Feb 2024 13:24:20 +0100 Subject: [PATCH 1/2] MINOR: [Archery] Output full Docker progress when --debug is passed --- 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 0ad3eee14d1f3..32921afb2e61b 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 42caecd7427a4..ae6667128b81a 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['debug']) 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 b0e9d32552cbb..184d9808759b8 100644 --- a/dev/archery/archery/docker/core.py +++ b/dev/archery/archery/docker/core.py @@ -164,11 +164,12 @@ def __init__(self, docker_bin=None): 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 @@ def _build(service, use_cache): 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 @@ def _build(service, use_cache): ]) 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) From ff8bea7660e0d5e4937c14831fed715c9962a3c8 Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Mon, 19 Feb 2024 13:33:32 +0100 Subject: [PATCH 2/2] Fix test failure --- dev/archery/archery/docker/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/archery/archery/docker/cli.py b/dev/archery/archery/docker/cli.py index ae6667128b81a..162f73ec0ffe0 100644 --- a/dev/archery/archery/docker/cli.py +++ b/dev/archery/archery/docker/cli.py @@ -65,7 +65,7 @@ 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, - debug=ctx.obj['debug']) + debug=ctx.obj.get('debug', False)) if dry_run: _mock_compose_calls(compose) ctx.obj['compose'] = compose