pub struct JobBuilder<'bb> { /* private fields */ }
Implementations§
Source§impl<'bb> JobBuilder<'bb>
impl<'bb> JobBuilder<'bb>
pub fn name(&mut self, name: impl Into<String>) -> &mut Self
pub fn attribute( &mut self, key: impl ToString, value: impl ToString, ) -> &mut Self
pub fn attributes<I, S, T>(&mut self, attrs: I) -> &mut Self
Sourcepub fn always_run(&mut self, always_run: bool) -> &mut Self
pub fn always_run(&mut self, always_run: bool) -> &mut Self
Sets the always_run
field of the job (Default: false
).
Sourcepub fn arg(&mut self, arg: impl Into<String>) -> &mut Self
pub fn arg(&mut self, arg: impl Into<String>) -> &mut Self
Adds a single argument to the command.
Sourcepub fn args_mut(&mut self) -> &mut Vec<String>
pub fn args_mut(&mut self) -> &mut Vec<String>
Returns the current arguments, including the command, for arbitrary manipulation
Sourcepub fn env(
&mut self,
key: impl Into<String>,
val: impl Into<String>,
) -> &mut Self
pub fn env( &mut self, key: impl Into<String>, val: impl Into<String>, ) -> &mut Self
Add/Replace one environment variable.
Sourcepub fn env_vars<I, S, T>(&mut self, vars: I) -> &mut Self
pub fn env_vars<I, S, T>(&mut self, vars: I) -> &mut Self
Adds/Replace several environment variables.
Sourcepub fn env_remove(&mut self, key: &impl Borrow<str>) -> Option<String>
pub fn env_remove(&mut self, key: &impl Borrow<str>) -> Option<String>
Removes a key from the environment, if it exists
Sourcepub fn env_clear(&mut self)
pub fn env_clear(&mut self)
Clears the provided environment, doesn’t affect the environment otherwise present in the image.
Sourcepub fn gcsfuse(
&mut self,
bucket: impl Into<String>,
mount_path: impl Into<String>,
read_only: bool,
) -> &mut Self
pub fn gcsfuse( &mut self, bucket: impl Into<String>, mount_path: impl Into<String>, read_only: bool, ) -> &mut Self
Adds a gcsfuse mount point.
Sourcepub fn input_file(
&mut self,
from: impl Into<String>,
to: impl Into<String>,
) -> &mut Self
pub fn input_file( &mut self, from: impl Into<String>, to: impl Into<String>, ) -> &mut Self
Adds an input file.
Sourcepub fn input_files<I, S, T>(&mut self, paths: I) -> &mut Self
pub fn input_files<I, S, T>(&mut self, paths: I) -> &mut Self
Adds several input files.
Sourcepub fn mount_docker_socket(&mut self, mount: bool) -> &mut Self
pub fn mount_docker_socket(&mut self, mount: bool) -> &mut Self
Sets the mount_docker_socket
property (Default: false
).
Sourcepub fn output_file(
&mut self,
from: impl Into<String>,
to: impl Into<String>,
) -> &mut Self
pub fn output_file( &mut self, from: impl Into<String>, to: impl Into<String>, ) -> &mut Self
Adds an output file.
Sourcepub fn output_files<I, S, T>(&mut self, paths: I) -> &mut Self
pub fn output_files<I, S, T>(&mut self, paths: I) -> &mut Self
Adds several output files.
Sourcepub fn parent(&mut self, parent_id: usize) -> &mut Self
pub fn parent(&mut self, parent_id: usize) -> &mut Self
Adds a parent job id. Job parents need to be handled carefully, once set, they cannot be unset. They are not deserialized when fetching job specs, and so have to be reconstructed using other means.
§Panics
Panics if parent_id is greater than or equal to this job’s id
Sourcepub fn parents(
&mut self,
parent_ids: impl IntoIterator<Item = usize>,
) -> &mut Self
pub fn parents( &mut self, parent_ids: impl IntoIterator<Item = usize>, ) -> &mut Self
Adds several parent job ids. Job parents need to be handled carefully, once set, they cannot be unset. They are not deserialized when fetching job specs, and so have to be reconstructed using other means.
§Panics
Panics if any of the parent_ids are greater than or equal to this job’s id
Sourcepub fn port(&mut self, port: u16) -> &mut Self
pub fn port(&mut self, port: u16) -> &mut Self
Sets a port this container will publish (Default: no port will be published)
Sourcepub fn clear_port(&mut self) -> &mut Self
pub fn clear_port(&mut self) -> &mut Self
Clears published port (if any)
Sourcepub fn requester_pays_project(
&mut self,
project: impl Into<String>,
) -> &mut Self
pub fn requester_pays_project( &mut self, project: impl Into<String>, ) -> &mut Self
Set a requester pays project for this job (Default: no requester pays project)
Sourcepub fn network(&mut self, network: impl Into<String>) -> &mut Self
pub fn network(&mut self, network: impl Into<String>) -> &mut Self
Sets the network to use for this job. (Default: no special networking).
Sourcepub fn resources(&mut self, cpu: f64, memory: u64, storage: u64) -> &mut Self
pub fn resources(&mut self, cpu: f64, memory: u64, storage: u64) -> &mut Self
Sets the requested resources for this job, cpu
is the fraction of whole cpus (1.0 is
1 cpu, 0.5 is half a cpu, etc.), memory
and storage
are both expressed in bytes.
(Defaults: 1 cpu, 3.75 GiB RAM, 10 GB Storage Space).
Sourcepub fn cpu(&mut self, cpu: f64) -> &mut Self
pub fn cpu(&mut self, cpu: f64) -> &mut Self
Sets the requested cpu. 1.0 is 1 whole cpu. (Default: 1 cpu)
Sourcepub fn memory(&mut self, memory: u64) -> &mut Self
pub fn memory(&mut self, memory: u64) -> &mut Self
Sets the requested memory in bytes. (Default: 3.75 GiB)
Sourcepub fn storage(&mut self, storage: u64) -> &mut Self
pub fn storage(&mut self, storage: u64) -> &mut Self
Sets the requested disk space in bytes. (Default: 10 GiB)
Sourcepub fn service_account(
&mut self,
namespace: impl Into<String>,
name: impl Into<String>,
) -> &mut Self
pub fn service_account( &mut self, namespace: impl Into<String>, name: impl Into<String>, ) -> &mut Self
Sets the service account to use for this job.