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
//! Shared deployment context primitives for Greentic runtimes.
use alloc::string::String;
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
pub use crate::TenantCtx;
/// Cloud provider locations supported by Greentic deployments.
#[derive(Debug, Clone, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub enum Cloud {
/// Amazon Web Services.
Aws,
/// Google Cloud Platform.
Gcp,
/// Microsoft Azure.
Azure,
/// Hetzner Cloud.
Hetzner,
/// Local/self-hosted environments.
Local,
/// Any other cloud provider not covered above.
Other,
}
/// Platform-level schedulers supported by Greentic deployments.
#[derive(Debug, Clone, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub enum Platform {
/// Kubernetes workloads.
K8s,
/// Nomad workloads.
Nomad,
/// Systemd services.
Systemd,
/// Cloudflare Workers.
CfWorkers,
/// AWS Lambda functions.
Lambda,
/// Bare-metal deployments.
Baremetal,
/// Any other platform not captured above.
Other,
}
/// Deployment metadata propagated to Greentic surfaces.
#[derive(Debug, Clone, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct DeploymentCtx {
/// Cloud provider.
pub cloud: Cloud,
/// Optional region identifier (for example `us-east-1`).
#[cfg_attr(feature = "serde", serde(default))]
pub region: Option<String>,
/// Platform or scheduler running the deployment.
pub platform: Platform,
/// Optional runtime engine backing the deployment (for example `wasmtime`).
#[cfg_attr(feature = "serde", serde(default))]
pub runtime: Option<String>,
}