Watch
0
0
Fork
You've already forked hyperhive
0

swarm daemons: opt-in /healthz and /readyz listener, and /readyz on the controller

This commit is contained in:
atlas 2026-11-18 13:52:36 +01:00 • committed by mara
commit c21b158884

View file

@ -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,