Switch from docker-compose to docker compose command.#2085
Switch from docker-compose to docker compose command.#2085fressi-elastic merged 16 commits intoelastic:masterfrom
docker-compose to docker compose command.#2085Conversation
There was a problem hiding this comment.
Pull request overview
Updates the repository to use Docker Compose v2 (docker compose) instead of the legacy docker-compose binary to avoid dependency conflicts with Rally’s tooling.
Changes:
- Replace
docker-composeinvocations withdocker composeacross launcher code, tests, scripts, recipes, and docs. - Refactor the Docker dev image integration test to be table-driven (multiple commands) and run via
subprocess. - Update the Docker Compose integration test stack configuration (Elasticsearch image/env/healthcheck).
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/mechanic/launcher_test.py | Update expected subprocess command strings to docker compose. |
| release-docker-test.sh | Use docker compose in prerequisites check and integration test orchestration. |
| recipes/ccr/stop.sh | Switch stop commands to docker compose. |
| recipes/ccr/start.sh | Switch start commands to docker compose. |
| it/docker_dev_image_test.py | Refactor docker image IT into table-driven cases and switch to docker compose. |
| it/conftest.py | Update integration test prerequisite check to docker compose version. |
| esrally/mechanic/launcher.py | Update DockerLauncher compose command builder to docker compose. |
| docs/developing.rst | Update developer docs to reference docker compose. |
| docker/docker-compose-tests.yml | Update ES container image/config and healthcheck used by docker-compose based integration tests. |
| CONTRIBUTING.md | Update contribution docs to reference docker compose. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
8388962 to
059703c
Compare
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
00138ec to
b463964
Compare
There was a problem hiding this comment.
I've noticed the following warnings, please address them:
it/docker_dev_image_test.py::test_docker_compose[help] WARN[0000] The "RALLY_DOCKER_IMAGE" variable is not set. Defaulting to a blank string.
--
WARN[0000] The "RALLY_VERSION_TAG" variable is not set. Defaulting to a blank string.
WARN[0000] The "TEST_COMMAND" variable is not set. Defaulting to a blank string.
[+] Running 5/5
✔ Container rally Removed 0.0s
✔ Container es01 Removed 0.0s
✔ Volume docker_esdata1 Removed 0.0s
✔ Volume docker_rally Removed 0.0s
✔ Network rally-tests Removed 0.1s
PASSED
… the same module reuses the same instance for it.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 12 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Log then pytest.fail when docker compose down fails in IT teardown - Use docker compose -f for debug logs collection - Parameterize test compose image with RALLY_DOCKER_IMAGE default - Document docker-py and pip constraints in pyproject.toml Made-with: Cursor
eb4bb06 to
7a74d1f
Compare
- Use unquoted ${VAR:-default} for image and command
- Allow overriding Dockerfile path via RALLY_DOCKER_FILE
- Pin Elasticsearch to 7.17.0; comment xpack security env vars
Made-with: Cursor
gareth-ellis
left a comment
There was a problem hiding this comment.
LGTM - i wonder why the list tracks test was removed. I disabled auto merge so @gbanasiak can confirm he's happy with the changes you made based on his review
Restore the ten paths touched by both the ES client upgrade and the docker-compose v2 migration to origin/master so the client-upgrade follow-up branch does not carry duplicate changes. pyproject.toml and uv.lock stay on the esclient-upgrade-2 versions. Made-with: Cursor
Extend the docker compose integration test with a list tracks case that normalizes CLI output and compares it to a golden file under it/resources/. ComposeCase.want_stdout may be a callable for custom checks; refresh the golden when the file is missing or empty, or when RALLY_UPDATE_DOCKER_LIST_TRACKS_GOLDEN=1. Log a warning before overwriting the golden. Also cover the explicit esrally-prefixed race command. Made-with: Cursor
Co-authored-by: Quentin Pradet <quentin.pradet@gmail.com>
- Pin docker-py to 7.1.0; trim dependency comments (pquentin review). - Add _docker_compose_process_env with defaults for TEST_COMMAND and RALLY_DOCKER_FILE to silence compose variable warnings on down/logs. - Fail tests when docker compose down fails (Copilot review). - Document image+build, ports, and security/xpack in docker-compose-tests.yml. - Format _RACE_FLAGS string split across lines. Made-with: Cursor
Status update (latest:
|
| Topic | Resolution |
|---|---|
@gareth-ellis — list tracks removed |
Restored via list tracks case + golden: it/resources/docker_dev_image_list_tracks_stdout.golden.txt; refresh with RALLY_UPDATE_DOCKER_LIST_TRACKS_GOLDEN=1 (5bf86121). |
@gbanasiak — Compose WARN … variable is not set |
_docker_compose_process_env() sets defaults for TEST_COMMAND and RALLY_DOCKER_FILE on down / logs / run (e222110b). |
Copilot — docker compose down failure swallowed |
tear_down_stack now pytest.fail after logging (e222110b). |
@pquentin — docker not pinned / long comments |
docker==7.1.0; shortened docker + pip dependency comments (e222110b). |
@pquentin — commented ports / security |
Expanded YAML comments for ports, xpack, and CA docs pointer; image+build behavior (e222110b). |
| CONTRIBUTING.md | Updated with co-authored merge (0000a2c1). |
Please resolve conversation threads on GitHub where this matches your expectations, or reply if something still needs changes.
- Parse docker list tracks output to a sorted JSON array; replace .golden.txt with .golden.json - Document when to enable xpack security overrides for ES 8+ and how to obtain the HTTP CA - Expand rally service comment on RALLY_DOCKER_IMAGE/RALLY_VERSION_TAG vs build fallback for release and local runs Made-with: Cursor
|
Following review feedback, the docker dev image IT no longer uses a golden file for |
Remove the docker dev image golden JSON for `list tracks` and replace it with `assert_list_tracks_contains`, which returns a stdout checker for an inline list of expected track names. This matches review feedback to avoid brittle full-output goldens and unclear update workflows. Made-with: Cursor
Summary
Replaces the legacy Compose v1 binary with the Docker CLI plugin everywhere it mattered for Rally, and tightens the dev/test Docker story so CI and local runs stay reliable.
Changes
docker composeinstead ofdocker-composeinDockerLauncher, integration prerequisites (it/conftest.py),release-docker-test.sh, CCR recipe scripts, and contributor docs so the project matches Compose V2 / current Docker installs.docker/docker-compose-tests.yml: remove the top-levelversion, build the Rally image from the dev Dockerfile with a stable default image name/tag, upgrade the test Elasticsearch image to 8.19.13, turn off security for the test node, replace the ES healthcheck (cluster health, not red), increase retries, and leave host port mapping commented to avoid clashes.it/docker_dev_image_test.py): module-scoped compose env/teardown,cases-driven scenarios, anddocker compose runwith captured stdout/stderr for clearer failures and debug logging.list tracksin the docker dev image IT: Removed the golden file (it/resources/docker_dev_image_list_tracks_stdout.golden.json) andRALLY_UPDATE_DOCKER_LIST_TRACKS_GOLDEN. The test now usesassert_list_tracks_contains(expected_track_names), which returns a closure checked againstdocker compose runstdout, with an inline list of stable default-repo track names (elastic/logs,geonames,http_logs,nyc_taxis,so_vector). This matches review feedback to avoid brittle full-output goldens and unclear maintenance for track authors.dockerPyPI package to ≥7.1.0 (and lockfile), and pinpipto 26.0.1 inpyproject.toml/uv.lock; unit tests forDockerLauncherupdated for the new command string.Dependency rationale
docker(docker-py) ≥7.1.0: Matches expectations of current Docker Engine APIs; 6.x is a poor fit for newer daemons. Rationale is also noted inline inpyproject.toml.pip==26.0.1: Pins the interpreter used forpython -m pip installwhen loading track dependencies so CI and local installs stay reproducible. Rationale is also noted inline inpyproject.toml.