Skip to content

Causa backend changes - #32

Draft
gulati-aakriti wants to merge 16 commits into
causaai:mvp_demofrom
gulati-aakriti:causa-backend-changes
Draft

Causa backend changes#32
gulati-aakriti wants to merge 16 commits into
causaai:mvp_demofrom
gulati-aakriti:causa-backend-changes

Conversation

@gulati-aakriti

@gulati-aakriti gulati-aakriti commented Aug 30, 2026

Copy link
Copy Markdown

Summary by Sourcery

Extend the installer to deploy and manage the Causa RCA stack consistently on Kind and OpenShift with configurable integrations, platform-native networking, and database provisioning.

New Features:

  • Support installing the Causa Backend and MCP ecosystem on OpenShift with platform-specific manifests, Routes, security permissions, and Prometheus integration.
  • Allow configuring the Quarkus application metrics endpoint used by the Causa Backend.
  • Provision PostgreSQL on OpenShift through the CloudNativePG operator and create the backend database credentials.
  • Expose Jafra, Quarkus, Causa Backend, and Causa MCP services through OpenShift Routes.

Bug Fixes:

  • Ensure cert-manager webhook CA injection is complete before dependent resources are installed.
  • Ensure interrupted installers terminate correctly after spinner cleanup.
  • Switch to the Kind Kubernetes context before uninstalling Kind resources.

Enhancements:

  • Unify installation and teardown flows across Kind and OpenShift targets, including all shared components.
  • Configure and validate Causa MCP endpoint environment variables after backend deployment and wait for its rollout.
  • Add platform-specific Prometheus endpoints and increase the Causa Backend memory limit.
  • Include pod and container context in generated Prometheus alert labels.

Deployment:

  • Add OpenShift deployment resources for the Causa Backend, MCP Routes, Jafra agent permissions, and CloudNativePG database provisioning.

Documentation:

  • Document the configurable Quarkus metrics endpoint in installer usage and environment-variable help.

- Add INSTALL_TARGET=openshift to CLI (--target openshift)
- Add _is_openshift_target() helper
- Split validate_prerequisites for openshift (no kind/docker needed)
- Split validate_cluster_access for openshift (trust current kubeconfig context)
- Add POSTGRES_KIND_IMAGE / POSTGRES_OCP_IMAGE CLI flags and env vars
- Add postgres image overrides to validate_image_overrides
- Add post_component_validation CNPG health check for OpenShift
- Source install_openshift_infra.sh and install_openshift_monitoring.sh
- Add .gitignore entries for OCP TLS cert/kubeconfig files
- Update usage docs and help text for openshift target
- Add lib/install_openshift_infra.sh (namespace/SCC setup for OCP)
- Add lib/install_openshift_monitoring.sh (configure UWM Alertmanager webhook + PrometheusRule)
- Add manifests/openshift/ Route and SCC manifests
- Wire install_openshift_infra + install_openshift_prometheus into main install/uninstall flow
- Add _print_access_summary OpenShift Route output
- Renumber install steps (2a/2b, 3b) for kind vs openshift divergence
- Add CNPG operator install/uninstall (OLM Subscription, OperatorGroup, InstallPlan approval)
- Add CNPG Cluster CRD management with idempotent healthy-cluster check (preserves data on re-run)
- Add _cnpg_create_causa_db_secrets — always syncs causa-db-secrets from live iri-db-app secret
- Add manifests/postgres/operator/ and manifests/postgres/database-cluster/
- Fix kind path: switch to pgvector/pgvector:pg17; remove shared_preload_libraries=vector arg
- Add CNPG credential resync in install_causa (handles password rotation between install steps)
- Add uninstall_postgres OpenShift path (delete Cluster, Subscription, CSV, OperatorGroup)
…branch

Jafra Ecosystem, Jafra MCP Server, and Quarkus MCP are not deployed on
OpenShift in feat/openshift-postgres (kind-only via _install_kind_components).
Remove the stale OpenShift manifests that were added prematurely:
  - manifests/openshift/jafra-mcp-route.yaml
  - manifests/openshift/jafra/jafra-agent-scc.yaml
Replace the single causa-backend-manifests.yaml with individual files
under manifests/openshift/causa-backend/:
  - serviceaccount.yaml
  - configmap.yaml
  - deployment.yaml
  - service.yaml
  - route.yaml (moved from causa-backend-route.yaml)

