Settings
Settings say how and where a run happens on this machine: how many steps run at once, how large the resource pools are, where a tool is installed, what is kept. They never change what a job makes, so no setting is part of a cache key, and changing one invalidates nothing.
Project config is different. It says what can run, is committed to the repo, and is the same for everyone (see Configuration). Settings vary by site and user.
Layers
Settings are read in layers. Each later layer overrides the earlier ones, key by key:
| Order | Layer | Where | Typical use |
|---|---|---|---|
| 1 | Built-in defaults | doris | Values for a laptop |
| 2 | System | /etc/doris/settings.* | Site policy: licence pool sizes, tool installs, limits |
| 3 | User | $XDG_CONFIG_HOME/doris/settings.*, else ~/.config/doris/ | Personal preferences: how long to keep things, limits |
| 4 | Checkout | .doris/settings.* in the repo root, untracked | One checkout’s tweaks |
| 5 | Command line | --settings FILE, then -j N, then each --set KEY=VALUE | This command only. CI passes its settings as a file |
- A settings file can be HJSON, TOML or JSON:
settings.hjson,settings.tomlorsettings.json. Two at the same layer is an error, rather than one silently winning. - A file is a table of keys, nested or not:
pools: { xcelium: 2 }and"pools.xcelium": 2are the same key. No key takes a list:plugins.pathtakes its directories as one value, separated by:. - Every key is checked. An unknown key, or a value of the wrong kind, is an error naming the file or
--setit came from. A pool’s name is the exception:pools.NAMEis not checked against the pools there are, so a misspelt pool is set and never used. - A relative path in a file is relative to the file’s directory. One given with
--setis relative to the current directory. - Every command reads them,
doris checkanddoris cleanincluded, and--settingsand--setare accepted by every command. The checkout’s layer is read when doris is started inside a repo, whichdoris gcanddoris settingsneed not be.
# ~/.config/doris/settings.toml
[pools]
memory = "48G"
[dirs]
work_max_age = "7d"
[tools.xcelium]
path = "/tools/cadence/XCELIUM2409/bin"
[plugins]
path = "/tools/doris/plugins"
doris run testrig --settings ci-settings.hjson --set pools.xcelium=2
Keys
| Key | Value | Default | Meaning |
|---|---|---|---|
jobs.max | A count | The CPU threads | The most steps running at once, over every job. -j N sets it |
pools.NAME | A count, a size such as 32G for memory and disk, or unlimited | The machine’s threads and memory, the free disk space. A licence pool: the CPU threads, at most 16 | The size of a resource pool |
resources.enforce | off, systemd or cgroup | off | Whether what a step holds from the pools is enforced, or only reserved |
resources.cgroup | A cgroup v2 directory | The cgroup doris was started in | Where resources.enforce = cgroup makes a cgroup per step |
resources.pin | true or false | false | Pin each step to as many CPUs as it holds threads |
resources.measure | auto, systemd, cgroup or off | auto | How each step is measured in a cgroup of its own when nothing is enforced |
resources.min_samples | A count | 5 | The records of a step doris resources needs before it suggests a value |
resources.min_change | A percentage such as 20% | 20% | How much a value must change by for doris resources to suggest it, unless it was too low |
measurements.dir | A directory, or off | ~/.cache/doris/measurements | The measurement store, which each run adds what its steps used to. off keeps nothing |
measurements.max_age | A duration such as 90d, or never | 365 days | doris gc removes the measurements of runs older than this |
dirs.keep_failed | true or false | true | Keep the whole working directory of a step that failed. With false it is cleaned like that of a step that passed |
dirs.work_max_age | A duration such as 7d, or never | 14 days | At the start of a run, working directories that were kept whole longer ago than this are removed |
tools.NAME.path | A directory | Not set: tools are found on PATH | Where the tool NAME is, for its own commands only (see Tools not on PATH). NAME is a tool config can bind |
plugins.path | Directories, separated by : | None: only the plugins built into doris | Where more tool plugins are: each .wasm file in them is loaded, after the built-in ones. One for a tool doris has replaces doris’s. A later layer’s list replaces an earlier one’s |
gc.* | See Cleaning the cache | See there | What a collection keeps, and whether a run collects |
Limits
Some settings are policy, not defaults. The system file and the user’s file can put a key under limits, and no later layer can raise it above that:
// /etc/doris/settings.hjson
{
pools: { xcelium: 4 }
limits: {
jobs: { max: 16 }
pools: { xcelium: 4 }
}
}
A user can still ask for fewer. One who asks for more, such as -j 32 here, runs with the limit and a warning naming the file that set it. A key no layer sets is held to the limit too, quietly: on a 64-thread machine jobs.max is 16.
- Only
jobs.maxandpools.NAMEcan be limited. Any other key underlimitsis an error. - Only the system and user files can set
limits. Alimitstable in the checkout’s file or a--settings FILEis an error. - Where both files limit a key, the lower limit holds. A user can tighten a site’s limit, for example to keep a shared machine’s licences for others, but not raise it.
- A limit can’t be
unlimited.
Seeing what applies
doris settings lists every setting, its value, and the file or flag it came from:
KEY VALUE FROM
dirs.keep_failed true default
dirs.work_max_age 7d /home/me/.config/doris/settings.toml
gc.auto off default
jobs.max 16 /etc/doris/settings.hjson (limit)
measurements.dir ~/.cache/doris/measurements default
measurements.max_age 365d default
pools.memory 30.9G machine
pools.xcelium 2 --set
resources.cgroup doris's own default
resources.enforce off default
resources.measure auto default
resources.min_change 20% default
resources.min_samples 5 default
resources.pin false default
tools.xcelium.path /tools/cadence/... /home/me/.config/doris/settings.toml
A pool no layer sizes is listed with the machine’s size, and disk as the space free in the scratch directory. doris settings takes --settings and --set like any command, so it shows what a command with them would use.