Skip to content

Add a CLI command for pulling coredevices firmware from memfault#13

Draft
aveao wants to merge 3 commits into
pebble-dev:masterfrom
aveao:memfault-support
Draft

Add a CLI command for pulling coredevices firmware from memfault#13
aveao wants to merge 3 commits into
pebble-dev:masterfrom
aveao:memfault-support

Conversation

@aveao
Copy link
Copy Markdown
Member

@aveao aveao commented Apr 21, 2026

Builds on #12 (only last 2 commits here are new), should be undrafted after that's merged.

@aveao aveao force-pushed the memfault-support branch from c7368f4 to ec0dfd6 Compare April 21, 2026 21:27
@aveao aveao force-pushed the memfault-support branch from ec0dfd6 to f5cf38e Compare June 1, 2026 17:14
aveao and others added 3 commits June 1, 2026 21:52
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
@aveao aveao force-pushed the memfault-support branch from f5cf38e to 06fff68 Compare June 1, 2026 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant