Skip to content

Commit a38062a

Browse files
committed
Polish docs with common plugins and Mermaid diagrams
1 parent 21a6969 commit a38062a

5 files changed

Lines changed: 119 additions & 35 deletions

File tree

.github/workflows/docs.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,12 @@ jobs:
2929
with:
3030
python-version: "3.12"
3131

32-
- name: Install mkdocs-material
33-
run: pip install mkdocs-material
32+
- name: Install docs dependencies
33+
run: |
34+
pip install \
35+
mkdocs-material \
36+
mkdocs-minify-plugin \
37+
mkdocs-git-revision-date-localized-plugin
3438
3539
- name: Build site
3640
run: mkdocs build --strict

docs/architecture.md

Lines changed: 48 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,35 @@ pools**. Each pool maps to a `[[runners]]` entry in the config file and
1010
operates independently with its own executor type, concurrency level, and
1111
GitHub API credentials.
1212

13-
```
14-
┌─────────────────────────────────────────────────┐
15-
│ CLI (cobra) │
16-
├─────────────────────────────────────────────────┤
17-
│ Runner Manager (1 per process) │
18-
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
19-
│ │ Worker 1 │ │ Worker 2 │ │ Worker N │ ... │
20-
│ │ (Job) │ │ (Idle) │ │ (Job) │ │
21-
│ └──────────┘ └──────────┘ └──────────┘ │
22-
├─────────────────────────────────────────────────┤
23-
│ Executor Layer │ Cache Layer │ Artifact │
24-
│ (shell/docker/ │ (local/s3/ │ Manager │
25-
│ k8s/firecracker)│ gcs) │ │
26-
├─────────────────────────────────────────────────┤
27-
│ GitHub API Client │ Metrics │ Health │ Logger │
28-
└─────────────────────────────────────────────────┘
13+
```mermaid
14+
flowchart TB
15+
CLI["CLI (cobra)"] --> Manager["Runner Manager (1 per process)"]
16+
17+
subgraph Pools["Runner pools (one per [[runners]] entry)"]
18+
W1["Worker 1 (job)"]
19+
W2["Worker 2 (idle)"]
20+
WN["Worker N (job)"]
21+
end
22+
23+
Manager --> Pools
24+
25+
subgraph Layers["Execution + services"]
26+
Executor["Executor layer<br/>shell / docker / kubernetes / firecracker"]
27+
Cache["Cache layer<br/>local / s3 / gcs"]
28+
Artifact["Artifact manager"]
29+
GitHubAPI["GitHub API client"]
30+
Metrics["Metrics"]
31+
Health["Health"]
32+
Logger["Logger"]
33+
end
34+
35+
Pools --> Executor
36+
Pools --> Cache
37+
Pools --> Artifact
38+
Manager --> GitHubAPI
39+
Manager --> Metrics
40+
Manager --> Health
41+
Manager --> Logger
2942
```
3043

3144
## Component diagram
@@ -203,23 +216,25 @@ If shutdown_timeout expires:
203216

204217
## Data flow: job lifecycle
205218

206-
```
207-
GitHub API Runner Executor
208-
│ │ │
209-
│◄── poll (GET /jobs) ──────│ │
210-
│── job payload ───────────►│ │
211-
│ │── Prepare() ─────────────────►│
212-
│◄── status: in_progress ───│ │
213-
│ │── Run(step 1) ───────────────►│
214-
│◄── heartbeat ─────────────│ │
215-
│◄── step status ───────────│◄── StepResult ────────────────│
216-
│ │── Run(step 2) ───────────────►│
217-
│◄── heartbeat ─────────────│ │
218-
│◄── step status ───────────│◄── StepResult ────────────────│
219-
│ │ │
220-
│◄── status: completed ─────│ │
221-
│ │── Cleanup() ─────────────────►│
222-
│ │ │
219+
```mermaid
220+
sequenceDiagram
221+
participant GH as GitHub API
222+
participant R as Runner
223+
participant E as Executor
224+
225+
R->>GH: Poll jobs (GET /jobs)
226+
GH-->>R: Job payload
227+
R->>E: Prepare()
228+
R->>GH: Status in_progress
229+
230+
loop For each workflow step
231+
R->>E: Run(step)
232+
E-->>R: StepResult
233+
R->>GH: Step status + heartbeat
234+
end
235+
236+
R->>GH: Status completed
237+
R->>E: Cleanup()
223238
```
224239

225240
## Package dependency graph

docs/javascripts/mermaid.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
const renderMermaid = () => {
2+
if (!window.mermaid) {
3+
return;
4+
}
5+
6+
window.mermaid.initialize({
7+
startOnLoad: false,
8+
securityLevel: "loose",
9+
theme: "neutral",
10+
});
11+
12+
window.mermaid.run({ querySelector: ".mermaid" });
13+
};
14+
15+
if (typeof document$ !== "undefined") {
16+
document$.subscribe(renderMermaid);
17+
} else {
18+
window.addEventListener("load", renderMermaid);
19+
}

docs/stylesheets/extra.css

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
:root {
2+
--runner-matte-black: #141414;
3+
}
4+
5+
[data-md-color-scheme="default"] .md-header,
6+
[data-md-color-scheme="default"] .md-tabs,
7+
[data-md-color-scheme="slate"] .md-header,
8+
[data-md-color-scheme="slate"] .md-tabs {
9+
background-color: var(--runner-matte-black);
10+
}
11+
12+
[data-md-color-scheme="default"] .md-tabs__link--active,
13+
[data-md-color-scheme="default"] .md-tabs__link:focus,
14+
[data-md-color-scheme="default"] .md-tabs__link:hover,
15+
[data-md-color-scheme="slate"] .md-tabs__link--active,
16+
[data-md-color-scheme="slate"] .md-tabs__link:focus,
17+
[data-md-color-scheme="slate"] .md-tabs__link:hover {
18+
color: #ffd54f;
19+
}

mkdocs.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,40 @@ theme:
2626
icon: material/weather-sunny
2727
name: Switch to light mode
2828
features:
29+
- content.action.edit
30+
- content.code.annotate
2931
- content.code.copy
3032
- navigation.tabs
3133
- navigation.instant
3234
- navigation.sections
3335
- navigation.expand
3436
- navigation.top
37+
- navigation.footer
3538
- search.highlight
3639
- toc.follow
3740

41+
plugins:
42+
- search
43+
- minify:
44+
minify_html: true
45+
- git-revision-date-localized:
46+
type: timeago
47+
enable_creation_date: true
48+
fallback_to_build_date: true
49+
3850
markdown_extensions:
3951
- tables
52+
- attr_list
53+
- md_in_html
54+
- def_list
55+
- footnotes
4056
- admonition
57+
- pymdownx.details
4158
- pymdownx.highlight:
4259
anchor_linenums: true
60+
- pymdownx.inlinehilite
61+
- pymdownx.keys
62+
- pymdownx.snippets
4363
- pymdownx.superfences:
4464
custom_fences:
4565
- name: mermaid
@@ -52,6 +72,13 @@ markdown_extensions:
5272
- toc:
5373
permalink: true
5474

75+
extra_css:
76+
- stylesheets/extra.css
77+
78+
extra_javascript:
79+
- https://unpkg.com/mermaid@10.9.1/dist/mermaid.min.js
80+
- javascripts/mermaid.js
81+
5582
nav:
5683
- Home: index.md
5784
- Architecture: architecture.md

0 commit comments

Comments
 (0)