You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Fix flavor default application to only apply when pod doesn't specify limits
- Resolve flavor once and pass to produceSLURMScript to avoid redundant resolution
- Fix pointer to loop variable issue by creating explicit copies
- Improve GPU flavor matching to prefer exact GPU count match
- Add SLURM flag deduplication with proper priority handling
- Add FlavorConfig validation method with startup checks
- Add comprehensive unit tests for all flavor functions (43 new tests)
- Update README with detailed flavor system documentation and examples
- Remove unused variables (maxCPULimit, maxMemoryLimit)
This fixes critical bugs where flavor defaults would override pod-specified
resources, and adds proper validation and testing for the flavor system.
Signed-off-by: Diego Ciangottini <diego.ciangottini@pg.infn.it>
Copy file name to clipboardExpand all lines: README.md
+107Lines changed: 107 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -128,6 +128,111 @@ It is possible to specify Annotations when submitting Pods to the K8S cluster. A
128
128
| slurm-job.vk.io/image-root | Used to specify the root path of the Singularity Image |
129
129
| slurm-job.vk.io/flags | Used to specify SLURM flags. These flags will be added to the SLURM script in the form of #SBATCH flag1, #SBATCH flag2, etc |
130
130
| slurm-job.vk.io/mpi-flags | Used to prepend "mpiexec -np $SLURM_NTASKS \*flags\*" to the Singularity Execution |
131
+
| slurm-job.vk.io/flavor | Used to explicitly select a flavor configuration (e.g., "gpu-nvidia", "high-io") |
132
+
133
+
### :art: Flavor System
134
+
135
+
The SLURM plugin supports "flavors" - predefined configurations that provide default resource values and SLURM-specific settings. This simplifies pod definitions and ensures consistent resource allocation across jobs.
136
+
137
+
#### How Flavors Work
138
+
139
+
Flavors are resolved in the following priority order:
# Will use high-io flavor's 16 CPU and 32GB RAM defaults
217
+
```
218
+
219
+
**Example 3: Pod resources override flavor defaults**
220
+
```yaml
221
+
apiVersion: v1
222
+
kind: Pod
223
+
metadata:
224
+
name: custom-resources
225
+
annotations:
226
+
slurm-job.vk.io/flavor: "default"
227
+
spec:
228
+
containers:
229
+
- name: app
230
+
image: docker://myapp:latest
231
+
resources:
232
+
limits:
233
+
cpu: "32" # Overrides flavor's 4 CPU default
234
+
memory: "128Gi" # Overrides flavor's 16GB default
235
+
```
131
236
132
237
### :gear: Explanation of the SLURM Config file
133
238
@@ -156,6 +261,8 @@ building the docker image (`docker compose up -d --build --force-recreate` will
156
261
| VerboseLogging | Enable or disable Debug messages on logs. True or False values only |
157
262
| ErrorsOnlyLogging | Specify if you want to get errors only on logs. True or false values only |
158
263
| EnableProbes | Enable or disable health and readiness probes. True or False values only |
264
+
| Flavors | Map of flavor configurations. Each flavor can specify CPUDefault, MemoryDefault, and SlurmFlags. See Flavor System section above for details |
265
+
| DefaultFlavor | Name of the default flavor to use when no explicit flavor is specified and no auto-detection applies |
0 commit comments