Add a CLI command for pulling coredevices firmware from memfault#13
Draft
aveao wants to merge 3 commits into
Draft
Add a CLI command for pulling coredevices firmware from memfault#13aveao wants to merge 3 commits into
aveao wants to merge 3 commits into
Conversation
Polls Memfault's releases/latest endpoint for each CoreDevice hardware,
skips versions already recorded in the firmwares table, and for each
new one streams the .pbz down (computing sha256 on the fly), uploads it
to S3 at {S3_PATH}{hardware}/Pebble-{version}-{hardware}.pbz, and
upserts a `normal` row pointing at {FIRMWARE_ROOT}/{hardware}/... with
the computed hash. Idempotent, safe to run from cron.
Also lifts the upsert logic into a Firmware.upsert classmethod so
memfault.py and cli.py can share without a circular import, and adds
MEMFAULT_TOKEN / AWS_ACCESS_KEY / AWS_SECRET_KEY / S3_BUCKET / S3_PATH /
S3_ENDPOINT to settings + docker-compose env passthrough.
\`docker compose --profile s3 up\` brings up a MinIO container plus a one-shot minio/mc sidecar that pre-creates the \`cohorts-binaries\` bucket. Plain \`docker compose up\` is unchanged. The S3 API is only reachable inside the compose network at \`http://s3:9000\`; the admin console is forwarded at http://localhost:59001 (cohorts/cohortscohorts). Verified: - plain up: 2 services (db, app), no MinIO - --profile s3 up: 4 services; bucket auto-created - boto3 upload from the app container lands in the bucket - host :9001 console reachable, host :9000 not forwarded
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Builds on #12 (only last 2 commits here are new), should be undrafted after that's merged.