Skip to content

Commit

Permalink
GH-44667: [Archery] Suppress pull/push progress logs
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Nov 7, 2024
1 parent df24a82 commit 30ff1a4
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions dev/archery/archery/docker/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def _execute_docker(self, *args, **kwargs):

def pull(self, service_name, pull_leaf=True, ignore_pull_failures=True):
def _pull(service):
args = ['pull']
args = ['pull', '--quiet']
if service['image'] in self.pull_memory:
return

Expand Down Expand Up @@ -427,9 +427,9 @@ def run(self, service_name, command=None, *, env=None, volumes=None,
def push(self, service_name, user=None, password=None):
def _push(service):
if self.config.using_docker:
return self._execute_docker('push', service['image'])
return self._execute_docker('push', '--quiet', service['image'])
else:
return self._execute_compose('push', service['name'])
return self._execute_compose('push', '--quiet', service['name'])

if user is not None:
try:
Expand Down
20 changes: 10 additions & 10 deletions dev/archery/archery/docker/tests/test_docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ def test_compose_default_params_and_env(arrow_compose_path):

def test_forwarding_env_variables(arrow_compose_path):
expected_calls = [
"pull --ignore-pull-failures conda-cpp",
"pull --quiet --ignore-pull-failures conda-cpp",
"build conda-cpp",
]
expected_env = PartialEnv(
Expand All @@ -290,24 +290,24 @@ def test_compose_pull(arrow_compose_path):
compose = DockerCompose(arrow_compose_path)

expected_calls = [
"pull --ignore-pull-failures conda-cpp",
"pull --quiet --ignore-pull-failures conda-cpp",
]
with assert_compose_calls(compose, expected_calls):
compose.clear_pull_memory()
compose.pull('conda-cpp')

expected_calls = [
"pull --ignore-pull-failures conda-cpp",
"pull --ignore-pull-failures conda-python",
"pull --ignore-pull-failures conda-python-pandas"
"pull --quiet --ignore-pull-failures conda-cpp",
"pull --quiet --ignore-pull-failures conda-python",
"pull --quiet --ignore-pull-failures conda-python-pandas"
]
with assert_compose_calls(compose, expected_calls):
compose.clear_pull_memory()
compose.pull('conda-python-pandas')

expected_calls = [
"pull --ignore-pull-failures conda-cpp",
"pull --ignore-pull-failures conda-python",
"pull --quiet --ignore-pull-failures conda-cpp",
"pull --quiet --ignore-pull-failures conda-python",
]
with assert_compose_calls(compose, expected_calls):
compose.clear_pull_memory()
Expand All @@ -316,8 +316,8 @@ def test_compose_pull(arrow_compose_path):

def test_compose_pull_params(arrow_compose_path):
expected_calls = [
"pull --ignore-pull-failures conda-cpp",
"pull --ignore-pull-failures conda-python",
"pull --quiet --ignore-pull-failures conda-cpp",
"pull --quiet --ignore-pull-failures conda-python",
]
compose = DockerCompose(arrow_compose_path, params=dict(UBUNTU='18.04'))
expected_env = PartialEnv(PYTHON='3.8', PANDAS='latest')
Expand Down Expand Up @@ -483,7 +483,7 @@ def test_compose_push(arrow_compose_path):
for image in ["conda-cpp", "conda-python", "conda-python-pandas"]:
expected_calls.append(
mock.call(["docker", "compose", f"--file={compose.config.path}",
"push", image], check=True, env=expected_env)
"push", "--quiet", image], check=True, env=expected_env)
)
with assert_subprocess_calls(expected_calls):
compose.push('conda-python-pandas', user='user', password='pass')
Expand Down
6 changes: 3 additions & 3 deletions dev/archery/archery/docker/tests/test_docker_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def test_docker_run_with_custom_command(run, build, pull):

assert result.exit_code == 0
pull.assert_called_once_with(
"ubuntu-cpp", pull_leaf=True,
"--quiet", "ubuntu-cpp", pull_leaf=True,
)
build.assert_called_once_with(
"ubuntu-cpp",
Expand Down Expand Up @@ -72,7 +72,7 @@ def test_docker_run_options(run, build, pull):
result = CliRunner().invoke(docker, args)
assert result.exit_code == 0
pull.assert_called_once_with(
"ubuntu-cpp", pull_leaf=True,
"--quiet", "ubuntu-cpp", pull_leaf=True,
)
build.assert_called_once_with(
"ubuntu-cpp",
Expand Down Expand Up @@ -149,7 +149,7 @@ def test_docker_run_only_pulling_and_building(build, pull):
result = CliRunner().invoke(docker, args)
assert result.exit_code == 0
pull.assert_called_once_with(
"ubuntu-cpp", pull_leaf=True,
"--quiet", "ubuntu-cpp", pull_leaf=True,
)
build.assert_called_once_with(
"ubuntu-cpp",
Expand Down

0 comments on commit 30ff1a4

Please sign in to comment.