Corpus DB hot-reload: pick up weekly Purple Carrot additions without container restart #144
Labels
No labels
accessibility
backlog
beta-feedback
bug
duplicate
enhancement
feature-request
help wanted
invalid
needs-design
needs-triage
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Circuit-Forge/kiwi#144
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
The weekly Purple Carrot harvest pipeline (cron: Sunday 23:00) scrapes the current menu and upserts ~23 new recipes into
/Library/Assets/kiwi/kiwi.dbviaingest_purplecarrot.py. The cloud container currently mounts the corpus DB read-only at startup, so new rows are invisible until the container restarts.Problem
compose.cloud.ymlmounts/Library/Assets/kiwias a read-only bind mountProposed solution
Make the corpus mount read-write — change
rotorwincompose.cloud.ymlfor the corpus volume. The harvest script already writes to this path from the host; the container just needs to read the updated DB.Add a
/api/admin/reload-corpusendpoint (local-dev / bypass-IP only, never exposed to cloud users) that callsATTACH DATABASEagain or closes and reopens the corpus connection — effectively hot-swapping the attached DB without restarting the container.Alternative: a lighter-weight option is a weekly
docker restart kiwi-cloud-api-1scheduled 15 min after the harvest (23:15 Sunday), which is simpler but causes a brief outage window.Wire into harvest script — add step 4 to
weekly_harvest.shthat either calls the reload endpoint or triggers the container restart.Acceptance criteria
compose.cloud.ymlingest_purplecarrot.pyare visible to cloud users within 15 min of the harvest run, without a manual restartweekly_harvest.shstep 4 handles the reload automaticallyNotes
rwis safe.restart: unless-stoppedguard so the container comes back automatically.