Struct Planner

Source
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: String

The 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>

Source

pub fn new(scope: Scope<'a>, list_path: String) -> Self

A planner without run-time values, which plans placeholders for them.

Source

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.

Source

pub fn selected_list_path(&self) -> Option<PathBuf>

Where the selected build list lives, when the target has a selector.

Source

pub fn shard_dir(&self) -> String

<shard_dir>/<run-id>, where stack shard writes its plan; filesystems.shard_dir defaults to <scratch>/shards.

Source

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.

Source

pub fn shard_cmd(&self) -> Result<Cmd, Fail>

The stack shard command of the shard phase, for a site with [shards] active.

Source

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.

Source

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.

Source

pub fn staged_enabled(&self) -> bool

Whether the target routes rebuilds through staged rebuild.

Source

pub fn installed(&self, line: &ListLine) -> bool

Whether the line’s module file exists under the target’s modules root.

Source

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.

Source

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>.

Source

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.

Source

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.

Source

pub fn log_stdout(&self, stem: &str) -> String

<log_dir>/<stem>.stdout.log, the output of the line’s build.

Source

pub fn tmp_logdir(&self, stem: &str) -> String

<log_dir>/easybuild-logs/<stem>, the line’s --tmp-logdir with logs.keep_failed.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn cache_cmd(&self) -> Result<Option<Cmd>, Fail>

The cache command of the target’s [[caches.targets]] entry; None without an active [caches], its command or such an entry.

Trait Implementations§

Source§

impl<'a> Clone for Planner<'a>

Source§

fn clone(&self) -> Planner<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for Planner<'a>

§

impl<'a> RefUnwindSafe for Planner<'a>

§

impl<'a> Send for Planner<'a>

§

impl<'a> Sync for Planner<'a>

§

impl<'a> Unpin for Planner<'a>

§

impl<'a> UnwindSafe for Planner<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.