Struct Scope

Source
pub struct Scope<'a> {
    pub site: &'a Site,
    pub site_file: Option<String>,
    pub target: &'a Target,
    pub build_type: Option<&'a str>,
    pub run_id: String,
    pub log_stamp: String,
}
Expand description

Everything a phase needs to know about where it runs.

Fields§

§site: &'a Site

The site file.

§site_file: Option<String>

The path of the site file, absolute, exported as EB_PIPELINE_SITE so that a command can run eb-pipeline on the same file.

§target: &'a Target

The target the phase runs for.

§build_type: Option<&'a str>

The build type, which picks the target’s build_types override.

§run_id: String

The run id, --run-id.

§log_stamp: String

Timestamp directory name under filesystems.log_root.

Implementations§

Source§

impl<'a> Scope<'a>

Source

pub fn build_name(&self) -> &str

The build type, default without one: the {build} of job names.

Source

pub fn log_dir(&self) -> String

<log_root>/<log stamp>/<target>, where this run writes its logs.

Source

pub fn software_root(&self) -> String

The target’s software_root, else software under Scope::install_prefix.

Source

pub fn modules_root(&self) -> String

The target’s modules_root, else modules under Scope::install_prefix.

Source

pub fn ledger_config(&self) -> Option<String>

eb-staged-rebuild --ledger-config of the target.

Source

pub fn install_prefix(&self) -> String

The target’s site_prefix, else filesystems.install_root.

Source

pub fn build_path(&self) -> String

EASYBUILD_BUILDPATH of the target.

Source

pub fn source_paths(&self) -> Vec<String>

EASYBUILD_SOURCEPATH entries of the target.

Source

pub fn state_root(&self) -> Option<String>

eb-staged-rebuild --state-root of the target; None leaves the tool’s default.

Source

pub fn eessi_install_note(&self) -> Option<String>

Install path EESSI-extend sets for a site install when it loads, over the exported EASYBUILD_INSTALLPATH. EasyBuild prefers the split install variables to it, so split mode gets no note.

Source

pub fn optarch(&self) -> Option<String>

The build type’s eb_optarch, else the target’s.

Source

pub fn max_parallel(&self) -> Option<u32>

The build type’s max_parallel, else the target’s.

Source

pub fn job_name(&self, phase: &str) -> String

The job name of phase: scheduler.job_name_template with {project}, {build}, {phase} and {target} filled in.

Source

pub fn launch(&self, role: Role, phase: &str) -> Result<Vec<String>, Fail>

Launch prefix of a phase: route wrapper (CPU role), launch command, common arguments, job name, role arguments.

Source

pub fn launch_with( &self, role: Role, phase: &str, args: Option<&str>, ) -> Result<Vec<String>, Fail>

Like launch, with the role arguments replaced by args.

Source

pub fn launch_routed( &self, role: Role, phase: &str, args: Option<&str>, route_phase: Option<&str>, ) -> Result<Vec<String>, Fail>

Like launch_with; route_phase names the phase to look up in the route’s phases list, or None for a command that is not routed.

Source

pub fn route_env( &self, phase: &str, digest: Option<&str>, ) -> BTreeMap<String, String>

Environment of a routed command. digest is the run-time value of the receipt digest variable; None plans the ${NAME} placeholder.

Source

pub fn route_dirs(&self, phase: &str) -> Vec<String>

Directories a routed command expects to exist.

Source

pub fn hardware_env(&self, role: Role) -> BTreeMap<String, String>

Hardware class variables of a command, exported only when the target defines a CPU class.

Source

pub fn fetch_env(&self) -> BTreeMap<String, String>

The target’s fetch profile as JSON, for source prefetch commands.

Source

pub fn env(&self) -> BTreeMap<String, String>

Environment exported to every phase.

Source

pub fn line_env(&self, easyconfig: &str) -> BTreeMap<String, String>

Environment added for one build list line.

Source

pub fn module_wrap(&self) -> Vec<String>

Wrapper that loads modules before the wrapped command runs.

Trait Implementations§

Source§

impl<'a> Clone for Scope<'a>

Source§

fn clone(&self) -> Scope<'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 Scope<'a>

§

impl<'a> RefUnwindSafe for Scope<'a>

§

impl<'a> Send for Scope<'a>

§

impl<'a> Sync for Scope<'a>

§

impl<'a> Unpin for Scope<'a>

§

impl<'a> UnwindSafe for Scope<'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.