pub struct ApptainerState { /* private fields */ }Expand description
The state of an Apptainer backend for a given top-level execution.
As Apptainer-converted images are shared throughout all task executions of a given invocation, only one of these state structures should be constructed per top-level task/workflow execution.
Implementations§
Source§impl ApptainerState
impl ApptainerState
Sourcepub fn new(config: &ApptainerConfig, run_root_dir: &Path) -> Self
pub fn new(config: &ApptainerConfig, run_root_dir: &Path) -> Self
Create a new ApptainerState.
Sourcepub async fn prepare_apptainer_command(
&self,
container: &str,
cancellation_token: CancellationToken,
spawn_request: &TaskSpawnRequest,
) -> Result<String, Error>
pub async fn prepare_apptainer_command( &self, container: &str, cancellation_token: CancellationToken, spawn_request: &TaskSpawnRequest, ) -> Result<String, Error>
Prepare for an Apptainer execution by ensuring the image cache is
populated with the necessary container, and return a Bash script
that invokes the task’s command in the container context.
§Shared filesystem assumptions
The returned script should be run in an environment that shares a
filesystem with the environment where this method is invoked, except
for node-specific mounts like /tmp and /var. This assumption
typically holds on HPC systems with shared filesystems like Lustre or
GPFS.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ApptainerState
impl RefUnwindSafe for ApptainerState
impl Send for ApptainerState
impl Sync for ApptainerState
impl Unpin for ApptainerState
impl UnwindSafe for ApptainerState
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
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more