π Add auto-sync: daily product sync from master dataset to both storefronts
#28
by bep40 - opened
Auto-Sync Infrastructure - Pull Request
Purpose
Automate nightly sync (~23,400 products) from central master dataset (bep40/grob-products-updated) to both HuggingFace storefront spaces:
- V.AISTUDIO (primary storefront)
- vai-avatar2 (secondary storefront)
Files Added
sync_products.py- Python script that:- Loads latest product data from HF dataset
bep40/grob-products-updated - Computes diff against existing cached products
- Uploads ONLY new/updated products to both spaces
- Triggers Space rebuild via
.gitignoretouch for cache busting
- Loads latest product data from HF dataset
.github/workflows/auto-sync.yml- GitHub Actions workflow that:- Runs daily at 00:00 UTC via cron schedule
- Uses
actions/setup-python@v5for Python environment - Installs dependencies:
huggingface_hub,datasets - Executes
python3 sync_products.py - Includes proper error handling and logging
How It Works
malloca.com update β HF Dataset updated β Cron triggers β
Python sync script diffs β Pushes NEW products only β
Triggers Space rebuild on BOTH spaces
Requirements
HF_TOKENsecret must be configured in Repo Settings β Secrets & variables β Actions- Token needs write scope for both
bep40/V.AISTUDIOandbep40/vai-avatar2spaces
Key Features
- β Incremental sync: Only uploads changed/new products (slug-based diff detection)
- β
Cache-busting: Touches
.gitignoreto force Space rebuild after sync - β Image download & upload: Downloads product images from source URLs
- β Error handling: Logs warnings for failed image downloads without breaking sync
- β Progress tracking: Updates every 50 products during upload
- β
Minimal payload: Optimized HTML templates for fast rendering
"
bep40 changed pull request status to open