Commit 967c6cd
committed
feat(cli): add cleanup subcommand to remove run leftovers from the namespace
llmdbenchmark run tears down the harness launcher pod when a run
finishes, but leaves the data-access pod, the harness service, the
benchmark ConfigMaps and the workload PVC behind. The PVC keeps billing
against its storage backend, a stale claim wedges retries after a
wrong-StorageClass failure, and the only way out was a hand-written
kubectl delete naming CLI-internal resource names.
Add 'llmdbenchmark --spec <specification> cleanup [--keep-pvc]':
- takes --spec like every other subcommand and renders the scenario, so
resource names come from the plan config rather than from constants:
harness.podLabel, harness.name (the '*-profiles' ConfigMap),
labels.app (the harness service) and storage.workloadPvc.name
- resolution follows the precedence the run steps use (executor/step.py):
CLI flag > scenario > default
- cleans both namespaces: launcher pods and their ConfigMaps render into
'harness.namespace | default(namespace.name)' while the PVC, service
and data-access pod render into 'namespace.name', so a single
namespace cannot reach everything
- also deletes the resources with no scenario key of their own (the
data-access pod label and the llm-d-benchmark-* / harness-scripts
ConfigMaps), which stay matched by name
- pods are deleted before the PVC so the pvc-protection finalizer can
clear
- idempotent: missing resources are skipped and a namespace with no
benchmark resources exits 0
- --keep-pvc preserves the workload PVC so workload data survives
between runs; --namespace and --pvc-name override the scenario
Fixes: #1789
Signed-off-by: Himanshu Prajapati <himanshuprajapati15072003@gmail.com>1 parent e525662 commit 967c6cd
6 files changed
Lines changed: 737 additions & 2 deletions
File tree
- docs
- llmdbenchmark
- interface
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
648 | 648 | | |
649 | 649 | | |
650 | 650 | | |
| 651 | + | |
651 | 652 | | |
652 | 653 | | |
653 | 654 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
93 | 94 | | |
94 | 95 | | |
95 | 96 | | |
| 97 | + | |
96 | 98 | | |
97 | 99 | | |
98 | 100 | | |
| |||
164 | 166 | | |
165 | 167 | | |
166 | 168 | | |
167 | | - | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
168 | 173 | | |
169 | 174 | | |
170 | 175 | | |
| |||
178 | 183 | | |
179 | 184 | | |
180 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
181 | 189 | | |
182 | 190 | | |
183 | 191 | | |
| |||
2039 | 2047 | | |
2040 | 2048 | | |
2041 | 2049 | | |
| 2050 | + | |
2042 | 2051 | | |
2043 | 2052 | | |
2044 | 2053 | | |
| |||
2067 | 2076 | | |
2068 | 2077 | | |
2069 | 2078 | | |
2070 | | - | |
| 2079 | + | |
2071 | 2080 | | |
2072 | 2081 | | |
2073 | 2082 | | |
| |||
0 commit comments