pub struct ContainerBuild {
pub schema_version: SchemaVersion,
pub name: String,
pub build: ContainerBuildStep,
pub run: ContainerRunConfig,
}Expand description
kind = "container" in the recipe form: a Dockerfile next to the
component’s workload.toml, built and run on the operator’s box.
This is the shape ContainerReconciler drives (docker build from
build, docker run with run). It is
deliberately not a WorkloadSpec — see ContainerManifest for why the
digest invariant makes that impossible, and Self::into_spec for the one
lowering that is allowed.
Unknown keys are tolerated on purpose. crates/yah/cloud-admin/workload.toml
carries a [process] table read by LocalProcessReconciler on the dev
mirror — one component file, three tier runtimes (W324 §1). Adding
deny_unknown_fields here would make that file unparseable as a container
manifest, which is the opposite of the point.
Fields§
§schema_version: SchemaVersionWire-format version. Always V1 today.
name: StringComponent name. Same field the reference form carries, so a manifest identifies itself the same way whichever form it is written in.
build: ContainerBuildStepHow the image is built. Its presence is what makes this a recipe.
run: ContainerRunConfigHow the built image is run locally.
Implementations§
Source§impl ContainerBuild
impl ContainerBuild
Sourcepub fn into_spec(
self,
digest: &str,
tier: TierTag,
) -> Result<WorkloadSpec, String>
pub fn into_spec( self, digest: &str, tier: TierTag, ) -> Result<WorkloadSpec, String>
Lower a recipe to the wire type, once a build has produced a digest.
The signature is the invariant (W324 §5): there is no way to reach a
WorkloadSpec from a recipe without supplying the sha256:<hex> the
build emitted, so an unpinned container spec cannot be constructed by
accident.
Fallible because digest is a caller-supplied string: a malformed one
must be an error, not a WorkloadSpec that lies about being
content-addressed. Everything the recipe does not declare
(tier, resources, restart_policy, …) takes the same defaults a
hand-written local container gets; tier is the caller’s because
admission control is a cluster policy, not a manifest fact.
Trait Implementations§
Source§impl Clone for ContainerBuild
impl Clone for ContainerBuild
Source§fn clone(&self) -> ContainerBuild
fn clone(&self) -> ContainerBuild
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ContainerBuild
impl Debug for ContainerBuild
Source§impl<'de> Deserialize<'de> for ContainerBuild
impl<'de> Deserialize<'de> for ContainerBuild
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for ContainerBuild
impl PartialEq for ContainerBuild
Source§impl Serialize for ContainerBuild
impl Serialize for ContainerBuild
impl StructuralPartialEq for ContainerBuild
Source§impl TS for ContainerBuild
impl TS for ContainerBuild
Source§type WithoutGenerics = ContainerBuild
type WithoutGenerics = ContainerBuild
WithoutGenerics should just be Self.
If the type does have generic parameters, then all generic parameters must be replaced with
a dummy type, e.g ts_rs::Dummy or (). The only requirement for these dummy types is that
EXPORT_TO must be None. Read moreSource§type OptionInnerType = ContainerBuild
type OptionInnerType = ContainerBuild
std::option::Option<T>, then this associated type is set to T.
All other implementations of TS should set this type to Self instead.Source§fn docs() -> Option<String>
fn docs() -> Option<String>
TS is derived, docs are
automatically read from your doc comments or #[doc = ".."] attributesSource§fn decl_concrete(cfg: &Config) -> String
fn decl_concrete(cfg: &Config) -> String
TS::decl().
If this type is not generic, then this function is equivalent to TS::decl().Source§fn decl(cfg: &Config) -> String
fn decl(cfg: &Config) -> String
type User = { user_id: number, ... }.
This function will panic if the type has no declaration. Read moreSource§fn inline(cfg: &Config) -> String
fn inline(cfg: &Config) -> String
{ user_id: number }.
This function will panic if the type cannot be inlined.Source§fn inline_flattened(cfg: &Config) -> String
fn inline_flattened(cfg: &Config) -> String
Source§fn visit_generics(v: &mut impl TypeVisitor)where
Self: 'static,
fn visit_generics(v: &mut impl TypeVisitor)where
Self: 'static,
Source§fn output_path() -> Option<PathBuf>
fn output_path() -> Option<PathBuf>
T should be exported, relative to the output directory.
The returned path does not include any base directory. Read moreSource§fn visit_dependencies(v: &mut impl TypeVisitor)where
Self: 'static,
fn visit_dependencies(v: &mut impl TypeVisitor)where
Self: 'static,
Source§fn dependencies(cfg: &Config) -> Vec<Dependency>where
Self: 'static,
fn dependencies(cfg: &Config) -> Vec<Dependency>where
Self: 'static,
Source§fn export(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
fn export(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
TS::export_all. Read moreSource§fn export_all(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
fn export_all(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
TS::export. Read more