Skip to main content

EnsureImageRequest

Struct EnsureImageRequest 

Source
pub struct EnsureImageRequest {
Show 20 fields pub name_prefix: String, pub binary: Vec<u8>, pub dockerfile: String, pub context: Option<BuildContext>, pub s3_bucket: String, pub s3_key_prefix: Option<String>, pub build_role_arn: String, pub size: SizeClass, pub base_image: Option<BaseImage>, pub force: bool, pub tags: BTreeMap<String, String>, pub wait_timeout: Option<Duration>, pub project_files: Option<ProjectFiles>, pub base_image_version: Option<String>, pub log_group: Option<String>, pub log_stream: Option<String>, pub repair_guest_identity: bool, pub inherit_workdir: bool, pub run_hook_timeout: RunHookTimeout, pub build_hook_timeout: BuildHookTimeout,
}
Expand description

Everything Sandbox::ensure_image needs.

Fields§

§name_prefix: String

The stem of the image name; the name is <prefix>-<hash12>.

§binary: Vec<u8>

The daemon binary’s bytes.

§dockerfile: String

The Dockerfile, usually wrap_dockerfile’s output. Checked by the create call’s preflight before anything else happens.

§context: Option<BuildContext>

The files the Dockerfile may COPY ([super::context::from_dir]), or None.

§s3_bucket: String

The bucket the artifact is uploaded to, in the sandbox’s region.

§s3_key_prefix: Option<String>

A key prefix inside the bucket, or None for the bucket root.

§build_role_arn: String

The build role, which must read the bucket and write logs under /aws/lambda-microvms/.

§size: SizeClass

The size class the image is created with; part of the name.

§base_image: Option<BaseImage>

The base image, or None for BaseImage::from_dockerfile of the Dockerfile.

§force: bool

Delete what exists under the name and build afresh.

§tags: BTreeMap<String, String>

Tags for a created image. Not part of the name: a reused image keeps its own, and tags are not fixed at create.

§wait_timeout: Option<Duration>

The build wait’s deadline, or None for DEFAULT_BUILD_TIMEOUT.

§project_files: Option<ProjectFiles>

A project’s manifest and lockfile, baked as an environment layer (#74). Part of the name: they enter the artifact.

§base_image_version: Option<String>

baseImageVersion, or None for the service’s default. Part of the name when set.

§log_group: Option<String>

logging.cloudWatch.logGroup for a created image. Part of the name (#280): the service sets an image’s logging when it creates it, so a reused image logs where its creator asked.

§log_stream: Option<String>

The log-stream prefix for a created image; see CreateImageRequest::log_stream. Part of the name, as log_group is.

§repair_guest_identity: bool

CreateImageRequest::repair_guest_identity for a created image. Part of the name (#280): a reused image built without the repair would answer a caller who asked for it.

§inherit_workdir: bool

CreateImageRequest::inherit_workdir for a created image. Part of the name.

§run_hook_timeout: RunHookTimeout

The run-family hook timeouts for a created image. Part of the name.

§build_hook_timeout: BuildHookTimeout

The build-family hook timeouts for a created image. Part of the name.

Implementations§

Source§

impl EnsureImageRequest

Source

pub fn new( name_prefix: impl Into<String>, binary: Vec<u8>, dockerfile: impl Into<String>, s3_bucket: impl Into<String>, build_role_arn: impl Into<String>, ) -> EnsureImageRequest

A request with the defaults: no context, no key prefix, the default size class, the base derived from the Dockerfile, no force, no tags, the default wait, and the create request’s own defaults for everything a created image carries.

Source

pub fn from_create( create: CreateImageRequest, dockerfile: String, s3_bucket: impl Into<String>, ) -> EnsureImageRequest

The ensure request for a create request’s inputs (#258): its name becomes the prefix and every field it carries a created image carries too. dockerfile is the text the build takes, which a caller with no Dockerfile of its own gets from ControlPlane::dockerfile_for. The artifact URI and token label are dropped: the ensure derives both from the name it computes.

Trait Implementations§

Source§

impl Clone for EnsureImageRequest

Source§

fn clone(&self) -> EnsureImageRequest

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 EnsureImageRequest

Source§

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

Formats the value using the given formatter. Read more

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<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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> 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<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

Source§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
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> 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<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