UpdateStrategy

Struct UpdateStrategy 

Source
pub struct UpdateStrategy {
    pub max_parallel: u32,
    pub health_check: HealthCheck,
    pub min_healthy_time: Duration,
    pub healthy_deadline: Duration,
    pub progress_deadline: Duration,
    pub auto_revert: bool,
    pub canary: u32,
    pub auto_promote: bool,
    pub stagger: Duration,
}
Expand description

Specifies the task group update strategy. When omitted, rolling updates are disabled. The update stanza can be specified at the job or task group level. When specified at the job, the update stanza is inherited by all task groups. When specified in both the job and in a task group, the stanzas are merged with the task group’s taking precedence.

Fields§

§max_parallel: u32

Specifies the number of tasks that can be updated at the same time. Defaults to 1.

§health_check: HealthCheck

Specifies the mechanism in which allocations health is determined. See also HealthCheck

§min_healthy_time: Duration

Specifies the minimum time the allocation must be in the healthy state before it is marked as healthy and unblocks further allocations from being updated. Defaults to 10 seconds.

§healthy_deadline: Duration

Specifies the deadline in which the allocation must be marked as healthy after which the allocation is automatically transitioned to unhealthy. Defaults to 5 minutes.

§progress_deadline: Duration

Specifies the deadline in which an allocation must be marked as healthy. The deadline begins when the first allocation for the deployment is created and is reset whenever an allocation as part of the deployment transitions to a healthy state. If no allocation transitions to the healthy state before the progress deadline, the deployment is marked as failed. If the progress_deadline is set to 0, the first allocation to be marked as unhealthy causes the deployment to fail. Defaults to 10 minutes.

§auto_revert: bool

Specifies if the job should auto-revert to the last stable job on deployment failure. A job is marked as stable if all the allocations as part of its deployment were marked healthy. Defaults to false.

§canary: u32

Specifies that changes to the job that would result in destructive updates should create the specified number of canaries without stopping any previous allocations. Once the operator determines the canaries are healthy, they can be promoted which unblocks a rolling update of the remaining allocations at a rate of max_parallel. Defaults to 0.

§auto_promote: bool

specifies if the job should automatically promote to the new deployment if all canaries become healthy. Defaults to false.

§stagger: Duration

Specifies the delay between migrating allocations off nodes marked for draining. Defaults to 30 seconds.

Trait Implementations§

Source§

impl Clone for UpdateStrategy

Source§

fn clone(&self) -> UpdateStrategy

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for UpdateStrategy

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for UpdateStrategy

Source§

fn default() -> Self

Return UpdateStrategy { max_parallel: 1, health_check: Default::default(), min_healthy_time: Duration :: from_secs(10), healthy_deadline: Duration :: from_secs(300), progress_deadline: Duration :: from_secs(600), auto_revert: Default::default(), canary: Default::default(), auto_promote: Default::default(), stagger: Duration :: from_secs(30) }

Source§

impl<'de> Deserialize<'de> for UpdateStrategy

Source§

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 UpdateStrategy

Source§

fn eq(&self, other: &UpdateStrategy) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for UpdateStrategy

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for UpdateStrategy

Source§

impl StructuralPartialEq for UpdateStrategy

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,