Skip to main content

Stack

Struct Stack 

Source
pub struct Stack {
    pub id: String,
    pub resources: IndexMap<String, ResourceEntry>,
    pub permissions: PermissionsConfig,
    pub supported_platforms: Option<Vec<Platform>>,
    pub inputs: Vec<StackInputDefinition>,
    pub dynamic_container_repositories: Vec<String>,
    pub dynamic_container_image_resources: Vec<String>,
    pub operations: Option<OperationsConfig>,
    pub built_architectures: BTreeMap<String, Vec<Architecture>>,
    pub extensions: Vec<ExtensionManifest>,
}
Expand description

A bag of resources, unaware of any cloud.

Fields§

§id: String

Unique identifier for the stack

§resources: IndexMap<String, ResourceEntry>

Map of resource IDs to their configurations and lifecycle settings

§permissions: PermissionsConfig

Combined permissions configuration containing both profiles and management

§supported_platforms: Option<Vec<Platform>>

Which platforms this stack supports. When None, all platforms are supported.

§inputs: Vec<StackInputDefinition>

Input definitions required before setup or deployment can proceed.

§dynamic_container_repositories: Vec<String>

Exact image repositories approved for containers created after installation. The runtime API also requires an immutable SHA-256 digest.

§dynamic_container_image_resources: Vec<String>

Released Container resources whose image repositories are approved for containers created after installation.

§operations: Option<OperationsConfig>

Operations this stack’s deployments run: the plugins, their settings, and which operations run without approval. Changing them takes a new release.

§built_architectures: BTreeMap<String, Vec<Architecture>>

Set by alien build for a Kubernetes stack: the CPU architectures of the image built for each Container, Daemon and Worker, by resource id (more than one means a multi-architecture image). Pods of a single-architecture image are placed on matching nodes. A resource with no entry was not recorded (a prebuilt image or an older release), so no architecture is selected. Build output replaces any value written in the stack definition.

Kept on the stack, not on the resources: older managers and Operators read every resource strictly and refuse a field they do not know, but ignore an unknown stack-level field.

§extensions: Vec<ExtensionManifest>

Extensions whose resource types this stack may use, in the order the stack lists them.

Implementations§

Source§

impl Stack

Source

pub fn new(id: String) -> StackBuilder

Create an instance of Stack using the builder syntax

Source§

impl Stack

Source

pub fn built_architectures_of(&self, resource_id: &str) -> &[Architecture]

The architectures alien build recorded for a workload’s image. Empty when none were recorded.

Source

pub fn application_vault_ids(&self) -> Vec<String>

The ids of the stack’s own vaults: those the application reads and writes, not the reserved ones the framework keeps its secrets in.

Source

pub fn queue_visibility_timeout_seconds(&self, queue_id: &str) -> u32

SQS visibility derived from all consumers, including a batch collection window.

Source

pub fn container_linkers(&self, container_id: &str) -> Vec<ResourceRef>

Explicit consumers whose links grant access to every port on a container. Cluster-wide reach is separate and remains the backend’s existing behavior.

Source

pub fn linkers(&self, target: &ResourceRef) -> Vec<ResourceRef>

Workloads whose links name target, which are the ones that use it at runtime.

Source

pub fn setup_owned_digest(&self) -> String

Digest of what setup owns: every Frozen entry plus each Live sandbox’s setup inputs. Without a Live sandbox the bytes equal the Frozen-only projection. Declined gated entries must be stripped by the caller.

Source

pub fn setup_owned_entry_digests(&self) -> BTreeMap<String, String>

Per-entry digests of the projection setup_owned_digest hashes, keyed by resource ID. A Live sandbox’s setup inputs are keyed <id>#setupInputs. Two stacks with equal setup_owned_digest have equal maps; comparing the maps names the entries that differ without exposing their contents.

Source

pub fn setup_update_digest(&self) -> String

Binds a setup update to both its resources and installed permissions. Runtime code changes remain outside this authorization.

Source

pub fn resources(&self) -> impl Iterator<Item = (&String, &ResourceEntry)>

Returns an iterator over the resources in the stack, including their lifecycle state.

Source

pub fn resources_mut( &mut self, ) -> impl Iterator<Item = (&String, &mut ResourceEntry)>

Returns a mutable iterator over the resources in the stack, including their lifecycle state.

Source

pub fn id(&self) -> &str

Source

pub fn current() -> StackRef

Create a reference to the current stack

Source

pub fn permissions(&self) -> &PermissionsConfig

