Skip to content

Commit c99c57e

Browse files
authored
Merge pull request #17 from ding-labs/recipe-template-sweep
docs(recipes): restore duration_seconds + version pin sweep
2 parents 446ada4 + 07c37a6 commit c99c57e

9 files changed

Lines changed: 33 additions & 33 deletions

File tree

docs/recipes/_template.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ rubric.
1212
1313
## Prerequisites
1414

15-
- DING binary `>= v0.3.0` — see [install](../install.md)
15+
- DING binary `>= v0.10.0` — see [install](../install.md)
1616
- <Platform-specific requirements: account, runtime version, etc.>
1717
- A notifier endpoint (Slack webhook URL, custom webhook, etc.)
1818

@@ -32,7 +32,7 @@ rules:
3232
match:
3333
metric: run.exit
3434
condition: value > 0
35-
message: "Job failed (exit {{ .exit_code }})"
35+
message: "Job failed (exit {{ .exit_code }} after {{ .duration_seconds }}s)"
3636
alert:
3737
- notifier: slack
3838
```

docs/recipes/argo-workflows.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
## Prerequisites
66

7-
- DING binary `>= v0.7.0` — see [install](../install.md). The recipe pulls the official container image `ghcr.io/ding-labs/ding:v0.7.0` (multi-arch, scratch base) into each step's Pod via an initContainer; no need to bake DING into your workload image.
7+
- DING binary `>= v0.10.0` — see [install](../install.md). The recipe pulls the official container image `ghcr.io/ding-labs/ding:v0.10.0` (multi-arch, scratch base) into each step's Pod via an initContainer; no need to bake DING into your workload image.
88
- Argo Workflows controller installed in the cluster, `>= v3.5` (most users on v3.5/v3.6 LTS series).
99
- `kubectl` access to a namespace where you can create Workflows, ConfigMaps, and Secrets.
1010
- `argo` CLI installed locally (ships with the controller; one-line install per [Argo docs](https://argo-workflows.readthedocs.io/en/latest/quick-start/)).
@@ -49,7 +49,7 @@ data:
4949
match:
5050
metric: run.exit
5151
condition: value > 0
52-
message: "Argo step {{ .pod }} (workflow {{ .workflow }}) failed with exit {{ .exit_code }}"
52+
message: "Argo step {{ .pod }} (workflow {{ .workflow }}) failed with exit {{ .exit_code }} after {{ .duration_seconds }}s"
5353
alert:
5454
- notifier: slack
5555
---
@@ -71,7 +71,7 @@ spec:
7171
name: ding-config
7272
initContainers:
7373
- name: install-ding
74-
image: ghcr.io/ding-labs/ding:v0.7.0
74+
image: ghcr.io/ding-labs/ding:v0.10.0
7575
# `ding install` self-copies the binary — works against the FROM-scratch
7676
# release image (no /bin/sh available). Added in DING v0.5.1.
7777
command: ["/ding", "install", "/shared/ding"]
@@ -173,7 +173,7 @@ spec:
173173
- { name: ding-config, configMap: { name: ding-config } }
174174
initContainers:
175175
- name: install-ding
176-
image: ghcr.io/ding-labs/ding:v0.7.0
176+
image: ghcr.io/ding-labs/ding:v0.10.0
177177
command: ["/ding", "install", "/shared/ding"]
178178
mirrorVolumeMounts: true
179179
container:

docs/recipes/buildkite.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
## Prerequisites
66

7-
- DING binary `>= v0.3.0` — see [install](../install.md)
7+
- DING binary `>= v0.10.0` — see [install](../install.md)
88
- A Buildkite organization with at least one agent ([free trial available](https://buildkite.com/pricing))
99
- A notifier endpoint (Slack webhook URL, custom webhook, etc.)
1010

@@ -33,7 +33,7 @@ rules:
3333
match:
3434
metric: run.exit
3535
condition: value > 0
36-
message: "{{ .repo }}@{{ .branch }} failed (exit {{ .exit_code }})"
36+
message: "{{ .repo }}@{{ .branch }} failed (exit {{ .exit_code }} after {{ .duration_seconds }}s)"
3737
alert:
3838
- notifier: slack
3939
```
@@ -64,7 +64,7 @@ Use these in `match.labels` or `message` templates. See [Configuration](../confi
6464
2. Trigger a build. Confirm a successful step produces no alert.
6565
3. Force a failure (`exit 1` in `run-tests.sh`). Confirm the alert fires in Slack within ~5 seconds of step exit.
6666

67-
If the alert doesn't fire, check the Buildkite build log for `ding` output. Common issues: webhook URL not exposed (env hook scope, agent vs pipeline level), or `drain_timeout` shorter than the notifier retry window — see [Configuration](../configuration.md).
67+
If the alert doesn't fire, check the Buildkite build log for `ding` output. Common issues: webhook URL not exposed (env hook scope, agent vs pipeline level), or `drain_timeout` shorter than the notifier retry window — see [Configuration → drain_timeout](../configuration.md#drain_timeout-and-retry-behaviour-in-ding-run).
6868

6969
## Native Buildkite UI surfacing
7070

docs/recipes/gitlab-ci.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
## Prerequisites
66

7-
- DING binary `>= v0.3.0` — see [install](../install.md)
7+
- DING binary `>= v0.10.0` — see [install](../install.md)
88
- A GitLab project with CI enabled (gitlab.com or self-hosted)
99
- A notifier endpoint (Slack webhook URL, custom webhook, etc.) accessible from the runner
1010

@@ -35,7 +35,7 @@ rules:
3535
match:
3636
metric: run.exit
3737
condition: value > 0
38-
message: "Pipeline {{ .branch }} failed (exit {{ .exit_code }})"
38+
message: "Pipeline {{ .branch }} failed (exit {{ .exit_code }} after {{ .duration_seconds }}s)"
3939
alert:
4040
- notifier: slack
4141
```
@@ -67,7 +67,7 @@ Use these in `match.labels` for selective rules, or in `message` templates as `{
6767
2. Push a commit. Confirm the pipeline runs and that a successful job produces no alert.
6868
3. Force a failure: change `run-tests.sh` to `exit 1`. Confirm the alert fires in Slack within ~5 seconds of job exit.
6969

70-
If the alert doesn't fire, check the GitLab CI job log for `ding` output. Common issues: webhook URL not exposed to the job (mark the variable as not "Protected" if testing on a non-protected branch), or `drain_timeout` shorter than the notifier retry window — see [Configuration → drain_timeout](../configuration.md).
70+
If the alert doesn't fire, check the GitLab CI job log for `ding` output. Common issues: webhook URL not exposed to the job (mark the variable as not "Protected" if testing on a non-protected branch), or `drain_timeout` shorter than the notifier retry window — see [Configuration → drain_timeout](../configuration.md#drain_timeout-and-retry-behaviour-in-ding-run).
7171

7272
## Native GitLab UI surfacing
7373

docs/recipes/jenkins.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
## Prerequisites
66

7-
- DING binary `>= v0.3.0` — see [install](../install.md)
7+
- DING binary `>= v0.10.0` — see [install](../install.md)
88
- A Jenkins controller (any version supporting Pipeline DSL — most do)
99
- A notifier endpoint (Slack webhook URL, custom webhook, etc.) reachable from the Jenkins agent
1010

@@ -47,7 +47,7 @@ rules:
4747
match:
4848
metric: run.exit
4949
condition: value > 0
50-
message: "{{ .job }} build {{ .build }} failed (exit {{ .exit_code }})"
50+
message: "{{ .job }} build {{ .build }} failed (exit {{ .exit_code }} after {{ .duration_seconds }}s)"
5151
alert:
5252
- notifier: slack
5353
```
@@ -77,7 +77,7 @@ Note: Jenkins doesn't expose `repo`, `branch`, or `commit` as universal env vars
7777
2. Trigger the job. Confirm a successful build produces no alert.
7878
3. Force a failure (`exit 1` in `run-tests.sh`). Confirm the alert fires in Slack within ~5 seconds of build exit.
7979

80-
If the alert doesn't fire, check the Jenkins build console for `ding` output. Common issues: webhook credential not exposed to the job (`withCredentials` block missing or wrong `credentialsId`), or `drain_timeout` shorter than the notifier retry window — see [Configuration](../configuration.md).
80+
If the alert doesn't fire, check the Jenkins build console for `ding` output. Common issues: webhook credential not exposed to the job (`withCredentials` block missing or wrong `credentialsId`), or `drain_timeout` shorter than the notifier retry window — see [Configuration → drain_timeout](../configuration.md#drain_timeout-and-retry-behaviour-in-ding-run).
8181

8282
## Tradeoffs / known limitations
8383

docs/recipes/kubernetes-jobs.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
## Prerequisites
1616

17-
- DING binary `>= v0.7.0` — see [install](../install.md). The recipe pulls the official container image `ghcr.io/ding-labs/ding:v0.7.0` (multi-arch, scratch base) into your Pod via an initContainer; no need to bake DING into your workload image.
17+
- DING binary `>= v0.10.0` — see [install](../install.md). The recipe pulls the official container image `ghcr.io/ding-labs/ding:v0.10.0` (multi-arch, scratch base) into your Pod via an initContainer; no need to bake DING into your workload image.
1818
- A Kubernetes cluster `>= 1.21` for the primary wrapper pattern below. The sidecar alternative documented in [Configuration](#sidecar-alternative-k8s-129) requires `>= 1.29` for native sidecar lifecycle.
1919
- `kubectl` access to a namespace where you can create Jobs, ConfigMaps, and Secrets.
2020
- A notifier endpoint (Slack webhook URL or custom webhook) you can store in a Kubernetes Secret.
@@ -58,7 +58,7 @@ data:
5858
match:
5959
metric: run.exit
6060
condition: value > 0
61-
message: "{{ .pod }} (Job {{ .job_name }}) failed with exit {{ .exit_code }}"
61+
message: "{{ .pod }} (Job {{ .job_name }}) failed with exit {{ .exit_code }} after {{ .duration_seconds }}s"
6262
alert:
6363
- notifier: slack
6464
---
@@ -82,7 +82,7 @@ spec:
8282
name: ding-config
8383
initContainers:
8484
- name: install-ding
85-
image: ghcr.io/ding-labs/ding:v0.7.0
85+
image: ghcr.io/ding-labs/ding:v0.10.0
8686
# `ding install` self-copies the binary — works against the FROM-scratch
8787
# release image (no /bin/sh available). Added in DING v0.5.1.
8888
command: ["/ding", "install", "/shared/ding"]
@@ -184,7 +184,7 @@ spec:
184184
spec:
185185
initContainers:
186186
- name: ding
187-
image: ghcr.io/ding-labs/ding:v0.7.0
187+
image: ghcr.io/ding-labs/ding:v0.10.0
188188
restartPolicy: Always # native sidecar — K8s 1.29+
189189
command: ["/ding", "serve", "--config", "/etc/ding/ding.yaml"]
190190
# ...volumeMounts for config + downward-API env block
@@ -225,7 +225,7 @@ rules:
225225
- name: job_failed
226226
match: { metric: run.exit }
227227
condition: value > 0
228-
message: "Job failed (exit {{ .exit_code }})"
228+
message: "Job failed (exit {{ .exit_code }} after {{ .duration_seconds }}s)"
229229
alert:
230230
- notifier: k8s
231231
```

docs/recipes/mlflow.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
## Prerequisites
66

7-
- DING binary `>= v0.6.0` — see [install](../install.md)
7+
- DING binary `>= v0.10.0` — see [install](../install.md)
88
- `mlflow >= 2.0` (`pip install mlflow`)
99
- An MLflow tracking URI: local SQLite for dev; remote tracking server like Databricks or self-hosted (`mlflow server`) for production deep-links to work
1010
- A notifier endpoint (Slack webhook URL is the canonical example)
@@ -49,7 +49,7 @@ rules:
4949
match: { metric: run.exit }
5050
condition: value > 0
5151
message: |
52-
MLflow run failed (exit {{ .exit_code }})
52+
MLflow run failed (exit {{ .exit_code }} after {{ .duration_seconds }}s)
5353
<{{ .tracking_uri }}/#/experiments/{{ .experiment_id }}/runs/{{ .run_id }}|View run in MLflow UI>
5454
alert:
5555
- notifier: slack
@@ -87,7 +87,7 @@ A Slack message during training when `val_loss` exceeds threshold:
8787
…and on training-process exit:
8888

8989
> 🔔 `training_failed`
90-
> MLflow run failed (exit 1)
90+
> MLflow run failed (exit 1 after 42s)
9191
> [View run in MLflow UI](#)
9292

9393
The deep-link in the second message takes you straight to the MLflow run page. All alerts are auto-tagged with `run_id`, `runner=mlflow`, `experiment_id`, `tracking_uri`.
@@ -121,7 +121,7 @@ mlflow run . --env-manager=local
121121
# 3. labels include run_id, experiment_id, tracking_uri
122122
```
123123

124-
If the alert doesn't fire, check the `mlflow run` log for `ding` output. Common issues: `SLACK_WEBHOOK_URL` not exported in the shell that ran `mlflow run`, or `drain_timeout` shorter than the notifier retry window — see [Configuration](../configuration.md).
124+
If the alert doesn't fire, check the `mlflow run` log for `ding` output. Common issues: `SLACK_WEBHOOK_URL` not exported in the shell that ran `mlflow run`, or `drain_timeout` shorter than the notifier retry window — see [Configuration → drain_timeout](../configuration.md#drain_timeout-and-retry-behaviour-in-ding-run).
125125

126126
## Tradeoffs / known limitations
127127

docs/recipes/modal.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
## Prerequisites
66

7-
- DING binary `>= v0.8.0` — see [install](../install.md)
7+
- DING binary `>= v0.10.0` — see [install](../install.md)
88
- Modal CLI (`pip install modal`) authenticated via `modal token new`
99
- A Modal account (free tier with $30/mo credit covers this recipe end-to-end)
1010
- A notifier endpoint (Slack webhook URL is the canonical example)
@@ -67,7 +67,7 @@ rules:
6767
- name: training_failed
6868
match: { metric: run.exit }
6969
condition: value > 0
70-
message: "Modal function {{ .function_name }} (task {{ .modal_task_id }}) failed (exit {{ .exit_code }})"
70+
message: "Modal function {{ .function_name }} (task {{ .modal_task_id }}) failed (exit {{ .exit_code }} after {{ .duration_seconds }}s)"
7171
alert:
7272
- notifier: slack
7373
```
@@ -91,7 +91,7 @@ A Slack message during training when `val_loss` exceeds threshold:
9191
…and on function exit:
9292

9393
> 🔔 `training_failed`
94-
> Modal function trainer (task ta-abc123def) failed (exit 1)
94+
> Modal function trainer (task ta-abc123def) failed (exit 1 after 287s)
9595
9696
The `modal_task_id` matches the task ID visible in the Modal dashboard, so the Slack alert is one click away from the function's logs and metrics.
9797

@@ -105,7 +105,7 @@ DING does **not** auto-detect Modal — Modal's runtime owns the container entry
105105
| `MODAL_FUNCTION_NAME` | The function's Python name |
106106
| `MODAL_APP_NAME` | The Modal `App` name (for multi-function apps) |
107107

108-
Emit any subset as flat top-level JSON keys (DING's ingester at `internal/ingester/json.go` extracts top-level strings as labels and numbers as floats; nested objects are skipped). Use them in `match.labels` or `message` template variables. See [Configuration](../configuration.md) for the full reference.
108+
Emit any subset as flat top-level JSON keys DING extracts top-level strings as labels and numbers as floats; nested objects are skipped. Use them in `match.labels` or `message` template variables. See [Configuration](../configuration.md) for the full notifier reference.
109109

110110
## Verification
111111

docs/recipes/ray.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
## Prerequisites
66

7-
- DING binary `>= v0.7.1` — see [install](../install.md)
7+
- DING binary `>= v0.10.0` — see [install](../install.md)
88
- `ray >= 2.0` (`pip install "ray[default]"`; add `train`/`tune` extras as needed for your workload)
99
- A running Ray cluster: local single-node (`ray start --head`) for dev; KubeRay/Anyscale/EKS for production
1010
- A notifier endpoint (Slack webhook URL is the canonical example)
@@ -39,7 +39,7 @@ rules:
3939
- name: training_failed
4040
match: { metric: run.exit }
4141
condition: value > 0
42-
message: "Ray job {{ .run_id }} failed (exit {{ .exit_code }})"
42+
message: "Ray job {{ .run_id }} failed (exit {{ .exit_code }} after {{ .duration_seconds }}s)"
4343
alert:
4444
- notifier: slack
4545
```
@@ -112,7 +112,7 @@ A Slack message during training when `val_loss` exceeds threshold:
112112
…and on training-process exit:
113113

114114
> 🔔 `training_failed`
115-
> Ray job raysubmit_abcdef1234567890 failed (exit 1)
115+
> Ray job raysubmit_abcdef1234567890 failed (exit 1 after 1843s)
116116

117117
All Path A alerts are auto-tagged with `run_id` + `runner=ray`. The `run_id` matches the UUID printed by `ray job list`.
118118

@@ -125,7 +125,7 @@ All Path A alerts are auto-tagged with `run_id` + `runner=ray`. The `run_id` mat
125125
| `run_id` | `RAY_JOB_ID` | Ray job UUID matching `ray job list` output |
126126
| `runner` | `"ray"` (set by runctx) | |
127127

128-
Use these in `match.labels` or `message` template variables. See [Configuration](../configuration.md) for the full reference.
128+
Use these in `match.labels` or `message` template variables. See [Configuration](../configuration.md) for the full notifier reference.
129129

130130
## Verification
131131

@@ -146,7 +146,7 @@ ray job list
146146
ray stop
147147
```
148148

149-
If the alert doesn't fire, check the Ray driver logs (`ray job logs <id>`) for `ding` output. Common issues: `SLACK_WEBHOOK_URL` not forwarded via `--runtime-env-json`, or `drain_timeout` shorter than the notifier retry window — see [Configuration](../configuration.md).
149+
If the alert doesn't fire, check the Ray driver logs (`ray job logs <id>`) for `ding` output. Common issues: `SLACK_WEBHOOK_URL` not forwarded via `--runtime-env-json`, or `drain_timeout` shorter than the notifier retry window — see [Configuration → drain_timeout](../configuration.md#drain_timeout-and-retry-behaviour-in-ding-run).
150150

151151
## Tradeoffs / known limitations
152152

0 commit comments

Comments
 (0)