Interact with Docker Compose based builds.
(ctx, src, dry_run, using_legacy_docker_compose, using_docker_cli,
using_docker_buildx)
| 66 | "across hosts.") |
| 67 | @click.pass_context |
| 68 | def docker(ctx, src, dry_run, using_legacy_docker_compose, using_docker_cli, |
| 69 | using_docker_buildx): |
| 70 | """ |
| 71 | Interact with Docker Compose based builds. |
| 72 | """ |
| 73 | ctx.ensure_object(dict) |
| 74 | |
| 75 | config_path = src.path / 'compose.yaml' |
| 76 | if not config_path.exists(): |
| 77 | raise click.ClickException( |
| 78 | "Docker compose configuration cannot be found in directory {}, " |
| 79 | f"try to pass the arrow source directory explicitly. {src}" |
| 80 | ) |
| 81 | |
| 82 | # take the Docker Compose parameters like PYTHON, PANDAS, UBUNTU from the |
| 83 | # environment variables to keep the usage similar to docker compose |
| 84 | using_docker_cli |= using_docker_buildx |
| 85 | compose_bin = ("docker-compose" if using_legacy_docker_compose |
| 86 | else "docker compose") |
| 87 | with group("Docker: Prepare"): |
| 88 | compose = DockerCompose(config_path, params=os.environ, |
| 89 | using_docker=using_docker_cli, |
| 90 | using_buildx=using_docker_buildx, |
| 91 | debug=ctx.obj.get('debug', False), |
| 92 | compose_bin=compose_bin) |
| 93 | if dry_run: |
| 94 | _mock_compose_calls(compose) |
| 95 | ctx.obj['compose'] = compose |
| 96 | |
| 97 | |
| 98 | @docker.command("check-config") |
nothing calls this directly
no test coverage detected