Skip to content

Switch from docker-compose to docker compose command.#2085

Merged
fressi-elastic merged 16 commits intoelastic:masterfrom
fressi-elastic:switch-to-docker-compose-v2
Apr 2, 2026
Merged

Switch from docker-compose to docker compose command.#2085
fressi-elastic merged 16 commits intoelastic:masterfrom
fressi-elastic:switch-to-docker-compose-v2

Conversation

@fressi-elastic
Copy link
Copy Markdown
Contributor

@fressi-elastic fressi-elastic commented Mar 31, 2026

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

  • Use docker compose instead of docker-compose in DockerLauncher, integration prerequisites (it/conftest.py), release-docker-test.sh, CCR recipe scripts, and contributor docs so the project matches Compose V2 / current Docker installs.
  • Rework docker/docker-compose-tests.yml: remove the top-level version, 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.
  • Refactor Docker dev image integration tests (it/docker_dev_image_test.py): module-scoped compose env/teardown, cases-driven scenarios, and docker compose run with captured stdout/stderr for clearer failures and debug logging.
  • list tracks in the docker dev image IT: Removed the golden file (it/resources/docker_dev_image_list_tracks_stdout.golden.json) and RALLY_UPDATE_DOCKER_LIST_TRACKS_GOLDEN. The test now uses assert_list_tracks_contains(expected_track_names), which returns a closure checked against docker compose run stdout, 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.
  • CI / image build resilience: Buildkite dev and release Docker pipelines use larger GCP machine types and one automatic retry on build steps; dev/release Dockerfiles retry pbzip2 download/build on transient failures.
  • Dependencies: bump the docker PyPI package to ≥7.1.0 (and lockfile), and pin pip to 26.0.1 in pyproject.toml / uv.lock; unit tests for DockerLauncher updated 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 in pyproject.toml.
  • pip==26.0.1: Pins the interpreter used for python -m pip install when loading track dependencies so CI and local installs stay reproducible. Rationale is also noted inline in pyproject.toml.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-compose invocations with docker compose across 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.

@fressi-elastic fressi-elastic force-pushed the switch-to-docker-compose-v2 branch from 8388962 to 059703c Compare March 31, 2026 13:47
@fressi-elastic fressi-elastic added the dependencies Pull requests that update a dependency file label Mar 31, 2026
fressi-elastic and others added 2 commits March 31, 2026 17:02
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@fressi-elastic fressi-elastic force-pushed the switch-to-docker-compose-v2 branch from 00138ec to b463964 Compare March 31, 2026 15:21
Copy link
Copy Markdown
Contributor

@gbanasiak gbanasiak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@fressi-elastic fressi-elastic added this to the 2.14.0 milestone Apr 1, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@fressi-elastic fressi-elastic force-pushed the switch-to-docker-compose-v2 branch from eb4bb06 to 7a74d1f Compare April 1, 2026 10:57
- 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
@fressi-elastic fressi-elastic enabled auto-merge (squash) April 1, 2026 15:49
@gareth-ellis gareth-ellis disabled auto-merge April 2, 2026 11:30
Copy link
Copy Markdown
Member

@gareth-ellis gareth-ellis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

fressi-elastic added a commit to fressi-elastic/rally that referenced this pull request Apr 2, 2026
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
Copy link
Copy Markdown
Member

@pquentin pquentin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you.

fressi-elastic and others added 3 commits April 2, 2026 15:30
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
@fressi-elastic
Copy link
Copy Markdown
Contributor Author

Status update (latest: e222110b)

Addressed open review feedback in recent commits:

Topic Resolution
@gareth-ellislist 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).
Copilotdocker compose down failure swallowed tear_down_stack now pytest.fail after logging (e222110b).
@pquentindocker 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
@fressi-elastic
Copy link
Copy Markdown
Contributor Author

Following review feedback, the docker dev image IT no longer uses a golden file for list tracks. The test now asserts that a small hardcoded subset of track names from the default repo (geonames, http_logs) appears in parsed stdout, which avoids brittle full-list updates and the golden maintenance/discoverability concern. Please resolve the related review threads if this matches your expectations.

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
Copy link
Copy Markdown
Contributor

@gbanasiak gbanasiak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fressi-elastic fressi-elastic enabled auto-merge (squash) April 2, 2026 16:40
@fressi-elastic fressi-elastic merged commit 42136c9 into elastic:master Apr 2, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants