Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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:

OrderLayerWhereTypical use
1Built-in defaultsdorisValues for a laptop
2System/etc/doris/settings.*Site policy: licence pool sizes, tool installs, limits
3User$XDG_CONFIG_HOME/doris/settings.*, else ~/.config/doris/Personal preferences: how long to keep things, limits
4Checkout.doris/settings.* in the repo root, untrackedOne checkout’s tweaks
5Command line--settings FILE, then -j N, then each --set KEY=VALUEThis command only. CI passes its settings as a file
  • A settings file can be HJSON, TOML or JSON: settings.hjson, settings.toml or settings.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": 2 are the same key. No key takes a list: plugins.path takes 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 --set it came from. A pool’s name is the exception: pools.NAME is 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 --set is relative to the current directory.
  • Every command reads them, doris check and doris clean included, and --settings and --set are accepted by every command. The checkout’s layer is read when doris is started inside a repo, which doris gc and doris settings need 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

KeyValueDefaultMeaning
jobs.maxA countThe CPU threadsThe most steps running at once, over every job. -j N sets it
pools.NAMEA count, a size such as 32G for memory and disk, or unlimitedThe machine’s threads and memory, the free disk space. A licence pool: the CPU threads, at most 16The size of a resource pool
resources.enforceoff, systemd or cgroupoffWhether what a step holds from the pools is enforced, or only reserved
resources.cgroupA cgroup v2 directoryThe cgroup doris was started inWhere resources.enforce = cgroup makes a cgroup per step
resources.pintrue or falsefalsePin each step to as many CPUs as it holds threads
resources.measureauto, systemd, cgroup or offautoHow each step is measured in a cgroup of its own when nothing is enforced
resources.min_samplesA count5The records of a step doris resources needs before it suggests a value
resources.min_changeA percentage such as 20%20%How much a value must change by for doris resources to suggest it, unless it was too low
measurements.dirA directory, or off~/.cache/doris/measurementsThe measurement store, which each run adds what its steps used to. off keeps nothing
measurements.max_ageA duration such as 90d, or never365 daysdoris gc removes the measurements of runs older than this
dirs.keep_failedtrue or falsetrueKeep the whole working directory of a step that failed. With false it is cleaned like that of a step that passed
dirs.work_max_ageA duration such as 7d, or never14 daysAt the start of a run, working directories that were kept whole longer ago than this are removed
tools.NAME.pathA directoryNot set: tools are found on PATHWhere the tool NAME is, for its own commands only (see Tools not on PATH). NAME is a tool config can bind
plugins.pathDirectories, separated by :None: only the plugins built into dorisWhere 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 cacheSee thereWhat 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.max and pools.NAME can be limited. Any other key under limits is an error.
  • Only the system and user files can set limits. A limits table in the checkout’s file or a --settings FILE is 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.