Skip to content

[mcp_gateway] Replace MLflow historical data with S3-based KPI pipeline - #121

Draft
ashtarkb wants to merge 8 commits into
openshift-psap:mainfrom
ashtarkb:mcp-gateway-s3-historical-data
Draft

[mcp_gateway] Replace MLflow historical data with S3-based KPI pipeline#121
ashtarkb wants to merge 8 commits into
openshift-psap:mainfrom
ashtarkb:mcp-gateway-s3-historical-data

Conversation

@ashtarkb

Copy link
Copy Markdown
Collaborator

Summary

  • Replace MLflow-based historical data fetching with Caliper's standard S3 import/export pipeline for KPI comparison
  • Rewrite Slack notifications to use S3-imported historical kpis.json files with version-aware filtering (skips same-version runs)
  • Add full S3 configuration (bucket, vault, import/export settings) and enable KPI CSV generation

Details

The previous implementation queried MLflow directly for historical run data, which had timing issues (called during do_test before MLflow export) and didn't align with how other projects (skeleton, llm_d) handle historical data.

This PR switches to Caliper's standard approach:

  1. After KPI generation, S3 import downloads previous runs' kpis.json into historical_data/
  2. The analyse_kpis step compares current vs historical KPIs
  3. S3 export uploads the current run's KPIs for future comparisons
  4. Notifications read from historical_data/ and filter by mcp_gateway_version to find the most recent different version for meaningful comparison

Test plan

  • Verify S3 bucket mcp-gateway-cpt-data is created and accessible
  • Run a nightly test and confirm KPIs are exported to S3
  • Run a second test and confirm historical data is imported and comparison table appears in Slack
  • Verify version filtering works (same version runs are skipped in comparison)

Made with Cursor

Switch from querying MLflow for historical run comparison to using
Caliper's standard S3 import/export pipeline for KPI historical data.

- Add S3 import/export configuration to config.yaml (bucket, vault, filters)
- Enable KPI CSV generation and historical data analysis
- Rewrite notifications to compare against S3-imported historical KPIs
  instead of querying MLflow API directly
- Add version-aware filtering: skip same-version runs when selecting
  the comparison baseline for Slack notifications
- Remove MLflow-specific run name parsing and metric key mapping

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

openshift-ci Bot commented Jul 12, 2026

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 12, 2026
@openshift-ci

openshift-ci Bot commented Jul 12, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign sjmonson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 637bf16d-dfe6-49d3-99f1-32b758a6f010

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

ashtarkb and others added 4 commits July 12, 2026 18:27
… matching

- Add `analyze_kpis` hook to Caliper's PostProcessingPlugin interface,
  allowing projects to implement custom regression analysis
- Update caliper's analyze step to delegate to plugin when implemented
- Create mcp_gateway analyze module with full matching logic:
  - SHA vs semver version type filtering
  - Load config matching (num_servers + users)
  - Preset matching
  - Same-version deduplication
- Update notifications to reuse analyze module's matching logic

Co-authored-by: Cursor <cursoragent@cursor.com>
@openshift-ci openshift-ci Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 13, 2026
ashtarkb and others added 2 commits July 13, 2026 13:31
…orical-data

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

# Conflicts:
#	fournos/gitops/base/workflows/task-forge-step.yaml
…egation

Restore the upstream run_kpi_analysis() code exactly as-is and add only
the plugin delegation logic (_load_plugin + try plugin.analyze_kpis first).

Co-authored-by: Cursor <cursoragent@cursor.com>
@openshift-ci openshift-ci Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 13, 2026
@psap-forge-bot

Copy link
Copy Markdown

🔴 Execution of mcp_gateway demo 🔴

Execution Engine Configuration

forge:
  args:
  - demo
  configOverrides:
    infrastructure.mcp_gateway_version: 18ae80d08857dbd97a85dfc05d65889c56b69dab
  project: mcp_gateway

Artifact Links

Test Logs

00 Pre-Cleanup 1 second

01 Prepare 2 minutes, 26 seconds

02 Preflight 30 seconds

03 Test 15 minutes, 49 seconds

04 Post-Cleanup 2 minutes, 3 seconds

🔄 05 Export-Artifacts

Post-processing Status

- Add _load_kpi_file() helper that handles both single-document JSON
  and JSONL formats, converting flat JSONL records into the hierarchical
  {"tests": [...]} structure that plugins expect.
- Fix UnboundLocalError for sys in commands.py analyse_kpis_cmd by
  moving import sys to function scope.

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

Copy link
Copy Markdown

🔴 Execution of mcp_gateway demo 🔴

Execution Engine Configuration

forge:
  args:
  - demo
  configOverrides:
    infrastructure.mcp_gateway_version: 18ae80d08857dbd97a85dfc05d65889c56b69dab
  project: mcp_gateway

Artifact Links

Test Logs

00 Preflight 23 seconds

🔄 02 Export-Artifacts

@psap-forge-bot

Copy link
Copy Markdown

🟢 Execution of mcp_gateway demo 🟢

Execution Engine Configuration

forge:
  args:
  - demo
  configOverrides:
    infrastructure.mcp_gateway_version: 18ae80d08857dbd97a85dfc05d65889c56b69dab
  project: mcp_gateway

Artifact Links

Test Logs

00 Pre-Cleanup 8 seconds

01 Prepare 2 minutes, 24 seconds

02 Preflight 30 seconds

03 Test 15 minutes, 47 seconds

04 Post-Cleanup 1 minute, 50 seconds

🔄 05 Export-Artifacts

Post-processing Status

@psap-forge-bot

Copy link
Copy Markdown

🔴 Execution of mcp_gateway demo 🔴

Execution Engine Configuration

