Skip to content

Commit

Permalink
apacheGH-40954: [CI] Fix use of obsolete docker-compose command on Gi…
Browse files Browse the repository at this point in the history
…thub Actions (apache#40949)

### Rationale for this change

The `docker-compose` utility is progressively being removed from GHA-provided runners:
actions/runner-images#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: apache#40954

Authored-by: Antoine Pitrou <antoine@python.org>
Signed-off-by: Antoine Pitrou <antoine@python.org>
  • Loading branch information
pitrou authored and tolleybot committed May 4, 2024
1 parent ae9060d commit b2e5f18
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}
Expand Down
4 changes: 1 addition & 3 deletions dev/archery/archery/docker/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions dev/archery/archery/docker/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)])
Expand All @@ -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'])

Expand Down

0 comments on commit b2e5f18

Please sign in to comment.