Skip to content

Commit 822a203

Browse files
committed
Document how Prow jobs are used in etcd
- Introduction to Prow - How Prow is used for etcd testing - Navigating perfomance dashboards (Grafana) - Prow job categories - Interpreting metrics Signed-off-by: ronaldngounou <ronald.ngounou@yahoo.com>
1 parent dda4eb4 commit 822a203

File tree

1 file changed

+109
-0
lines changed

1 file changed

+109
-0
lines changed
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# Prow Jobs in etcd
2+
3+
## 1. Introduction to Prow
4+
5+
[Prow] is a Kubernetes based CI/CD system. Jobs can be triggered by various types of events and report their status to many different services. In addition to job execution, Prow provides GitHub automation in the form of policy enforcement, chat-ops via `/foo` style commands, and automatic PR merging.
6+
7+
When a user comments `/ok-to-test`or `/retest,` on a Pull Request, GitHub sends a webhook to Prow's Kubernetes cluster. The request travels through an ingress for TLS termination, gets routed to the hook service, and arrives at the hook application running in pods. Visit this [site][life-of-a-prow-job] to further understand the lifecycle of a Prow job.
8+
This is where you can find all etcd Prow jobs [status](https://prow.k8s.io/?repo=etcd-io%2Fetcd)
9+
10+
## 2. How Prow is used for etcd Testing
11+
12+
The CI of etcd is managed by kubernetes/test-infra, which leverages prow inside it.
13+
14+
Whenever a pull request is submitted, or a command is called, the CI of etcd, managed by [kubernetes/test-infra](https://github.com/kubernetes/test-infra) leverages Prow to run the tests. You can find all the supported [commands](https://prow.k8s.io/command-help).
15+
16+
The [history](https://prow.k8s.io/job-history/gs/kubernetes-ci-logs/pr-logs/directory/pull-etcd-e2e-amd64?buildId=)of the ran can be found.
17+
18+
### Jobs Types
19+
20+
The jobs [configuration](https://github.com/kubernetes/test-infra/tree/master/config/jobs/etcd) for etcd.
21+
22+
There are 3 different job types:
23+
24+
- Presubmits run against code in PRs
25+
- Postsubmits run after merging code
26+
- Periodics run on a periodic basis
27+
28+
Please see [ProwJob](https://docs.prow.k8s.io/docs/jobs/) docs for more info.
29+
30+
As an [example](https://github.com/kubernetes/test-infra/blob/master/config/jobs/etcd/etcd-presubmits.yaml), are the presubmits jobs of etcd. `pull-etcd-e2e-amd64` is one of the [presubmits](https://github.com/kubernetes/test-infra/blob/b21a1d3a72d5715ea7c9234cade21751847cfbe5/config/jobs/etcd/etcd-presubmits.yaml#L193).
31+
32+
Refer to [this](https://github.com/kubernetes/test-infra/tree/master/config/jobs#job-types) to learn more about job types.
33+
34+
### How to manually run a given job on Prow
35+
36+
These tests can be triggered when you leave a comment, like `/ok-to-test` or `/retest`, in PR [example](https://github.com/etcd-io/etcd/pull/20733#issuecomment-3341443205).
37+
You can find all supported [commands](https://prow.k8s.io/command-help).
38+
39+
## 3. Navigating Performance Dashboard (Grafana)
40+
41+
One example of [dashboards](monitoring-gke.prow.k8s.io/d/96Q8oOOZk/builds?orgId=1&refresh=30s&var-org=etcd-io&var-repo=etcd&var-build=All&from=now-7d&to=now) can be found.
42+
43+
This dashboard provides visibility into build resource usage (CPU, memory, number of running builds, etc.) for the Prow build cluster’s Kubernetes jobs. It is scoped via organization, repository, build identifier and time range filters.
44+
45+
### Panel: “Running / Pending Builds”
46+
47+
Shows the number of builds that are in Running vs Pending states over time.
48+
Use it to track build backlog or concurrency — e.g., if the “Pending” line rises, builds may be waiting for resources.
49+
If the “Running” line fluctuates a lot or remains at some steady value, you can infer how many builds typically run in parallel.
50+
51+
### Panel: “Memory Usage per Build”
52+
53+
Shows memory usage over time for each build ID (each build listed in the legend at the bottom).
54+
The y‑axis shows memory use (e.g., in MiB / GiB).
55+
Use this to spot builds with unusually high memory usage — a spike indicates one build consumed many resources.
56+
57+
### Panel: “CPU Usage per Build”
58+
59+
Similar to the memory panel but shows CPU usage per build over time. Spikes in CPU usage may indicate heavy compute jobs, inefficiencies, or need for resource tuning.
60+
61+
### Panel: "Resources"
62+
63+
- Memory panel
64+
65+
Green line (“used”): how much memory this build’s pod was using at each time point. Orange/Yellow line (“requested”): how much memory was requested (i.e., Kubernetes requests.memory) for that pod.
66+
Red line (“limit”): how much memory was limited (i.e., Kubernetes limits.memory) for that pod.
67+
Y‑axis: shows memory (GiB, MiB) over the build runtime.
68+
69+
X‑axis: time of day/date.
70+
If the green “used” line is close to or hits the red “limit”, it means the build came close to its memory cap (risking OOM). If “used” is much lower than “requested”, you may be over‑allocating memory (waste).
71+
If the “requested” line is much higher than “used”, it suggests the job’s request could be tuned downward.
72+
73+
- CPU panel
74+
75+
Similar structure: green = actual usage, orange/yellow = requested CPU, red = CPU limit (if set).
76+
Y‑axis often in number of CPU cores or fraction thereof (e.g., 1.0 = one core).
77+
A green line with spikes may show bursts of CPU usage (e.g., build or compile phases) while idle periods show low usage.
78+
If CPU usage consistently saturates the limit, the job may be throttled or delayed. If usage is consistently far below request, tuning may reduce cost.
79+
80+
It is useful for a few reasons:
81+
82+
1. Tuning resources: By drilling into each build-run, you can determine realistic memory & CPU requests and limits for that job‑type. This helps avoid waste or avoid failed builds hitting resource limits.
83+
84+
2. Spotting anomalies: If one build suddenly used 8 GiB while normally this job uses 1 GiB, it may indicate a regression or mis‑configuration.
85+
86+
3. Capacity planning: Seeing typical and peak usage helps cluster operators plan node sizes, scheduling, concurrency of builds, etc.
87+
88+
4. Debugging performance issues: A build with unexpectedly high CPU or memory might be stuck, looping, or consuming resources inefficiently.
89+
90+
## 3.1 Prow job categories (robustness, integration, static checks)
91+
92+
- Robustness:
93+
- Description: Long-running, fault-injection and chaos-style end-to-end tests that validate etcd correctness and availability under failures (node crashes, network partitions, resource exhaustion, upgrades).
94+
- When to run: Periodics for continuous coverage; run for PRs that touch consensus, storage, recovery, or upgrade paths.
95+
- Example job patterns: pull-etcd-robustness, periodic-robustness
96+
97+
- Integration:
98+
- Description: Functional end-to-end and cross-component tests that exercise real client/server interactions, snapshots/restore, upgrades and compatibility across OS/arch.
99+
- When to run: Presubmits for PRs that change APIs, client behavior, or integration points; periodics for broad platform coverage.
100+
- Example job patterns: pull-etcd-e2e-amd64, pull-etcd-integration
101+
102+
- Static check:
103+
- Description: Fast, deterministic checks (build, unit tests, linters, go vet/staticcheck, formatting, license/header checks, generated-code verification) that catch style, correctness and packaging problems early.
104+
- When to run: Every PR as presubmits; quick feedback loop before running expensive tests.
105+
- Example job patterns: pull-etcd-verify, pull-etcd-lint, pull-etcd-unit
106+
107+
## 4. Interpreting Metrics
108+
109+
Some Prow components expose Prometheus metrics that can be used for monitoring and alerting. You can find metrics like the number of PRs in each Tide pool, a histogram of the number of PRs in each merge and various other metrics to this [site](https://github.com/kubernetes-sigs/prow/blob/main/site/content/en/docs/metrics/_index.md).

0 commit comments

Comments
 (0)