Free Motion Capture for Everyone πβ¨
TypeScript
ugh builds
jonmatthis9ad53ed2cdba
diff --git a/.github/workflows/build-installers-pyinstaller.yml b/.github/workflows/build-installers-pyinstaller.ymlindex 7cccd5a0..93e8864d 100644--- a/.github/workflows/build-installers-pyinstaller.yml+++ b/.github/workflows/build-installers-pyinstaller.yml@@ -46,15 +46,16 @@ jobs:electron-arch: x64install-gpu: true- # ββ macOS Apple Silicon ββ+ # ββ macOS Apple Silicon (CPU only β macOS has no NVIDIA CUDA; the CPU+ # onnxruntime backend is the only variant, so there is no separate GPU build) ββ- os: macos-latestplatform: macosarch: arm64- variant: gpu+ variant: cpulabel: macos-arm64-apple-siliconserver-binary: freemocap_serverelectron-arch: arm64- install-gpu: true+ install-gpu: false# ββ Linux x64 CPU (fits on GitHub Releases) ββ- os: ubuntu-22.04@@ -201,26 +202,28 @@ jobs:run: uv venv# ββ Conditional dependency install ββ- # CPU variant: uv sync --group cpu β skellytracker[all-cpu] (onnxruntime CPU,- # zero NVIDIA packages β installer fits on GitHub Releases).- # CUDA variant: plain uv sync β tracker-default, which platform-switches to- # skellytracker[all-cuda] on Windows/Linux and [all-cpu] on macOS.+ # CPU variant (macOS + Windows/Linux CPU): uv sync --group cpu β+ # skellytracker[all-cpu] (onnxruntime CPU, zero NVIDIA packages).+ # CUDA variant (Windows/Linux GPU only): uv sync --group cuda β+ # skellytracker[all-cuda] (onnxruntime-gpu + NVIDIA CUDA stack).- name: Install dependencies (CPU variant)if: "!matrix.install-gpu"shell: bashrun: |echo "=== CPU BUILD β skellytracker[all-cpu] (onnxruntime CPU, zero NVIDIA packages) ==="- # Plain `uv sync` uses the tracker-default group, which resolves to- # skellytracker[all-cuda] on Linux/Windows (dragging in onnxruntime-gpu + the- # ~1.5 GB NVIDIA CUDA stack β and there are NO aarch64 GPU wheels at all).- # Force the CPU group explicitly so CPU installers stay small and arm64 resolves.+ # Runs for the macOS, Windows-CPU and Linux-CPU jobs. Plain `uv sync` would use+ # the tracker-default group, which pulls skellytracker[all-cuda] (onnxruntime-gpu+ # + the ~1.5 GB NVIDIA CUDA stack) on Windows/Linux. Force the CPU group so these+ # installers stay small, and macOS gets the CPU onnxruntime it needs.uv sync --no-default-groups --group cpu- name: Install dependencies (CUDA variant)if: matrix.install-gpurun: |- echo "=== CUDA BUILD β tracker-default (skellytracker[all-cuda] on Win/Linux, [all-cpu] on macOS) ==="- uv sync+ echo "=== CUDA BUILD β skellytracker[all-cuda] (onnxruntime-gpu + NVIDIA CUDA stack) ==="+ # Runs only for the Windows-CUDA and Linux-CUDA jobs (install-gpu: true).+ # Force the CUDA group explicitly β symmetric with the CPU step above.+ uv sync --no-default-groups --group cuda- name: Verify installation 1/3run: uv pip show freemocap@@ -463,7 +466,10 @@ jobs:VERSION="dev-${{ github.run_number }}"fi- for file in freemocap-ui/release/*/*.AppImage freemocap-ui/release/*/*.deb; do+ # CUDA app installers: Windows .exe (NSIS) + Linux .AppImage/.deb. The matching+ # CUDA server zips are pushed to R2 by the release job. (macOS is CPU-only, so+ # this step never runs there.)+ for file in freemocap-ui/release/*/*.exe freemocap-ui/release/*/*.AppImage freemocap-ui/release/*/*.deb; do[ -f "$file" ] || continueext="${file##*.}"aws s3 cp "$file" \@@ -598,6 +604,11 @@ jobs:run: find artifacts -type f | sort- name: Prepare release assets+ env:+ R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}+ R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}+ R2_ENDPOINT: ${{ secrets.R2_ENDPOINT }}+ R2_BUCKET: ${{ secrets.R2_BUCKET }}run: |mkdir -p release-assets@@ -605,33 +616,58 @@ jobs:VERSION="${GITHUB_REF#refs/tags/v}"echo "VERSION=$VERSION"- # ββ Server bundles (onedir: launcher + _internal/ tree) ββ- # Artifact directories are named server-<label>, e.g.:- # server-windows-x64-cpu, server-windows-x64-cuda,- # server-macos-arm64-apple-silicon,- # server-linux-x64-cpu, server-linux-x64-cuda, server-linux-arm64-cpu- # Each holds a PyInstaller onedir bundle β the launcher won't run without its- # _internal/ tree, so ship the whole bundle as a zip.+ # ββ ROUTING RULE (single source of truth; mirrored by isR2Hosted() in+ # freemocap-docs/src/components/download/downloads.ts) ββ+ # CUDA builds bundle the ~1.5-2 GB NVIDIA CUDA stack and exceed GitHub's 2 GB+ # per-asset limit, so EVERY CUDA asset (app installer AND server zip) is hosted+ # on Cloudflare R2. CPU/macOS builds go to the GitHub Release.+ # CUDA *app installers* were already pushed to R2 by the build job; CUDA *server+ # zips* are built and pushed here (on this Linux runner, where `zip` is reliable+ # for >2 GB archives). The size guard below enforces that nothing left in+ # release-assets/ (i.e. GitHub-bound) exceeds the limit.+ R2_READY=0+ if [ -n "$R2_ACCESS_KEY_ID" ] && [ -n "$R2_BUCKET" ]; then+ pip install --quiet awscli && R2_READY=1+ else+ echo "::warning::R2 credentials not configured β CUDA server bundles will be skipped"+ fi++ # ββ Server bundles (onedir launcher + _internal/ β single .zip) ββfor dir in artifacts/server-*; do+ [ -d "$dir" ] || continuelabel=$(basename "$dir" | sed 's/^server-//')if [ -z "$(ls -A "$dir" 2>/dev/null)" ]; thenecho "::warning::Empty server artifact in $dir β skipping"continuefi- ( cd "$dir" && zip -qr "$OLDPWD/release-assets/freemocap_server_${VERSION}_${label}.zip" . )- echo "Zipped server bundle: freemocap_server_${VERSION}_${label}.zip"+ asset="freemocap_server_${VERSION}_${label}.zip"+ ( cd "$dir" && zip -qr "$OLDPWD/${asset}" . )+ case "$label" in+ *-cuda)+ if [ "$R2_READY" = 1 ]; then+ aws s3 cp "${asset}" "s3://${R2_BUCKET}/releases/v${VERSION}/${asset}" \+ --endpoint-url "${R2_ENDPOINT}" --no-progress+ echo "R2: ${asset}"+ else+ echo "::warning::Skipping CUDA server bundle ${asset} (no R2 credentials)"+ fi+ rm -f "${asset}"+ ;;+ *)+ mv "${asset}" "release-assets/${asset}"+ echo "GitHub: ${asset}"+ ;;+ esacdone- # ββ App installers β all except Linux CUDA (which goes to R2) ββ- # CPU installers + Windows CUDA fit under GitHub's 2 GB file limit.- # Linux CUDA bundles NVIDIA runtime libraries (~1.5 GB extra, >2 GB total)- # and is uploaded to Cloudflare R2 during the build job instead.+ # ββ App installers β CUDA β R2 (already uploaded by the build job),+ # CPU/macOS β GitHub. ββfor dir in artifacts/installer-*; dolabel=$(basename "$dir" | sed 's/^installer-//')- # Skip Linux CUDA β it goes to R2+ # CUDA installers live on R2 (uploaded during the build job) β skip here.case "$label" in- linux-*-cuda) continue ;;+ *-cuda) continue ;;esacfind "$dir" -type f \( \@@ -646,7 +682,29 @@ jobs:donedone- echo "=== Release assets ==="+ # ββ Collect R2 (GPU/CUDA) download links for the release notes ββ+ # These live on R2 (too big for GitHub), so they must be linked in the notes or+ # they're invisible on the Releases page. Keys mirror the R2 uploads (app+ # installers from the build job, server zips from this job), under releases/v<ver>/.+ R2_PUBLIC_BASE="https://pub-0a275a10417e425c94e48de393793129.r2.dev/releases/v${VERSION}"+ : > r2-links.md+ for dir in artifacts/installer-*-cuda; do+ [ -d "$dir" ] || continue+ label=$(basename "$dir" | sed 's/^installer-//')+ find "$dir" -type f \( -name '*.exe' -o -name '*.AppImage' -o -name '*.deb' \) | while read -r f; do+ name="freemocap_${VERSION}_${label}.${f##*.}"+ echo "- [\`${name}\`](${R2_PUBLIC_BASE}/${name})" >> r2-links.md+ done+ done+ for dir in artifacts/server-*-cuda; do+ [ -d "$dir" ] || continue+ label=$(basename "$dir" | sed 's/^server-//')+ name="freemocap_server_${VERSION}_${label}.zip"+ echo "- [\`${name}\`](${R2_PUBLIC_BASE}/${name})" >> r2-links.md+ done+ echo "=== R2 (GPU/CUDA) links ==="; cat r2-links.md || true++ echo "=== GitHub-bound release assets ==="ls -lh release-assets/- name: Prepare auto-update metadata@@ -693,19 +751,34 @@ jobs:fifi- # Also include linux-arm64-cpu latest-linux.yml if present- if [ -d "artifacts/update-metadata-linux-arm64-cpu" ]; then- YML=$(find artifacts/update-metadata-linux-arm64-cpu -name 'latest-linux.yml' | head -1)- if [ -n "$YML" ]; then- echo "Linux ARM64 latest-linux.yml available at: $YML"- # Note: electron-updater currently only supports one latest-linux.yml;- # ARM64 auto-update metadata is available for future use.- fi- fi-echo "=== Final release assets ==="ls -lh release-assets/+ # ββ Size guard β the "double check" on our R2/GitHub routing ββ+ # GitHub caps release assets at 2 GiB. Everything oversized is supposed to be+ # routed to R2 (all CUDA builds). This verifies that by measuring every file left+ # in release-assets/ (i.e. everything about to be uploaded to GitHub) and failing+ # loudly if any is over the limit β instead of a cryptic mid-upload failure. If this+ # trips, route that build to R2: add it to the CUDA path here AND to isR2Hosted()+ # in freemocap-docs/src/components/download/downloads.ts so the download link matches.+ - name: Guard against oversized GitHub assets+ run: |+ MAX=$((2 * 1000 * 1000 * 1000)) # 2 GB β conservative margin under GitHub's 2 GiB cap+ over=0+ echo "=== GitHub-bound asset sizes ==="+ for f in release-assets/*; do+ [ -f "$f" ] || continue+ size=$(stat -c%s "$f")+ echo " $((size / 1000000)) MB $(basename "$f")"+ if [ "$size" -gt "$MAX" ]; then+ echo "::error::$(basename "$f") is $((size / 1000000)) MB β over GitHub's 2 GB asset limit."+ echo "::error::Route this build to R2 (CUDA path in 'Prepare release assets' + isR2Hosted() in downloads.ts)."+ over=1+ fi+ done+ [ "$over" = 0 ] || { echo "::error::Refusing to publish oversized asset(s)."; exit 1; }+ echo "OK β all GitHub-bound assets are under 2 GB."+- name: Create or update GitHub Releaseenv:GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}@@ -725,3 +798,16 @@ jobs:--generate-notes \--title "$TAG"fi++ # ββ Append the download guide + R2 (GPU/CUDA) links to the notes ββ+ # GPU builds are on Cloudflare R2 (too big for GitHub) so they must be linked+ # here; everyone also gets a pointer to the "which build?" picker.+ EXTRA=$'\n\n''---'$'\n''**Not sure which build to download?** See the download guide: https://docs.freemocap.org/freemocap/download'+ if [ -s r2-links.md ]; then+ EXTRA="${EXTRA}"$'\n\n''## GPU (CUDA) builds β hosted on Cloudflare R2'$'\n''(Too large for GitHub'"'"'s 2 GB asset limit.)'$'\n\n'"$(cat r2-links.md)"+ fi+ BODY="$(gh release view "$TAG" --repo "$GITHUB_REPOSITORY" --json body -q .body 2>/dev/null || echo '')"+ case "$BODY" in+ *"docs.freemocap.org/freemocap/download"*) echo "Notes already contain the download guide/links" ;;+ *) gh release edit "$TAG" --repo "$GITHUB_REPOSITORY" --notes "${BODY}${EXTRA}" ;;+ esacdiff --git a/freemocap-docs/src/components/download/downloads.ts b/freemocap-docs/src/components/download/downloads.tsindex 8e5113d3..386882e1 100644--- a/freemocap-docs/src/components/download/downloads.ts+++ b/freemocap-docs/src/components/download/downloads.ts@@ -46,18 +46,22 @@ export function getReleaseBaseUrl(version: string): string {return `https://github.com/${REPO}/releases/download/v${version}`;}-// Assets too large for a GitHub release (currently just Linux CUDA β see the-// "release" job in .github/workflows/build-installers-pyinstaller.yml) are-// hosted on Cloudflare R2 instead.+// Assets too large for a GitHub release (the CUDA / GPU builds β they bundle the+// ~1.5-2 GB NVIDIA CUDA stack; see isR2Hosted() and the "release" job in+// .github/workflows/build-installers-pyinstaller.yml) are hosted on Cloudflare R2.export const R2_PUBLIC_URL = 'https://pub-0a275a10417e425c94e48de393793129.r2.dev';export function getR2BaseUrl(version: string): string {return `${R2_PUBLIC_URL}/${version}`;}-/** True for the one build whose release assets live on R2 instead of GitHub. */+/** True for builds whose release assets live on R2 instead of GitHub.+ * Mirrors the routing rule in .github/workflows/build-installers-pyinstaller.yml:+ * every CUDA build (app installer + server zip) bundles the ~1.5-2 GB NVIDIA CUDA stack+ * and exceeds GitHub's 2 GB per-asset limit, so it is hosted on R2. CPU / macOS β GitHub.+ * (`os` is kept in the signature for call-site symmetry; routing is purely by variant.) */export function isR2Hosted(os: OsType, variant?: VariantType): boolean {- return os === 'linux' && variant === 'cuda';+ return variant === 'cuda';}/** Resolves the actual download URL for a file, routing R2-hosted builds correctly. */@@ -197,9 +201,9 @@ export const OS_NOTES: OsNoteEntry[] = [os: 'linux',arch: 'arm64',variant: 'warning',- title: 'Linux ARM64 builds arenβt available yet',+ title: 'Linux ARM64 builds arenβt available',content:- 'We donβt currently build a Linux ARM64 release (e.g. for Raspberry Pi). Nothing upstream is blocking it β it just hasnβt been built yet.',+ 'We canβt build a Linux ARM64 release (e.g. for Raspberry Pi) yet: mediapipe β a core dependency of the pose-tracking backend β ships no linux-aarch64 wheel, so the build is unsatisfiable on that platform. Itβll stay unavailable until mediapipe publishes ARM64 Linux wheels.',issues: [{label: 'Add Linux ARM64 installer build',