Skip to main content

Module deploy

Module deploy 

Source

StructsΒ§

DeployManifest πŸ”’
PackageEntry πŸ”’
Spawned πŸ”’

ConstantsΒ§

CMD_ACTIVATE πŸ”’
CMD_DEACTIVATE πŸ”’
CMD_INIT πŸ”’
CMD_SHUTDOWN πŸ”’
DEPLOY_CONSUMER_ID πŸ”’
DRIVER_INIT_TIMEOUT πŸ”’
DRIVER_REGISTER_TIMEOUT πŸ”’

FunctionsΒ§

call_driver_cmd πŸ”’
Issue one Driver(cmd) RPC against a freshly-connected channel, then release the channel. Returns the response’s state string on success; bail-errors when ok=false or the RPC itself fails. Used by the boot path for both CMD_INIT and CMD_ACTIVATE, with identical timeout / channel hygiene.
check_prerequisites πŸ”’
Boot-time prerequisites check:
component_records πŸ”’
contract_id_to_service_name πŸ”’
Mirrors robonix_codegen::contract_gen::contract_id_to_service_name. Uniform PascalCase: robonix/primitive/chassis/driver β†’ RobonixPrimitiveChassisDriver. No prefix stripping. Full gRPC service path: /robonix.contracts.<this>/Driver.
execute
expand_env_in_str πŸ”’
expand_yaml πŸ”’
log_path πŸ”’
persist_state πŸ”’
port_is_free πŸ”’
Probe a host:port. Returns Ok(()) when nothing is listening (we can safely bind), Err describing the live owner otherwise. This is a race-prone pre-check (someone else can grab the port between probe and spawn) but in practice the failure mode it catches β€” a stale previous-boot daemon β€” has been alive for minutes, not seconds, so a single connect attempt is enough.
require_system_args πŸ”’
Render a one-line β€œwhat is this binary doing” string for the boot log. Pulls out the high-signal flags (port, vlm model+host) and drops noisy ones (–capabilities, –log, raw API keys). Per-binary required-arg sanity check, run before spawning.
resolve_entry_path πŸ”’
Compute a PackageEntry’s expected on-disk path. PURE β€” no I/O, no logging, no cloning. path: entries land at manifest_dir/path; url: entries land at cache_root/<name> (whether or not it’s been cloned yet). Use entry_path_exists_on_disk to check presence; use the public cmd::fetch::clone_remote_packages (called from rbnx build) to actually populate the cache.
short_label πŸ”’
Poll atlas until a provider NOT in before appears. Returns the new provider_id plus an optional driver_contract_id if the new provider declared a */driver gRPC capability (signal to the caller that Driver(CMD_INIT) lifecycle should run). Strip the leading <component>_ from the boot-log pkg_label. system_memory β†’ memory; primitive_tiago_chassis β†’ tiago_chassis. Keeps boot-output columns narrow (the section header above already said which class the entry belongs to).
spawn_and_init πŸ”’
Spawn one primitive / service package and wait for it to register at least one capability with atlas. If the new provider has a */driver gRPC capability, also drive Driver(CMD_INIT) and pass the entry’s config: as config_json. Packages that don’t declare a driver (e.g. system packages or new packages that just don’t need init-time wiring) are deployed as-is once their first provider appears in atlas.
spawn_package πŸ”’
spawn_system_binary πŸ”’
system_boot_detail πŸ”’
system_cli_args πŸ”’
system_listen πŸ”’
Translate a system.<name>: block into CLI args for the corresponding Rust binary. Per-binary mapping kept narrow β€” adding a new flag means touching exactly this function plus the binary’s clap struct.
wait_for_registration πŸ”’
with_spinner πŸ”’
Run fut while animating the boot spinner so the user sees the [ β ™ ] name msg_prefix N.Ns line update steadily even when the underlying RPC takes a while (Driver(CMD_INIT) for sensor-warm-up packages routinely sits at 30+ seconds). Without this the line goes silent right after wait_for_registration finishes and rbnx looks hung between OK lines.