Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MINOR: [Archery] Output full Docker progress when --debug is passed #40129

Merged
merged 2 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.get('debug', False))
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
Loading