forge:
  args:
  - demo
  configOverrides:
    infrastructure.mcp_gateway_version: fa4340834ecf090c429130dc0c6479baf02767db
  project: mcp_gateway

Artifact Links

Test Logs

00 Pre-Cleanup 1 second

01 Prepare 6 minutes, 32 seconds

04 Post-Cleanup 1 minute, 46 seconds

🔄 05 Export-Artifacts

@psap-forge-bot

Copy link
Copy Markdown

🔴 Execution of mcp_gateway demo 🔴

Execution Engine Configuration

forge:
  args:
  - demo
  configOverrides:
    infrastructure.mcp_gateway_version: fa4340834ecf090c429130dc0c6479baf02767db
  project: mcp_gateway

Artifact Links

Test Logs

00 Pre-Cleanup 1 second

01 Prepare 6 minutes, 58 seconds

04 Post-Cleanup 1 minute, 33 seconds

🔄 05 Export-Artifacts

@psap-forge-bot

Copy link
Copy Markdown

🔴 Execution of mcp_gateway demo 🔴

Execution Engine Configuration

forge:
  args:
  - demo
  configOverrides:
    infrastructure.mcp_gateway_version: fa4340834ecf090c429130dc0c6479baf02767db
  project: mcp_gateway

Artifact Links

Test Logs

00 Pre-Cleanup 1 second

01 Prepare 6 minutes, 42 seconds

04 Post-Cleanup 1 minute, 32 seconds

🔄 05 Export-Artifacts

@psap-forge-bot

Copy link
Copy Markdown

🛑 Execution of mcp_gateway demo 🛑
🛑 JOB ABORTED - spec.shutdown=Stop

Execution Engine Configuration

forge:
  args:
  - demo
  configOverrides:
    infrastructure.mcp_gateway_version: fa4340834ecf090c429130dc0c6479baf02767db
  project: mcp_gateway

Artifact Links

Test Logs

00 Pre-Cleanup 1 second

01 Prepare

04 Post-Cleanup 1 minute, 38 seconds

🔄 05 Export-Artifacts

@psap-forge-bot

Copy link
Copy Markdown

🔴 Execution of mcp_gateway demo 🔴

Execution Engine Configuration

forge:
  args:
  - demo
  configOverrides:
    infrastructure.mcp_gateway_version: fa4340834ecf090c429130dc0c6479baf02767db
  project: mcp_gateway

Artifact Links

Test Logs

00 Pre-Cleanup 1 second

01 Prepare 2 minutes, 17 seconds

04 Post-Cleanup 11 seconds

🔄 05 Export-Artifacts

@psap-forge-bot

Copy link
Copy Markdown

🔴 Execution of mcp_gateway demo 🔴

Execution Engine Configuration

forge:
  args:
  - demo
  configOverrides:
    infrastructure.mcp_gateway_version: fa4340834ecf090c429130dc0c6479baf02767db
  project: mcp_gateway

Artifact Links

Test Logs

00 Pre-Cleanup 1 second

01 Prepare 2 minutes, 10 seconds

04 Post-Cleanup 9 seconds

🔄 05 Export-Artifacts

@psap-forge-bot

Copy link
Copy Markdown

🛑 Execution of mcp_gateway demo 🛑
🛑 JOB ABORTED - spec.shutdown=Stop

Execution Engine Configuration

forge:
  args:
  - demo
  configOverrides:
    infrastructure.mcp_gateway_version: fa4340834ecf090c429130dc0c6479baf02767db
  project: mcp_gateway

Artifact Links

Test Logs

00 Pre-Cleanup 1 second

01 Prepare

04 Post-Cleanup 9 seconds

🔄 05 Export-Artifacts

@psap-forge-bot

Copy link
Copy Markdown

🛑 Execution of mcp_gateway demo 🛑
🛑 JOB ABORTED - spec.shutdown=Stop

Execution Engine Configuration

forge:
  args:
  - demo
  configOverrides:
    infrastructure.mcp_gateway_version: fa4340834ecf090c429130dc0c6479baf02767db
  project: mcp_gateway

Artifact Links

Test Logs

00 Pre-Cleanup 1 second

01 Prepare

04 Post-Cleanup 1 minute, 31 seconds

🔄 05 Export-Artifacts

@psap-forge-bot

Copy link
Copy Markdown

🔴 Execution of mcp_gateway demo 🔴

Execution Engine Configuration

forge:
  args:
  - demo
  configOverrides:
    infrastructure.mcp_gateway_version: ' sha-18ae80d08857dbd97a85dfc05d65889c56b69dab'
  project: mcp_gateway

Artifact Links

Test Logs

00 Pre-Cleanup 1 second

01 Prepare 1 minute, 26 seconds

04 Post-Cleanup 1 minute, 27 seconds

🔄 05 Export-Artifacts

@ashtarkb
ashtarkb force-pushed the mcp-gateway-s3-historical-data branch from 4cacdc6 to 1ec55a8 Compare July 14, 2026 22:33
@psap-forge-bot

Copy link
Copy Markdown

🟢 Execution of mcp_gateway demo 🟢

Execution Engine Configuration

forge:
  args:
  - demo
  configOverrides:
    infrastructure.mcp_gateway_version: fa4340834ecf090c429130dc0c6479baf02767db
  project: mcp_gateway

Artifact Links

Test Logs

00 Pre-Cleanup 1 second

01 Prepare 2 minutes, 36 seconds

02 Preflight 28 seconds

03 Test 15 minutes, 52 seconds

04 Post-Cleanup 1 minute, 53 seconds

🔄 05 Export-Artifacts

Post-processing Status

@openshift-ci openshift-ci Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 17, 2026
@openshift-ci

openshift-ci Bot commented Jul 17, 2026

Copy link
Copy Markdown

PR needs rebase.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@kpouget

kpouget commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

@ashtarkb can this be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants