Expand description
RL project bundle packaging + upload (LAB-2768)
mecha10 build rl packages a project’s configs/rl/ (job/task definitions - jobs/*.yml,
tasks/*/task.json) and configs/simulation/{models,environments} (the assets those jobs
reference) into a single tar.gz and uploads it, scoped by the project’s registered
robot_id, via the endpoint LAB-2767 adds to mecha10-api. mecha10 run rl (on the trainer
host) downloads and unpacks this same bundle before training starts - see “RL: Vision and
Phased Roadmap” doc.
This bundle is deliberately separate from mecha10 config push’s configs/ archive
(mecha10_robot_config::build_configs_archive): that one syncs the whole configs/
directory to the robot-config KV service for the robot/launcher to consume at runtime, while
this one is a purpose-built blob (Minio-backed via LAB-2767, not the KV store) for exactly
what a remote/Kestra-dispatched training run needs - replacing the old simulation-assets/*
KV convention mecha10 sim push/pull used for this purpose (see LAB-2767’s context: that
mechanism is real, working code, but nothing downstream ever reads what it pushes today).
Only models/environments ride along from configs/simulation/ - not images (the flat
billboard-image pool environment.json/task.json objects reference by path elsewhere,
already synced to the robot separately via mecha10 config push) - matching this ticket’s
(LAB-2768) explicit requirement.
Functions§
- build_
rl_ bundle_ archive - Build the RL project bundle archive (tar.gz) for
project_root, orOk(None)if the project has neither aconfigs/rl/directory nor anyconfigs/simulation/{models,environments}content to package - callers should skip the upload step entirely in that case rather than upload an empty archive. - download_
rl_ bundle - Download the RL project bundle previously uploaded for
robot_idviaupload_rl_bundle- LAB-2769’s download side of LAB-2767’s endpoint, called bymecha10 run rl --download-bundle-onlyon the trainer host. Authenticated identically toupload_rl_bundle(Authorization: Bearer <api_key>+X-User-ID); returns the raw tar.gz bytes forunpack_rl_bundle_archiveto unpack. - rl_
bundle_ tarball_ name - Tarball filename for an RL project bundle - matches the
<name>-v<version>-<suffix>.tar.gzconventionscripts/release/build/package-templates.sh(mecha10-v{VERSION}-templates.tar.gz) andhandlers::upload::handle_upload({name}-v{version}-{platform}-{arch}.tar.gz) already use for versioned release archives. - unpack_
rl_ bundle_ archive - Unpack an RL project bundle archive (as built by
build_rl_bundle_archiveand returned bydownload_rl_bundle) intodest_root- entries land atdest_root/configs/rl/...and/ordest_root/configs/simulation/{models,environments}/..., mirroring the project-relative layout the archive was built from (same “archive root mirrors project layout” convention asmecha10_robot_config::extract_configs_archive). Overwrites files already present at the destination; does not delete anything at the destination that’s absent from the archive. - upload_
rl_ bundle - Upload a pre-built RL project bundle archive for
robot_id, authenticated the same way every other mecha10 CLI command talks to mecha10-api (Authorization: Bearer <api_key>+X-User-ID, seehandlers::upload::upload_to_registry/services::publish_status).