1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
// Project: scalo
// File: src/deployment/mod.rs
// Purpose: Deployment contract validation and generation for Helm charts and Dockerfiles
// Language: Rust
//
// License: Apache-2.0
// Copyright: (c) 2026 HYPERI PTY LIMITED
//! Deployment contract validation and generation for Kubernetes/Helm/Docker.
//!
//! Apps provide ~20% customisation via [`DeploymentContract`]; this module
//! generates ~80% boilerplate (Dockerfile, Helm chart, Compose fragment) and
//! validates existing artifacts against the contract.
//!
//! # Architecture
//!
//! ```text
//! App Config::default() → DeploymentContract → generate_chart("chart/")
//! → generate_dockerfile()
//! → generate_compose_fragment()
//! → validate_helm_values("chart/")
//! → validate_dockerfile("Dockerfile")
//! ```
//!
//! The config cascade (figment) is the SSoT for app defaults. The contract
//! captures the deployment-facing subset. Generation creates artifacts from
//! scratch; validation asserts that existing artifacts match.
//!
//! # Example
//!
//! ```rust,no_run
//! use scalo::deployment::{
//! DEFAULT_BASE_DISTRO, DeploymentContract, HealthContract, ImageProfile, KedaContract,
//! NativeDepsContract, base_image_from_cascade, generate_dockerfile, generate_chart,
//! generate_compose_fragment,
//! };
//!
//! let contract = DeploymentContract {
//! app_name: "dfe-loader".into(),
//! binary_name: "dfe-loader".into(),
//! description: "High-performance data loader".into(),
//! metrics_port: 9090,
//! health: HealthContract::default(),
//! env_prefix: "DFE_LOADER".into(),
//! metric_prefix: "loader".into(),
//! config_mount_path: "/etc/dfe/loader.yaml".into(),
//! image_registry: "ghcr.io/hyperi-io".into(),
//! extra_ports: vec![],
//! entrypoint_args: vec!["--config".into(), "/etc/dfe/loader.yaml".into()],
//! secrets: vec![],
//! default_config: None,
//! depends_on: vec!["kafka".into(), "clickhouse".into()],
//! keda: Some(KedaContract::default()),
//! base_image: base_image_from_cascade(),
//! native_deps: NativeDepsContract::for_features(
//! &["transport-kafka", "spool", "tiered-sink"],
//! DEFAULT_BASE_DISTRO,
//! ),
//! image_profile: ImageProfile::Production,
//! oci_labels: Default::default(),
//! schema_version: 3,
//! config_schema: None,
//! capabilities: vec![],
//! };
//!
//! // Generate production Dockerfile (without identity annotations -- Phase 1
//! // backwards-compat. New callers should pass `Some(&identity)`; see
//! // `ContractIdentity::new` and `ContractIdentity::detect`.)
//! let dockerfile = generate_dockerfile(&contract, None);
//!
//! // Generate development Dockerfile (same binary, adds debug tools)
//! let dev_dockerfile = generate_dockerfile(&contract.with_dev_profile(), None);
//!
//! // Generate Helm chart directory
//! // generate_chart(&contract, "chart/").unwrap();
//!
//! // Generate Docker Compose service fragment
//! let compose = generate_compose_fragment(&contract);
//! ```
pub use ;
pub use ;
pub use ;
pub use ;
pub use config_schema_json;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub