Skip to content

Commit

Permalink
MINOR: [Archery] Output full Docker progress when --debug is passed
Browse files Browse the repository at this point in the history
  • Loading branch information
pitrou committed Feb 19, 2024
1 parent ca67ec2 commit 6462e22
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dev/archery/archery/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion dev/archery/archery/docker/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion dev/archery/archery/docker/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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:
Expand All @@ -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)
Expand Down

0 comments on commit 6462e22

Please sign in to comment.