Skip to content

Commit 7c13d33

Browse files
author
Eidmantas Ivanauskas
committed
docs(readme): add Mermaid architecture diagram of fork-specific enhancements
1 parent a275578 commit 7c13d33

File tree

1 file changed

+79
-0
lines changed

1 file changed

+79
-0
lines changed

README.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,3 +193,82 @@ Notes
193193

194194
- Combined effects (scheduler + limits)
195195
- Higher `--max-concurrency` with `--per-repo-cap` and `--cooldown` improves fleet throughput and fairness while avoiding monorepo starvation.
196+
197+
## Enhanced runtime architecture (fork-specific)
198+
199+
This diagram shows how our improvements compose when running with the recommended flags (e.g., `--mode=continuous`, `--max-concurrency=0`, `--schedule=lru|fail-first`, `--cooldown`, `--per-repo-cap`, with `REGISTRY_JWT_*` retries enabled).
200+
201+
```mermaid
202+
flowchart LR
203+
subgraph Scheduler[Scheduler]
204+
S1[--mode=continuous] --> S2[Per-app timers (interval)]
205+
S1 --> S3[Auto concurrency (--max-concurrency=0)]
206+
S1 --> S4[Priorities (--schedule=lru|fail-first)]
207+
S1 --> S5[Cooldown (--cooldown)]
208+
S1 --> S6[Fairness cap (--per-repo-cap)]
209+
end
210+
211+
S2 --> WQ[Worker Pool]
212+
S3 --> WQ
213+
S4 --> WQ
214+
S5 --> WQ
215+
S6 --> WQ
216+
217+
subgraph Worker[Worker (per app)]
218+
W1[Compute image candidates] --> W2[Registry operations]
219+
W1 --> W3[Spec patch in-memory]
220+
W3 -->|WriteBackGit| W4[enqueue writeIntent(repo)]
221+
W3 -->|WriteBack Argo CD API| W5[Update via ArgoCD API]
222+
end
223+
224+
WQ --> W1
225+
226+
%% Registry client path
227+
subgraph RegistryClient[Registry client (per registry endpoint)]
228+
RC1[Dedicated http.Transport cache\nkeep-alive + sane timeouts\nMaxConnsPerHost cap] --> RC2[rateLimit transport\nper-registry in-flight cap]
229+
RC2 --> RC3[singleflight(tags, manifests)]
230+
RC3 --> RC4[JWT auth interceptor\n singleflight + retries\n REGISTRY_JWT_*]
231+
RC4 --> RC5[HTTPS (HTTP/2 when available)]
232+
end
233+
234+
W2 --> RegistryClient
235+
236+
%% Batched Git writer path
237+
subgraph GitWriter[Per-repo batched writer]
238+
GW1[intent queue (repo)] --> GW2[group by branch]
239+
GW2 --> GW3[commitBatch]
240+
GW3 --> GW4[Git client (fetch/checkout/commit/push)\nretries + backoff]
241+
end
242+
243+
W4 --> GitWriter
244+
245+
%% Metrics and logging
246+
subgraph Metrics[Prometheus metrics]
247+
M1[App timings\n(last attempt/success, duration)]
248+
M2[Cycle timings]
249+
M3[Registry health\n(in-flight, duration, status, retries, errors)]
250+
M4[JWT auth\n(requests, errors, duration, TTL)]
251+
M5[Singleflight effectiveness]
252+
end
253+
254+
Worker --> M1
255+
Scheduler --> M2
256+
RegistryClient --> M3
257+
RegistryClient --> M4
258+
RegistryClient --> M5
259+
GitWriter --> M1
260+
```
261+
262+
Key behaviors added vs upstream:
263+
264+
- Continuous scheduling: per-app timers remove whole-cycle stalls; auto concurrency scales workers.
265+
- Fairness: `--per-repo-cap` and `--cooldown` prevent hot monorepos from starving others.
266+
- Registry resiliency and efficiency:
267+
- Reused transports with tuned timeouts limit dials and hangs.
268+
- Per-registry in-flight cap stops connection storms/port exhaustion.
269+
- Singleflight for tags/manifests and JWT auth dedupes bursts.
270+
- JWT auth retries with backoff (config via `REGISTRY_JWT_*`).
271+
- HTTP/2 when using HTTPS reduces socket pressure under load.
272+
- Git throughput: per-repo batched writer coalesces multiple app changes per branch into 1 commit+push; Git ops have retries.
273+
- Clear logs: startup settings, continuous start/finish, queued write-backs.
274+
- Expanded metrics: deep visibility for scheduling, registry/JWT, and Git paths.

0 commit comments

Comments
 (0)