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
|
|
@ -54,6 +54,11 @@ async fn serve() -> 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 trampoline =
|
||||
std::env::current_exe().context("finding this binary for the child trampoline")?;
|
||||
|
|
@ -90,11 +95,14 @@ async fn serve() -> Result<()> {
|
|||
.map(PathBuf::from),
|
||||
})
|
||||
.await?;
|
||||
let mut requests = queue
|
||||
.queue_subscribe(SUBJECT, QUEUE_GROUP.to_owned())
|
||||
.await
|
||||
.with_context(|| format!("subscribing to {SUBJECT}"))?
|
||||
.take_until(stop.clone());
|
||||
swarm_queue_client::ready_when_connected(&health, &queue);
|
||||
let mut requests = health.beating(
|
||||
queue
|
||||
.queue_subscribe(SUBJECT, QUEUE_GROUP.to_owned())
|
||||
.await
|
||||
.with_context(|| format!("subscribing to {SUBJECT}"))?
|
||||
.take_until(stop.clone()),
|
||||
);
|
||||
tracing::info!(subject = SUBJECT, "review classifier: awaiting try-outs");
|
||||
|
||||
let models = std::sync::Arc::new(models);
|
||||
|
|
|
|||
Loading…
Reference in a new issue