← Back to Pull requests

RHOAIENG-102547: Automate live E2E deployment and testing #10

Open
unknown opened this pull request with 650 lines diff across 8 files
View on GitHub
unknown unknown commented on Nov 04, 2026 11:06 UTC
Author

Summary

Implements manually invoked live E2E automation for RHOAIENG-102547, separately from merged PR #8. Default tests/CI remain unit-only; no Jenkins integration.

  • make test-e2e tests an existing deployment. make test-e2e-deploy automates Podman build, Quay push, digest-pinned Helm deployment and live HTTP tests. Explicit --reuse-image IMAGE@sha256:DIGEST skips build/push when service build inputs are unchanged.

  • Create a fresh, Kueue-enrolled namespace, LocalQueue, RWX PVC and pinned tiny model/dataset fixtures. Require real Kueue admission, successful GPU training, snapshot/SSE logs, independently validated LoRA checkpoints and owner-linked workload/GPU cleanup. Directly installed Kueue works without DSC checks; queue failures remain test-local and do not abort independent API checks.

  • Clean up by default after success, failure or interruption: uninstall the isolated Helm release, verify its cluster-scoped RBAC is gone, then UID/run-label-guard deletion of the test namespace, remaining Ray resources, temporary credentials and test storage. Preserve local reports/manifests. --keep-resources retains debugging resources; --keep-deployment remains an alias. Temporary registry credentials are removed even when resources are retained.

  • Optional --use-podman-auth supports private Quay images: resolve only the local Quay credential, send it in memory to a temporary namespace-local pull Secret and attach references to the service/fixtures/default ServiceAccount. No credential files, Secret values, tokens or personal configuration are committed or copied into evidence/Helm history. Honor existing kubeconfig TLS settings with a clear warning for insecure development connections; block HTTP DEBUG logging. Route/Ray gateway verification remains enabled.

  • Discover the public ingress CA automatically; no PEM is committed. Keep separate trust overrides for custom Route/Ray issuers and optional chart CA volume mounts with unchanged defaults.

  • Include run/recovery instructions, explicit implemented/conditional/deferred coverage and reusable examples under tests/e2e/examples/. Keep the internal test plan out of the PR. Existing-deployment tests preserve customer namespaces/storage. No shared operators, DSC, ClusterQueues, ResourceFlavors, StorageClasses, CRDs or registry visibility are changed.
  • Review feedback addressed

  • Remove retained namespaces/PVCs/LocalQueues and failed-install Helm RBAC by default, with explicit debug retention and bounded ownership-checked cleanup.

  • Use a managed pytest subprocess: handled SIGINT permits fixture teardown before a bounded kill/reap fallback. SIGTERM follows normal runner cleanup; repeated interrupts cannot silently leave a detached child or report incomplete cleanup as passed.

  • Treat oc auth can-i exit 1 with no as a denied permission, allowing resource-specific guidance; connection/authentication failures remain errors.

  • Add regression coverage for ambiguous namespace creation, ownership replacement, pending/failed cleanup, registry credential scope/logging and concurrent ServiceAccount reference updates.
  • Run

    After cluster/Podman/Quay login and preparing credential-free values:

    export TRAINING_SERVICE_TOKEN="$(oc whoami -t)"
    make test-e2e-deploy E2E_ARGS="--image-repository quay.io/YOUR_ORG/training-service --namespace YOUR_NEW_NAMESPACE --values /path/to/e2e-values.yaml --storage-class YOUR_RWX_CLASS --use-podman-auth"
    

    Omit --namespace for an automatically generated fresh name; existing namespaces are never adopted. Omit --use-podman-auth for public images. Add --keep-resources only when retaining test resources for debugging. See tests/e2e/README.md for prerequisites, image reuse and existing-deployment profiles.

    Validation

  • 401 unit tests passed, including actual pytest-timeout/finalizer and isolated SIGTERM subprocess proofs. Ruff lint/format, mypy, Helm lint/rendering and diff checks passed.

  • Fresh private-image deploy/test run: 51 passed, 0 failed, 6 conditional skips. Real Kueue-admitted training reached SUCCEEDED; snapshot/SSE logs, two LoRA checkpoints and observed GPU cleanup passed. Namespace, test PVC/PV, credentials, deployment and chart RBAC were removed and independently checked absent.

  • Deliberate missing-ClusterQueue run: 50 passed, 1 expected setup error, 6 conditional skips; independent tests continued, the exit status was nonzero, and namespace/storage/credentials/Helm RBAC were still removed.

  • An earlier normal run encountered a GET RemoteProtocolError; it remained failed with evidence preserved and cleaned its resources. A complete fresh rerun passed; no automatic POST replay or failure-hiding retry was added.

  • All three validation namespaces and their volumes/chart RBAC were independently confirmed absent. Existing image reused throughout; no rebuild or image push was needed for test-harness changes.

  • Six conditional skips require prepared missing-Ray-submission, invalid-Kubernetes-URL or restricted-project fixtures. No required Kueue/training/log/checkpoint/GPU lifecycle check was skipped. This is a repeatable sanity baseline, not full customer-readiness certification or proof of every runtime/custom-ServiceAccount configuration.
  • [RHOAIENG-102547]: https://redhat.atlassian.net/browse/RHOAIENG-102547?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->

    <!-- coderabbit-ai-generated:v1 -->

    Summary by CodeRabbit

    New Features
    Training Service deployments can now be configured with additional pod volumes and container mounts.
    Added commands for running live end-to-end checks against an existing service or a fresh deployment.
    Documentation
    Added guidance, examples, and operational requirements for end-to-end testing, including deployment setup, TLS, cleanup, and test coverage.
    Tests
    * Added checks for service API behavior, training-job lifecycles, deployment workflows, and related operational safeguards.

    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: Sridhar1030 Review duration: 1458m
    All Vouch review confidence checks passed
    Residual risk 0.40 = Change Risk (0.75) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.75 · 650 lines diff across 8 files
    0.75
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.344
    Sensitive Paths sensitive_paths
    0.075
    Real PR Conversation Timeline
    1 comments
    "Review active on #10"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: medium confidence: 46.7% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 75.2% (HIGH) · Higher = larger blast radius
    75.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 40.1% · Moderate risk
    40.1%