Update install_causa.sh to apply/delete each file individually.
…xt switch, fix Ctrl+C trap, expand access summary
@gulati-aakriti gulati-aakriti self-assigned this Aug 30, 2026
@sourcery-ai

sourcery-ai Bot commented Aug 30, 2026

Copy link
Copy Markdown

Reviewer's Guide

Extends the installer for OpenShift alongside Kind by adding target-specific manifests, Routes, SCC and CNPG-based PostgreSQL provisioning, wires Causa Backend MCP endpoints including a configurable analyzed-Quarkus URL, and strengthens readiness, uninstall, access-summary, and signal-handling behavior.

Sequence diagram for Causa Backend installation and endpoint wiring

sequenceDiagram
    participant Installer
    participant Kubernetes
    participant CausaBackend
    participant QuarkusMCP
    participant JafraMCP

    Installer->>Kubernetes: install_causa
    Kubernetes-->>Installer: causa-backend ready
    Installer->>Kubernetes: _set_causa_env_vars
    Kubernetes->>CausaBackend: set CAUSA_MCP_QUARKUS_ENDPOINT
    Kubernetes->>CausaBackend: set CAUSA_MCP_QUARKUS_METRICS_BASE_URL
    Kubernetes->>CausaBackend: set CAUSA_MCP_ASYNC_PROFILER_ENDPOINT
    Installer->>Kubernetes: _rollout_causa
    Kubernetes-->>Installer: rollout complete
    CausaBackend->>QuarkusMCP: CAUSA_MCP_QUARKUS_ENDPOINT
    CausaBackend->>JafraMCP: CAUSA_MCP_ASYNC_PROFILER_ENDPOINT
Loading

File-Level Changes

Change Details Files
Add platform-aware installation and teardown for Causa components.
  • Run Jafra, Jafra MCP, and Quarkus MCP on both targets.
  • Install Causa Backend, Causa MCP, and PostgreSQL through target-specific paths.
  • Add OpenShift Route exposure and corresponding uninstall handling.
  • Switch to the Kind context before Kind uninstall operations.
install.sh
lib/install_causa.sh
lib/install_causa_mcp.sh
lib/install_jafra.sh
lib/install_jafra_mcp.sh
lib/install_postgres.sh
lib/install_quarkus_mcp.sh
manifests/openshift/causa-backend/configmap.yaml
manifests/openshift/causa-backend/deployment.yaml
manifests/openshift/causa-backend/route.yaml
manifests/openshift/causa-backend/service.yaml
manifests/openshift/causa-backend/serviceaccount.yaml
manifests/openshift/causa-mcp-route.yaml
manifests/openshift/jafra-mcp-route.yaml
manifests/openshift/jafra/daemonset.yaml
manifests/openshift/jafra/jafra-agent-scc.yaml
manifests/openshift/quarkus-mcp-route.yaml
Configure Causa Backend MCP integrations and the analyzed Quarkus endpoint.
  • Expose CAUSA_MCP_QUARKUS_METRICS_BASE_URL as an installer override.
  • Derive internal Quarkus and Jafra MCP endpoints from the install namespace.
  • Apply endpoint environment variables after deployment and wait for the resulting rollout.
  • Add endpoint settings to the Kind manifest and OpenShift ConfigMap.
install.sh
lib/install_causa.sh
manifests/causa/deployment.yaml
manifests/openshift/causa-backend/configmap.yaml
Use CloudNativePG for OpenShift PostgreSQL and retain a standalone Kind database deployment.
  • Install or discover the CNPG operator through OLM and approve its InstallPlan.
  • Create and monitor the iri-db Cluster resource with configurable image support.
  • Translate CNPG-generated credentials into the causa-db-secrets contract.
  • Remove the database cluster, operator resources, and secrets during teardown.
lib/install_postgres.sh
manifests/postgres/database-cluster/iri_db_cluster.yaml
manifests/postgres/operator/cnpg_subscription.yaml
manifests/postgres/operator/operator_group.yaml
Improve deployment readiness and installer signal handling.
  • Probe cert-manager webhook admission before installing dependent resources.
  • Re-raise INT and TERM after spinner cleanup so interrupted installs terminate correctly.
  • Adjust access summaries for Kind NodePorts and dynamically discovered OpenShift Route URLs.
  • Document the new Quarkus metrics URL and generalized termination option.
lib/install_cert_manager.sh
lib/logging.sh
install.sh

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant