Skip to content

Commit 9b00ce4

Browse files
committed
docs: improve manifest and quickstart structure
1 parent a5532f0 commit 9b00ce4

3 files changed

Lines changed: 154 additions & 31 deletions

File tree

docs/config-manifest.md

Lines changed: 136 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,24 @@ spec: {}
4343
- `idleTimeoutMinutes` (`int`, default from template): reserved for lifecycle policy.
4444
- `shareable` (`bool`): marks intent for team sharing workflows.
4545

46-
Validation:
46+
### Example
47+
48+
```yaml
49+
spec:
50+
session:
51+
defaultNameTemplate: "{{ .Repo }}-{{ .Branch }}-{{ .User }}"
52+
ttlHours: 72
53+
idleTimeoutMinutes: 120
54+
shareable: true
55+
```
56+
57+
### Validation
58+
4759
- `ttlHours >= 0`
4860
- `idleTimeoutMinutes >= 0`
4961

50-
Context precedence:
62+
### Context Precedence
63+
5164
- `--context` CLI flag (highest)
5265
- `spec.kubeContext` from manifest
5366
- active kubeconfig current-context (default client behavior)
@@ -59,7 +72,31 @@ Context precedence:
5972
- Define storage source with standard `VolumeSource` (for example `emptyDir`, `persistentVolumeClaim`, `ephemeral`, `configMap`, `secret`).
6073
- Mount points are defined with standard Kubernetes `volumeMounts` in `spec.podTemplate.spec.containers[*].volumeMounts`.
6174

62-
Workspace behavior:
75+
### Example
76+
77+
```yaml
78+
spec:
79+
volumes:
80+
- name: workspace
81+
persistentVolumeClaim:
82+
claimName: team-workspace
83+
- name: datasets
84+
persistentVolumeClaim:
85+
claimName: shared-datasets
86+
podTemplate:
87+
spec:
88+
containers:
89+
- name: dev
90+
volumeMounts:
91+
- name: workspace
92+
mountPath: /workspace
93+
- name: datasets
94+
mountPath: /data
95+
readOnly: true
96+
```
97+
98+
### Workspace Behavior
99+
63100
- If a `workspace` volume is not provided, okdev injects:
64101
- `name: workspace`
65102
- `emptyDir: {}`
@@ -79,20 +116,54 @@ Workspace behavior:
79116
- `autoInstall` (`bool`, default: `true`)
80117
- `image` (`string`, default: `ghcr.io/acmore/okdev:<okdev-version>` with `edge` fallback)
81118

82-
Validation:
119+
### Example
120+
121+
```yaml
122+
spec:
123+
sync:
124+
engine: syncthing
125+
syncthing:
126+
version: v1.29.7
127+
autoInstall: true
128+
paths:
129+
- .:/workspace
130+
exclude:
131+
- .git/
132+
- node_modules/
133+
- .venv/
134+
remoteExclude:
135+
- ".cache/"
136+
```
137+
138+
### Validation
139+
83140
- `engine` must be `syncthing`
84141
- each `paths[]` entry must be `local:remote`
85142
- currently at most one `paths[]` entry
86143

87144
## `spec.ports`
88145

89-
Each item:
146+
### Each Item
90147

91148
- `name` (`string`, optional)
92149
- `local` (`int`, required): local listening port
93150
- `remote` (`int`, required): remote target port in dev environment
94151

95-
Validation:
152+
### Example
153+
154+
```yaml
155+
spec:
156+
ports:
157+
- name: app
158+
local: 8080
159+
remote: 8080
160+
- name: tensorboard
161+
local: 6006
162+
remote: 6006
163+
```
164+
165+
### Validation
166+
96167
- `local` and `remote` must be `1..65535`
97168
- `local` ports must be unique
98169

@@ -105,7 +176,21 @@ Validation:
105176
- `keepAliveIntervalSeconds` (`int`, default: `10`)
106177
- `keepAliveTimeoutSeconds` (`int`, default: `10`)
107178

108-
Validation:
179+
### Example
180+
181+
```yaml
182+
spec:
183+
ssh:
184+
user: root
185+
privateKeyPath: ~/.okdev/ssh/id_ed25519
186+
autoDetectPorts: true
187+
persistentSession: true
188+
keepAliveIntervalSeconds: 30
189+
keepAliveTimeoutSeconds: 90
190+
```
191+
192+
### Validation
193+
109194
- `keepAliveIntervalSeconds > 0`
110195
- `keepAliveTimeoutSeconds > 0`
111196
- `keepAliveTimeoutSeconds >= keepAliveIntervalSeconds`
@@ -115,22 +200,64 @@ Validation:
115200
- `postCreate` (`string`, optional): command executed once after environment creation.
116201
- `preStop` (`string`, optional): command executed before pod termination.
117202

203+
### Example
204+
205+
```yaml
206+
spec:
207+
lifecycle:
208+
postCreate: uv sync --dev
209+
preStop: pkill -f my-dev-server || true
210+
```
211+
118212
## `spec.sidecar`
119213

120214
- `image` (`string`, required)
121215

122-
Recommended:
216+
### Example
217+
218+
```yaml
219+
spec:
220+
sidecar:
221+
image: ghcr.io/acmore/okdev:v0.2.16
222+
```
223+
224+
### Recommended
225+
123226
- use release-aligned tag, for example `ghcr.io/acmore/okdev:v0.2.0`
124227

125228
## `spec.podTemplate`
126229

127-
Direct PodSpec overlay:
230+
### Direct PodSpec Overlay
128231

129232
- `metadata.labels` (`map[string]string`, optional)
130233
- `spec` (`k8s PodSpec`, optional)
131234

132235
Use this to define the dev container image, resources, extra sidecars, env vars, and scheduling settings.
133236

237+
### Example
238+
239+
```yaml
240+
spec:
241+
podTemplate:
242+
spec:
243+
containers:
244+
- name: dev
245+
image: nvidia/cuda:12.4.1-devel-ubuntu22.04
246+
command: ["sleep", "infinity"]
247+
env:
248+
- name: HF_HOME
249+
value: /workspace/.cache/huggingface
250+
resources:
251+
requests:
252+
cpu: "8"
253+
memory: 32Gi
254+
nvidia.com/gpu: "1"
255+
limits:
256+
cpu: "16"
257+
memory: 64Gi
258+
nvidia.com/gpu: "1"
259+
```
260+
134261
## Example Manifest
135262

136263
```yaml

docs/quickstart.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,14 @@ okdev version
2727
./bin/okdev init --template gpu
2828
```
2929

30-
Configuration discovery order:
30+
## Configuration Discovery
31+
3132
1. `-c, --config <path>`
3233
2. `.okdev.yaml`
3334
3. `okdev.yaml`
3435

35-
Kubernetes context precedence:
36+
## Kubernetes Context
37+
3638
1. `--context`
3739
2. `spec.kubeContext` in manifest
3840
3. active kube context from your kubeconfig
@@ -43,19 +45,20 @@ Kubernetes context precedence:
4345
./bin/okdev up
4446
```
4547

46-
Use an explicit session name when running multiple environments for the same repo:
48+
### Named Sessions
4749

4850
```bash
4951
./bin/okdev up --session serving-main-alice
5052
```
5153

52-
Tmux-backed persistent shells are enabled by default. Disable them for a pod with:
54+
### Disable Tmux
5355

5456
```bash
5557
./bin/okdev up --no-tmux
5658
```
5759

58-
`okdev up` performs one-step setup:
60+
### What `okdev up` Does
61+
5962
- ensures Pod/PVC state
6063
- writes managed `~/.ssh/config` host entry (`okdev-<session>`)
6164
- starts managed SSH/forwarding bootstrap
@@ -78,7 +81,8 @@ Tmux-backed persistent shells are enabled by default. Disable them for a pod wit
7881
./bin/okdev sync --background
7982
```
8083

81-
Notes:
84+
## Notes
85+
8286
- Local Syncthing is auto-installed when `sync.engine=syncthing`.
8387
- `okdev up` starts background sync in bidirectional mode by default.
8488
- Default sidecar image (syncthing + okdev-sshd binary) follows binary version: `ghcr.io/<owner>/okdev:<okdev-version>` (`edge` for dev builds).
@@ -92,9 +96,7 @@ Notes:
9296
- The managed SSH host entry uses tighter proxy keepalive settings than the general CLI defaults so hung `ssh okdev-<session>` sessions fail fast instead of freezing indefinitely.
9397
- Proxy health diagnostics are written to `~/.okdev/logs/okdev.log`, not printed into the SSH client session.
9498
- Tmux uses a built-in okdev profile (history/mouse/vi-copy/status) and keeps the default command prefix (`Ctrl-b`).
95-
- SSH keepalive can be tuned with:
96-
- `spec.ssh.keepAliveIntervalSeconds` (default `30`)
97-
- `spec.ssh.keepAliveTimeoutSeconds` (default `90`, must be `>= interval`)
99+
- SSH keepalive can be tuned with `spec.ssh.keepAliveIntervalSeconds` (default `30`) and `spec.ssh.keepAliveTimeoutSeconds` (default `90`, must be `>= interval`).
98100

99101
## Preview Mode (No Cluster Mutations)
100102

docs/release.md

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
- `MINOR`: backward-compatible features.
99
- `PATCH`: backward-compatible fixes.
1010

11-
Tag format:
11+
### Tag Format
1212

1313
- `vX.Y.Z` (example: `v0.2.1`)
1414

@@ -22,23 +22,17 @@ git tag v0.1.0
2222
git push origin v0.1.0
2323
```
2424

25-
3. GitHub Actions `Release` workflow builds binaries for:
26-
- `linux/amd64`
27-
- `linux/arm64`
28-
- `darwin/amd64`
29-
- `darwin/arm64`
30-
4. Workflow publishes assets:
31-
- `okdev_<os>_<arch>.tar.gz`
32-
- `checksums.txt`
25+
3. GitHub Actions `Release` workflow builds binaries for `linux/amd64`, `linux/arm64`, `darwin/amd64`, and `darwin/arm64`.
26+
4. Workflow publishes `okdev_<os>_<arch>.tar.gz` assets plus `checksums.txt`.
3327

3428
## Sidecar image tags
3529

36-
Sidecar image tags are aligned with the `okdev` release tag:
30+
### Published Tags
3731

3832
- release `vX.Y.Z` publishes:
39-
- `ghcr.io/acmore/okdev:vX.Y.Z` (sidecar runtime: syncthing + okdev-sshd binary)
33+
`ghcr.io/acmore/okdev:vX.Y.Z` (sidecar runtime: syncthing + okdev-sshd binary)
4034
- dev/main pushes publish:
41-
- `ghcr.io/acmore/okdev:edge`
35+
`ghcr.io/acmore/okdev:edge`
4236

4337
Default sidecar image resolution uses the running `okdev` binary version, with `edge` fallback for dev builds.
4438

@@ -48,7 +42,7 @@ Default sidecar image resolution uses the running `okdev` binary version, with `
4842
curl -fsSL https://raw.githubusercontent.com/acmore/okdev/main/scripts/install.sh | sh
4943
```
5044

51-
Install specific version:
45+
### Install Specific Version
5246

5347
```bash
5448
curl -fsSL https://raw.githubusercontent.com/acmore/okdev/main/scripts/install.sh | sh -s -- v0.1.0

0 commit comments

Comments
 (0)