[compose] register minio storage backend on osprey-ui-api#288
Conversation
The osprey-ui-api service was missing the OSPREY_EXECUTION_RESULT_STORAGE_BACKEND and related MinIO configuration variables, causing bootstrap_execution_result_storage_service() to fail with 'No storage backend registered' when the /scan endpoint was called. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthroughThe ChangesMinIO Configuration
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
docker-compose.yaml (1)
140-144:⚠️ Potential issue | 🟠 Major | ⚖️ Poor tradeoffAdd MinIO service dependencies to prevent startup race.
The
osprey-ui-apiservice now depends on MinIO storage (lines 163-168) but does not gate startup on MinIO readiness. This can cause bootstrap failures ifosprey-ui-apistarts before MinIO is healthy or the bucket is initialized.Consider adding the same MinIO dependencies that
osprey-workerhas (lines 97-100):depends_on: - osprey-worker - druid-broker - postgres - snowflake-id-worker minio: condition: service_healthy minio-bucket-init: condition: service_completed_successfullyI acknowledge your follow-up note about deferring this to a separate compose-hardening PR, but flagging for visibility since it can cause intermittent failures on fresh setups.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docker-compose.yaml` around lines 140 - 144, The osprey-ui-api service's depends_on block is missing MinIO readiness gating which can cause startup races; update the osprey-ui-api service depends_on (the block that currently lists osprey-worker, druid-broker, postgres, snowflake-id-worker) to also include minio with condition: service_healthy and minio-bucket-init with condition: service_completed_successfully so osprey-ui-api waits for MinIO to be healthy and the bucket-init task to finish before starting.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docker-compose.yaml`:
- Around line 163-168: The change modifies restricted deployment settings in
docker-compose.yaml by altering environment variables like
OSPREY_EXECUTION_RESULT_STORAGE_BACKEND, OSPREY_MINIO_ENDPOINT,
OSPREY_MINIO_ACCESS_KEY, OSPREY_MINIO_SECRET_KEY, OSPREY_MINIO_SECURE and
OSPREY_MINIO_EXECUTION_RESULTS_BUCKET; do not merge this change until you obtain
explicit human approval from the ops/security owner—revert or hold the patch and
add a PR comment requesting approval, include justification for changing those
OSPREY_* variables, and document any required review approvals before reapplying
the updated docker-compose.yaml.
---
Outside diff comments:
In `@docker-compose.yaml`:
- Around line 140-144: The osprey-ui-api service's depends_on block is missing
MinIO readiness gating which can cause startup races; update the osprey-ui-api
service depends_on (the block that currently lists osprey-worker, druid-broker,
postgres, snowflake-id-worker) to also include minio with condition:
service_healthy and minio-bucket-init with condition:
service_completed_successfully so osprey-ui-api waits for MinIO to be healthy
and the bucket-init task to finish before starting.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 9392b7aa-d415-4c77-b67e-1aaa6e6b5e9f
📒 Files selected for processing (1)
docker-compose.yaml
|
Hailey: validated locally that this fixes things the way claude describes |
Summary
The example
docker-compose.yamlsetOSPREY_EXECUTION_RESULT_STORAGE_BACKEND(and the MinIO config it needs) onosprey-worker, but not onosprey-ui-api. The UI API process bootstraps its own storage backend, so its/scanendpoint was failing withAssertionError: No storage backend registeredon a fresh setup. Add the same six env vars to theosprey-ui-apiservice so the example compose is usable out of the box.Related Issues/Tasks
Closes #181
Changes Made
osprey-ui-apiservice indocker-compose.yaml:OSPREY_EXECUTION_RESULT_STORAGE_BACKEND=minioOSPREY_MINIO_ENDPOINT=minio:9000OSPREY_MINIO_ACCESS_KEY=minioadminOSPREY_MINIO_SECRET_KEY=minioadmin123OSPREY_MINIO_SECURE=falseOSPREY_MINIO_EXECUTION_RESULTS_BUCKET=execution-outputosprey-worker.Confidence Level
Confidence Level: Claude
Testing
docker compose config --quiet— passes (compose syntax valid).bootstrap_execution_result_storage_service()inosprey_worker/src/osprey/worker/lib/storage/stored_execution_result.pyandget_rules_execution_result_storage_backend()inosprey_worker/src/osprey/worker/_stdlibplugin/execution_result_store_chooser.py../start.sh.Follow-up note (out of scope here)
osprey-ui-api.depends_ondoes not gate onminio: service_healthylikeosprey-worker.depends_ondoes — the transitive chain viaosprey-workercovers the typical boot order but leaves a narrow race. Worth a separate compose-hardening pass; deliberately not included here per the "minimal and scoped" rule.Summary by CodeRabbit