swarm daemons: opt-in /healthz and /readyz listener, and /readyz on the controller
This commit is contained in:
parent
377bc1d5df
commit
c21b158884
1 changed files with 787 additions and 26 deletions
|
|
@ -95,6 +95,11 @@ async fn main() -> Result<()> {
|
|||
let full = format!("{PREFIX}_{name}");
|
||||
std::env::var(&full).with_context(|| format!("{full} is unset"))
|
||||
};
|
||||
let health = swarm_secret_client::health::Health::from_env(
|
||||
&format!("{PREFIX}_HEALTH_ADDR"),
|
||||
stop.clone(),
|
||||
)
|
||||
.await?;
|
||||
let client_id = var("OIDC_CLIENT_ID")?;
|
||||
let builder = Arc::new(nix_build::Builder {
|
||||
nix: PathBuf::from(var("NIX")?),
|
||||
|
|
@ -134,6 +139,7 @@ async fn main() -> Result<()> {
|
|||
.map(PathBuf::from),
|
||||
})
|
||||
.await?;
|
||||
swarm_queue_client::ready_when_connected(&health, &queue);
|
||||
let requests = queue
|
||||
.queue_subscribe(SUBJECT, QUEUE_GROUP.to_owned())
|
||||
.await
|
||||
|
|
@ -176,7 +182,7 @@ async fn main() -> Result<()> {
|
|||
serve_meta_builds(&queue, &publisher, Store, &builder, &slot, &metrics).await?;
|
||||
|
||||
answer_builds(
|
||||
requests.take_until(stop.clone()),
|
||||
health.beating(requests.take_until(stop.clone())),
|
||||
publisher,
|
||||
Store,
|
||||
builder,
|
||||
|
|
|
|||
Loading…
Reference in a new issue