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 SiteThe 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 TargetThe target the phase runs for.
build_type: Option<&'a str>The build type, which picks the target’s build_types override.
run_id: StringThe run id, --run-id.
log_stamp: StringTimestamp directory name under filesystems.log_root.
Implementations§
Source§impl<'a> Scope<'a>
impl<'a> Scope<'a>
Sourcepub fn build_name(&self) -> &str
pub fn build_name(&self) -> &str
The build type, default without one: the {build} of job names.
Sourcepub fn log_dir(&self) -> String
pub fn log_dir(&self) -> String
<log_root>/<log stamp>/<target>, where this run writes its logs.
Sourcepub fn software_root(&self) -> String
pub fn software_root(&self) -> String
The target’s software_root, else software under
Scope::install_prefix.
Sourcepub fn modules_root(&self) -> String
pub fn modules_root(&self) -> String
The target’s modules_root, else modules under
Scope::install_prefix.
Sourcepub fn ledger_config(&self) -> Option<String>
pub fn ledger_config(&self) -> Option<String>
eb-staged-rebuild --ledger-config of the target.
Sourcepub fn install_prefix(&self) -> String
pub fn install_prefix(&self) -> String
The target’s site_prefix, else filesystems.install_root.
Sourcepub fn build_path(&self) -> String
pub fn build_path(&self) -> String
EASYBUILD_BUILDPATH of the target.
Sourcepub fn source_paths(&self) -> Vec<String>
pub fn source_paths(&self) -> Vec<String>
EASYBUILD_SOURCEPATH entries of the target.
Sourcepub fn state_root(&self) -> Option<String>
pub fn state_root(&self) -> Option<String>
eb-staged-rebuild --state-root of the target; None leaves the
tool’s default.
Sourcepub fn eessi_install_note(&self) -> Option<String>
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.
Sourcepub fn max_parallel(&self) -> Option<u32>
pub fn max_parallel(&self) -> Option<u32>
The build type’s max_parallel, else the target’s.
Sourcepub fn job_name(&self, phase: &str) -> String
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.
Sourcepub fn launch(&self, role: Role, phase: &str) -> Result<Vec<String>, Fail>
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.
Sourcepub fn launch_with(
&self,
role: Role,
phase: &str,
args: Option<&str>,
) -> Result<Vec<String>, Fail>
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.
Sourcepub fn launch_routed(
&self,
role: Role,
phase: &str,
args: Option<&str>,
route_phase: Option<&str>,
) -> Result<Vec<String>, Fail>
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.
Sourcepub fn route_env(
&self,
phase: &str,
digest: Option<&str>,
) -> BTreeMap<String, String>
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.
Sourcepub fn route_dirs(&self, phase: &str) -> Vec<String>
pub fn route_dirs(&self, phase: &str) -> Vec<String>
Directories a routed command expects to exist.
Sourcepub fn hardware_env(&self, role: Role) -> BTreeMap<String, String>
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.
Sourcepub fn fetch_env(&self) -> BTreeMap<String, String>
pub fn fetch_env(&self) -> BTreeMap<String, String>
The target’s fetch profile as JSON, for source prefetch commands.
Sourcepub fn line_env(&self, easyconfig: &str) -> BTreeMap<String, String>
pub fn line_env(&self, easyconfig: &str) -> BTreeMap<String, String>
Environment added for one build list line.
Sourcepub fn module_wrap(&self) -> Vec<String>
pub fn module_wrap(&self) -> Vec<String>
Wrapper that loads modules before the wrapped command runs.