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,
pub github: Github,
}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.
github: GithubWhat runnerd may ask of GitHub on the owner’s behalf.
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 unreviewed() -> &'static str
pub fn unreviewed() -> &'static str
Why a save from a diff is refused when the text changed after the diff was shown: the save would write lines nobody reviewed.
Sourcepub fn parse_error(text: &str) -> Option<ParseError>
pub fn parse_error(text: &str) -> Option<ParseError>
Where text stops parsing as a config: the line, counted from 1, and the parser’s words without its own
excerpt of the text, for an editor that marks the line. None when it parses, and for an error the parser
places nowhere.
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 runner_ceiling(&self) -> Option<u64>
pub fn runner_ceiling(&self) -> Option<u64>
The most memory one runner of any profile may have under [host] memory_ceiling: the ceiling less the
mirror while it is enabled, as no host of that size starts more beside it. None without a ceiling. The
config check refuses a profile above it, and auto sizing raises none past it (ADR 0086).
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 pricing(&self) -> Pricing
pub fn pricing(&self) -> Pricing
The GitHub-hosted runner each profile’s jobs are priced at (ADR 0072).
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.