Skip to main content

Module binary_manager

Module binary_manager 

Source
Expand description

Binary Manager service for downloading and caching node binaries via mecha10-api

This service implements the Node Binary Distribution architecture, providing:

  • Downloading pre-built node binaries via the public mecha10-api downloads proxy (GET /api/downloads/node/{name}), never the private Minio instance directly
  • Caching binaries to ~/.mecha10/bin/
  • Platform detection and target triple resolution

There is a single resolution path: a cached binary if one already exists, otherwise a download via mecha10-api. There is no cargo install fallback — an unsupported platform or a failed download is a hard, immediate error naming what was tried and why it failed.

§Design

  • Binaries are downloaded from {mecha10_api}/downloads/node/{node}?os=..&arch=..&version=..
  • Binary naming: {node}-{version}-{target}.tar.gz
  • Cached to: ~/.mecha10/bin/{node}-{version}-{target}
  • Symlink created: ~/.mecha10/bin/{node} -> latest version

§Usage

use mecha10_deploy::services::BinaryManager;

let manager = BinaryManager::new()?;

// Resolve binary path (downloads if needed)
let path = manager.resolve("speaker").await?;

// Execute the binary
std::process::Command::new(&path).spawn()?;

Structs§

BinaryManager