Skip to main content

RequiredSpec

Struct RequiredSpec 

Source
pub struct RequiredSpec {
    pub regions: Vec<String>,
    pub zones: Vec<String>,
    pub providers: Vec<String>,
    pub mesh_tags: Vec<String>,
    pub nodes: Vec<String>,
    pub memory_mb: u32,
    pub cpu_millis: u32,
    pub repel_archetype: Option<LifecycleArchetype>,
    pub requires_taint: Option<String>,
}
Expand description

F16 placement constraints declared on a MirrorProviderSlot, lives under [providers.<role>] required = { regions = [...], mesh_tags = [...] } in mirrors/<env>.toml.

Hard (must-satisfy) axes, all AND-ed together:

  • regions / zones / providers — membership: the machine’s region / zone / provider must be one of the listed values.
  • mesh_tags — superset: the machine’s mesh_tags must contain every listed tag.
  • memory_mb / cpu_millis — capacity floor (R572-F5): the machine’s allocatable budget must cover the demand. 0 = no constraint.
  • repel_archetype — taint repulsion (R572-F5): the machine must not carry the taint "no-<archetype.taint_key()>" for the workload’s class. None = no repulsion check. Absolute — see Self::repel_archetype.
  • requires_taint — taint affinity (R572-F5): the machine must carry this taint key (in taints or mesh_tags). None = no affinity.

These two are the only readers of MachineConfig::taints, which is what makes taint_effect’s closed vocabulary well-founded.

MachineConfig::sovereign_group is deliberately not an axis here and must not become one (W305/R742-F1). A sovereign group is a blast radius, not a filter: which quorum a box votes in says nothing about whether a workload may run on it, and a dev-group node exists precisely so dev-mode services — stateful ones included — can be scheduled onto it. Filtering on it would re-make the mistake W305 exists to undo, where one mechanism silently carried three unrelated properties.

An empty / zero / None on every axis means “no constraint on that axis”. A fully-unconstrained RequiredSpec matches every machine (see RequiredSpec::is_unconstrained).

Fields§

§regions: Vec<String>§zones: Vec<String>§providers: Vec<String>§mesh_tags: Vec<String>§nodes: Vec<String>

R833-F8: imperative placement — the machine must be one of these by name. Empty (the default) = no constraint, which is every pre-R833-F8 caller.

This is the one axis that is not a capability the scheduler infers. The operator typed --where=node:us-west-003, so it composes with the other axes exactly like the rest — a named node that fails the capacity floor or carries a repelling taint still does not match, and the refusal names why rather than silently placing the work somewhere else.

§memory_mb: u32

R572-F5: minimum memory (MiB) the target node must have in its declared allocatable budget. 0 = no constraint. Filled by CloudConfig::admit_workload from the workload’s memory_request_mb() — its placement request, which is not the same number as the resources.memory_mb cgroup ceiling.

§cpu_millis: u32

R572-F5: minimum CPU (millicores) the target node must have in its declared allocatable budget. 0 = no constraint. Filled by CloudConfig::admit_workload from the workload’s resources.cpu_millis.

§repel_archetype: Option<LifecycleArchetype>

R572-F5: effective archetype of the workload being placed. The scheduler rejects any node that carries the taint "no-<archetype.taint_key()>". None = no repulsion check (backwards-compat for callers that don’t thread a spec through).

This is an absolute block, not a preference. CloudConfig::admit_workload sets it unconditionally from the workload’s effective archetype, and nothing in the tree tolerates a taint — so a workload cannot opt out of a no-<archetype> node (W305 finding 2 / R742-T4). Adding toleration means giving WorkloadSpec a tolerations list and consulting it here; until then, do not describe this as “repel-unless-tolerate”.

§requires_taint: Option<String>

R572-F5: taint the workload requires the target node to carry (annotation yah.placement.requires-taint). The node must have the key in its taints list or mesh_tags. None = no affinity constraint.

Implementations§

Source§

impl RequiredSpec

Source

pub fn is_unconstrained(&self) -> bool

True when no axis carries a constraint — every machine matches.

Source

pub fn matches(&self, machine: &MachineConfig) -> bool

Whether machine satisfies every hard axis.

  • Membership axes (region/zone/provider): machine must carry the field and it must appear in the constraint list.
  • mesh_tags: machine tags must be a superset of the required set.
  • R572-F5 capacity floor: machine.allocatable.{memory,cpu} must cover self.{memory,cpu}. A machine with no allocatable block passes unconditionally (capacity unknown → no constraint enforced).
  • R572-F5 taint repulsion: machine must not carry the taint "no-<archetype.taint_key()>" for the workload’s class. Absolute — the workload has no way to tolerate it (W305 finding 2).
  • R572-F5 taint affinity: if requires_taint is set, the machine must carry that key in its taints list or mesh_tags.

Any other taint on the machine is ignored here, which is precisely why crate::validate::check_inert_taints refuses to let one be declared: it would read as a constraint and be none.

Source

pub fn describe(&self) -> String

Human-readable summary of the constraints, for fail-loud error messages. Example: required.regions=[us-west] + required.mesh_tags=[tag:cloud-runner].

Trait Implementations§

Source§

impl Clone for RequiredSpec

Source§

fn clone(&self) -> RequiredSpec

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for RequiredSpec

Source§

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

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

impl Default for RequiredSpec

Source§

fn default() -> RequiredSpec

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for RequiredSpec

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 Serialize for RequiredSpec

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

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Converts &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSend for T
where T: Any + Send,

Source§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Send + Sync>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

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

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Fruit for T
where T: Send + Downcast,

Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Serialize for T
where T: Serialize + ?Sized,

Source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>

Source§

fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>

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 = !

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