Skip to content

[ML] Publish controller-protocol.version in Linux and DRA packaging - #3224

Merged
edsavage merged 3 commits into
elastic:mainfrom
edsavage:fix/publish-controller-protocol-version-linux-packaging
Sep 27, 2026
Merged

edsavage merged 3 commits into
elastic:mainfrom
edsavage:fix/publish-controller-protocol-version-linux-packaging

Conversation

@edsavage

@edsavage edsavage commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The controller-protocol.version marker was only wired into the Gradle buildZip packaging path, but the Linux artifacts that CI and DRA actually produce/consume are built by dev-tools/docker/docker_entrypoint.sh (the platform zip) and .buildkite/scripts/steps/create_dra.sh (the -deps/-nodeps split) — neither of which staged the marker. As a result the resolved -nodeps bundle contained no marker, and Elasticsearch's new verifyControllerProtocolVersion gate (from elastic/elasticsearch#159052) rejected it:

> Task :x-pack:plugin:ml:verifyControllerProtocolVersion FAILED
> None of the resolved native controller bundles (checked: ml-cpp-9.6.0-SNAPSHOT-deps.zip,
  ml-cpp-9.6.0-SNAPSHOT-nodeps.zip) contain a 'controller-protocol.version' file, at any depth
  (required: controller-protocol-version >= 2).

This surfaced in the nightly ml-cpp-pytorch-builds #832, whose triggered ml-cpp-pr-builds #3252 failed all three Java integration steps (multi-node, YAML REST, inference) on this gate. ml-cpp-snapshot-builds and DRA/staging stay green only because they don't run the Elasticsearch Java integration tests — but they were still publishing marker-less -nodeps/-deps bundles, so this fixes the shipped artifacts too.

Changes

  • dev-tools/docker/docker_entrypoint.sh: stage 3rd_party/controller-protocol.version at the bundle root before zipping (parity with the Gradle buildZip task). set -e makes a missing marker source fail here.
  • .buildkite/scripts/steps/create_dra.sh: add controller-protocol.version to the -nodeps include list so the marker ships alongside the controller it describes.
  • Guarded fast-fail checks in both paths so a future omission fails loudly at packaging time rather than as an opaque downstream Elasticsearch build failure.

Test plan

  • Green ml-cpp-pr-builds (the Java integration steps that run verifyControllerProtocolVersion now pass)
  • Confirm the produced ml-cpp-<version>-linux-x86_64.zip and ml-cpp-<version>-nodeps.zip contain controller-protocol.version (unzip -l ... | grep controller-protocol.version)
  • Verify aarch64 Docker path produces the marker as well

Verified against the artifacts from ml-cpp-pr-builds #3255:

  • ml-cpp-9.6.0-SNAPSHOT-linux-aarch64.zip — unzip -l shows controller-protocol.version (30 bytes) at the zip root.
  • ml-cpp-9.6.0-SNAPSHOT-linux-x86_64.zip — contains the controller-protocol.version entry.
  • In the PR pipeline the linux platform zip is copied in as both ml-cpp-<version>.zip and -nodeps.zip for the ES integration tests (run_es_tests.sh), so the passing verifyControllerProtocolVersion gate validated exactly this artifact. The dedicated create_dra.sh -nodeps/uber assembly runs in the snapshot/DRA pipeline and is now guarded by the new fast-fail marker checks.

Made with Cursor

The controller-protocol.version marker was only added to the Gradle
buildZip packaging path, but the Linux artifacts consumed by CI and DRA
are produced by dev-tools/docker/docker_entrypoint.sh (platform zip) and
.buildkite/scripts/steps/create_dra.sh (-deps/-nodeps split), neither of
which staged the marker. As a result the -nodeps bundle lacked the file
and Elasticsearch's new verifyControllerProtocolVersion gate rejected it,
failing the nightly PyTorch build's triggered Java integration tests.

Stage the marker at the bundle root in the Docker packaging step and add
it to the create_dra.sh -nodeps include list, with guarded fast-fail
checks in both paths so a future omission fails loudly at packaging time
rather than as an opaque downstream Elasticsearch build failure.

Co-authored-by: Cursor <cursoragent@cursor.com>
@elasticsearchmachine

Copy link
Copy Markdown

Pinging @elastic/ml-core (Team:ML)

… helper

Both the Linux Docker packaging path (dev-tools/docker/docker_entrypoint.sh)
and the DRA assembly step (.buildkite/scripts/steps/create_dra.sh) duplicated
the same unzip/grep fast-fail check for the controller-protocol.version marker.
Extract it into dev-tools/verify_controller_protocol_version.sh and source it
from both, keeping the unzip-availability guard in one place.

Co-authored-by: Cursor <cursoragent@cursor.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Critical issues remain in the DRA all-platform archive and marker verification pipeline.

Review effort: Lite
Findings: 2 High severity

Open (2)
What changed in this PR

Adds controller-protocol.version packaging and validation for Linux and DRA artifacts.

Changes:

  • Adds shared archive marker verification.
  • Stages the marker in Linux bundles.
  • Includes and validates it in DRA packaging.
File Summary
dev-tools/​verify_controller_protocol_version.sh Validates the controller protocol marker in archives; the pipefail/SIGPIPE interaction needs correction.
dev-tools/​docker/​docker_entrypoint.sh Stages the marker in Docker-built Linux artifacts.
.buildkite/​scripts/​steps/​create_dra.sh Adds the marker to split bundles, but the all-platform archive still omits it.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .buildkite/scripts/steps/create_dra.sh Outdated
Comment thread dev-tools/verify_controller_protocol_version.sh Outdated
- create_dra.sh: include controller-protocol.version in the all-platform
  ml-cpp-<version>.zip so the DRA uber artifact carries the marker too,
  matching the Gradle buildUberZip task, and verify it alongside -nodeps.
- verify_controller_protocol_version.sh: capture the unzip listing and match
  it via a here-string instead of piping into 'grep -q'. Under set -o pipefail
  grep could close the pipe early and SIGPIPE unzip, making a present marker
  be reported as missing.

Co-authored-by: Cursor <cursoragent@cursor.com>
@edsavage
edsavage enabled auto-merge (squash) September 27, 2026 22:48
@edsavage
edsavage disabled auto-merge September 27, 2026 22:48
@edsavage
edsavage merged commit 53f3d64 into elastic:main Sep 27, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants