Skip to content

fix(ci): defer MLflow provisioning and add CRD wait helpers - #1527

Merged
Ladas merged 2 commits into
mainfrom
fix/setup-kagenti-crd-waits-v2
May 17, 2026
Merged

Ladas merged 2 commits into
mainfrom
fix/setup-kagenti-crd-waits-v2

Conversation

@Ladas

@Ladas Ladas commented May 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes HyperShift E2E CI failures caused by ordering issues in setup-kagenti.sh where MLflow provisioning (Step 2.5) ran before kagenti-deps (Step 3) installed the RHOAI operator Subscription.

  • Extract reusable _wait_for_crd() helper with configurable timeout and periodic OLM InstallPlan auto-approval
  • Add _auto_approve_installplans() for operator namespaces (OLM batching workaround)
  • Refactor _apply_operand_crs() to use _wait_for_crd() for Keycloak, ZTWIM (SPIRE), and Sail CRDs
  • Move MLflow provisioning from Step 2.5 to Step 3c (after kagenti-deps): wait for RHOAI CSV → create/patch DSC → wait for MLflow CRD (10min) → create CR → upgrade kagenti-deps with OTEL endpoint
  • Make PSA labels (pod-security.kubernetes.io) conditional on openshift in agent-namespaces.yaml Helm template
  • Re-enable RHOAI and MLflow in ocp_ci_values.yaml

Root Cause

setup-kagenti.sh Step 2.5 checked for the DataScienceCluster CRD before Step 3 (kagenti-deps) created the RHOAI operator OLM Subscription. On fresh HyperShift CI clusters, this always silently skipped MLflow provisioning because the CRD didn't exist yet.

Test plan

  • /run-e2e — HyperShift E2E passes with deferred MLflow provisioning
  • CRD waits succeed with InstallPlan auto-approval
  • PSA labels correctly applied on OpenShift, absent on Kind
  • MLflow OTEL endpoint correctly wired after Step 3c upgrade

🤖 Generated with Claude Code

@Ladas

Ladas commented May 9, 2026

Copy link
Copy Markdown
Contributor Author

/run-e2e

@github-actions github-actions Bot added the safe-to-test Maintainer reviewed - safe to run E2E tests label May 9, 2026
@github-actions

github-actions Bot commented May 9, 2026

Copy link
Copy Markdown

E2E HyperShift Tests Started

Triggered by: @Ladas
Commit: c4dba48923f4b4a34137b29ab693997c8e269769
Workflow Run: View logs

Tests are running on OpenShift 4.20.11. This typically takes 30-45 minutes.


To re-run tests after new commits, comment /run-e2e again.

@github-actions

github-actions Bot commented May 9, 2026

Copy link
Copy Markdown

E2E HyperShift Tests Failed

Commit: c4dba48923f4b4a34137b29ab693997c8e269769
Result: Tests failed - please check the logs
Workflow Run: View logs


To re-run tests after fixing issues, comment /run-e2e again.

@Ladas

Ladas commented May 11, 2026

Copy link
Copy Markdown
Contributor Author

/run-e2e

@github-actions github-actions Bot removed the safe-to-test Maintainer reviewed - safe to run E2E tests label May 11, 2026
@github-actions

Copy link
Copy Markdown

New Commits Detected

The safe-to-test label has been automatically removed because new commits were pushed.

New HEAD: e7da352

For maintainers: Please review the new changes and comment /run-e2e to trigger E2E tests.

Security checklist

Before running E2E tests, verify the PR does NOT contain:

  • Changes to .github/workflows/ that bypass security
  • Changes to .github/scripts/ that could exfiltrate secrets
  • curl, wget, or nc commands to external URLs in scripts
  • Base64 encoding of environment variables
  • Printing secrets to logs (echo $SECRET)
  • Suspicious package installations

This is an automated security measure to prevent TOCTOU attacks

@github-actions github-actions Bot added the safe-to-test Maintainer reviewed - safe to run E2E tests label May 11, 2026
@github-actions

Copy link
Copy Markdown

E2E HyperShift Tests Started

Triggered by: @Ladas
Commit: e7da3524cdeaa88b8e600894ff5bfef19e753ee0
Workflow Run: View logs

Tests are running on OpenShift 4.20.11. This typically takes 30-45 minutes.


To re-run tests after new commits, comment /run-e2e again.

@github-actions

Copy link
Copy Markdown

E2E HyperShift Tests Failed

Commit: e7da3524cdeaa88b8e600894ff5bfef19e753ee0
Result: Tests failed - please check the logs
Workflow Run: View logs


To re-run tests after fixing issues, comment /run-e2e again.

@Ladas
Ladas force-pushed the fix/setup-kagenti-crd-waits-v2 branch from e7da352 to 52ed4e0 Compare May 11, 2026 11:58
@Ladas

Ladas commented May 11, 2026

Copy link
Copy Markdown
Contributor Author

/run-e2e

@github-actions github-actions Bot removed the safe-to-test Maintainer reviewed - safe to run E2E tests label May 11, 2026
@github-actions

Copy link
Copy Markdown

New Commits Detected

The safe-to-test label has been automatically removed because new commits were pushed.

New HEAD: 52ed4e0

For maintainers: Please review the new changes and comment /run-e2e to trigger E2E tests.

Security checklist

Before running E2E tests, verify the PR does NOT contain:

  • Changes to .github/workflows/ that bypass security
  • Changes to .github/scripts/ that could exfiltrate secrets
  • curl, wget, or nc commands to external URLs in scripts
  • Base64 encoding of environment variables
  • Printing secrets to logs (echo $SECRET)
  • Suspicious package installations

This is an automated security measure to prevent TOCTOU attacks

@github-actions github-actions Bot added the safe-to-test Maintainer reviewed - safe to run E2E tests label May 11, 2026
@github-actions

Copy link
Copy Markdown

E2E HyperShift Tests Started

Triggered by: @Ladas
Commit: 52ed4e001c040e7d3e7d92368315bb591955a557
Workflow Run: View logs

Tests are running on OpenShift 4.20.21. This typically takes 30-45 minutes.


To re-run tests after new commits, comment /run-e2e again.

@github-actions

Copy link
Copy Markdown

E2E HyperShift Tests Passed

Commit: 52ed4e001c040e7d3e7d92368315bb591955a557
Result: All tests passed
Workflow Run: View logs

The safe-to-test label indicates this commit has been approved for E2E testing.


If you push new commits, the label will be removed and you'll need to comment /run-e2e again.

@Ladas

Ladas commented May 11, 2026

Copy link
Copy Markdown
Contributor Author

/run-e2e

@github-actions github-actions Bot removed the safe-to-test Maintainer reviewed - safe to run E2E tests label May 11, 2026
@github-actions

Copy link
Copy Markdown

New Commits Detected

The safe-to-test label has been automatically removed because new commits were pushed.

New HEAD: 058a961

For maintainers: Please review the new changes and comment /run-e2e to trigger E2E tests.

Security checklist

Before running E2E tests, verify the PR does NOT contain:

  • Changes to .github/workflows/ that bypass security
  • Changes to .github/scripts/ that could exfiltrate secrets
  • curl, wget, or nc commands to external URLs in scripts
  • Base64 encoding of environment variables
  • Printing secrets to logs (echo $SECRET)
  • Suspicious package installations

This is an automated security measure to prevent TOCTOU attacks

@github-actions github-actions Bot added the safe-to-test Maintainer reviewed - safe to run E2E tests label May 11, 2026
@github-actions

Copy link
Copy Markdown

E2E HyperShift Tests Started

Triggered by: @Ladas
Commit: 058a961cd688e5c4adfd508513825be147fb319a
Workflow Run: View logs

Tests are running on OpenShift 4.20.21. This typically takes 30-45 minutes.


To re-run tests after new commits, comment /run-e2e again.

@github-actions

Copy link
Copy Markdown

E2E HyperShift Tests Failed

Commit: 058a961cd688e5c4adfd508513825be147fb319a
Result: Tests failed - please check the logs
Workflow Run: View logs


To re-run tests after fixing issues, comment /run-e2e again.

@Ladas
Ladas force-pushed the fix/setup-kagenti-crd-waits-v2 branch from 058a961 to 99c9ae1 Compare May 13, 2026 06:53
@Ladas

Ladas commented May 13, 2026

Copy link
Copy Markdown
Contributor Author

/run-e2e

@github-actions

Copy link
Copy Markdown

New Commits Detected

The safe-to-test label has been automatically removed because new commits were pushed.

New HEAD: 99c9ae1

For maintainers: Please review the new changes and comment /run-e2e to trigger E2E tests.

Security checklist

Before running E2E tests, verify the PR does NOT contain:

  • Changes to .github/workflows/ that bypass security
  • Changes to .github/scripts/ that could exfiltrate secrets
  • curl, wget, or nc commands to external URLs in scripts
  • Base64 encoding of environment variables
  • Printing secrets to logs (echo $SECRET)
  • Suspicious package installations

This is an automated security measure to prevent TOCTOU attacks

@github-actions github-actions Bot added safe-to-test Maintainer reviewed - safe to run E2E tests and removed safe-to-test Maintainer reviewed - safe to run E2E tests labels May 13, 2026
@github-actions github-actions Bot removed the safe-to-test Maintainer reviewed - safe to run E2E tests label May 15, 2026
@github-actions

Copy link
Copy Markdown

New Commits Detected

The safe-to-test label has been automatically removed because new commits were pushed.

New HEAD: 7d6e022

For maintainers: Please review the new changes and comment /run-e2e to trigger E2E tests.

Security checklist

Before running E2E tests, verify the PR does NOT contain:

  • Changes to .github/workflows/ that bypass security
  • Changes to .github/scripts/ that could exfiltrate secrets
  • curl, wget, or nc commands to external URLs in scripts
  • Base64 encoding of environment variables
  • Printing secrets to logs (echo $SECRET)
  • Suspicious package installations

This is an automated security measure to prevent TOCTOU attacks

@github-actions github-actions Bot added the safe-to-test Maintainer reviewed - safe to run E2E tests label May 15, 2026
@github-actions

Copy link
Copy Markdown

E2E HyperShift Tests Started

Triggered by: @Ladas
Commit: 7d6e022cb29027e0689377666a5f9f66ecd35a8c
Workflow Run: View logs

Tests are running on OpenShift 4.20.21. This typically takes 30-45 minutes.


To re-run tests after new commits, comment /run-e2e again.

@github-actions

Copy link
Copy Markdown

E2E HyperShift Tests Failed

Commit: 7d6e022cb29027e0689377666a5f9f66ecd35a8c
Result: Tests failed - please check the logs
Workflow Run: View logs


To re-run tests after fixing issues, comment /run-e2e again.

@Ladas

Ladas commented May 15, 2026

Copy link
Copy Markdown
Contributor Author

/run-e2e

@github-actions

Copy link
Copy Markdown

E2E HyperShift Tests Started

Triggered by: @Ladas
Commit: 7d6e022cb29027e0689377666a5f9f66ecd35a8c
Workflow Run: View logs

Tests are running on OpenShift 4.20.21. This typically takes 30-45 minutes.


To re-run tests after new commits, comment /run-e2e again.

@github-actions

Copy link
Copy Markdown

E2E HyperShift Tests Passed

Commit: 7d6e022cb29027e0689377666a5f9f66ecd35a8c
Result: All tests passed
Workflow Run: View logs

The safe-to-test label indicates this commit has been approved for E2E testing.


If you push new commits, the label will be removed and you'll need to comment /run-e2e again.

Root cause: setup-kagenti.sh Step 2.5 checked for RHOAI CRDs before
Step 3 (kagenti-deps) installed the RHOAI operator. MLflow was always
silently skipped on fresh CI clusters. Multiple additional CI failures
were discovered and fixed during iteration.

setup-kagenti.sh:
- Extract reusable _wait_for_crd() with configurable timeout and
  periodic OLM InstallPlan auto-approval
- Move MLflow provisioning from Step 2.5 to Step 3d (after kagenti-deps):
  wait for RHOAI operator deployment readiness, create DSC with only
  CRD-schema fields then patch mlflowoperator to Managed (webhook
  injects it), wait for MLflow CRD, create CR, fall back to in-cluster
  endpoint when gateway URL missing
- Wait for MLflow RBAC ClusterRole before granting OTEL access
- Make MLflow Service wait non-fatal (return 1, not exit 1)
- Adopt cert-manager resources for Helm before MLflow OTEL upgrade
- Enable KServe (Managed) in DSC for RHOAI integration tests
- Make PSA labels conditional on openshift in agent-namespaces.yaml

CI scripts:
- Re-enable RHOAI/MLflow in ocp_ci_values.yaml
- Fix jq parse error on SPIRE OIDC HCL config (55-setup-spiffe-idp.sh)
- Add 3-attempt build retry for DNS flakes (37-build-platform-images.sh,
  71-build-weather-tool.sh)
- Sync keycloak-admin-secret to agent namespace for AuthBridge sidecar
  (91-run-authbridge-weather-e2e.sh)
- Port-forward MLflow from redhat-ods-applications on RHOAI
  (85-start-port-forward.sh)
- Remove shellcheck SC2168 (local outside function)

E2E tests:
- Accept 401 (API-key auth) in MLflow version/health/connectivity tests
- Follow up 401 with authenticated Keycloak token request
- Check redhat-ods-applications for MLflow pod on OpenShift
- Skip MLflow auth/trace tests gracefully when MLflow unavailable
- Verify MLflow connectivity in setup_mlflow_client before proceeding

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Ladislav Smola <[email protected]>
@Ladas
Ladas force-pushed the fix/setup-kagenti-crd-waits-v2 branch from 7d6e022 to 2f8d4e8 Compare May 16, 2026 20:50
@Ladas

Ladas commented May 16, 2026

Copy link
Copy Markdown
Contributor Author

/run-e2e

@github-actions github-actions Bot removed the safe-to-test Maintainer reviewed - safe to run E2E tests label May 16, 2026
@github-actions

Copy link
Copy Markdown

New Commits Detected

The safe-to-test label has been automatically removed because new commits were pushed.

New HEAD: 2f8d4e8

For maintainers: Please review the new changes and comment /run-e2e to trigger E2E tests.

Security checklist

Before running E2E tests, verify the PR does NOT contain:

  • Changes to .github/workflows/ that bypass security
  • Changes to .github/scripts/ that could exfiltrate secrets
  • curl, wget, or nc commands to external URLs in scripts
  • Base64 encoding of environment variables
  • Printing secrets to logs (echo $SECRET)
  • Suspicious package installations

This is an automated security measure to prevent TOCTOU attacks

@github-actions github-actions Bot added the safe-to-test Maintainer reviewed - safe to run E2E tests label May 16, 2026
@github-actions

Copy link
Copy Markdown

E2E HyperShift Tests Started

Triggered by: @Ladas
Commit: 2f8d4e85c9833708bc8046c14ea153224a33d96e
Workflow Run: View logs

Tests are running on OpenShift 4.20.21. This typically takes 30-45 minutes.


To re-run tests after new commits, comment /run-e2e again.

@github-actions

Copy link
Copy Markdown

E2E HyperShift Tests Failed

Commit: 2f8d4e85c9833708bc8046c14ea153224a33d96e
Result: Tests failed - please check the logs
Workflow Run: View logs


To re-run tests after fixing issues, comment /run-e2e again.

CodeQL flagged verify=False as a high-severity issue. Use /health
(unprotected by mlflow-oidc-auth) with default SSL verification
instead of /version with verify=False.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Ladislav Smola <[email protected]>
@Ladas

Ladas commented May 17, 2026

Copy link
Copy Markdown
Contributor Author

/run-e2e

@github-actions github-actions Bot removed the safe-to-test Maintainer reviewed - safe to run E2E tests label May 17, 2026
@github-actions

Copy link
Copy Markdown

New Commits Detected

The safe-to-test label has been automatically removed because new commits were pushed.

New HEAD: 97bbf5a

For maintainers: Please review the new changes and comment /run-e2e to trigger E2E tests.

Security checklist

Before running E2E tests, verify the PR does NOT contain:

  • Changes to .github/workflows/ that bypass security
  • Changes to .github/scripts/ that could exfiltrate secrets
  • curl, wget, or nc commands to external URLs in scripts
  • Base64 encoding of environment variables
  • Printing secrets to logs (echo $SECRET)
  • Suspicious package installations

This is an automated security measure to prevent TOCTOU attacks

@github-actions github-actions Bot added the safe-to-test Maintainer reviewed - safe to run E2E tests label May 17, 2026
@github-actions

Copy link
Copy Markdown

E2E HyperShift Tests Started

Triggered by: @Ladas
Commit: 97bbf5a3b0d6c3acd1a2d0e9c256f3ffccbfb1d8
Workflow Run: View logs

Tests are running on OpenShift 4.20.21. This typically takes 30-45 minutes.


To re-run tests after new commits, comment /run-e2e again.

@github-actions

Copy link
Copy Markdown

E2E HyperShift Tests Failed

Commit: 97bbf5a3b0d6c3acd1a2d0e9c256f3ffccbfb1d8
Result: Tests failed - please check the logs
Workflow Run: View logs


To re-run tests after fixing issues, comment /run-e2e again.

@Ladas
Ladas merged commit b18c157 into main May 17, 2026
22 checks passed
pdettori pushed a commit that referenced this pull request May 21, 2026
fix(ci): defer MLflow provisioning and add CRD wait helpers

(cherry picked from commit b18c157)
eranra pushed a commit to eranra/kagenti that referenced this pull request May 24, 2026
…aits-v2

fix(ci): defer MLflow provisioning and add CRD wait helpers
Signed-off-by: Eran Raichstein <[email protected]>
@pdettori
pdettori deleted the fix/setup-kagenti-crd-waits-v2 branch June 2, 2026 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe-to-test Maintainer reviewed - safe to run E2E tests

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants