Skip to content

Include maniftests that can run load with the benchmark pod for techempower and petclinic benchmark#71

Open
kusumachalasani wants to merge 4 commits intokruize:masterfrom
kusumachalasani:runtimes
Open

Include maniftests that can run load with the benchmark pod for techempower and petclinic benchmark#71
kusumachalasani wants to merge 4 commits intokruize:masterfrom
kusumachalasani:runtimes

Conversation

@kusumachalasani
Copy link
Copy Markdown
Contributor

@kusumachalasani kusumachalasani commented Feb 27, 2026

Include kruize-runtimes manifests in the TechEmpower benchmark so that the pod runs the load internally instead of relying on a separate Docker image.

Summary by Sourcery

Add Kubernetes manifests to run internal load-generating benchmarks for TechEmpower Quarkus RESTEasy Hibernate and Spring Petclinic applications, including their database and monitoring setup.

New Features:

  • Introduce TechEmpower Quarkus RESTEasy Hibernate deployment, service, and Hyperfoil-based load generator job manifests.
  • Add Spring Petclinic deployment, service, and JMeter-based load generator job manifests for benchmark execution.
  • Provide a PostgreSQL deployment and service manifest for the TechEmpower benchmark backend database.
  • Define ServiceMonitor resources to scrape Prometheus metrics for the TechEmpower and Spring Petclinic benchmark services.

Signed-off-by: kusuma chalasani <kchalasa@redhat.com>
@kusumachalasani kusumachalasani self-assigned this Feb 27, 2026
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai bot commented Feb 27, 2026

Reviewer's Guide

Adds Kubernetes manifests for TechEmpower Quarkus RESTEasy Hibernate and Spring Petclinic benchmarks, including app and database deployments, services, in-cluster load generator Jobs, and ServiceMonitors for Prometheus scraping.

Sequence diagram for benchmark load job waiting on app readiness and running load

sequenceDiagram
  participant TFB_Load_Job as tfb-qrh-load-generator Job
  participant Init as wait-for-tfb initContainer
  participant Load as tfb-qrh-load container
  participant TFB_Service as tfb-qrh-service
  participant TFB_App as tfb-qrh application Pod

  TFB_Load_Job->>Init: Start initContainer wait-for-tfb
  Init->>TFB_Service: HTTP GET /plaintext
  TFB_Service->>TFB_App: Forward request to app
  TFB_App-->>TFB_Service: 200 OK when ready
  TFB_Service-->>Init: 200 OK
  Init-->>TFB_Load_Job: Exit 0 (app is ready)

  TFB_Load_Job->>Load: Start tfb-qrh-load container
  Load->>TFB_Service: Run Phase 1 ramp-up (plaintext, db, queries)
  TFB_Service->>TFB_App: Handle Phase 1 traffic
  Load->>TFB_Service: Run Phase 2 plaintext (CPU focus)
  TFB_Service->>TFB_App: Handle Phase 2 traffic
  Load->>TFB_Service: Run Phase 3 db (pool focus)
  TFB_Service->>TFB_App: Handle Phase 3 traffic
  Load->>TFB_Service: Run Phase 4 queries (memory focus)
  TFB_Service->>TFB_App: Handle Phase 4 traffic
  Load-->>TFB_Load_Job: Complete benchmark and exit
Loading

File-Level Changes

Change Details Files
Introduce TechEmpower Quarkus RESTEasy Hibernate deployment, service, and load-generator Job for in-cluster benchmarking.
  • Add Deployment for the tfb-qrh Quarkus application with resource requests/limits, logging volume, and Kruize labels.
  • Expose the application via a NodePort Service with Prometheus scrape annotations and a named metrics port.
  • Create a batch Job that waits for the frontend service readiness and then runs a scripted, multi-phase Hyperfoil load sequence against multiple endpoints.
techempower/manifests/kruize-demos/quarkus-resteasy-hibernate.yaml
Add PostgreSQL database deployment and service tailored to the TechEmpower benchmark schema.
  • Create a tfb-database Deployment using a benchmark-specific Postgres image with configured user, password, and database name.
  • Use a postStart lifecycle hook to apply the benchmark schema via an init SQL script after container startup.
  • Expose the database via a ClusterIP Service on port 5432 with appropriate labels and selectors.
techempower/manifests/kruize-demos/postgres.yaml
Define Spring Petclinic deployment, service, and JMeter load Job to run load inside the cluster.
  • Add a NodePort Service for Petclinic on port 8081 with Prometheus scrape annotations and a stable nodePort.
  • Create a Petclinic Deployment using the specified Tomcat-based image, with readiness probe, logging volume, and Kruize-identifying labels.
  • Introduce a batch Job with an initContainer that waits for the Petclinic service port to open, then runs a staged JMeter load (low, medium, peak users) against the service.
spring-petclinic/manifests/kruize-demos/petclinic.yaml
Register ServiceMonitors for Prometheus scraping of TechEmpower and Petclinic frontend services.
  • Add a ServiceMonitor for the tfb-qrh frontend that selects services by app label and scrapes the tfb-qrh-port on /q/metrics.
  • Add a ServiceMonitor for Petclinic that targets the petclinic-port on /manage/prometheus using a label selector on the frontend service.
techempower/manifests/kruize-demos/service-monitor.yaml
spring-petclinic/manifests/kruize-demos/service-monitor.yaml

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

Copy link
Copy Markdown

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue, and left some high level feedback:

  • The test-volume in the tfb-qrh-sample Deployment is declared without a type (e.g. emptyDir, hostPath, etc.), which makes the manifest invalid; define an appropriate volume source under spec.volumes.
  • The loadgen sidecar exits after running the load script, and with a Deployment's default restartPolicy: Always this will cause the whole pod to restart and rerun the load in a loop; consider making this an initContainer, a separate Job, or otherwise adjusting the workload/restart semantics.
  • The Postgres postStart hook uses a fixed sleep 10 before running psql, which is prone to race conditions on slower starts; consider replacing this with an initContainer that waits for readiness or a more robust readiness check before seeding the database.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `test-volume` in the `tfb-qrh-sample` Deployment is declared without a type (e.g. `emptyDir`, `hostPath`, etc.), which makes the manifest invalid; define an appropriate volume source under `spec.volumes`.
- The `loadgen` sidecar exits after running the load script, and with a Deployment's default `restartPolicy: Always` this will cause the whole pod to restart and rerun the load in a loop; consider making this an `initContainer`, a separate `Job`, or otherwise adjusting the workload/restart semantics.
- The Postgres `postStart` hook uses a fixed `sleep 10` before running `psql`, which is prone to race conditions on slower starts; consider replacing this with an initContainer that waits for readiness or a more robust readiness check before seeding the database.

## Individual Comments

### Comment 1
<location path="techempower/manifests/kruize-runtimes/quarkus-resteasy-hibernate.yaml" line_range="70" />
<code_context>
+            1200 \
+            1024 \
+            8096
+            echo "wrk finished"
+
+---
</code_context>
<issue_to_address>
**suggestion:** Log message at the end of the loadgen script is misleading relative to the tool being run.

The container runs `/opt/run_hyperfoil_load.sh`, but the final log line says `wrk finished`, which is misleading when reading logs. Please update the message (e.g., `echo "hyperfoil load finished"`) to reflect the actual tool being used.

```suggestion
            echo "hyperfoil load finished"
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Signed-off-by: kusuma chalasani <kchalasa@redhat.com>
@kusumachalasani kusumachalasani added this to the 0.9.1 milestone Mar 2, 2026
@kusumachalasani kusumachalasani moved this to Under Review in Monitoring Mar 2, 2026
@kusumachalasani kusumachalasani changed the title Include maniftests that can run load with in tfb pod for techempower benchmark Include maniftests that can run load with the benchmark pod for techempower and petclinic benchmark Mar 2, 2026
@chandrams
Copy link
Copy Markdown
Contributor

@sourcery-ai review

Copy link
Copy Markdown

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue, and left some high level feedback:

  • In the tfb-qrh-sample Deployment, the test-volume is referenced by a volumeMount but the corresponding volume definition has no type (e.g. emptyDir: {} or PVC), which will prevent the pod from starting; define the volume source under spec.volumes.
  • The PetClinic ServiceMonitor selects app: petclinic-app, but neither the petclinic-service nor the Deployment's pod template uses that label (they use app: petclinic-deployment), so the ServiceMonitor will not match anything; align the labels between the ServiceMonitor selector and the Service/Pod labels.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In the `tfb-qrh-sample` Deployment, the `test-volume` is referenced by a `volumeMount` but the corresponding volume definition has no type (e.g. `emptyDir: {}` or PVC), which will prevent the pod from starting; define the volume source under `spec.volumes`.
- The PetClinic `ServiceMonitor` selects `app: petclinic-app`, but neither the `petclinic-service` nor the Deployment's pod template uses that label (they use `app: petclinic-deployment`), so the ServiceMonitor will not match anything; align the labels between the ServiceMonitor selector and the Service/Pod labels.

## Individual Comments

### Comment 1
<location path="spring-petclinic/manifests/kruize-demos/service-monitor.yaml" line_range="8-10" />
<code_context>
+      targetPort: 8081
+      nodePort: 32334
+      name: petclinic-port
+  selector:
+    app: petclinic-deployment
+---
</code_context>
<issue_to_address>
**issue (bug_risk):** ServiceMonitor selector label does not match the Service/Deployment labels, so nothing will be scraped.

The ServiceMonitor is selecting `app: petclinic-app`, but the Service/Deployment use `app: petclinic-deployment`, and the Service metadata in `petclinic.yaml` doesn’t define `app: petclinic-app`. This mismatch means the ServiceMonitor won’t discover any targets; please update the label to match the Service you intend to monitor.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@@ -0,0 +1,98 @@
# 1. PetClinic Service: Fixed port 8081 and matching selectors
apiVersion: v1
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kusumachalasani Can you update the benchmark readme to indicate that on using these manifests load is run internally

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

Projects

Status: Under Review

Development

Successfully merging this pull request may close these issues.

3 participants