Repository navigation
✨ Add MLflow integration for LLM trace observability - #569
Conversation
🔄 New Commits DetectedThe New HEAD: For maintainers: Please review the new changes and re-add the Security checklistBefore re-adding the label, verify the PR does NOT contain:
🤖 This is an automated security measure to prevent TOCTOU attacks |
🔄 New Commits DetectedThe New HEAD: For maintainers: Please review the new changes and re-add the Security checklistBefore re-adding the label, verify the PR does NOT contain:
🤖 This is an automated security measure to prevent TOCTOU attacks |
🔄 New Commits DetectedThe New HEAD: For maintainers: Please review the new changes and re-add the Security checklistBefore re-adding the label, verify the PR does NOT contain:
🤖 This is an automated security measure to prevent TOCTOU attacks |
| - /bin/bash | ||
| - -c | ||
| - | | ||
| pip install --quiet psycopg2-binary && \ |
There was a problem hiding this comment.
psycopg2-binary is installed at runtime using pip ... dependencies should be baked into image and we should pin a version that works. I suggest we use a sidecar init container to prepare dependencies OR we create a custom MLflow Docker image with psycopg2-binary pre-installed (we could perhaps add a git action to build it using our own ghcr.io/kagenti repo)
| port: 5000 | ||
| initialDelaySeconds: 10 | ||
| periodSeconds: 10 | ||
| failureThreshold: 30 # Allow up to 5 minutes for startup |
There was a problem hiding this comment.
Why so long ? Is because it may wait for Postgres to start or because currently need to do the pip install ? can it be 2 minutes ?
There was a problem hiding this comment.
yes, I'll try to make it quicker in iterations
|
It seems there is some issue with the e2e tests and cleanup. Perhaps some pods did not get to a ready state and the helm chart times out since we use |
|
Running locally I can see indeed that the MLflow pod does many restarts: and logs show: |
🔄 New Commits DetectedThe New HEAD: For maintainers: Please review the new changes and re-add the Security checklistBefore re-adding the label, verify the PR does NOT contain:
🤖 This is an automated security measure to prevent TOCTOU attacks |
🔄 New Commits DetectedThe New HEAD: For maintainers: Please review the new changes and re-add the Security checklistBefore re-adding the label, verify the PR does NOT contain:
🤖 This is an automated security measure to prevent TOCTOU attacks |
Use 'client.V1Secret' and 'ApiException' instead of 'kubernetes.client.V1Secret' — kubernetes is imported as 'from kubernetes import client'. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> Signed-off-by: Ladislav Smola <[email protected]>
The init thread's information_schema.tables query returns False in background threads even though the table exists - likely PostgreSQL catalog caching with new connections from a different thread. Replace with direct INSERT ... ON CONFLICT DO NOTHING which: - Works regardless of catalog cache state - Fails with a clear "table not found" error if table doesn't exist - Is idempotent (ON CONFLICT skips existing rows) - Removes the separate table-existence check entirely Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> Signed-off-by: Ladislav Smola <[email protected]>
New Commits DetectedThe New HEAD: For maintainers: Please review the new changes and comment Security checklistBefore running E2E tests, verify the PR does NOT contain:
This is an automated security measure to prevent TOCTOU attacks |
|
/run-e2e |
E2E HyperShift Tests FailedCommit: To re-run tests after fixing issues, comment |
E2E HyperShift Tests FailedCommit: To re-run tests after fixing issues, comment |
|
/run-e2e |
Exponential backoff exhausted 30 retries before alembic finished creating ~50 tables on fresh databases. The experiments table is created mid-migration, not at the start. Switch to fixed 5s intervals with 60 retries (5 min total), giving alembic enough time to complete all migrations before giving up. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> Signed-off-by: Ladislav Smola <[email protected]>
New Commits DetectedThe New HEAD: For maintainers: Please review the new changes and comment Security checklistBefore running E2E tests, verify the PR does NOT contain:
This is an automated security measure to prevent TOCTOU attacks |
E2E HyperShift Tests CancelledCommit: To re-run tests, comment |
|
/run-e2e |
E2E HyperShift Tests FailedCommit: To re-run tests after fixing issues, comment |
The init thread couldn't create experiments/users because alembic migrations hadn't run yet. MLflow core migrations (which create the experiments table) only run via `mlflow db upgrade` or `mlflow server`, not when importing mlflow_oidc_auth.app directly. Add explicit `mlflow db upgrade` before starting the Python app. This ensures all tables exist before the init thread runs. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> Signed-off-by: Ladislav Smola <[email protected]>
New Commits DetectedThe New HEAD: For maintainers: Please review the new changes and comment Security checklistBefore running E2E tests, verify the PR does NOT contain:
This is an automated security measure to prevent TOCTOU attacks |
|
/run-e2e |
E2E HyperShift Tests FailedCommit: To re-run tests after fixing issues, comment |
mlflow db upgrade alone fails on fresh databases because alembic migrations try to ALTER tables before they exist. MLflow's internal _initialize_tables() does create_all() first (safe for fresh DB), then we run mlflow db upgrade for any pending migrations. This matches what mlflow server does internally. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> Signed-off-by: Ladislav Smola <[email protected]>
New Commits DetectedThe New HEAD: For maintainers: Please review the new changes and comment Security checklistBefore running E2E tests, verify the PR does NOT contain:
This is an automated security measure to prevent TOCTOU attacks |
|
/run-e2e |
E2E HyperShift Tests PassedCommit: The If you push new commits, the label will be removed and you'll need to comment |
Summary
✨ Deploy MLflow alongside Phoenix to capture LLM traces from weather agent:
Add MLflow Helm template (charts/kagenti-deps/templates/mlflow.yaml)
Update OTEL collector to export traces to MLflow
Add E2E test for MLflow traces (test_mlflow_traces.py)
Enable MLflow in dev and ocp values files
Add documentation (docs/mlflow-integration.md)
Related issue(s)