pub enum Bootstrap {
Proc {
proc_id: ProcId,
backend_addr: ChannelAddr,
callback_addr: ChannelAddr,
socket_dir_path: PathBuf,
config: Option<Attrs>,
},
Host {
addr: ChannelAddr,
command: Option<BootstrapCommand>,
config: Option<Attrs>,
exit_on_shutdown: bool,
},
V0ProcMesh {
config: Option<Attrs>,
},
}Expand description
Bootstrap configures how a mesh process starts up.
Both Proc and Host variants may include an optional
configuration snapshot (hyperactor_config::Attrs). This
snapshot is serialized into the bootstrap payload and made
available to the child. Interpretation and application of that
snapshot is up to the child process; if omitted, the child falls
back to environment/default values.
Variants§
Proc
Bootstrap as a “v1” proc
Fields
backend_addr: ChannelAddrThe backend address to which messages are forwarded.
See hyperactor::host for channel topology details.
callback_addr: ChannelAddrThe callback address used to indicate successful spawning.
Host
Bootstrap as a “v1” host bootstrap. This sets up a new Host,
managed by a crate::host_mesh::host_agent::HostAgent.
Fields
addr: ChannelAddrThe address on which to serve the host.
command: Option<BootstrapCommand>If specified, use the provided command instead of
BootstrapCommand::current.
V0ProcMesh
Bootstrap as a legacy “v0” proc.
Implementations§
Source§impl Bootstrap
impl Bootstrap
Sourcepub fn get_from_env() -> Result<Option<Self>>
pub fn get_from_env() -> Result<Option<Self>>
Get a bootstrap configuration from the environment; returns None
if the environment does not specify a boostrap config.
Sourcepub fn to_env(&self, cmd: &mut Command)
pub fn to_env(&self, cmd: &mut Command)
Inject this bootstrap configuration into the environment of the provided command.
Sourcepub async fn bootstrap(self) -> Result<i32>
pub async fn bootstrap(self) -> Result<i32>
Bootstrap this binary according to this configuration. This runs until all processes are ready to exit, or returns an error. The Ok value is the exit code that should be used.
Sourcepub async fn bootstrap_or_die(self) -> !
pub async fn bootstrap_or_die(self) -> !
A variant of bootstrap that logs the error and exits the process
if bootstrapping fails.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Bootstrap
impl<'de> Deserialize<'de> for Bootstrap
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for Bootstrap
impl !RefUnwindSafe for Bootstrap
impl Send for Bootstrap
impl Sync for Bootstrap
impl Unpin for Bootstrap
impl !UnwindSafe for Bootstrap
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<A, M> Handler<IndexedErasedUnbound<M>> for A
impl<A, M> Handler<IndexedErasedUnbound<M>> for A
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].