feat: phase 2 — automatisation: doctor --watch, schedule, service, orchestration, conteneurs (closes #55 #56 #57 #58 #59)
This commit is contained in:
@@ -244,6 +244,46 @@ pub struct AgentDef {
|
||||
/// Restrict the agent to platforms: linux, macos, windows (empty = all).
|
||||
#[serde(default)]
|
||||
pub platforms: Vec<String>,
|
||||
/// Health check waited before the next orchestration step (issue #57).
|
||||
#[serde(default)]
|
||||
pub healthcheck: Option<HealthCheck>,
|
||||
/// Container profile used by 'am run --container' (issue #58).
|
||||
#[serde(default)]
|
||||
pub container: Option<ContainerSpec>,
|
||||
}
|
||||
|
||||
/// Health check for group orchestration (issue #57): a command that must
|
||||
/// exit 0, or a TCP port that must accept connections, within timeout_secs.
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct HealthCheck {
|
||||
/// Shell command to probe (exit 0 = healthy).
|
||||
#[serde(default)]
|
||||
pub command: Option<String>,
|
||||
/// TCP port to connect to (accepts = healthy).
|
||||
#[serde(default)]
|
||||
pub port: Option<u16>,
|
||||
/// Seconds to wait before declaring failure (default 30).
|
||||
#[serde(default)]
|
||||
pub timeout_secs: Option<u64>,
|
||||
}
|
||||
|
||||
/// Container profile (issue #58): image, volumes, network and env applied
|
||||
/// by 'am run <agent> --container'.
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct ContainerSpec {
|
||||
/// Container image (required).
|
||||
pub image: String,
|
||||
/// Extra volumes "host:container[:ro]" on top of state_dir/log_dir.
|
||||
#[serde(default)]
|
||||
pub volumes: Vec<String>,
|
||||
/// Network (default: host on Linux, bridge elsewhere).
|
||||
#[serde(default)]
|
||||
pub network: Option<String>,
|
||||
/// Extra environment variables inside the container.
|
||||
#[serde(default)]
|
||||
pub env: BTreeMap<String, String>,
|
||||
}
|
||||
|
||||
fn default_true() -> bool {
|
||||
|
||||
Reference in New Issue
Block a user