feat: Add Single Bucket Mode for MinIO/S3 #11416
Open
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.
Overview
This PR adds support for Single Bucket Mode in RAGFlow, allowing users to configure MinIO/S3 to use a single bucket with a directory structure instead of creating multiple buckets per Knowledge Base and user folder.
Problem Statement
The current implementation creates one bucket per Knowledge Base and one bucket per user folder, which can be problematic when:
Solution
Added a
prefix_pathconfiguration option to the MinIO connector that enables:Changes
rag/utils/minio_conn.py: Enhanced MinIO connector to support single bucket mode with prefix pathsconf/service_conf.yaml: Added new configuration options (bucketandprefix_path)docker/service_conf.yaml.template: Updated template with single bucket configuration examplesdocker/.env.single-bucket-example: Added example environment variables for single bucket setupdocs/single-bucket-mode.md: Comprehensive documentation covering usage, migration, and troubleshootingConfiguration Example
Backward Compatibility
✅ Fully backward compatible - existing deployments continue to work without any changes
bucketis not configured, uses default multi-bucket behaviorbucketis configured withoutprefix_path, uses bucket rootbucket/prefix_path/structureTesting
Documentation
Included comprehensive documentation in
docs/single-bucket-mode.mdcovering:Related Issue: Addresses use cases where bucket creation is restricted or costly