Files
sunnypilot/tools/release/release_files.py
T
Harald Schäfer 1328ace068 Remove model chunking and use LFS for Chestnut releases (#38941)
* Remove model chunking and use LFS for Chestnut releases

* Check Git blob sizes once during release packaging

* Download the big model for Chestnut nightly builds

* Reuse published LFS models when pushing releases

* Preserve LFS configuration when copying Chestnut releases

* Detect release builds independently of LFS attributes
2026-09-17 16:34:52 -07:00

42 lines
1.1 KiB
Python
Executable File

#!/usr/bin/env python3
import os
import re
import subprocess
import sys
HERE = os.path.abspath(os.path.dirname(__file__))
ROOT = os.path.abspath(os.path.join(HERE, "../.."))
blacklist = [
".git/",
".venv/",
".github/workflows/",
"matlab.*.md",
# release scripts configure LFS for the big driving model
".lfsconfig",
".gitattributes",
".git$",
".gitmodules",
]
# gets you through the blacklist
whitelist: list[str] = [r"^\.lfsconfig$"] if os.getenv("INCLUDE_BIG_MODEL") else []
if __name__ == "__main__":
tracked_files = subprocess.check_output(["git", "ls-files", "-z", "--recurse-submodules"], cwd=ROOT).split(b"\0")
for tracked_file in tracked_files:
if not tracked_file:
continue
rf = os.fsdecode(tracked_file)
if not os.getenv("INCLUDE_BIG_MODEL") and rf == "openpilot/selfdrive/modeld/models/big_driving_tinygrad.pkl":
continue
blacklisted = any(re.search(p, rf) for p in blacklist)
whitelisted = any(re.search(p, rf) for p in whitelist)
if blacklisted and not whitelisted:
continue
sys.stdout.buffer.write(tracked_file + b"\0")