pub struct TemplateDefinition {Show 13 fields
pub name: TemplateName,
pub summary: &'static str,
pub image: &'static str,
pub ports: Vec<Port>,
pub env: HashMap<&'static str, &'static str>,
pub compose_path: &'static str,
pub extra_docker_args: &'static [&'static str],
pub data_path: Option<&'static str>,
pub tier: &'static str,
pub replication: ReplicationMode,
pub min_cpu_millicores: u64,
pub min_memory_mb: u64,
pub min_storage_gb: u64,
}Expand description
Full definition of a template. The consumer-visible defaults (tier, replication) and the operator-visible facts (image, ports, env, compose_path).
Fields§
§name: TemplateName§summary: &'static str§image: &'static strReal, public Docker image. No ubuntu:22.04 placeholders.
ports: Vec<Port>§env: HashMap<&'static str, &'static str>Environment variables the workload expects. Values are defaults; consumers can override per-deploy.
compose_path: &'static strPath (relative to the repo root) to a working
docker-compose.yml. Operators run
docker compose -f <compose_path> up to reproduce the
workload locally with no Paygress involved.
extra_docker_args: &'static [&'static str]Extra docker run flags this template needs (ulimits,
sysctls, capabilities, etc.). Passed verbatim before the
image positional. Keep these minimal and well-justified —
every flag here is a cross-template attack surface.
Example: &["--ulimit", "nofile=1048576:1048576"] for
strfry, which tries to bump NOFILES to 1M and fails inside
Docker’s default 524288 cap.
data_path: Option<&'static str>Container-internal path that holds the workload’s persistent state (LMDB for strfry, models for ollama, chain data for bitcoind). DockerBackend mounts a vmid-scoped volume here. None means stateless (browser).
tier: &'static str§replication: ReplicationMode§min_cpu_millicores: u64Minimum sane resources. Provisioning rejects tiers below this.
min_memory_mb: u64§min_storage_gb: u64Implementations§
Trait Implementations§
Source§impl Clone for TemplateDefinition
impl Clone for TemplateDefinition
Source§fn clone(&self) -> TemplateDefinition
fn clone(&self) -> TemplateDefinition
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for TemplateDefinition
impl RefUnwindSafe for TemplateDefinition
impl Send for TemplateDefinition
impl Sync for TemplateDefinition
impl Unpin for TemplateDefinition
impl UnsafeUnpin for TemplateDefinition
impl UnwindSafe for TemplateDefinition
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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