mirror of
https://github.com/DeeJanuz/frametop.git
synced 2026-10-06 07:00:14 +02:00
hands/rec/validate.py (standard library; Linux and Windows, Python 3.12+) checks an export before upload and when it's received: SHA256SUMS, an allow-list of files, the manifest's schema and keys, the consent version, a uuid4 contributor, no identifying fields in calibration.json or device.json, every sets.bin.zst decompressed to its end as a stream with each FHSET01 header checked against the manifest, jsonl lines, the total size. It decompresses with compression.zstd, zstandard or the zstd program. validate.py DIR [--json]. hands/rec/hub.py uploads an export with huggingface_hub, as a pull request to contributions/<contributor>/<session>: validate first, refuse a repeat of the same export, check the login (whoami) and access (auth_check), upload_folder(create_pr=True) with the manifest summary as the description, then record the PR under "uploads" in session.json. Errors are explained (terms not accepted, not found, 401/403, network). --dry-run makes no network calls. FT_HANDREC_DATASET overrides HF_DATASET (DeeJanuz/frametop-hands); while the texts are drafts a real upload needs FT_HANDREC_ALLOW_UPLOAD=1. The Upload page shows the login with "Check again" and how to run hf auth login in a terminal (the token never enters the window), then Upload with a phase, progress and Cancel (hub.py as a child process), the PR link, and a warning for an export uploaded before. The manual command stays as the fallback. ft-handrec --hub-dry-run. session.py also saves device.json: cv.cad_from_cal and head from /persist/device_config.json, the labeller's shape, nothing identifying; export copies it. Session ids with a -N suffix are accepted everywhere. hands/rec/rehearse.sh runs it all without the headset: ft-ringplay plays 30 s of a capture into a ring, session.py records a short test script with ft-handpanel --no-vr and a tracker, then export, validate and a dry-run upload (--repo ID uploads for real). It runs in one frame-job scope, deletes its data and stops its processes, also on Ctrl+C. hands/rec/tests/test_validate.py covers good and broken exports and hub.py without the network. The dev container gains python3-huggingface-hub. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
57 lines
2.9 KiB
Bash
Executable File
57 lines
2.9 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Create or update the "dev" build container on the Steam Frame (Fedora 44 toolbox,
|
|
# aarch64, via distrobox). Safe to re-run: it only creates what's missing and dnf
|
|
# skips installed packages. This package list is the source of truth for rebuilding
|
|
# the container.
|
|
# Usage: setup/dev-container.sh (on the Frame, or from a PC over SSH)
|
|
# Needs distrobox in ~/.local/bin on the Frame (see the top-level README).
|
|
set -euo pipefail
|
|
|
|
root=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
|
|
. "$root/scripts/_env.sh"
|
|
|
|
packages=(
|
|
# toolchains
|
|
gcc gcc-c++ clang clang-devel cmake meson ninja-build make pkgconf-pkg-config cargo rust git
|
|
# libraries for Frametop's native pieces
|
|
pipewire-devel libxkbcommon-devel libinput-devel systemd-devel dbus-devel libdrm-devel
|
|
mesa-libgbm-devel wayland-devel vulkan-loader-devel vulkan-headers plasma-wayland-protocols wlroots-devel
|
|
# ft_pointer SteamVR driver: static C++ runtime (the host has an older glibc)
|
|
libstdc++-static
|
|
# hand tracking (deferred: not installed by install.sh; hands/run.sh install builds it): ft-hands
|
|
# reads the calibration with jsoncpp; ft-camd runs on the host, linked statically. Its Python
|
|
# tools (hands/tools) need NumPy and OpenCV, which aren't here: Fedora's python3-opencv pulls
|
|
# in over a gigabyte (hands/README.md says how to get them)
|
|
jsoncpp-devel glibc-static
|
|
# hand recorder (hands/rec): its export compresses recordings with zstd; its Upload page and
|
|
# hub.py upload to Hugging Face with huggingface_hub (also the hf command, for hf auth login)
|
|
zstd python3-huggingface-hub
|
|
# Frametop Input Settings app (Kirigami, PySide6)
|
|
python3-pyside6 kf6-kirigami kf6-qqc2-desktop-style qt6-qtwayland breeze-icon-theme plasma-breeze
|
|
# Frametop remote desktop (VNC bridge through krdp)
|
|
krdp freerdp tigervnc-x11-server xrandr
|
|
# diagnostics and remote UI testing
|
|
wayland-utils xorg-x11-server-Xvfb ImageMagick xdotool
|
|
)
|
|
|
|
on_frame_script "$FRAME_REPO" "${packages[@]}" <<'EOF'
|
|
set -euo pipefail
|
|
repo=$1
|
|
shift
|
|
distrobox=$HOME/.local/bin/distrobox
|
|
[ -x "$distrobox" ] || { echo "distrobox not found at $distrobox (see the top-level README)" >&2; exit 1; }
|
|
if ! podman container exists dev; then
|
|
echo "creating the dev container (Fedora 44 toolbox)"
|
|
"$distrobox" create --yes --name dev --image registry.fedoraproject.org/fedora-toolbox:44
|
|
fi
|
|
"$repo/scripts/container-up.sh" # in a scope of its own, not this shell's
|
|
"$distrobox" enter dev -- bash -c '
|
|
set -euo pipefail
|
|
echo "installing ${#@} packages (already-installed ones are skipped)"
|
|
sudo -n dnf install -y -q "$@" 2>&1 | { grep -vE "is already installed|^Nothing to do|^$" || true; }
|
|
# OpenVR programs built here (the pointer helper and probe) look for the runtime at /opt/steamvr.
|
|
[ -e /opt/steamvr ] || sudo -n ln -s /run/host/opt/steamvr /opt/steamvr
|
|
echo "dev container ready: $(. /etc/os-release; echo $PRETTY_NAME), glibc $(ldd --version | head -1 | grep -oE "[0-9.]+$")"
|
|
' dev "$@"
|
|
EOF
|