Skip to content

Commit 45d93fc

Browse files
authored
Configuration update (#140)
* (fix): tmpfiles was wrong recommendation. recommending systemd service now for RAPL power limits * Updated machine baseline checks to include checks and template script
1 parent 97d3674 commit 45d93fc

2 files changed

Lines changed: 107 additions & 28 deletions

File tree

content/en/docs/cluster/machine-baseline-checks.md

Lines changed: 106 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,18 @@ weight: 1005
66
toc: false
77
---
88

9-
GMT can verify a set of hardware and OS properties before every measurement run. All checks are configured under the `machine:` key in `config.yml`.
9+
GMT can verify a set of hardware and OS properties before every measurement run. Most checks are configured under the `machine:` key in `config.yml`; a few (systemd timers, cron files, kernel watchdogs) need no configuration at all and always run on Linux — see [Unconditional Checks](#unconditional-checks) below.
1010

11-
Every check is **opt-in**: omitting a key (or setting it to `null` / `False`) silently skips that check. A failed check emits a `WARN` and, depending on `system_check_threshold`, may abort the run.
11+
Every config-driven check is **opt-in**: omitting a key (leaving it unset / `null`) always skips that check, and is now reported as `INFO` (not `OK`), so a `system_check` run makes it obvious which checks are not yet configured on a given machine.
12+
13+
For most keys, explicitly setting `false` also just skips the check, same as leaving it unset. There are two kinds of exceptions:
14+
15+
- `cpu_smt` and `cpu_turbo_boost` are plain booleans by nature: `false` asserts the feature is **off**, `true` asserts it is **on**, and only leaving the key unset (`null`) skips the check.
16+
- `cpu_governor`, `cpu_scaling_driver`, and `docker_registry_url` take a string when you want to match a specific value, but `false` has a special meaning for them — it asserts that the feature must be **absent** altogether (e.g. "no scaling governor is active on any core") rather than skipping the check.
17+
18+
A failed check emits a `WARN` and, depending on `system_check_threshold`, may abort the run.
19+
20+
If you don't yet know the right value for a given key, each section below shows the exact command to read it off the current machine. There is no single script that detects and writes out all of these `machine:` values at once — they describe the fixed identity/capacity of a specific machine (its RAM size, its RAPL wattage caps, its expected CPU governor, etc.) and are meant to be set once, deliberately, per machine. The one place a script *does* auto-prepare values for you is the [Unconditional Checks](#unconditional-checks) below, via the [NOP Linux script →]({{< relref "nop-linux" >}}).
1221

1322
## Temperature
1423

@@ -59,18 +68,21 @@ To read the current limits on your machine:
5968
cat /sys/devices/virtual/powercap/intel-rapl/intel-rapl:*/constraint_0_power_limit_uw
6069
```
6170

62-
Also see [NOP Linux →]({{< relref "nop-linux" >}}) for how to make these limits persistent across reboots.
71+
Also see [Power Saving →]({{< relref "power-saving#power-capping-machines" >}}) for how to make these limits persistent across reboots via a systemd service.
6372

6473
## Docker Registry Mirror
6574

66-
Confirms that the Docker daemon is configured to use a specific registry mirror (e.g. a local cache).
75+
Confirms that the Docker daemon's registry mirror configuration matches what you expect.
6776

6877
```yaml
6978
machine:
7079
docker_registry_url: "https://registry.example.com"
7180
```
7281

7382
The check runs `docker info` and looks for the URL in the `Registry Mirrors` section.
83+
84+
Set `docker_registry_url: false` to instead assert that **no** registry mirror is configured at all — the check then fails if a `Registry Mirrors:` section is present in `docker info` output.
85+
7486
Also see [Container Registry →]({{< relref "container-registry" >}}).
7587

7688
## CPU Core Count
@@ -140,7 +152,7 @@ echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governo
140152
sudo cpupower frequency-set -g performance
141153
```
142154

143-
Also see [NOP Linux →]({{< relref "nop-linux" >}}).
155+
Set `cpu_governor: false` to instead assert that **no** core exposes a `scaling_governor` file at all (i.e. cpufreq is not active/available on this machine).
144156

145157
## CPU Frequency
146158

@@ -160,7 +172,9 @@ machine:
160172
cpu_scaling_driver: "intel_pstate" # or "acpi-cpufreq", "cppc_cpufreq", etc.
161173
```
162174

163-
A different driver can apply different power and frequency policies even when the governor setting appears identical.
175+
Reads `/sys/devices/system/cpu/cpu*/cpufreq/scaling_driver`. A different driver can apply different power and frequency policies even when the governor setting appears identical.
176+
177+
Set `cpu_scaling_driver: false` to instead assert that **no** core exposes a `scaling_driver` file at all.
164178

165179
## SMT / Hyper-Threading
166180

@@ -193,36 +207,101 @@ To disable Turbo Boost (Intel):
193207
echo 1 | sudo tee /sys/devices/system/cpu/intel_pstate/no_turbo
194208
```
195209

196-
## System-wide Systemd Timers
210+
## Unconditional Checks
211+
212+
The following three checks need **no** `config.yml` entry at all — they always run on Linux (they are skipped, returning `None`/`OK`, on macOS and Windows) and simply verify that nothing on the machine can silently interrupt or bias a measurement.
197213

198-
This check runs as root and warns when any active system-wide `systemd` timer is detected. Timers can wake the system and create measurement noise.
214+
The [NOP Linux script →]({{< relref "nop-linux" >}}) auto-prepares a machine so that all three of these pass: it disables/masks system and user `systemd` timers, deletes all cron files, and zeroes out the kernel watchdog sysctls, in addition to disabling NTP and removing swap-adjacent packages. Run it once on a fresh cluster machine instead of doing the steps below by hand.
199215

200-
This check is not configured via `config.yml` — it always runs on Linux. To inspect active timers:
216+
### System-wide Systemd Timers
217+
218+
Runs as root and warns when any active system-wide `systemd` timer is detected. Timers can wake the system and create measurement noise. To inspect active timers:
201219

202220
```sh
203221
systemctl --all list-timers
204222
```
205223

206-
Also see [NOP Linux →]({{< relref "nop-linux" >}}) for a full list of services and timers to disable on cluster machines.
224+
### Cron Files
225+
226+
Runs as root and warns when any cron file is found under `/var/spool/cron` or `/etc/cron*`. To inspect and remove them:
227+
228+
```sh
229+
ls -la /etc/cron* /var/spool/cron* 2>/dev/null
230+
sudo rm -fR /etc/cron* /var/spool/cron*
231+
```
232+
233+
### Kernel Watchdog
234+
235+
Warns when the kernel's hard/soft lockup watchdog is active (any of `kernel.watchdog`, `kernel.nmi_watchdog`, or `kernel.soft_watchdog` reads non-zero). These watchdogs periodically fire NMIs/interrupts to detect a hung kernel, which can add noise to measurements.
236+
237+
To check the current values:
238+
239+
```sh
240+
sysctl kernel.watchdog kernel.nmi_watchdog kernel.soft_watchdog
241+
```
242+
243+
To disable them immediately (until the next reboot):
244+
245+
```sh
246+
sudo sysctl -w kernel.watchdog=0 kernel.nmi_watchdog=0 kernel.soft_watchdog=0
247+
```
248+
249+
To make this persist across reboots, drop a file in `/etc/sysctl.d/` and apply it:
250+
251+
```sh
252+
cat <<'EOF' | sudo tee /etc/sysctl.d/99-gmt-watchdog.conf
253+
kernel.watchdog = 0
254+
kernel.nmi_watchdog = 0
255+
kernel.soft_watchdog = 0
256+
EOF
257+
sudo sysctl --system
258+
```
207259

208260
---
209261

210262
## All checks at a glance
211263

212-
| Config key | Default | Severity |
213-
|---|---|---|
214-
| `base_temperature_{chip,feature,value}` | `False` (skipped) | WARN (blocks run until stable) |
215-
| `rapl_power_capping.package` | `null` (skipped) | WARN |
216-
| `rapl_power_capping.dram` | `null` (skipped) | WARN |
217-
| `rapl_power_capping.psys` | `null` (skipped) | WARN |
218-
| `docker_registry_url` | `null` (skipped) | WARN |
219-
| `cpu_cores` | `null` (skipped) | WARN |
220-
| `dram_gb` | `null` (skipped) | WARN |
221-
| `usb_devices` | absent (skipped) | WARN |
222-
| `pci_devices` | absent (skipped) | WARN |
223-
| `cpu_governor` | `null` (skipped) | WARN |
224-
| `cpu_frequency_mhz` | `null` (skipped) | WARN |
225-
| `cpu_scaling_driver` | `null` (skipped) | WARN |
226-
| `cpu_smt` | `null` (skipped) | WARN |
227-
| `cpu_turbo_boost` | `null` (skipped) | WARN |
228-
| systemd timers (root, always on) | — | WARN |
264+
Leaving a config-driven key unset (or `null`) always reports `INFO` — not `OK` — so it's visible at a glance which checks aren't configured yet. Checks marked "assert absence" in the last column treat `false` specially: instead of skipping, they require the feature to be completely absent from the machine.
265+
266+
| Config key | Unset behaviour | Severity | `false` behaviour |
267+
|---|---|---|---|
268+
| `base_temperature_{chip,feature,value}` | `INFO` (skipped) | WARN (blocks run until stable) | skipped |
269+
| `rapl_power_capping.package` | `INFO` (skipped) | WARN | skipped |
270+
| `rapl_power_capping.dram` | `INFO` (skipped) | WARN | skipped |
271+
| `rapl_power_capping.psys` | `INFO` (skipped) | WARN | skipped |
272+
| `docker_registry_url` | `INFO` (skipped) | WARN | assert absence |
273+
| `cpu_cores` | `INFO` (skipped) | WARN | skipped |
274+
| `dram_gb` | `INFO` (skipped) | WARN | skipped |
275+
| `usb_devices` | `INFO` (skipped) | WARN | skipped |
276+
| `pci_devices` | `INFO` (skipped) | WARN | skipped |
277+
| `cpu_governor` | `INFO` (skipped) | WARN | assert absence |
278+
| `cpu_frequency_mhz` | `INFO` (skipped) | WARN | skipped |
279+
| `cpu_scaling_driver` | `INFO` (skipped) | WARN | assert absence |
280+
| `cpu_smt` | `INFO` (skipped) | WARN | asserts SMT is off |
281+
| `cpu_turbo_boost` | `INFO` (skipped) | WARN | asserts boost is off |
282+
283+
| Unconditional check (no config key, always on for Linux) | Severity |
284+
|---|---|
285+
| systemd timers | WARN |
286+
| cron files | WARN |
287+
| kernel watchdog | WARN |
288+
289+
## Auto-Dump template script
290+
291+
If you want to get a quick template of the current settings you can run this `bash` script (tested only on Ubuntu):
292+
293+
```bash
294+
echo " cpu_cores: $(nproc)"
295+
echo " cpu_frequency_mhz: $(grep -m1 MHz /proc/cpuinfo | awk -F: '{printf "%.0f", $2}')"
296+
echo -e " rapl_power_capping:\n package: $(echo "scale=2; $(cat /sys/devices/virtual/powercap/intel-rapl/intel-rapl\:0/constraint_0_power_limit_uw) / 1000000" | bc)"
297+
echo " dram_gb: $(lsmem | awk '/Total online memory:/{print $NF}' | tr -d 'GiB')"
298+
echo " cpu_smt: false"
299+
echo " cpu_turbo_boost: false"
300+
echo " cpu_governor: $(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor 2>/dev/null || echo "false")"
301+
echo " cpu_scaling_driver: $(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver 2>/dev/null || echo "false")"
302+
echo " docker_registry_url: http://192.168.30.10:5000/"
303+
echo " usb_devices:"
304+
lsusb | awk '{print " - " $6}'
305+
echo " pci_devices:"
306+
lspci | awk -F': ' '{print " - \"" $2 "\""}'
307+
```

content/en/docs/measuring/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ Please see [cluster installation →]({{< relref "/docs/cluster/installation" >}
119119

120120
Also see [Resource Limits]({{< relref "/docs/measuring/resource-limits" >}}) to better understand how GMT enforces resource limits on its orchestrated containers.
121121

122-
GMT can also verify a range of optional hardware and OS properties before each measurement run — CPU governor, turbo boost, SMT state, installed RAM, connected USB/PCI devices, RAPL power limits, and more. All are opt-in via keys under `machine:` in `config.yml`.
122+
GMT can also verify a range of optional hardware and OS properties before each measurement run — CPU governor, turbo boost, SMT state, installed RAM, connected USB/PCI devices, RAPL power limits, and more. All are opt-in via keys under `machine:` in `config.yml`; a couple of checks (systemd timers, cron files, kernel watchdog) need no key at all and always run on Linux.
123123

124124
See [Machine Baseline Checks →]({{< relref "/docs/cluster/machine-baseline-checks" >}}) for the full list and configuration reference.
125125

0 commit comments

Comments
 (0)