diff --git a/ctl/src/http/mod.rs b/ctl/src/http/mod.rs index e4c7d6f..f22615e 100644 --- a/ctl/src/http/mod.rs +++ b/ctl/src/http/mod.rs @@ -1,4 +1,5 @@ use axum::{routing::post, Router}; +use tracing::info; pub mod worker; @@ -6,6 +7,6 @@ pub async fn run_server() { let app = Router::new().route("/worker/metrics", post(worker::push_metrics)); let listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await.unwrap(); - println!("HTTP listening at port 3000"); + info!("HTTP listening at port 3000"); axum::serve(listener, app).await.unwrap(); } diff --git a/docs/DESIGN.md b/docs/DESIGN.md index 48c0f15..48c8db4 100644 --- a/docs/DESIGN.md +++ b/docs/DESIGN.md @@ -75,6 +75,60 @@ graph TB may also optionally call a health check endpoint for the corresponding service. +# Deployment seq. diagram + +```mermaid +sequenceDiagram + %% Alice->>+John: Hello John, how are you? + %% Alice->>+John: John, can you hear me? + %% John-->>-Alice: Hi Alice, I can hear you! + %% John-->>-Alice: I feel great! + actor SysAdmin + participant deployer as ctl::deployer + participant discovery as ctl::discovery + participant wrk_mgr as ctl::worker_mgr + + participant runner as wrk::runner + participant builder as wrk::builder + participant supervisor as wrk::supervisor + + SysAdmin ->>+ deployer: New deploy request (via CLI) + deployer ->>+ discovery: Create new deployment + discovery ->>- deployer: Deployment ID + deployer ->>- SysAdmin: Deployment ID + + deployer ->>+ discovery: Fetch available workers + discovery ->>- deployer: + + deployer ->> deployer: Select worker + + deployer -->>+ runner: Start deployment + + runner ->>+ builder: Execute build script + builder ->>- runner: Report status + + alt build failed + runner -->> wrk_mgr: Report build failure + wrk_mgr -->> discovery: Record build failed status + else build ok + runner ->>+ supervisor: Start service + supervisor ->>- runner: Report status + + alt service started + runner -->> wrk_mgr: Report service running + wrk_mgr -->> discovery: Record running status + + opt service crashed + runner -->> wrk_mgr: Report failed + wrk_mgr -->> discovery: Record failed status + end + else service failed to start + runner -->> wrk_mgr: Report failure + wrk_mgr -->> discovery: Record failed status + end + end +``` + # TODO - Add sequence diagrams for communication patterns.