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>, ) -> Self

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>, ) -> Self

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) -> 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 EnsureImageRequest

Source§

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

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