Skip to content

[ML] Add serverless MKI testing for ml-cpp PR builds#3027

Open
edsavage wants to merge 2 commits intoelastic:mainfrom
edsavage:feature/serverless-pr-testing
Open

[ML] Add serverless MKI testing for ml-cpp PR builds#3027
edsavage wants to merge 2 commits intoelastic:mainfrom
edsavage:feature/serverless-pr-testing

Conversation

@edsavage
Copy link
Copy Markdown
Contributor

Summary

Adds the ability to build a serverless Elasticsearch Docker image with custom ml-cpp artifacts from a PR build and run E2E tests against MKI QA. This automates the manual process documented in elastic/ml-team#1243.

How to trigger

PR comment:

buildkite run_serverless_tests

PR label:
ci:run-serverless-tests

What it does

  1. Builds ml-cpp (Linux x86_64) from the PR branch (existing pipeline step)
  2. Sets up a local Ivy repo with the custom ml-cpp artifacts, using the same pattern as the existing ES integration tests
  3. Clones elasticsearch-serverless, initializes the ES submodule, and runs ./gradlew buildDockerImage -Dbuild.ml_cpp.repo=<local-ivy> to inject the custom ml-cpp
  4. Pushes the Docker image to docker.elastic.co/elasticsearch-ci/elasticsearch-serverless
  5. Triggers E2E tests via elasticsearch-serverless-e2e-tests-qa for both new and upgraded project scenarios

Files

  • .buildkite/pipelines/run_serverless_tests.yml.sh — pipeline definition chaining Docker build → E2E tests
  • .buildkite/scripts/steps/build_serverless_docker.sh — core script: Ivy repo setup, serverless Docker build, push
  • .buildkite/ml_pipeline/config.pyrun_serverless_tests flag with label/comment parsing
  • .buildkite/pipeline.json.py — wires serverless step into the PR pipeline
  • .buildkite/pull-requests.json — adds run_serverless_tests to trigger comment regex

Prerequisites verified

  • Vault: secret/ci/elastic-elasticsearch-serverless/migrated/es-license (license key) — accessible
  • Vault: secret/ci/elastic-elasticsearch-serverless/prod_docker_registry_credentials (Docker push) — accessible
  • Pipeline trigger: elasticsearch-serverless-e2e-tests-qa has trigger_mode: none with no restrictions, same pattern as existing appex-qa-stateful-custom-ml-cpp-build-testing

Relates elastic/ml-team#1243

Made with Cursor

@prodsecmachine
Copy link
Copy Markdown

prodsecmachine commented Apr 16, 2026

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@edsavage edsavage force-pushed the feature/serverless-pr-testing branch 4 times, most recently from d089817 to 86a5bb1 Compare April 16, 2026 04:08
Add pipeline and scripts to build a serverless ES Docker image
with custom ml-cpp artifacts and run E2E tests against MKI QA.

Triggered via PR comment (`buildkite run_serverless_tests`) or
label (`ci:run-serverless-tests`). Builds Linux x86_64 ml-cpp,
sets up a local Ivy repo, clones elasticsearch-serverless, builds
the Docker image with -Dbuild.ml_cpp.repo override, pushes to the
CI registry, and triggers the E2E QA pipeline.

Relates elastic/ml-team#1243

Made-with: Cursor
@edsavage edsavage force-pushed the feature/serverless-pr-testing branch from 86a5bb1 to 0c5b4ea Compare April 16, 2026 04:11
@elasticsearchmachine
Copy link
Copy Markdown

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

@edsavage edsavage force-pushed the feature/serverless-pr-testing branch 4 times, most recently from e493cb4 to 59cc65e Compare April 17, 2026 01:25
Instead of cloning elasticsearch-serverless from the ml-cpp
pipeline (which requires cross-repo GitHub token access), upload
the custom ml-cpp artifacts to an S3 staging path under the
existing prelert-artifacts bucket, then trigger the serverless
validation pipeline which runs in its own context with full
permissions.

The serverless pipeline picks up the custom artifacts via the
ML_CPP_REPO_OVERRIDE env var, which is passed through as
-Dbuild.ml_cpp.repo to the Gradle build. This requires a small
change in elasticsearch-serverless (documented in
docs/serverless-integration/).

Made-with: Cursor
@edsavage edsavage force-pushed the feature/serverless-pr-testing branch from 59cc65e to df41985 Compare April 17, 2026 02:03
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.

4 participants