bge_m3_embedding_server/bootstrap.rs
1// Copyright (c) 2026 J. Patrick Fulton
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15//! Server-startup orchestration: routing, workspace budget, readiness probe,
16//! and the background probe task that fits the cost model on first start.
17//!
18//! Submodules:
19//! - `router`: axum `Router` construction + tracing/request-id layers.
20//! - `budget`: pure workspace-budget arithmetic (`compute_workspace_budget`).
21//! - `readiness`: the foreground readiness probe (`run_readiness_probe`,
22//! `run_readiness_checks_and_open`).
23//! - `probe_task`: the background probe task (`spawn_probe_task`) used when
24//! the cost model has not been overridden and no EFS cache hit was found.
25
26mod budget;
27mod probe_task;
28mod readiness;
29mod router;
30
31pub use readiness::run_readiness_probe;
32pub use router::build_router;
33
34#[cfg(test)]
35mod tests;