MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / run_external

Function run_external

guest-agent/src/server.rs:135–153  ·  view source on GitHub ↗
(state: AppState, figment: Figment)

Source from the content-addressed store, hash-verified

133}
134
135async fn run_external(state: AppState, figment: Figment) -> Result<()> {
136 let rocket = rocket::custom(figment)
137 .mount("/", http_routes::external_routes(state.config()))
138 .mount(
139 "/prpc",
140 ra_rpc::prpc_routes!(AppState, ExternalRpcHandler, trim: "Worker."),
141 )
142 .attach(AdHoc::on_response("Add app version header", |_req, res| {
143 Box::pin(async move {
144 res.set_raw_header("X-App-Version", app_version());
145 })
146 }))
147 .manage(state);
148 let _ = rocket
149 .launch()
150 .await
151 .map_err(|err| anyhow!("Failed to ignite rocket: {err}"))?;
152 Ok(())
153}
154
155async fn run_guest_api(state: AppState, figment: Figment) -> Result<()> {
156 let rocket = rocket::custom(figment)

Callers

nothing calls this directly

Calls 3

external_routesFunction · 0.85
app_versionFunction · 0.70
configMethod · 0.45

Tested by

no test coverage detected