pub enum Bootstrap {
Proc {
proc_id: ProcId,
backend_addr: ChannelAddr,
callback_addr: ChannelAddr,
config: Option<Attrs>,
},
Host {
addr: ChannelAddr,
command: Option<BootstrapCommand>,
config: Option<Attrs>,
},
V0ProcMesh,
}
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
“v1” proc bootstrap
Fields
backend_addr: ChannelAddr
The backend address to which messages are forwarded.
See hyperactor::host
for channel topology details.
callback_addr: ChannelAddr
The callback address used to indicate successful spawning.
Host
Host bootstrap. This sets up a new Host
, managed by a
crate::v1::host_mesh::mesh_agent::HostMeshAgent
.
Fields
addr: ChannelAddr
The address on which to serve the host.
command: Option<BootstrapCommand>
If specified, use the provided command instead of
BootstrapCommand::current
.
V0ProcMesh
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) -> Error
pub async fn bootstrap(self) -> Error
Bootstrap this binary according to this configuration. This either runs forever, or returns an error.
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