hyperactor_mesh/config_dump.rs
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 * All rights reserved.
4 *
5 * This source code is licensed under the BSD-style license found in the
6 * LICENSE file in the root directory of this source tree.
7 */
8
9//! Config inspection messages for remote per-proc configuration dumps.
10//!
11//! See CFG-* invariants in `admin_tui/main.rs`.
12
13use hyperactor::HandleClient;
14use hyperactor::Handler;
15use hyperactor::RefClient;
16use serde::Deserialize;
17use serde::Serialize;
18use typeuri::Named;
19
20/// Result of a config dump request — the effective configuration entries
21/// from the target process.
22#[derive(Debug, Clone, Serialize, Deserialize, Named)]
23pub struct ConfigDumpResult {
24 pub entries: Vec<hyperactor_config::global::ConfigEntry>,
25}
26wirevalue::register_type!(ConfigDumpResult);
27
28/// Request a config dump from a proc's process-global config state.
29///
30/// Sent to ProcAgent (worker procs) or HostAgent (service proc) by the
31/// admin HTTP bridge. The handler calls `hyperactor_config::global::config_entries()`
32/// and replies with the snapshot.
33#[derive(Debug, Serialize, Deserialize, Named, Handler, HandleClient, RefClient)]
34pub struct ConfigDump {
35 #[reply]
36 pub result: hyperactor::reference::OncePortRef<ConfigDumpResult>,
37}
38wirevalue::register_type!(ConfigDump);