PRO Lab Series 10: Embodied Control — LeRobot Policies, Simulation & Physical Safety Gates
This dedicated PRO lab series harnesses Hugging Face PRO capabilities (8× ZeroGPU priority, Inference Providers routing, private datasets, and Spaces Dev Mode) across ten reproducible exercises—combining Debian 12/13 scripts with multi-stage non-root OCI containers that bind the NVIDIA Container Toolkit strictly where GPU acceleration is used.
Authored by Imad Soltani (human author, sole release authority) with Antigravity (Google DeepMind, non-human co-author).
1. Series Architecture, Hardware & Hugging Face Curriculum Linkage
- Permanent Series ID:
LAB-PRO-10· Cost / Tier (11E): Hugging Face PRO ($9/mo — 8× ZeroGPU, $2/mo credits, 1 TB private storage, Spaces Dev Mode) - Hardware Profile (10A): NVIDIA GPU >= 16 GB VRAM (or Hugging Face PRO 8× ZeroGPU H200/A100), 4+ vCPU, 16 GB RAM, 30 GB disk — NVIDIA Container Toolkit required ONLY for local NVIDIA GPU execution
- Hugging Face Learn (10F): https://huggingface.co/learn/deep-rl-course
- Hugging Face Docs (10F): https://huggingface.co/docs/lerobot/index
- GitHub Source Directory: github.com/ximad/solarisk/lab/v116.0/pro/series_10_pro-robotics-rl-lerobot-safety
7. Self-Check Comprehension Gate
Why does this lab series enforce a non-root multi-stage OCI container and idempotent Debian setup?
Multi-stage builds strip compilers and build secrets from the runtime layer, non-root UID execution limits blast radius if a dependency or prompt-triggered tool misbehaves, and idempotent Debian setup ensures repeatable runs across workstations and CI without hidden host drift.
How does the 30/30/30/10 progression split map to operational readiness?
Labs 01–03 establish clean data and deterministic baselines (Beginner), Labs 04–06 integrate adaptation, paired evaluation, and OCI packaging (Practitioner), Labs 07–09 harden latency, security boundaries, and governance compliance (Expert), and Lab 10 consolidates artifacts and primary documentation links (Capstone).
Complete 10-Lab Progression (30% Beginner · 30% Practitioner · 30% Expert · 10% Capstone & Resources)
| ID (10B) | Series-Specific Lab Module | Level | Duration | Cost / Tier | Expected Result & Capability (10F) |
|---|---|---|---|---|---|
| LAB-PRO-10-01 | LeRobot Dataset Schema (Parquet + Video Synchronization) | Beginner | 35 min | PRO ($9/mo) | Inspect synchronized joint-state, action, and multi-camera episode shards on Hub Reader capability (10F): Design, verify, and deploy reproducible 'LeRobot Dataset Schema (Parquet + Video Synchronization)' workflows grounded in https://huggingface.co/learn/deep-rl-course and https://huggingface.co/docs/lerobot/index. |
| LAB-PRO-10-02 | Imitation Learning: Action Chunking with Transformers (ACT) | Beginner | 40 min | PRO ($9/mo) | Understand temporal ensembling and action-chunk horizon trade-offs Reader capability (10F): Design, verify, and deploy reproducible 'Imitation Learning: Action Chunking with Transformers (ACT)' workflows grounded in https://huggingface.co/learn/deep-rl-course and https://huggingface.co/docs/lerobot/index. |
| LAB-PRO-10-03 | Diffusion Policy for Continuous Visuomotor Control | Beginner | 45 min | PRO ($9/mo) | Model multimodal human demonstration trajectories without mode averaging Reader capability (10F): Design, verify, and deploy reproducible 'Diffusion Policy for Continuous Visuomotor Control' workflows grounded in https://huggingface.co/learn/deep-rl-course and https://huggingface.co/docs/lerobot/index. |
| LAB-PRO-10-04 | Training Embodied Policies on PRO GPU / ZeroGPU | Practitioner | 50 min | PRO ($9/mo) | Run reproducible simulation policy training with SafeTensors checkpointing Reader capability (10F): Design, verify, and deploy reproducible 'Training Embodied Policies on PRO GPU / ZeroGPU' workflows grounded in https://huggingface.co/learn/deep-rl-course and https://huggingface.co/docs/lerobot/index. |
| LAB-PRO-10-05 | Sim-to-Real Domain Randomization Benchmarks | Practitioner | 55 min | PRO ($9/mo) | Measure policy robustness across lighting, friction, and camera-pose perturbations Reader capability (10F): Design, verify, and deploy reproducible 'Sim-to-Real Domain Randomization Benchmarks' workflows grounded in https://huggingface.co/learn/deep-rl-course and https://huggingface.co/docs/lerobot/index. |
| LAB-PRO-10-06 | Deterministic OCI Simulation Container (GPU + Headless EGL) | Practitioner | 60 min | PRO ($9/mo) | Run headless robotics evaluation under Docker, containerd, and CRI-O with NVIDIA Toolkit Reader capability (10F): Design, verify, and deploy reproducible 'Deterministic OCI Simulation Container (GPU + Headless EGL)' workflows grounded in https://huggingface.co/learn/deep-rl-course and https://huggingface.co/docs/lerobot/index. |
| LAB-PRO-10-07 | Control-Loop Latency & Action-Horizon Profiling | Expert | 65 min | PRO ($9/mo) | Verify deterministic 30–50 Hz inference jitter bounds before hardware deployment Reader capability (10F): Design, verify, and deploy reproducible 'Control-Loop Latency & Action-Horizon Profiling' workflows grounded in https://huggingface.co/learn/deep-rl-course and https://huggingface.co/docs/lerobot/index. |
| LAB-PRO-10-08 | Hardware-Enforced Torque, Workspace & E-Stop Safety Gates | Expert | 70 min | PRO ($9/mo) | Implement deterministic kinematic safety shields independent of neural policy weights Reader capability (10F): Design, verify, and deploy reproducible 'Hardware-Enforced Torque, Workspace & E-Stop Safety Gates' workflows grounded in https://huggingface.co/learn/deep-rl-course and https://huggingface.co/docs/lerobot/index. |
| LAB-PRO-10-09 | EU Machinery Regulation & AI Act Annex I High-Risk Audit | Expert | 75 min | PRO ($9/mo) | Map embodied robotics safety logs to EU AI Act product-embedded high-risk obligations Reader capability (10F): Design, verify, and deploy reproducible 'EU Machinery Regulation & AI Act Annex I High-Risk Audit' workflows grounded in https://huggingface.co/learn/deep-rl-course and https://huggingface.co/docs/lerobot/index. |
| LAB-PRO-10-10 | Capstone: Auditable Embodied Control Stack & LeRobot Docs | Capstone & Resources (10%) | 45 min | PRO ($9/mo) | Deliver safety-shield code, sim benchmarks, and official LeRobot documentation Reader capability (10F): Design, verify, and deploy reproducible 'Capstone: Auditable Embodied Control Stack & LeRobot Docs' workflows grounded in https://huggingface.co/learn/deep-rl-course and https://huggingface.co/docs/lerobot/index. |
Debian 12/13 Commented Idempotent Setup & Domain Python Runner (10C)
setup.sh (Debian 12/13 Bash)
#!/usr/bin/env bash
# ==============================================================================
# SolarisK Lab Series Setup — LAB-PRO-10 (series_10_pro-robotics-rl-lerobot-safety)
# Target OS: Latest stable Debian Linux (Debian 12 Bookworm / 13 Trixie)
# Idempotent setup with inline comments & explicit destructive-reset warning.
# ==============================================================================
set -euo pipefail
# Isolated virtual environment path so Debian system Python stays untouched
LAB_VENV="${HOME}/.venvs/solarisk-lab-pro-10"
# Warn explicitly before destructive environment reset (--reset)
if [[ "${1:-}" == "--reset" ]]; then
echo "[WARNING] Destructive reset: deleting ${LAB_VENV} in 5s (Ctrl+C to cancel)..."
sleep 5
rm -rf "${LAB_VENV}"
fi
# Confirm Debian python3 & venv tooling exist before creating environment
if ! command -v python3 >/dev/null 2>&1; then
echo "[ERROR] Missing python3. Install on Debian: sudo apt-get update && sudo apt-get install -y python3 python3-venv python3-pip"
exit 1
fi
# Verify NVIDIA driver & Container Toolkit (required ONLY for local GPU execution)
if command -v nvidia-smi >/dev/null 2>&1; then
nvidia-smi --query-gpu=name,memory.total --format=csv,noheader
else
echo '[INFO] No local NVIDIA GPU detected — use Hugging Face PRO ZeroGPU Spaces or Inference Providers.'
fi
# Idempotently create virtual environment
if [[ ! -d "${LAB_VENV}" ]]; then
echo "[SETUP] Creating Debian virtual environment at ${LAB_VENV}..."
python3 -m venv "${LAB_VENV}"
fi
# Install series-specific packages cleanly inside the isolated virtualenv
"${LAB_VENV}/bin/pip" install --quiet --upgrade pip
"${LAB_VENV}/bin/pip" install --quiet gymnasium numpy huggingface_hub safetensors
echo "[READY] Activate: source ${LAB_VENV}/bin/activate"
echo "[READY] Run self-test: ${LAB_VENV}/bin/python3 run_lab.py --check"
run_lab.py (Executable Series-Specific Python Kernel)
#!/usr/bin/env python3
"""
SolarisK Executable Lab Runner — LAB-PRO-10: PRO Lab Series 10: Embodied Control — LeRobot Policies, Simulation & Physical Safety Gates
Hugging Face Learn: https://huggingface.co/learn/deep-rl-course
Hugging Face Docs: https://huggingface.co/docs/lerobot/index
"""
import argparse, json, os, platform
from datetime import datetime, timezone
def run_domain_demo() -> dict:
"""Series-specific reproducible verification kernel (runs offline or online)."""
out = {"series_id": "LAB-PRO-10", "tier": "PRO", "uses_gpu": True}
try:
# Domain kernel preview (safe offline fallback if optional weights/packages not yet pulled)
exec_ns = {}
code = "import numpy as np\njoint_cmd = np.array([0.45, -1.85, 0.22])\nlimits = np.array([1.20, 1.20, 1.20])\nsafe_cmd = np.clip(joint_cmd, -limits, limits)\nprint({'raw_rad': joint_cmd.tolist(), 'clamped_safe_rad': safe_cmd.tolist(), 'shield_triggered': bool(np.any(joint_cmd != safe_cmd))})"
exec(compile(code, "<LAB-PRO-10>", "exec"), exec_ns)
out["kernel_status"] = "EXECUTED"
except Exception as exc:
out["kernel_status"] = "DEFERRED_INSTALL"
out["hint"] = f"Run ./setup.sh first to install [gymnasium numpy huggingface_hub safetensors]: {exc}"
return out
def main() -> None:
parser = argparse.ArgumentParser(description="SolarisK LAB-PRO-10 Reproducible Runner")
parser.add_argument("--check", action="store_true", help="Verify Debian/OCI runtime & run domain kernel")
args = parser.parse_args()
report = {
"series_id": "LAB-PRO-10",
"timestamp_utc": datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ"),
"python": platform.python_version(),
"os": platform.platform(),
"hf_token_present": bool(os.environ.get("HF_TOKEN")),
"hf_learn": "https://huggingface.co/learn/deep-rl-course",
"hf_docs": "https://huggingface.co/docs/lerobot/index",
"domain_check": run_domain_demo(),
}
print(json.dumps(report, indent=2, ensure_ascii=False))
if __name__ == "__main__":
main()
OCI Multi-Stage Non-Root Container & Docker / containerd / CRI-O Runbook (10D)
Containerfile (opencontainers.org)
# syntax=docker/dockerfile:1
# OCI-compliant multi-stage non-root Containerfile for LAB-PRO-10 (opencontainers.org)
FROM python:3.11-slim-bookworm AS builder
WORKDIR /build
RUN python3 -m venv /opt/venv && /opt/venv/bin/pip install --no-cache-dir --upgrade pip gymnasium numpy huggingface_hub safetensors
FROM nvidia/cuda:12.4.1-runtime-ubuntu22.04 AS runtime
LABEL org.opencontainers.image.title="SolarisK LAB-PRO-10" \
org.opencontainers.image.source="https://github.com/ximad/solarisk/tree/main/lab/v116.0/pro/series_10_pro-robotics-rl-lerobot-safety" \
org.opencontainers.image.authors="Imad Soltani <bsdimad@gmail.com>"
ENV NVIDIA_VISIBLE_DEVICES=all NVIDIA_DRIVER_CAPABILITIES=compute,utility
RUN groupadd -g 10001 solarisk && useradd -u 10001 -g 10001 -m -s /usr/sbin/nologin solarisk
COPY --from=builder /opt/venv /opt/venv
WORKDIR /app
COPY --chown=10001:10001 run_lab.py /app/run_lab.py
ENV PATH="/opt/venv/bin:$PATH" HF_HOME="/tmp/hf_cache" PYTHONDONTWRITEBYTECODE=1
USER 10001:10001
ENTRYPOINT ["python3", "/app/run_lab.py"]
CMD ["--check"]
Docker, containerd (nerdctl), and CRI-O Commands
# GPU lab: NVIDIA Container Toolkit (nvidia-ctk) is required ONLY for local NVIDIA GPU execution.
# 1. Docker (OCI-compliant multi-stage non-root image)
docker build -f Containerfile -t solarisk/lab-pro-10:latest .
docker run --rm --gpus all --read-only --tmpfs /tmp -e HF_TOKEN="$HF_TOKEN" solarisk/lab-pro-10:latest
# 2. containerd via nerdctl (rootless OCI workflow)
nerdctl build -f Containerfile -t solarisk/lab-pro-10:latest .
nerdctl run --rm --gpus all --read-only --tmpfs /tmp -e HF_TOKEN="$HF_TOKEN" solarisk/lab-pro-10:latest
# 3. CRI-O / Podman (Kubernetes CRI-O node verification via crictl / podman)
podman build -f Containerfile -t localhost/solarisk/lab-pro-10:latest .
podman run --rm --device nvidia.com/gpu=all --userns=keep-id -e HF_TOKEN="$HF_TOKEN" localhost/solarisk/lab-pro-10:latest
# On CRI-O cluster nodes, pull the OCI image and inspect pod sandbox via: crictl images | grep lab-pro-10Troubleshooting: Two Most Common Errors & Deterministic Fixes (10E)
Reduce micro-batch size, enable gradient checkpointing or 4-bit NF4 quantization, verify `nvidia-smi` on Debian 12/13, and confirm `nvidia-ctk runtime configure` before launching Docker, containerd, or CRI-O.
Run `./setup.sh --reset` to rebuild the isolated `.venv`, export a fine-grained `HF_TOKEN` with read permission, and accept the upstream Model Card license on huggingface.co.
Living Semantics Chapter — Human Glossary & Machine-Readable RAG Index (12A–12D)
| Term / Concept (12A–12C) | Category | Explanation & Operational Boundary |
|---|---|---|
| Action Chunking with Transformers (ACT) | Robotics | Imitation-learning architecture predicting sequences of k future joint actions with temporal ensembling to eliminate compounding error. |
| Sim-to-Real Gap | Robotics | Performance degradation when policies trained in physics simulators encounter unmodeled real-world friction, optics, or sensor noise. |
| Deterministic Kinematic Safety Shield | Safety | Non-learned runtime envelope clamping joint angles, velocities, and torques before actuators execute neural commands. |
| Hugging Face Hub Token (`HF_TOKEN`) | Security | Fine-grained bearer token authorizing read/write access to gated weights, private datasets, and Inference Providers without hardcoding secrets. |
| OCI Multi-Stage Non-Root Image | Infrastructure | Open Container Initiative (`opencontainers.org`) image discarding build compilers and running strictly under unprivileged UID `10001`. |
| 30 / 30 / 30 / 10 Mastery Split | Pedagogy | Curriculum pacing allocating 30% Beginner, 30% Practitioner, 30% Expert labs, plus 10% Capstone synthesis and verified HF Learn/Docs URLs. |
| Idempotent Debian Setup | Reproducibility | Setup discipline allowing `setup.sh` to re-run safely on Debian 12/13 with explicit destructive warnings (`--reset`) and isolated `.venv`. |
No comments:
Post a Comment