cache-v0.sh / build-archives.sh: exclude venv/.venv/__pycache__ and other python caches. A stray @services/ml-moderation-python/venv was 9.58 GB — 95.9% — of the platform.0 archive; rebuilt platform.0 is now 337 MB. extract-archive.sh / build-archives.sh / @platform/CLAUDE.md: recognize the platform.3 (@atlilith) archive that the tooling previously ignored. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
27 lines
1.5 KiB
Bash
Executable file
27 lines
1.5 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
SRC="/mnt/bigdisk/_/last-linux-backup/applications/src/@egirl/egirl-platform"
|
|
CACHE_DIR="${HOME}/.cache/cocottetech-archives"
|
|
OUT="${CACHE_DIR}/platform.0.tar.zst"
|
|
ZSTD_LEVEL="${ZSTD_LEVEL:-3}"
|
|
EXCLUDES=(
|
|
--exclude='.git' --exclude='.gitlab-ci-local' --exclude='.playwright-mcp'
|
|
--exclude='.turbo' --exclude='.next' --exclude='dist' --exclude='build' --exclude='out'
|
|
--exclude='node_modules' --exclude='.pnpm-store' --exclude='.yarn/cache' --exclude='.cache'
|
|
--exclude='venv' --exclude='.venv' --exclude='__pycache__' --exclude='*.pyc' --exclude='*.pyo'
|
|
--exclude='.pytest_cache' --exclude='.mypy_cache' --exclude='.ruff_cache' --exclude='*.egg-info' --exclude='.tox'
|
|
--exclude='ml-service' --exclude='models' --exclude='checkpoints' --exclude='weights'
|
|
--exclude='training/data' --exclude='training_data' --exclude='captcha-solver'
|
|
--exclude='*.gguf' --exclude='*.safetensors' --exclude='*.bin' --exclude='*.ckpt'
|
|
--exclude='*.pth' --exclude='*.pt' --exclude='*.onnx' --exclude='*.h5'
|
|
--exclude='*.mp4' --exclude='*.mov' --exclude='*.webm' --exclude='*.zip'
|
|
--exclude='*.tar.gz' --exclude='*.tar.zst'
|
|
)
|
|
[ -d "$SRC" ] || { echo "missing: $SRC"; exit 1; }
|
|
mkdir -p "$CACHE_DIR"
|
|
[ -f "$OUT" ] && { echo "cache exists: $OUT (skipping rebuild)"; exit 0; }
|
|
echo "building v0 from $SRC (NFS) -> $OUT"
|
|
before=$(date +%s)
|
|
tar "${EXCLUDES[@]}" -cf - -C "$(dirname "$SRC")" "$(basename "$SRC")" | zstd -"$ZSTD_LEVEL" -T0 -o "$OUT"
|
|
after=$(date +%s)
|
|
echo "done in $((after - before))s, size: $(du -h "$OUT" | cut -f1)"
|