pub struct Config {
pub host: Host,
pub caches: Caches,
pub profiles: BTreeMap<String, Profile>,
pub repositories: Vec<Repository>,
pub history: History,
pub records: Records,
pub sizing: Sizing,
pub web: Web,
pub notify: Notify,
}Expand description
A parsed runnerd.toml. validate checks it against the host’s budget.
Fields§
§host: HostThe host’s budget and isolation.
caches: CachesThe caches runners share.
profiles: BTreeMap<String, Profile>Runner profiles by name.
repositories: Vec<Repository>The repositories to serve, one pool per entry: a repository named by several entries is served by each of their profiles, a job by the one whose labels match it (ADR 0058).
history: HistoryWhat is kept of past jobs.
records: RecordsHow much the records of failed jobs may keep.
sizing: SizingHow sizing advice reads the job history.
web: WebWho may use the dashboard through another address.
notify: NotifyWhere the daemon sends notifications; none by default.
Implementations§
Source§impl Config
impl Config
Sourcepub fn budget_blocks(
&self,
admission: AdmissionPolicy,
) -> Option<Vec<BudgetBlock>>
pub fn budget_blocks( &self, admission: AdmissionPolicy, ) -> Option<Vec<BudgetBlock>>
What admission holds to MemoryMax, a block per profile: under caps, every slot of each profile at its
cap; under measured, one runner of the largest profile. The mirror with either. None when the caps
overflow, as Config::memory_caps refuses them.
Sourcepub fn check_against(&self, memory_max: Option<ByteSize>) -> ConfigCheck
pub fn check_against(&self, memory_max: Option<ByteSize>) -> ConfigCheck
Validates the parsed config against memory_max, the slice’s MemoryMax: what Config::check answers once
the text parses and the slice is read, and what doctor checks the config the daemon runs with by.
Source§impl Config
impl Config
Sourcepub fn check(
text: &str,
memory_max: impl FnOnce(&str) -> Result<Option<ByteSize>>,
) -> (Option<Config>, ConfigCheck)
pub fn check( text: &str, memory_max: impl FnOnce(&str) -> Result<Option<ByteSize>>, ) -> (Option<Config>, ConfigCheck)
Parses text and validates it against the MemoryMax that memory_max reads for the slice it names:
what runnerd check-config prints and POST /v1/config/check answers. Returns the config if it is valid.
Sourcepub fn mirror_memory(&self) -> u64
pub fn mirror_memory(&self) -> u64
The mirror’s memory cap, 0 when it is disabled.
Sourcepub fn memory_caps(&self) -> Result<ByteSize, ConfigError>
pub fn memory_caps(&self) -> Result<ByteSize, ConfigError>
The memory every runner and the mirror may use at once.
Sourcepub fn memory_needed(&self) -> Result<ByteSize, ConfigError>
pub fn memory_needed(&self) -> Result<ByteSize, ConfigError>
The memory [host] admission must fit in MemoryMax: every cap at once under caps; under measured, the
largest single runner with the mirror, since slots there only bounds how many run at once.
Sourcepub fn pool(&self, repository: &str, labels: &[String]) -> Option<&Repository>
pub fn pool(&self, repository: &str, labels: &[String]) -> Option<&Repository>
The pool of repository whose labels match a job asking for labels: every label it asks for is one of
the pool’s. None when no pool of it does.
Sourcepub fn pool_in(&self, repository: &str, profile: &str) -> Option<&Repository>
pub fn pool_in(&self, repository: &str, profile: &str) -> Option<&Repository>
The pool of repository in profile, whose runners start in that profile’s slots.
Sourcepub fn repository_names(&self) -> Vec<String>
pub fn repository_names(&self) -> Vec<String>
The repositories served, each once, in the order the config first names them.