From fe7d1c59e52c5e48283d577c7b64d4d8336519fe Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Wed, 3 Apr 2024 10:33:31 +0200 Subject: [PATCH] GH-40954: [CI] Fix use of obsolete docker-compose command on Github Actions (#40949) ### Rationale for this change The `docker-compose` utility is progressively being removed from GHA-provided runners: https://github.com/actions/runner-images/issues/9557 ### What changes are included in this PR? Use `docker` client CLI directly instead of `docker-compose` where possible. ### Are these changes tested? Yes, this should fix the sporadic CI failures because of the above migration. ### Are there any user-facing changes? No, except additional optional env var `ARCHERY_DEBUG`. * GitHub Issue: #40954 Authored-by: Antoine Pitrou Signed-off-by: Antoine Pitrou --- .github/workflows/go.yml | 2 ++ dev/archery/archery/docker/cli.py | 4 +--- dev/archery/archery/docker/core.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index d5f0d305a4dcc..11dc29dcae54e 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -79,12 +79,14 @@ jobs: { "arch-label": "ARM64", "arch": "arm64v8", + "archery-use-docker-cli": "0", "go": "1.21", "runs-on": ["self-hosted", "arm", "linux"] }, { "arch-label": "ARM64", "arch": "arm64v8", + "archery-use-docker-cli": "0", "go": "1.22", "runs-on": ["self-hosted", "arm", "linux"] } diff --git a/dev/archery/archery/docker/cli.py b/dev/archery/archery/docker/cli.py index 7053db2afccff..e6baf0ca1f002 100644 --- a/dev/archery/archery/docker/cli.py +++ b/dev/archery/archery/docker/cli.py @@ -77,9 +77,7 @@ def docker(ctx, src, dry_run, using_docker_cli, using_docker_buildx): compose = DockerCompose(config_path, params=os.environ, using_docker=using_docker_cli, using_buildx=using_docker_buildx, - debug=ctx.obj.get('debug', False), - compose_bin=("docker compose" if using_docker_cli - else "docker-compose")) + 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 7376bb0a3b72d..0b49111dd6944 100644 --- a/dev/archery/archery/docker/core.py +++ b/dev/archery/archery/docker/core.py @@ -311,7 +311,7 @@ def _build(service, use_cache): self._execute_docker("buildx", "build", *args) elif self.config.using_docker: # better for caching - if self.config.debug and os.name != "nt": + if self.config.debug: args.append("--progress=plain") for k, v in service['build'].get('args', {}).items(): args.extend(['--build-arg', '{}={}'.format(k, v)]) @@ -324,7 +324,7 @@ def _build(service, use_cache): ]) self._execute_docker("build", *args) else: - if self.config.debug and os.name != "nt": + if self.config.debug: args.append("--progress=plain") self._execute_compose("build", *args, service['name'])