pub struct TaskSpec {
pub runnables: Vec<Runnable>,
pub compute_resource: Option<ComputeResource>,
pub max_run_duration: Option<Duration>,
pub max_retry_count: i32,
pub lifecycle_policies: Vec<LifecyclePolicy>,
pub environments: BTreeMap<String, String>,
pub volumes: Vec<Volume>,
pub environment: Option<Environment>,
}
Expand description
Spec of a task
Fields§
§runnables: Vec<Runnable>
Required. The sequence of one or more runnables (executable scripts, executable containers, and/or barriers) for each task in this task group to run. Each task runs this list of runnables in order. For a task to succeed, all of its script and container runnables each must meet at least one of the following conditions:
- The runnable exited with a zero status.
- The runnable didn’t finish, but you enabled its
background
subfield. - The runnable exited with a non-zero status, but you enabled its
ignore_exit_status
subfield.
compute_resource: Option<ComputeResource>
ComputeResource requirements.
max_run_duration: Option<Duration>
Maximum duration the task should run before being automatically retried
(if enabled) or automatically failed. Format the value of this field
as a time limit in seconds followed by s
—for example, 3600s
for 1 hour. The field accepts any value between 0 and the maximum listed
for the Duration
field type at
https://protobuf.dev/reference/protobuf/google.protobuf/#duration; however,
the actual maximum run time for a job will be limited to the maximum run
time for a job listed at
https://cloud.google.com/batch/quotas#max-job-duration.
max_retry_count: i32
Maximum number of retries on failures. The default, 0, which means never retry. The valid value range is [0, 10].
lifecycle_policies: Vec<LifecyclePolicy>
Lifecycle management schema when any task in a task group is failed. Currently we only support one lifecycle policy. When the lifecycle policy condition is met, the action in the policy will execute. If task execution result does not meet with the defined lifecycle policy, we consider it as the default policy. Default policy means if the exit code is 0, exit task. If task ends with non-zero exit code, retry the task with max_retry_count.
environments: BTreeMap<String, String>
Deprecated: please use environment(non-plural) instead.
volumes: Vec<Volume>
Volumes to mount before running Tasks using this TaskSpec.
environment: Option<Environment>
Environment variables to set before running the Task.
Trait Implementations§
source§impl Message for TaskSpec
impl Message for TaskSpec
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moresource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.source§impl PartialEq for TaskSpec
impl PartialEq for TaskSpec
impl StructuralPartialEq for TaskSpec
Auto Trait Implementations§
impl Freeze for TaskSpec
impl RefUnwindSafe for TaskSpec
impl Send for TaskSpec
impl Sync for TaskSpec
impl Unpin for TaskSpec
impl UnwindSafe for TaskSpec
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request