Returns the permissions configuration for the stack.

Source

pub fn permission_profiles(&self) -> &IndexMap<String, PermissionProfile>

Returns the permission profiles for the stack.

Source

pub fn management(&self) -> &ManagementPermissions

Returns the management permissions configuration for the stack.

Source

pub fn supported_platforms(&self) -> Option<&[Platform]>

Returns the supported platforms, or None if all platforms are supported.

Source

pub fn inputs(&self) -> &[StackInputDefinition]

Returns stack input definitions.

Source

pub fn supports_platform(&self, platform: &Platform) -> bool

Returns true if the given platform is supported by this stack. When supported_platforms is None, all platforms are supported.

Source

pub fn descriptor( &self, resource_type: &ResourceType, ) -> Option<&ResourceTypeDescriptor>

The descriptor of a resource type an extension in this stack defines. None for a built-in type, even when a manifest lists it, for a type listed only by an extension whose name is not the type’s prefix, and for a type no extension defines.

Source

pub fn check_setup_format( &self, resource_id: &str, resource_type: &ResourceType, format: SetupFormat, platform: Platform, ) -> Result<()>

Refuses to set up resource resource_id with format on platform when its type comes from an extension that has no part for that format and platform. A setup path a custom resource lacks is off for every stack that uses it, and the error says why. Alien’s own types pass.

Source§

impl Stack

Source

pub fn command_targets(&self) -> Vec<CommandTarget>

Returns the ordered list of command-capable targets in this stack: Worker, Container, and Daemon resources with commands_enabled set, in stack declaration order.

Declaration order is the order resources were added to the stack (via StackBuilder::add/add_with_dependencies/add_with_remote_access). resources is an IndexMap, which preserves insertion order, so iterating it directly yields declaration order without any extra bookkeeping.

Source

pub fn command_receiver_reads_capability_file(&self, resource_id: &str) -> bool

Whether alien build recorded that the command receiver of this Container or Daemon reads ALIEN_COMMANDS_CAPABILITY_FILE (commands_capability_file). Everything else is treated as a receiver from an older build: it needs ALIEN_COMMANDS_TOKEN to start. This is the one place that rule lives; deployers and token revocation use it.

Source

pub fn command_receivers_without_capability_file(&self) -> Vec<String>

Ids of the command-enabled Containers and Daemons whose receiver is not recorded as reading the capability file. While any exists, the deployment token must stay valid: those receivers cannot start without it.

Source

pub fn worker_command_push_env_vars( &self, commands_token: Option<&str>, ) -> Result<Vec<EnvironmentVariable>>

Returns the authentication token used by the manager/operator to push commands to each command-enabled Local/Kubernetes Worker runtime. Cloud-native Worker transports authenticate through their platform and do not use this helper.

Source

pub fn receiver_command_env_vars( &self, commands_url: &str, credential: impl Fn(&str) -> ReceiverCommandCredential, ) -> Result<Vec<EnvironmentVariable>>

Returns the command receiver environment variables for each command-enabled Container and Daemon in this stack, scoped via target_resources so every var reaches only its own resource.

Workers receive platform pushes; Containers and Daemons run the pull receiver, which reads this environment:

  • ALIEN_COMMANDS_URL (Plain) — base receiver URL
  • the credential, chosen per target by credential
  • ALIEN_COMMANDS_TARGET_RESOURCE_ID (Plain) — this resource’s id
  • ALIEN_COMMANDS_TARGET_RESOURCE_TYPE (Plain) — container/daemon

ALIEN_DEPLOYMENT_ID is intentionally NOT emitted here: the manager and operator already inject it deployment-wide (target_resources: None).

Workers are excluded here, and a commands-disabled Container/Daemon is never a command_targets() entry, so it receives nothing.

Trait Implementations§

Source§

impl Clone for Stack

Source§

fn clone(&self) -> Self

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 Stack

Source§

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

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

impl<'de> Deserialize<'de> for Stack

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 Eq for Stack

Source§

impl From<&Stack> for StackRef

Source§

fn from(stack: &Stack) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for Stack

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl Serialize for Stack

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 StructuralPartialEq for Stack

Auto Trait Implementations§

§

impl !RefUnwindSafe for Stack

§

impl !UnwindSafe for Stack

§

impl Forget for Stack

§

impl Freeze for Stack

§

impl Move for Stack

§

impl Send for Stack

§

impl Sync for Stack

§

impl Unpin for Stack

§

impl UnsafeUnpin for Stack

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

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