pub struct EnrootServiceConfig { /* private fields */ }Implementations§
Source§impl EnrootServiceConfig
impl EnrootServiceConfig
pub fn new(image: EnrootImage) -> Self
Sourcepub fn from_local_image(path: AbsolutePath) -> Self
pub fn from_local_image(path: AbsolutePath) -> Self
Service running a local squashfs file, which must be present on the host (not managed)
Sourcepub fn from_imported_image(source: EnrootImageUri, path: AbsolutePath) -> Self
pub fn from_imported_image(source: EnrootImageUri, path: AbsolutePath) -> Self
Service running a squashfs file imported from source (enroot import) if it is missing
pub fn with_command(self, command: ContainerCommand) -> Self
pub fn with_gpus(self, gpus: GpuSelection) -> Self
Sourcepub fn with_all_gpus(self) -> Self
pub fn with_all_gpus(self) -> Self
Give all the GPUs to the container (NVIDIA_VISIBLE_DEVICES=all). Replaces the devices
added before.
Sourcepub fn with_gpu_device(self, gpu: GpuId) -> Self
pub fn with_gpu_device(self, gpu: GpuId) -> Self
Give a GPU to the container, in addition to the devices added before. Replaces
with_all_gpus().
pub fn with_mounts(self, mounts: Vec<BindMount>) -> Self
Sourcepub fn with_env(self, key: ServiceEnvVarName, value: Parameter<String>) -> Self
pub fn with_env(self, key: ServiceEnvVarName, value: Parameter<String>) -> Self
Add an environment variable (the value may be a secret reference)
pub fn with_root(self, root: bool) -> Self
pub fn with_read_write(self, read_write: bool) -> Self
pub fn with_restart_policy(self, restart_policy: UnitRestartPolicy) -> Self
Sourcepub fn with_restart_never(self) -> Self
pub fn with_restart_never(self) -> Self
Never restart the service (Restart=no)
Sourcepub fn with_restart_on_failure(self) -> Self
pub fn with_restart_on_failure(self) -> Self
Restart the service when it fails (Restart=on-failure, the default)
Sourcepub fn with_restart_always(self) -> Self
pub fn with_restart_always(self) -> Self
Always restart the service (Restart=always)
Trait Implementations§
Source§impl Clone for EnrootServiceConfig
impl Clone for EnrootServiceConfig
Source§impl Debug for EnrootServiceConfig
impl Debug for EnrootServiceConfig
Source§impl<'de> Deserialize<'de> for EnrootServiceConfig
impl<'de> Deserialize<'de> for EnrootServiceConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for EnrootServiceConfig
impl PartialEq for EnrootServiceConfig
Source§impl Serialize for EnrootServiceConfig
impl Serialize for EnrootServiceConfig
impl StructuralPartialEq for EnrootServiceConfig
Auto Trait Implementations§
impl Freeze for EnrootServiceConfig
impl RefUnwindSafe for EnrootServiceConfig
impl Send for EnrootServiceConfig
impl Sync for EnrootServiceConfig
impl Unpin for EnrootServiceConfig
impl UnsafeUnpin for EnrootServiceConfig
impl UnwindSafe for EnrootServiceConfig
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