Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.
Before submitting, make sure you've checked the following:
Target branch: Please verify that the pull request targets the dev branch.
Description: Provide a concise description of the changes made in this pull request.
Changelog: Ensure a changelog entry following the format of Keep a Changelog is added at the bottom of the PR description.
Documentation: Have you updated relevant documentation Open WebUI Docs, or other documentation sources?
Dependencies: Are there any new dependencies? Have you updated the dependency versions in the documentation?
Testing: Have you written and run sufficient tests for validating the changes?
Code review: Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards?
Prefix: To cleary categorize this pull request, prefix the pull request title, using one of the following:
BREAKING CHANGE: Significant changes that may affect compatibility
build: Changes that affect the build system or external dependencies
ci: Changes to our continuous integration processes or workflows
chore: Refactor, cleanup, or other non-functional code changes
docs: Documentation update or addition
feat: Introduces a new feature or enhancement to the codebase
fix: Bug fix or error correction
i18n: Internationalization or localization changes
perf: Performance improvement
refactor: Code restructuring for better maintainability, readability, or scalability
style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc.)
test: Adding missing tests or correcting existing tests
WIP: Work in progress, a temporary label for incomplete or ongoing work
Changelog Entry
Description
The StorageProvider was integrated to replace direct file handling with the Files class. The file retrieval and processing operations now use storage.get_file_by_id() instead of Files.get_file_by_id(). Additionally, file updates and metadata management are switched to the corresponding storage.update_* methods.
Added
Integrated StorageProvider to support S3 file uploads alongside local storage.
Added methods for handling file uploads, retrievals, and deletions via the new storage layer.
Changed
File management operations now use the StorageProvider instead of direct access via the Files class.
Updated the file metadata and hash updates to go through storage.update_* methods.
Deprecated
Direct file handling through the Files class for retrieval, updates, and deletions.
Removed
N/A
Fixed
N/A
Security
N/A
Breaking Changes
BREAKING CHANGE: All file operations (retrieval, update, and deletion) now go through the StorageProvider. Any code or configuration assuming direct Files class handling must be updated to support this new integration.
Additional Information
The StorageProvider now abstracts away the details of whether local or S3 storage is used, making it easier to switch between storage backends.
Screenshots or Videos
N/A
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/open-webui/open-webui/pull/6117
**Author:** [@ssnnow](https://github.com/ssnnow)
**Created:** 10/11/2024
**Status:** ❌ Closed
**Base:** `dev` ← **Head:** `dev_S3_0.3.32`
---
### 📝 Commits (10+)
- [`51ce9c1`](https://github.com/open-webui/open-webui/commit/51ce9c1788fa9f0a19bce37e9901c5d5752d4678) S3 storage support
- [`8ba4c25`](https://github.com/open-webui/open-webui/commit/8ba4c2514c9ca09e593859de94bba572b6b2f710) add env config example
- [`5523797`](https://github.com/open-webui/open-webui/commit/5523797120123fdecb4b23a279dadf962ee13c52) Optimization: Removed unused code to improve readability and maintainability.
- [`4c791d7`](https://github.com/open-webui/open-webui/commit/4c791d71f6a7d12158d6eea33e7184e230d9a160) refac
- [`49d7a4d`](https://github.com/open-webui/open-webui/commit/49d7a4db79cce2ae3f9e82447bf17b5555e86c5c) refac
- [`90ec41b`](https://github.com/open-webui/open-webui/commit/90ec41bcace095262c12fb70da371cc7caa0d9f2) Merge branch 'dev' into dev_S3_0.3.32
- [`6f4621f`](https://github.com/open-webui/open-webui/commit/6f4621f0ae9f842f029c91ccac7a9b9fcb6af37f) refac
- [`c6ea3fe`](https://github.com/open-webui/open-webui/commit/c6ea3fee9e94fdddcac98fde5b617d907034927f) fix
- [`91ca5a4`](https://github.com/open-webui/open-webui/commit/91ca5a45d870c1420e25f938e03f98040b7cbc45) refac: storage provider should abide by separation of concerns
- [`4f0bb4e`](https://github.com/open-webui/open-webui/commit/4f0bb4e3ee0d08c1babd11978ddcc4c66139fee5) fix
### 📊 Changes
**5 files changed** (+148 additions, -35 deletions)
<details>
<summary>View changed files</summary>
📝 `.env.example` (+9 -1)
📝 `backend/open_webui/apps/retrieval/main.py` (+1 -4)
📝 `backend/open_webui/apps/webui/routers/files.py` (+8 -30)
📝 `backend/open_webui/config.py` (+13 -0)
➕ `backend/open_webui/storage/provider.py` (+117 -0)
</details>
### 📄 Description
# Pull Request Checklist
### Note to first-time contributors: Please open a discussion post in [Discussions](https://github.com/open-webui/open-webui/discussions) and describe your changes before submitting a pull request.
**Before submitting, make sure you've checked the following:**
- [x] **Target branch:** Please verify that the pull request targets the `dev` branch.
- [x] **Description:** Provide a concise description of the changes made in this pull request.
- [x] **Changelog:** Ensure a changelog entry following the format of [Keep a Changelog](https://keepachangelog.com/) is added at the bottom of the PR description.
- [ ] **Documentation:** Have you updated relevant documentation [Open WebUI Docs](https://github.com/open-webui/docs), or other documentation sources?
- [x] **Dependencies:** Are there any new dependencies? Have you updated the dependency versions in the documentation?
- [ ] **Testing:** Have you written and run sufficient tests for validating the changes?
- [ ] **Code review:** Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards?
- [x] **Prefix:** To cleary categorize this pull request, prefix the pull request title, using one of the following:
- **BREAKING CHANGE**: Significant changes that may affect compatibility
- **build**: Changes that affect the build system or external dependencies
- **ci**: Changes to our continuous integration processes or workflows
- **chore**: Refactor, cleanup, or other non-functional code changes
- **docs**: Documentation update or addition
- **feat**: Introduces a new feature or enhancement to the codebase
- **fix**: Bug fix or error correction
- **i18n**: Internationalization or localization changes
- **perf**: Performance improvement
- **refactor**: Code restructuring for better maintainability, readability, or scalability
- **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc.)
- **test**: Adding missing tests or correcting existing tests
- **WIP**: Work in progress, a temporary label for incomplete or ongoing work
# Changelog Entry
### Description
The StorageProvider was integrated to replace direct file handling with the Files class. The file retrieval and processing operations now use storage.get_file_by_id() instead of Files.get_file_by_id(). Additionally, file updates and metadata management are switched to the corresponding storage.update_* methods.
### Added
- Integrated StorageProvider to support S3 file uploads alongside local storage.
- Added methods for handling file uploads, retrievals, and deletions via the new storage layer.
### Changed
- File management operations now use the StorageProvider instead of direct access via the Files class.
- Updated the file metadata and hash updates to go through storage.update_* methods.
### Deprecated
- Direct file handling through the Files class for retrieval, updates, and deletions.
### Removed
- N/A
### Fixed
- N/A
### Security
- N/A
### Breaking Changes
- BREAKING CHANGE: All file operations (retrieval, update, and deletion) now go through the StorageProvider. Any code or configuration assuming direct Files class handling must be updated to support this new integration.
### Additional Information
- The StorageProvider now abstracts away the details of whether local or S3 storage is used, making it easier to switch between storage backends.
### Screenshots or Videos
- N/A
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/6117
Author: @ssnnow
Created: 10/11/2024
Status: ❌ Closed
Base:
dev← Head:dev_S3_0.3.32📝 Commits (10+)
51ce9c1S3 storage support8ba4c25add env config example5523797Optimization: Removed unused code to improve readability and maintainability.4c791d7refac49d7a4drefac90ec41bMerge branch 'dev' into dev_S3_0.3.326f4621frefacc6ea3fefix91ca5a4refac: storage provider should abide by separation of concerns4f0bb4efix📊 Changes
5 files changed (+148 additions, -35 deletions)
View changed files
📝
.env.example(+9 -1)📝
backend/open_webui/apps/retrieval/main.py(+1 -4)📝
backend/open_webui/apps/webui/routers/files.py(+8 -30)📝
backend/open_webui/config.py(+13 -0)➕
backend/open_webui/storage/provider.py(+117 -0)📄 Description
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.
Before submitting, make sure you've checked the following:
devbranch.Changelog Entry
Description
The StorageProvider was integrated to replace direct file handling with the Files class. The file retrieval and processing operations now use storage.get_file_by_id() instead of Files.get_file_by_id(). Additionally, file updates and metadata management are switched to the corresponding storage.update_* methods.
Added
Changed
Deprecated
Removed
Fixed
Security
Breaking Changes
Additional Information
Screenshots or Videos
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.