pub struct Planner<'a> {
pub scope: Scope<'a>,
pub list_path: String,
pub job_id: Option<String>,
pub route_digest: Option<String>,
pub runtime_env: Option<BTreeMap<String, String>>,
}Expand description
Builds the commands of one target’s run of a build list.
Fields§
§scope: Scope<'a>Where the phases run.
list_path: StringThe build list, as given.
job_id: Option<String>Scheduler job id read at run time; None plans the ${NAME} placeholder.
route_digest: Option<String>Value of the route’s receipt digest variable read at run time.
runtime_env: Option<BTreeMap<String, String>>Values of the installed_modules_dirs_from_env variables read at run
time; None plans the ${NAME} placeholders and keeps every
installed-modules directory.
Implementations§
Source§impl<'a> Planner<'a>
impl<'a> Planner<'a>
Sourcepub fn new(scope: Scope<'a>, list_path: String) -> Self
pub fn new(scope: Scope<'a>, list_path: String) -> Self
A planner without run-time values, which plans placeholders for them.
Sourcepub fn select_lines(
&self,
lines: &[ListLine],
) -> (Vec<ListLine>, Vec<Deselected>)
pub fn select_lines( &self, lines: &[ListLine], ) -> (Vec<ListLine>, Vec<Deselected>)
Apply the target’s selector to the list lines, in order. Kept lines
carry the arguments strip leaves; the others are recorded. Without a
selector every line is kept as read and nothing is recorded.
Sourcepub fn selected_list_path(&self) -> Option<PathBuf>
pub fn selected_list_path(&self) -> Option<PathBuf>
Where the selected build list lives, when the target has a selector.
Sourcepub fn shard_dir(&self) -> String
pub fn shard_dir(&self) -> String
<shard_dir>/<run-id>, where stack shard writes its plan;
filesystems.shard_dir defaults to <scratch>/shards.
Sourcepub fn missing_installed_modules_dirs(&self) -> Vec<String>
pub fn missing_installed_modules_dirs(&self) -> Vec<String>
Module trees run leaves out of the shard phase because they do not
exist. A site’s tree appears with its first install, and eb-stack
refuses a directory that is missing.
Sourcepub fn shard_cmd(&self) -> Result<Cmd, Fail>
pub fn shard_cmd(&self) -> Result<Cmd, Fail>
The stack shard command of the shard phase, for a site with
[shards] active.
Sourcepub fn prefetch_cmd(
&self,
line: &ListLine,
name: &str,
unit_role: Role,
) -> Result<Cmd, Fail>
pub fn prefetch_cmd( &self, line: &ListLine, name: &str, unit_role: Role, ) -> Result<Cmd, Fail>
The eb --fetch command of line, logged as name, in a unit of
unit_role; the fetch of a CPU-role unit goes through its route.
Sourcepub fn admission_cmd(&self, unit: &str, footprint: u64) -> Result<Cmd, Fail>
pub fn admission_cmd(&self, unit: &str, footprint: u64) -> Result<Cmd, Fail>
The stack admit command of unit, with its inode footprint, for a
site with [admission] active.
Sourcepub fn staged_enabled(&self) -> bool
pub fn staged_enabled(&self) -> bool
Whether the target routes rebuilds through staged rebuild.
Sourcepub fn installed(&self, line: &ListLine) -> bool
pub fn installed(&self, line: &ListLine) -> bool
Whether the line’s module file exists under the target’s modules root.
Sourcepub fn is_staged(&self, line: &ListLine) -> bool
pub fn is_staged(&self, line: &ListLine) -> bool
Staged rebuild applies when it is enabled for the target, the line carries a whole rebuild option, and the module is already installed.
Sourcepub fn staged_run_id(&self, stem: &str) -> String
pub fn staged_run_id(&self, stem: &str) -> String
eb-staged-rebuild run id of one line. That tool refuses a run id it
has seen before, so each line gets its own: <run-id>-<stem>.
Sourcepub fn state_root_lock(&self, env_root: Option<&str>) -> PathBuf
pub fn state_root_lock(&self, env_root: Option<&str>) -> PathBuf
<state root>/.lock, the lock a staged line waits
rebuild.lock_timeout for. Without rebuild.state_root the state
root is eb-staged-rebuild’s default: env_root, the
EB_STAGED_REBUILD_STATE_ROOT it sees, else .eb-staged-rebuild next to
the software tree.
Sourcepub fn in_place_reason(&self, line: &ListLine) -> Option<String>
pub fn in_place_reason(&self, line: &ListLine) -> Option<String>
Why a rebuild line on a staged target builds with plain eb: no
module file under the modules root.
Sourcepub fn log_stdout(&self, stem: &str) -> String
pub fn log_stdout(&self, stem: &str) -> String
<log_dir>/<stem>.stdout.log, the output of the line’s build.
Sourcepub fn tmp_logdir(&self, stem: &str) -> String
pub fn tmp_logdir(&self, stem: &str) -> String
<log_dir>/easybuild-logs/<stem>, the line’s --tmp-logdir with
logs.keep_failed.
Sourcepub fn build_cmd(
&self,
role: Role,
line: &ListLine,
stem: &str,
) -> Result<Cmd, Fail>
pub fn build_cmd( &self, role: Role, line: &ListLine, stem: &str, ) -> Result<Cmd, Fail>
The command that builds line, logged as stem, with the launch
arguments of role: eb, or eb-staged-rebuild run for a staged
rebuild.
Sourcepub fn keep_failed_cmd(&self, stem: &str, status: &str) -> Result<Cmd, Fail>
pub fn keep_failed_cmd(&self, stem: &str, status: &str) -> Result<Cmd, Fail>
The eb-keep-logs failed command for the line logged as stem, which
failed with exit status.
Sourcepub fn rotate_cmd(&self, lock_timeout: bool) -> Result<Option<Cmd>, Fail>
pub fn rotate_cmd(&self, lock_timeout: bool) -> Result<Option<Cmd>, Fail>
eb-keep-logs rotate of the log root; with lock_timeout, it gives
up at once on the lock another rotate holds. run leaves the option
out for an eb-keep-logs whose --help does not list it.
Sourcepub fn rotate_lock(&self) -> Option<PathBuf>
pub fn rotate_lock(&self) -> Option<PathBuf>
<log_root>/.eb-pipeline-rotate.lock, with [logs.rotate] set. A
run holds it shared while it writes logs and rotates only when it can
take it alone. eb-keep-logs takes a lock of its own, keep_logs_lock,
which keeps two rotates apart but not a rotate and a run that is
still writing, and never takes this one: whatever takes both takes
this one first. eb-keep-logs 0.2.1 takes no lock.
Sourcepub fn keep_logs_lock(&self) -> PathBuf
pub fn keep_logs_lock(&self) -> PathBuf
<log_root>/.eb-keep-logs-rotate.lock, which eb-keep-logs rotate
holds alone for the whole rotation where it takes a lock of its own.