Improve development environment defaults and storage setup#849
Conversation
* Add .env.example documenting development defaults for services, storage, and optional integrations * Rename docker-compose.override.yml to docker-compose.override.yml.bak and retain expanded rustfs/minio setup * Ignore override file to prevent accidental inclusion in version control
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 077e8abe9d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| - EXPORT_SERVICE=core.services.storages.cloud.minio.MinIO | ||
| - MINIO_ENDPOINT=rustfs:9000 | ||
| - MINIO_ACCESS_KEY=${MINIO_ACCESS_KEY-rustfsadmin} | ||
| - MINIO_SECRET_KEY=${MINIO_SECRET_KEY-rustfsadmin} | ||
| - MINIO_BUCKET_NAME=${MINIO_BUCKET_NAME-oclapi2-dev} |
There was a problem hiding this comment.
Set storage backend consistently across worker services
api is now pinned to MinIO/RustFS via EXPORT_SERVICE and MINIO_*, but the Celery services still inherit the default backend (core.settings.EXPORT_SERVICE falls back to AWS S3 when unset). That creates a split-brain storage setup where API writes/deletes against MinIO while async tasks run by workers (for example delete_s3_objects triggered via apply_async in core/common/models.py) operate on a different backend, causing export cleanup and other storage-backed tasks to fail or act on the wrong bucket.
Useful? React with 👍 / 👎.
* Add MINIO_PORT and MINIO_EXTERNAL_ENDPOINT defaults to expose stable host and port for browser access * Introduce MINIO_EXTERNAL_ENDPOINT and MINIO_REGION settings for external client configuration * Create dedicated external MinIO client for url_for to generate correct presigned URLs * Update docker-compose overrides to pass new MinIO environment variables
| # Separate client for presigned URL generation using the externally accessible endpoint. | ||
| # Region is set explicitly to avoid a network round-trip for region discovery | ||
| # (the external endpoint is not reachable from inside the container). | ||
| self.external_client = Minio( |
There was a problem hiding this comment.
there are usages of self.client; shouldn't they all move to self.external_client?
There was a problem hiding this comment.
Good point on the naming — external_client was ambiguous. I renamed it to _presign_client to make the intent explicit: it is only used for presigned URL generation, so the signature carries the publicly accessible host. All other operations (upload_file, exists, has_path, delete_objects, etc.) intentionally continue using self.client, since they run server-side inside the container, where only MINIO_ENDPOINT is reachable through the Docker network.
If we move toward using a single external-style variable for everything, the idea is reasonable, but it is not the fastest path for developers because it does not take advantage of Docker networking and the ready-to-use RustFS service. In that setup, we also would not be able to use localhost, since it would not resolve externally. We would need to introduce a proxy plus an /etc/hosts entry, which is a much more complete setup for what is currently intended to be a simple development configuration.
In any case, if you already have MinIO or RustFS running as an externally reachable service on your machine, defining only MINIO_ENDPOINT is enough to configure both self.client and self._presign_client.
…use it was ambiguous




Summary
This PR improves the local development environment by documenting the expected defaults, reducing maintenance overhead from deprecated components, and making the storage layer more practical for development and testing workflows.
Context
The current development setup had a few limitations:
To address this, the development environment now moves toward a documented default
.envtemplate and a backup-based override workflow, while introducingRUSTFSas the preferred local S3-compatible service.What changed
added
.env.exampledocumenting the expected development defaults for:renamed
docker-compose.override.ymltodocker-compose.override.yml.bakupdated the repository to ignore the active override file, so local developer-specific overrides are not committed accidentally
preserved the backup override template so developers can still enable it locally when needed with:
kept the expanded storage-related development setup available in the backup override file
introduced
RUSTFSas the local storage service, replacing the previous dependence on MinIO for active development workflowsWhy this approach
This approach keeps the repository cleaner and makes the development workflow more explicit:
.env.exampleBenefits
RUSTFSNotes for reviewers
Developers who need local override behavior can still enable it manually:
This preserves flexibility for development without keeping override configuration as a first-class tracked file.