pub struct WorkerSection {Show 22 fields
pub id: Option<String>,
pub slots: u32,
pub queues: Vec<String>,
pub data_dir: Option<PathBuf>,
pub connection_dir: Option<PathBuf>,
pub pass_env: Vec<String>,
pub master_url: Option<String>,
pub termination_grace_period: Duration,
pub drain_terminate_period: Duration,
pub log_bind: IpAddr,
pub log_port: u16,
pub log_address: Option<String>,
pub log_retention: Duration,
pub log_max_size: Option<u64>,
pub log_mode: String,
pub memory_budget: Option<u64>,
pub memory_reserve: Option<MemoryReserve>,
pub runner_start_timeout: Duration,
pub fork_server_preload_timeout: Duration,
pub cleanup_timeout: Option<Duration>,
pub resource_cleanup_timeout: Duration,
pub fork_server_import_retry: Duration,
}Expand description
[worker].
Fields§
§id: Option<String>The worker’s ID, stable across restarts; the host name when not set.
slots: u32Task slots.
queues: Vec<String>The queues served; none serves default.
data_dir: Option<PathBuf>Where task logs, the journal (journal/<id>; keep it across restarts), the copies of
the DAG roots’ code that parse jobs and tasks import from (code/<id>, one or two per
root, read-only) and (in standalone) the SQLite database go; $XDG_DATA_HOME/schedr
(else ~/.local/share/schedr) when not set.
connection_dir: Option<PathBuf>Where commands’ connection files go while their attempts run (.pgpass, SSH keys:
secrets as files their tools read), in a folder per worker; the worker’s user’s own,
mode 0700, or the worker refuses to start. In memory when not set: under /dev/shm
where it exists, else connections/ in data_dir.
pass_env: Vec<String>Agent environment variables passed to tasks besides the allow-list.
master_url: Option<String>The master’s gRPC URL, e.g. https://schedr-master:8070 (http:// with [tls] mode = "mesh"); required by schedr worker
(schedr standalone connects to its own master).
termination_grace_period: DurationHow long running tasks get when the worker is asked to stop (SIGTERM): match the
pod’s terminationGracePeriodSeconds.
drain_terminate_period: DurationFor a task still running when a drain’s time is up: from its SIGTERM to its SIGKILL
(the drain’s own, instead of [master] cancel_grace). The running tasks get
termination_grace_period minus this and drain_report_period, whose sum must not
exceed it.
log_bind: IpAddrThe address the log endpoint listens on (all interfaces by default; schedr standalone always listens on 127.0.0.1).
log_port: u16The log endpoint’s port (0: a free one).
log_address: Option<String>The host the webserver reaches the log endpoint at, sent to the master (e.g. the pod’s DNS name through a headless Service); the host name when not set.
log_retention: DurationTask logs older than this are deleted.
log_max_size: Option<u64>Beyond this many bytes of logs the oldest are deleted; no limit when not set.
log_mode: StringThe mode of the log files the worker creates (task, attempt, parse and watcher-host
logs), in octal: owner-only "0600" by default, as the journal and connection files. A
log shipper reading them under another uid needs them opened on purpose: "0640" for
one in the worker’s group. At most "0644", and the owner always reads and writes.
memory_budget: Option<u64>Each task’s memory budget; when not set, (the pod’s limit − 10 %) ÷ slots.
memory_reserve: Option<MemoryReserve>The part of the pod’s memory limit kept out of task budgets (for schedr’s own process):
a percentage (25%) or a size (1GiB); when not set, 10 % for schedr worker and 25 %
for schedr standalone (whose process also runs the master and the API). Not used when
memory_budget is set.
runner_start_timeout: DurationHow long a started Python runner has to say hello. Raise it where the interpreter is slow to start (cold storage, a loaded machine); a runner that can’t start is noticed this much later.
fork_server_preload_timeout: DurationHow long a fork server may take to import its preloaded libraries. Raise it for large preload lists or slow storage; until it is up, tasks are spawned instead.
cleanup_timeout: Option<Duration>How long one try of a cleanup may run, for a task that doesn’t set cleanup_timeout.
The attempt holds its slot meanwhile: raise it if your cleanups wait on slow systems,
lower it to free slots sooner. When not set, 5 minutes or what a drain leaves of
termination_grace_period for a cleanup, whichever is shorter (25 s with the defaults;
B252: a longer one is lost when the pod is killed at the grace period’s end), at least
1 s.
resource_cleanup_timeout: DurationHow long one try of a resource’s cleanup may run, for one that doesn’t set timeout.
It ends a cleanup hung on a system that never answers, which can’t be cancelled with
its run and holds the run (and its max_active_runs slot) until it ends. Raise it for
teardowns that take longer (a cluster’s deletion), lower it to notice a hang sooner.
fork_server_import_retry: DurationHow long a fork server whose preloaded library fails to import is retried (with
backoff, from the first failure), for what isn’t ready when the pod starts (a
sidecar’s network, a mount); 0s: not retried. Threads after preloading and a version
mismatch are never retried (they don’t change until the image does).
Trait Implementations§
Source§impl Clone for WorkerSection
impl Clone for WorkerSection
Source§fn clone(&self) -> WorkerSection
fn clone(&self) -> WorkerSection
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WorkerSection
impl Debug for WorkerSection
Source§impl Default for WorkerSection
impl Default for WorkerSection
Source§fn default() -> Self
fn default() -> Self
The host name, 2 slots, the default queue, the default data directory, 30 s of grace
(Kubernetes’ default) of which the last 5 s stop and report what still runs (3 s to
SIGKILL, 2 s to report), the log endpoint on port 8081 of every interface, logs kept for
30 days and mode 0600, the memory budget from the pod’s limit, sampled every second, 30 s for a runner
to start, 5 minutes for a fork server to preload and for a cleanup’s try, 30 minutes for
a resource cleanup’s try, a fork server’s failing import retried for 20 minutes.
Source§impl<'de> Deserialize<'de> for WorkerSectionwhere
WorkerSection: Default,
impl<'de> Deserialize<'de> for WorkerSectionwhere
WorkerSection: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for WorkerSection
Source§impl JsonSchema for WorkerSection
impl JsonSchema for WorkerSection
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for WorkerSection
impl PartialEq for WorkerSection
Source§impl Serialize for WorkerSection
impl Serialize for WorkerSection
impl StructuralPartialEq for WorkerSection
Auto Trait Implementations§
impl Freeze for WorkerSection
impl RefUnwindSafe for WorkerSection
impl Send for WorkerSection
impl Sync for WorkerSection
impl Unpin for WorkerSection
impl UnsafeUnpin for WorkerSection
impl UnwindSafe for WorkerSection
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling [Attribute] value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi [Quirk] value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the [Condition] value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);