coolmanx commited on
Commit
52db962
·
verified ·
1 Parent(s): 76aa260
.github/FUNDING.yml CHANGED
@@ -1 +1 @@
1
- github: tjbck
 
1
+ github: tjbck
.github/ISSUE_TEMPLATE/bug_report.md CHANGED
@@ -1,70 +1,80 @@
1
- ---
2
- name: Bug report
3
- about: Create a report to help us improve
4
- title: ''
5
- labels: ''
6
- assignees: ''
7
- ---
8
-
9
- # Bug Report
10
-
11
- **Important: Before submitting a bug report, please check whether a similar issue or feature request has already been posted in the Issues or Discussions section. It's likely we're already tracking it. In case of uncertainty, initiate a discussion post first. This helps us all to efficiently focus on improving the project.**
12
-
13
- **Let's collaborate respectfully. If you bring negativity, please understand our capacity to engage may be limited. If you're open to learning and communicating constructively, we're more than happy to assist you. Remember, Open WebUI is a volunteer-driven project maintained by a single maintainer, supported by our amazing contributors who also manage full-time jobs. We respect your time; please respect ours. If you have an issue, We highly encourage you to submit a pull request or to fork the project. We actively work to prevent contributor burnout to preserve the quality and continuity of Open WebUI.**
14
-
15
- ## Installation Method
16
-
17
- [Describe the method you used to install the project, e.g., git clone, Docker, pip, etc.]
18
-
19
- ## Environment
20
-
21
- - **Open WebUI Version:** [e.g., v0.3.11]
22
- - **Ollama (if applicable):** [e.g., v0.2.0, v0.1.32-rc1]
23
-
24
- - **Operating System:** [e.g., Windows 10, macOS Big Sur, Ubuntu 20.04]
25
- - **Browser (if applicable):** [e.g., Chrome 100.0, Firefox 98.0]
26
-
27
- **Confirmation:**
28
-
29
- - [ ] I have read and followed all the instructions provided in the README.md.
30
- - [ ] I am on the latest version of both Open WebUI and Ollama.
31
- - [ ] I have included the browser console logs.
32
- - [ ] I have included the Docker container logs.
33
- - [ ] I have provided the exact steps to reproduce the bug in the "Steps to Reproduce" section below.
34
-
35
- ## Expected Behavior:
36
-
37
- [Describe what you expected to happen.]
38
-
39
- ## Actual Behavior:
40
-
41
- [Describe what actually happened.]
42
-
43
- ## Description
44
-
45
- **Bug Summary:**
46
- [Provide a brief but clear summary of the bug]
47
-
48
- ## Reproduction Details
49
-
50
- **Steps to Reproduce:**
51
- [Outline the steps to reproduce the bug. Be as detailed as possible.]
52
-
53
- ## Logs and Screenshots
54
-
55
- **Browser Console Logs:**
56
- [Include relevant browser console logs, if applicable]
57
-
58
- **Docker Container Logs:**
59
- [Include relevant Docker container logs, if applicable]
60
-
61
- **Screenshots/Screen Recordings (if applicable):**
62
- [Attach any relevant screenshots to help illustrate the issue]
63
-
64
- ## Additional Information
65
-
66
- [Include any additional details that may help in understanding and reproducing the issue. This could include specific configurations, error messages, or anything else relevant to the bug.]
67
-
68
- ## Note
69
-
70
- If the bug report is incomplete or does not follow the provided instructions, it may not be addressed. Please ensure that you have followed the steps outlined in the README.md and troubleshooting.md documents, and provide all necessary information for us to reproduce and address the issue. Thank you!
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ name: Bug report
3
+ about: Create a report to help us improve
4
+ title: ''
5
+ labels: ''
6
+ assignees: ''
7
+ ---
8
+
9
+ # Bug Report
10
+
11
+ ## Important Notes
12
+
13
+ - **Before submitting a bug report**: Please check the Issues or Discussions section to see if a similar issue or feature request has already been posted. It's likely we're already tracking it! If you’re unsure, start a discussion post first. This will help us efficiently focus on improving the project.
14
+
15
+ - **Collaborate respectfully**: We value a constructive attitude, so please be mindful of your communication. If negativity is part of your approach, our capacity to engage may be limited. We’re here to help if you’re open to learning and communicating positively. Remember, Open WebUI is a volunteer-driven project managed by a single maintainer and supported by contributors who also have full-time jobs. We appreciate your time and ask that you respect ours.
16
+
17
+ - **Contributing**: If you encounter an issue, we highly encourage you to submit a pull request or fork the project. We actively work to prevent contributor burnout to maintain the quality and continuity of Open WebUI.
18
+
19
+ - **Bug reproducibility**: If a bug cannot be reproduced with a `:main` or `:dev` Docker setup, or a pip install with Python 3.11, it may require additional help from the community. In such cases, we will move it to the "issues" Discussions section due to our limited resources. We encourage the community to assist with these issues. Remember, it’s not that the issue doesn’t exist; we need your help!
20
+
21
+ Note: Please remove the notes above when submitting your post. Thank you for your understanding and support!
22
+
23
+ ---
24
+
25
+ ## Installation Method
26
+
27
+ [Describe the method you used to install the project, e.g., git clone, Docker, pip, etc.]
28
+
29
+ ## Environment
30
+
31
+ - **Open WebUI Version:** [e.g., v0.3.11]
32
+ - **Ollama (if applicable):** [e.g., v0.2.0, v0.1.32-rc1]
33
+
34
+ - **Operating System:** [e.g., Windows 10, macOS Big Sur, Ubuntu 20.04]
35
+ - **Browser (if applicable):** [e.g., Chrome 100.0, Firefox 98.0]
36
+
37
+ **Confirmation:**
38
+
39
+ - [ ] I have read and followed all the instructions provided in the README.md.
40
+ - [ ] I am on the latest version of both Open WebUI and Ollama.
41
+ - [ ] I have included the browser console logs.
42
+ - [ ] I have included the Docker container logs.
43
+ - [ ] I have provided the exact steps to reproduce the bug in the "Steps to Reproduce" section below.
44
+
45
+ ## Expected Behavior:
46
+
47
+ [Describe what you expected to happen.]
48
+
49
+ ## Actual Behavior:
50
+
51
+ [Describe what actually happened.]
52
+
53
+ ## Description
54
+
55
+ **Bug Summary:**
56
+ [Provide a brief but clear summary of the bug]
57
+
58
+ ## Reproduction Details
59
+
60
+ **Steps to Reproduce:**
61
+ [Outline the steps to reproduce the bug. Be as detailed as possible.]
62
+
63
+ ## Logs and Screenshots
64
+
65
+ **Browser Console Logs:**
66
+ [Include relevant browser console logs, if applicable]
67
+
68
+ **Docker Container Logs:**
69
+ [Include relevant Docker container logs, if applicable]
70
+
71
+ **Screenshots/Screen Recordings (if applicable):**
72
+ [Attach any relevant screenshots to help illustrate the issue]
73
+
74
+ ## Additional Information
75
+
76
+ [Include any additional details that may help in understanding and reproducing the issue. This could include specific configurations, error messages, or anything else relevant to the bug.]
77
+
78
+ ## Note
79
+
80
+ If the bug report is incomplete or does not follow the provided instructions, it may not be addressed. Please ensure that you have followed the steps outlined in the README.md and troubleshooting.md documents, and provide all necessary information for us to reproduce and address the issue. Thank you!
.github/ISSUE_TEMPLATE/feature_request.md CHANGED
@@ -1,25 +1,35 @@
1
- ---
2
- name: Feature request
3
- about: Suggest an idea for this project
4
- title: ''
5
- labels: ''
6
- assignees: ''
7
- ---
8
-
9
- # Feature Request
10
-
11
- **Important: Before submitting a feature request, please check whether a similar issue or feature request has already been posted in the Issues or Discussions section. It's likely we're already tracking it. In case of uncertainty, initiate a discussion post first. This helps us all to efficiently focus on improving the project.**
12
-
13
- **Let's collaborate respectfully. If you bring negativity, please understand our capacity to engage may be limited. If you're open to learning and communicating constructively, we're more than happy to assist you. Remember, Open WebUI is a volunteer-driven project maintained by a single maintainer, supported by our amazing contributors who also manage full-time jobs. We respect your time; please respect ours. If you have an issue, We highly encourage you to submit a pull request or to fork the project. We actively work to prevent contributor burnout to preserve the quality and continuity of Open WebUI.**
14
-
15
- **Is your feature request related to a problem? Please describe.**
16
- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
17
-
18
- **Describe the solution you'd like**
19
- A clear and concise description of what you want to happen.
20
-
21
- **Describe alternatives you've considered**
22
- A clear and concise description of any alternative solutions or features you've considered.
23
-
24
- **Additional context**
25
- Add any other context or screenshots about the feature request here.
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ name: Feature request
3
+ about: Suggest an idea for this project
4
+ title: ''
5
+ labels: ''
6
+ assignees: ''
7
+ ---
8
+
9
+ # Feature Request
10
+
11
+ ## Important Notes
12
+
13
+ - **Before submitting a report**: Please check the Issues or Discussions section to see if a similar issue or feature request has already been posted. It's likely we're already tracking it! If you’re unsure, start a discussion post first. This will help us efficiently focus on improving the project.
14
+
15
+ - **Collaborate respectfully**: We value a constructive attitude, so please be mindful of your communication. If negativity is part of your approach, our capacity to engage may be limited. We’re here to help if you’re open to learning and communicating positively. Remember, Open WebUI is a volunteer-driven project managed by a single maintainer and supported by contributors who also have full-time jobs. We appreciate your time and ask that you respect ours.
16
+
17
+ - **Contributing**: If you encounter an issue, we highly encourage you to submit a pull request or fork the project. We actively work to prevent contributor burnout to maintain the quality and continuity of Open WebUI.
18
+
19
+ - **Bug reproducibility**: If a bug cannot be reproduced with a `:main` or `:dev` Docker setup, or a pip install with Python 3.11, it may require additional help from the community. In such cases, we will move it to the "issues" Discussions section due to our limited resources. We encourage the community to assist with these issues. Remember, it’s not that the issue doesn’t exist; we need your help!
20
+
21
+ Note: Please remove the notes above when submitting your post. Thank you for your understanding and support!
22
+
23
+ ---
24
+
25
+ **Is your feature request related to a problem? Please describe.**
26
+ A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
27
+
28
+ **Describe the solution you'd like**
29
+ A clear and concise description of what you want to happen.
30
+
31
+ **Describe alternatives you've considered**
32
+ A clear and concise description of any alternative solutions or features you've considered.
33
+
34
+ **Additional context**
35
+ Add any other context or screenshots about the feature request here.
.github/dependabot.yml CHANGED
@@ -1,12 +1,12 @@
1
- version: 2
2
- updates:
3
- - package-ecosystem: pip
4
- directory: '/backend'
5
- schedule:
6
- interval: monthly
7
- target-branch: 'dev'
8
- - package-ecosystem: 'github-actions'
9
- directory: '/'
10
- schedule:
11
- # Check for updates to GitHub Actions every week
12
- interval: monthly
 
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: pip
4
+ directory: '/backend'
5
+ schedule:
6
+ interval: monthly
7
+ target-branch: 'dev'
8
+ - package-ecosystem: 'github-actions'
9
+ directory: '/'
10
+ schedule:
11
+ # Check for updates to GitHub Actions every week
12
+ interval: monthly
.github/pull_request_template.md CHANGED
@@ -1,72 +1,72 @@
1
- # Pull Request Checklist
2
-
3
- ### 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.
4
-
5
- **Before submitting, make sure you've checked the following:**
6
-
7
- - [ ] **Target branch:** Please verify that the pull request targets the `dev` branch.
8
- - [ ] **Description:** Provide a concise description of the changes made in this pull request.
9
- - [ ] **Changelog:** Ensure a changelog entry following the format of [Keep a Changelog](https://keepachangelog.com/) is added at the bottom of the PR description.
10
- - [ ] **Documentation:** Have you updated relevant documentation [Open WebUI Docs](https://github.com/open-webui/docs), or other documentation sources?
11
- - [ ] **Dependencies:** Are there any new dependencies? Have you updated the dependency versions in the documentation?
12
- - [ ] **Testing:** Have you written and run sufficient tests for validating the changes?
13
- - [ ] **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?
14
- - [ ] **Prefix:** To cleary categorize this pull request, prefix the pull request title, using one of the following:
15
- - **BREAKING CHANGE**: Significant changes that may affect compatibility
16
- - **build**: Changes that affect the build system or external dependencies
17
- - **ci**: Changes to our continuous integration processes or workflows
18
- - **chore**: Refactor, cleanup, or other non-functional code changes
19
- - **docs**: Documentation update or addition
20
- - **feat**: Introduces a new feature or enhancement to the codebase
21
- - **fix**: Bug fix or error correction
22
- - **i18n**: Internationalization or localization changes
23
- - **perf**: Performance improvement
24
- - **refactor**: Code restructuring for better maintainability, readability, or scalability
25
- - **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc.)
26
- - **test**: Adding missing tests or correcting existing tests
27
- - **WIP**: Work in progress, a temporary label for incomplete or ongoing work
28
-
29
- # Changelog Entry
30
-
31
- ### Description
32
-
33
- - [Concisely describe the changes made in this pull request, including any relevant motivation and impact (e.g., fixing a bug, adding a feature, or improving performance)]
34
-
35
- ### Added
36
-
37
- - [List any new features, functionalities, or additions]
38
-
39
- ### Changed
40
-
41
- - [List any changes, updates, refactorings, or optimizations]
42
-
43
- ### Deprecated
44
-
45
- - [List any deprecated functionality or features that have been removed]
46
-
47
- ### Removed
48
-
49
- - [List any removed features, files, or functionalities]
50
-
51
- ### Fixed
52
-
53
- - [List any fixes, corrections, or bug fixes]
54
-
55
- ### Security
56
-
57
- - [List any new or updated security-related changes, including vulnerability fixes]
58
-
59
- ### Breaking Changes
60
-
61
- - **BREAKING CHANGE**: [List any breaking changes affecting compatibility or functionality]
62
-
63
- ---
64
-
65
- ### Additional Information
66
-
67
- - [Insert any additional context, notes, or explanations for the changes]
68
- - [Reference any related issues, commits, or other relevant information]
69
-
70
- ### Screenshots or Videos
71
-
72
- - [Attach any relevant screenshots or videos demonstrating the changes]
 
1
+ # Pull Request Checklist
2
+
3
+ ### 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.
4
+
5
+ **Before submitting, make sure you've checked the following:**
6
+
7
+ - [ ] **Target branch:** Please verify that the pull request targets the `dev` branch.
8
+ - [ ] **Description:** Provide a concise description of the changes made in this pull request.
9
+ - [ ] **Changelog:** Ensure a changelog entry following the format of [Keep a Changelog](https://keepachangelog.com/) is added at the bottom of the PR description.
10
+ - [ ] **Documentation:** Have you updated relevant documentation [Open WebUI Docs](https://github.com/open-webui/docs), or other documentation sources?
11
+ - [ ] **Dependencies:** Are there any new dependencies? Have you updated the dependency versions in the documentation?
12
+ - [ ] **Testing:** Have you written and run sufficient tests for validating the changes?
13
+ - [ ] **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?
14
+ - [ ] **Prefix:** To cleary categorize this pull request, prefix the pull request title, using one of the following:
15
+ - **BREAKING CHANGE**: Significant changes that may affect compatibility
16
+ - **build**: Changes that affect the build system or external dependencies
17
+ - **ci**: Changes to our continuous integration processes or workflows
18
+ - **chore**: Refactor, cleanup, or other non-functional code changes
19
+ - **docs**: Documentation update or addition
20
+ - **feat**: Introduces a new feature or enhancement to the codebase
21
+ - **fix**: Bug fix or error correction
22
+ - **i18n**: Internationalization or localization changes
23
+ - **perf**: Performance improvement
24
+ - **refactor**: Code restructuring for better maintainability, readability, or scalability
25
+ - **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc.)
26
+ - **test**: Adding missing tests or correcting existing tests
27
+ - **WIP**: Work in progress, a temporary label for incomplete or ongoing work
28
+
29
+ # Changelog Entry
30
+
31
+ ### Description
32
+
33
+ - [Concisely describe the changes made in this pull request, including any relevant motivation and impact (e.g., fixing a bug, adding a feature, or improving performance)]
34
+
35
+ ### Added
36
+
37
+ - [List any new features, functionalities, or additions]
38
+
39
+ ### Changed
40
+
41
+ - [List any changes, updates, refactorings, or optimizations]
42
+
43
+ ### Deprecated
44
+
45
+ - [List any deprecated functionality or features that have been removed]
46
+
47
+ ### Removed
48
+
49
+ - [List any removed features, files, or functionalities]
50
+
51
+ ### Fixed
52
+
53
+ - [List any fixes, corrections, or bug fixes]
54
+
55
+ ### Security
56
+
57
+ - [List any new or updated security-related changes, including vulnerability fixes]
58
+
59
+ ### Breaking Changes
60
+
61
+ - **BREAKING CHANGE**: [List any breaking changes affecting compatibility or functionality]
62
+
63
+ ---
64
+
65
+ ### Additional Information
66
+
67
+ - [Insert any additional context, notes, or explanations for the changes]
68
+ - [Reference any related issues, commits, or other relevant information]
69
+
70
+ ### Screenshots or Videos
71
+
72
+ - [Attach any relevant screenshots or videos demonstrating the changes]
.github/workflows/build-release.yml CHANGED
@@ -1,72 +1,72 @@
1
- name: Release
2
-
3
- on:
4
- push:
5
- branches:
6
- - main # or whatever branch you want to use
7
-
8
- jobs:
9
- release:
10
- runs-on: ubuntu-latest
11
-
12
- steps:
13
- - name: Checkout repository
14
- uses: actions/checkout@v4
15
-
16
- - name: Check for changes in package.json
17
- run: |
18
- git diff --cached --diff-filter=d package.json || {
19
- echo "No changes to package.json"
20
- exit 1
21
- }
22
-
23
- - name: Get version number from package.json
24
- id: get_version
25
- run: |
26
- VERSION=$(jq -r '.version' package.json)
27
- echo "::set-output name=version::$VERSION"
28
-
29
- - name: Extract latest CHANGELOG entry
30
- id: changelog
31
- run: |
32
- CHANGELOG_CONTENT=$(awk 'BEGIN {print_section=0;} /^## \[/ {if (print_section == 0) {print_section=1;} else {exit;}} print_section {print;}' CHANGELOG.md)
33
- CHANGELOG_ESCAPED=$(echo "$CHANGELOG_CONTENT" | sed ':a;N;$!ba;s/\n/%0A/g')
34
- echo "Extracted latest release notes from CHANGELOG.md:"
35
- echo -e "$CHANGELOG_CONTENT"
36
- echo "::set-output name=content::$CHANGELOG_ESCAPED"
37
-
38
- - name: Create GitHub release
39
- uses: actions/github-script@v7
40
- with:
41
- github-token: ${{ secrets.GITHUB_TOKEN }}
42
- script: |
43
- const changelog = `${{ steps.changelog.outputs.content }}`;
44
- const release = await github.rest.repos.createRelease({
45
- owner: context.repo.owner,
46
- repo: context.repo.repo,
47
- tag_name: `v${{ steps.get_version.outputs.version }}`,
48
- name: `v${{ steps.get_version.outputs.version }}`,
49
- body: changelog,
50
- })
51
- console.log(`Created release ${release.data.html_url}`)
52
-
53
- - name: Upload package to GitHub release
54
- uses: actions/upload-artifact@v4
55
- with:
56
- name: package
57
- path: |
58
- .
59
- !.git
60
- env:
61
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62
-
63
- - name: Trigger Docker build workflow
64
- uses: actions/github-script@v7
65
- with:
66
- script: |
67
- github.rest.actions.createWorkflowDispatch({
68
- owner: context.repo.owner,
69
- repo: context.repo.repo,
70
- workflow_id: 'docker-build.yaml',
71
- ref: 'v${{ steps.get_version.outputs.version }}',
72
- })
 
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main # or whatever branch you want to use
7
+
8
+ jobs:
9
+ release:
10
+ runs-on: ubuntu-latest
11
+
12
+ steps:
13
+ - name: Checkout repository
14
+ uses: actions/checkout@v4
15
+
16
+ - name: Check for changes in package.json
17
+ run: |
18
+ git diff --cached --diff-filter=d package.json || {
19
+ echo "No changes to package.json"
20
+ exit 1
21
+ }
22
+
23
+ - name: Get version number from package.json
24
+ id: get_version
25
+ run: |
26
+ VERSION=$(jq -r '.version' package.json)
27
+ echo "::set-output name=version::$VERSION"
28
+
29
+ - name: Extract latest CHANGELOG entry
30
+ id: changelog
31
+ run: |
32
+ CHANGELOG_CONTENT=$(awk 'BEGIN {print_section=0;} /^## \[/ {if (print_section == 0) {print_section=1;} else {exit;}} print_section {print;}' CHANGELOG.md)
33
+ CHANGELOG_ESCAPED=$(echo "$CHANGELOG_CONTENT" | sed ':a;N;$!ba;s/\n/%0A/g')
34
+ echo "Extracted latest release notes from CHANGELOG.md:"
35
+ echo -e "$CHANGELOG_CONTENT"
36
+ echo "::set-output name=content::$CHANGELOG_ESCAPED"
37
+
38
+ - name: Create GitHub release
39
+ uses: actions/github-script@v7
40
+ with:
41
+ github-token: ${{ secrets.GITHUB_TOKEN }}
42
+ script: |
43
+ const changelog = `${{ steps.changelog.outputs.content }}`;
44
+ const release = await github.rest.repos.createRelease({
45
+ owner: context.repo.owner,
46
+ repo: context.repo.repo,
47
+ tag_name: `v${{ steps.get_version.outputs.version }}`,
48
+ name: `v${{ steps.get_version.outputs.version }}`,
49
+ body: changelog,
50
+ })
51
+ console.log(`Created release ${release.data.html_url}`)
52
+
53
+ - name: Upload package to GitHub release
54
+ uses: actions/upload-artifact@v4
55
+ with:
56
+ name: package
57
+ path: |
58
+ .
59
+ !.git
60
+ env:
61
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62
+
63
+ - name: Trigger Docker build workflow
64
+ uses: actions/github-script@v7
65
+ with:
66
+ script: |
67
+ github.rest.actions.createWorkflowDispatch({
68
+ owner: context.repo.owner,
69
+ repo: context.repo.repo,
70
+ workflow_id: 'docker-build.yaml',
71
+ ref: 'v${{ steps.get_version.outputs.version }}',
72
+ })
.github/workflows/deploy-to-hf-spaces.yml CHANGED
@@ -1,59 +1,59 @@
1
- name: Deploy to HuggingFace Spaces
2
-
3
- on:
4
- push:
5
- branches:
6
- - dev
7
- - main
8
- workflow_dispatch:
9
-
10
- jobs:
11
- check-secret:
12
- runs-on: ubuntu-latest
13
- outputs:
14
- token-set: ${{ steps.check-key.outputs.defined }}
15
- steps:
16
- - id: check-key
17
- env:
18
- HF_TOKEN: ${{ secrets.HF_TOKEN }}
19
- if: "${{ env.HF_TOKEN != '' }}"
20
- run: echo "defined=true" >> $GITHUB_OUTPUT
21
-
22
- deploy:
23
- runs-on: ubuntu-latest
24
- needs: [check-secret]
25
- if: needs.check-secret.outputs.token-set == 'true'
26
- env:
27
- HF_TOKEN: ${{ secrets.HF_TOKEN }}
28
- steps:
29
- - name: Checkout repository
30
- uses: actions/checkout@v4
31
-
32
- - name: Remove git history
33
- run: rm -rf .git
34
-
35
- - name: Prepend YAML front matter to README.md
36
- run: |
37
- echo "---" > temp_readme.md
38
- echo "title: Open WebUI" >> temp_readme.md
39
- echo "emoji: 🐳" >> temp_readme.md
40
- echo "colorFrom: purple" >> temp_readme.md
41
- echo "colorTo: gray" >> temp_readme.md
42
- echo "sdk: docker" >> temp_readme.md
43
- echo "app_port: 8080" >> temp_readme.md
44
- echo "---" >> temp_readme.md
45
- cat README.md >> temp_readme.md
46
- mv temp_readme.md README.md
47
-
48
- - name: Configure git
49
- run: |
50
- git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
51
- git config --global user.name "github-actions[bot]"
52
- - name: Set up Git and push to Space
53
- run: |
54
- git init --initial-branch=main
55
- git lfs track "*.ttf"
56
- rm demo.gif
57
- git add .
58
- git commit -m "GitHub deploy: ${{ github.sha }}"
59
- git push --force https://open-webui:${HF_TOKEN}@huggingface.co/spaces/open-webui/open-webui main
 
1
+ name: Deploy to HuggingFace Spaces
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - dev
7
+ - main
8
+ workflow_dispatch:
9
+
10
+ jobs:
11
+ check-secret:
12
+ runs-on: ubuntu-latest
13
+ outputs:
14
+ token-set: ${{ steps.check-key.outputs.defined }}
15
+ steps:
16
+ - id: check-key
17
+ env:
18
+ HF_TOKEN: ${{ secrets.HF_TOKEN }}
19
+ if: "${{ env.HF_TOKEN != '' }}"
20
+ run: echo "defined=true" >> $GITHUB_OUTPUT
21
+
22
+ deploy:
23
+ runs-on: ubuntu-latest
24
+ needs: [check-secret]
25
+ if: needs.check-secret.outputs.token-set == 'true'
26
+ env:
27
+ HF_TOKEN: ${{ secrets.HF_TOKEN }}
28
+ steps:
29
+ - name: Checkout repository
30
+ uses: actions/checkout@v4
31
+
32
+ - name: Remove git history
33
+ run: rm -rf .git
34
+
35
+ - name: Prepend YAML front matter to README.md
36
+ run: |
37
+ echo "---" > temp_readme.md
38
+ echo "title: Open WebUI" >> temp_readme.md
39
+ echo "emoji: 🐳" >> temp_readme.md
40
+ echo "colorFrom: purple" >> temp_readme.md
41
+ echo "colorTo: gray" >> temp_readme.md
42
+ echo "sdk: docker" >> temp_readme.md
43
+ echo "app_port: 8080" >> temp_readme.md
44
+ echo "---" >> temp_readme.md
45
+ cat README.md >> temp_readme.md
46
+ mv temp_readme.md README.md
47
+
48
+ - name: Configure git
49
+ run: |
50
+ git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
51
+ git config --global user.name "github-actions[bot]"
52
+ - name: Set up Git and push to Space
53
+ run: |
54
+ git init --initial-branch=main
55
+ git lfs track "*.ttf"
56
+ rm demo.gif
57
+ git add .
58
+ git commit -m "GitHub deploy: ${{ github.sha }}"
59
+ git push --force https://open-webui:${HF_TOKEN}@huggingface.co/spaces/open-webui/open-webui main
.github/workflows/docker-build.yaml CHANGED
@@ -1,477 +1,477 @@
1
- name: Create and publish Docker images with specific build args
2
-
3
- on:
4
- workflow_dispatch:
5
- push:
6
- branches:
7
- - main
8
- - dev
9
- tags:
10
- - v*
11
-
12
- env:
13
- REGISTRY: ghcr.io
14
-
15
- jobs:
16
- build-main-image:
17
- runs-on: ubuntu-latest
18
- permissions:
19
- contents: read
20
- packages: write
21
- strategy:
22
- fail-fast: false
23
- matrix:
24
- platform:
25
- - linux/amd64
26
- - linux/arm64
27
-
28
- steps:
29
- # GitHub Packages requires the entire repository name to be in lowercase
30
- # although the repository owner has a lowercase username, this prevents some people from running actions after forking
31
- - name: Set repository and image name to lowercase
32
- run: |
33
- echo "IMAGE_NAME=${IMAGE_NAME,,}" >>${GITHUB_ENV}
34
- echo "FULL_IMAGE_NAME=ghcr.io/${IMAGE_NAME,,}" >>${GITHUB_ENV}
35
- env:
36
- IMAGE_NAME: '${{ github.repository }}'
37
-
38
- - name: Prepare
39
- run: |
40
- platform=${{ matrix.platform }}
41
- echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
42
-
43
- - name: Checkout repository
44
- uses: actions/checkout@v4
45
-
46
- - name: Set up QEMU
47
- uses: docker/setup-qemu-action@v3
48
-
49
- - name: Set up Docker Buildx
50
- uses: docker/setup-buildx-action@v3
51
-
52
- - name: Log in to the Container registry
53
- uses: docker/login-action@v3
54
- with:
55
- registry: ${{ env.REGISTRY }}
56
- username: ${{ github.actor }}
57
- password: ${{ secrets.GITHUB_TOKEN }}
58
-
59
- - name: Extract metadata for Docker images (default latest tag)
60
- id: meta
61
- uses: docker/metadata-action@v5
62
- with:
63
- images: ${{ env.FULL_IMAGE_NAME }}
64
- tags: |
65
- type=ref,event=branch
66
- type=ref,event=tag
67
- type=sha,prefix=git-
68
- type=semver,pattern={{version}}
69
- type=semver,pattern={{major}}.{{minor}}
70
- flavor: |
71
- latest=${{ github.ref == 'refs/heads/main' }}
72
-
73
- - name: Extract metadata for Docker cache
74
- id: cache-meta
75
- uses: docker/metadata-action@v5
76
- with:
77
- images: ${{ env.FULL_IMAGE_NAME }}
78
- tags: |
79
- type=ref,event=branch
80
- ${{ github.ref_type == 'tag' && 'type=raw,value=main' || '' }}
81
- flavor: |
82
- prefix=cache-${{ matrix.platform }}-
83
- latest=false
84
-
85
- - name: Build Docker image (latest)
86
- uses: docker/build-push-action@v5
87
- id: build
88
- with:
89
- context: .
90
- push: true
91
- platforms: ${{ matrix.platform }}
92
- labels: ${{ steps.meta.outputs.labels }}
93
- outputs: type=image,name=${{ env.FULL_IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true
94
- cache-from: type=registry,ref=${{ steps.cache-meta.outputs.tags }}
95
- cache-to: type=registry,ref=${{ steps.cache-meta.outputs.tags }},mode=max
96
- build-args: |
97
- BUILD_HASH=${{ github.sha }}
98
-
99
- - name: Export digest
100
- run: |
101
- mkdir -p /tmp/digests
102
- digest="${{ steps.build.outputs.digest }}"
103
- touch "/tmp/digests/${digest#sha256:}"
104
-
105
- - name: Upload digest
106
- uses: actions/upload-artifact@v4
107
- with:
108
- name: digests-main-${{ env.PLATFORM_PAIR }}
109
- path: /tmp/digests/*
110
- if-no-files-found: error
111
- retention-days: 1
112
-
113
- build-cuda-image:
114
- runs-on: ubuntu-latest
115
- permissions:
116
- contents: read
117
- packages: write
118
- strategy:
119
- fail-fast: false
120
- matrix:
121
- platform:
122
- - linux/amd64
123
- - linux/arm64
124
-
125
- steps:
126
- # GitHub Packages requires the entire repository name to be in lowercase
127
- # although the repository owner has a lowercase username, this prevents some people from running actions after forking
128
- - name: Set repository and image name to lowercase
129
- run: |
130
- echo "IMAGE_NAME=${IMAGE_NAME,,}" >>${GITHUB_ENV}
131
- echo "FULL_IMAGE_NAME=ghcr.io/${IMAGE_NAME,,}" >>${GITHUB_ENV}
132
- env:
133
- IMAGE_NAME: '${{ github.repository }}'
134
-
135
- - name: Prepare
136
- run: |
137
- platform=${{ matrix.platform }}
138
- echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
139
-
140
- - name: Checkout repository
141
- uses: actions/checkout@v4
142
-
143
- - name: Set up QEMU
144
- uses: docker/setup-qemu-action@v3
145
-
146
- - name: Set up Docker Buildx
147
- uses: docker/setup-buildx-action@v3
148
-
149
- - name: Log in to the Container registry
150
- uses: docker/login-action@v3
151
- with:
152
- registry: ${{ env.REGISTRY }}
153
- username: ${{ github.actor }}
154
- password: ${{ secrets.GITHUB_TOKEN }}
155
-
156
- - name: Extract metadata for Docker images (cuda tag)
157
- id: meta
158
- uses: docker/metadata-action@v5
159
- with:
160
- images: ${{ env.FULL_IMAGE_NAME }}
161
- tags: |
162
- type=ref,event=branch
163
- type=ref,event=tag
164
- type=sha,prefix=git-
165
- type=semver,pattern={{version}}
166
- type=semver,pattern={{major}}.{{minor}}
167
- type=raw,enable=${{ github.ref == 'refs/heads/main' }},prefix=,suffix=,value=cuda
168
- flavor: |
169
- latest=${{ github.ref == 'refs/heads/main' }}
170
- suffix=-cuda,onlatest=true
171
-
172
- - name: Extract metadata for Docker cache
173
- id: cache-meta
174
- uses: docker/metadata-action@v5
175
- with:
176
- images: ${{ env.FULL_IMAGE_NAME }}
177
- tags: |
178
- type=ref,event=branch
179
- ${{ github.ref_type == 'tag' && 'type=raw,value=main' || '' }}
180
- flavor: |
181
- prefix=cache-cuda-${{ matrix.platform }}-
182
- latest=false
183
-
184
- - name: Build Docker image (cuda)
185
- uses: docker/build-push-action@v5
186
- id: build
187
- with:
188
- context: .
189
- push: true
190
- platforms: ${{ matrix.platform }}
191
- labels: ${{ steps.meta.outputs.labels }}
192
- outputs: type=image,name=${{ env.FULL_IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true
193
- cache-from: type=registry,ref=${{ steps.cache-meta.outputs.tags }}
194
- cache-to: type=registry,ref=${{ steps.cache-meta.outputs.tags }},mode=max
195
- build-args: |
196
- BUILD_HASH=${{ github.sha }}
197
- USE_CUDA=true
198
-
199
- - name: Export digest
200
- run: |
201
- mkdir -p /tmp/digests
202
- digest="${{ steps.build.outputs.digest }}"
203
- touch "/tmp/digests/${digest#sha256:}"
204
-
205
- - name: Upload digest
206
- uses: actions/upload-artifact@v4
207
- with:
208
- name: digests-cuda-${{ env.PLATFORM_PAIR }}
209
- path: /tmp/digests/*
210
- if-no-files-found: error
211
- retention-days: 1
212
-
213
- build-ollama-image:
214
- runs-on: ubuntu-latest
215
- permissions:
216
- contents: read
217
- packages: write
218
- strategy:
219
- fail-fast: false
220
- matrix:
221
- platform:
222
- - linux/amd64
223
- - linux/arm64
224
-
225
- steps:
226
- # GitHub Packages requires the entire repository name to be in lowercase
227
- # although the repository owner has a lowercase username, this prevents some people from running actions after forking
228
- - name: Set repository and image name to lowercase
229
- run: |
230
- echo "IMAGE_NAME=${IMAGE_NAME,,}" >>${GITHUB_ENV}
231
- echo "FULL_IMAGE_NAME=ghcr.io/${IMAGE_NAME,,}" >>${GITHUB_ENV}
232
- env:
233
- IMAGE_NAME: '${{ github.repository }}'
234
-
235
- - name: Prepare
236
- run: |
237
- platform=${{ matrix.platform }}
238
- echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
239
-
240
- - name: Checkout repository
241
- uses: actions/checkout@v4
242
-
243
- - name: Set up QEMU
244
- uses: docker/setup-qemu-action@v3
245
-
246
- - name: Set up Docker Buildx
247
- uses: docker/setup-buildx-action@v3
248
-
249
- - name: Log in to the Container registry
250
- uses: docker/login-action@v3
251
- with:
252
- registry: ${{ env.REGISTRY }}
253
- username: ${{ github.actor }}
254
- password: ${{ secrets.GITHUB_TOKEN }}
255
-
256
- - name: Extract metadata for Docker images (ollama tag)
257
- id: meta
258
- uses: docker/metadata-action@v5
259
- with:
260
- images: ${{ env.FULL_IMAGE_NAME }}
261
- tags: |
262
- type=ref,event=branch
263
- type=ref,event=tag
264
- type=sha,prefix=git-
265
- type=semver,pattern={{version}}
266
- type=semver,pattern={{major}}.{{minor}}
267
- type=raw,enable=${{ github.ref == 'refs/heads/main' }},prefix=,suffix=,value=ollama
268
- flavor: |
269
- latest=${{ github.ref == 'refs/heads/main' }}
270
- suffix=-ollama,onlatest=true
271
-
272
- - name: Extract metadata for Docker cache
273
- id: cache-meta
274
- uses: docker/metadata-action@v5
275
- with:
276
- images: ${{ env.FULL_IMAGE_NAME }}
277
- tags: |
278
- type=ref,event=branch
279
- ${{ github.ref_type == 'tag' && 'type=raw,value=main' || '' }}
280
- flavor: |
281
- prefix=cache-ollama-${{ matrix.platform }}-
282
- latest=false
283
-
284
- - name: Build Docker image (ollama)
285
- uses: docker/build-push-action@v5
286
- id: build
287
- with:
288
- context: .
289
- push: true
290
- platforms: ${{ matrix.platform }}
291
- labels: ${{ steps.meta.outputs.labels }}
292
- outputs: type=image,name=${{ env.FULL_IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true
293
- cache-from: type=registry,ref=${{ steps.cache-meta.outputs.tags }}
294
- cache-to: type=registry,ref=${{ steps.cache-meta.outputs.tags }},mode=max
295
- build-args: |
296
- BUILD_HASH=${{ github.sha }}
297
- USE_OLLAMA=true
298
-
299
- - name: Export digest
300
- run: |
301
- mkdir -p /tmp/digests
302
- digest="${{ steps.build.outputs.digest }}"
303
- touch "/tmp/digests/${digest#sha256:}"
304
-
305
- - name: Upload digest
306
- uses: actions/upload-artifact@v4
307
- with:
308
- name: digests-ollama-${{ env.PLATFORM_PAIR }}
309
- path: /tmp/digests/*
310
- if-no-files-found: error
311
- retention-days: 1
312
-
313
- merge-main-images:
314
- runs-on: ubuntu-latest
315
- needs: [build-main-image]
316
- steps:
317
- # GitHub Packages requires the entire repository name to be in lowercase
318
- # although the repository owner has a lowercase username, this prevents some people from running actions after forking
319
- - name: Set repository and image name to lowercase
320
- run: |
321
- echo "IMAGE_NAME=${IMAGE_NAME,,}" >>${GITHUB_ENV}
322
- echo "FULL_IMAGE_NAME=ghcr.io/${IMAGE_NAME,,}" >>${GITHUB_ENV}
323
- env:
324
- IMAGE_NAME: '${{ github.repository }}'
325
-
326
- - name: Download digests
327
- uses: actions/download-artifact@v4
328
- with:
329
- pattern: digests-main-*
330
- path: /tmp/digests
331
- merge-multiple: true
332
-
333
- - name: Set up Docker Buildx
334
- uses: docker/setup-buildx-action@v3
335
-
336
- - name: Log in to the Container registry
337
- uses: docker/login-action@v3
338
- with:
339
- registry: ${{ env.REGISTRY }}
340
- username: ${{ github.actor }}
341
- password: ${{ secrets.GITHUB_TOKEN }}
342
-
343
- - name: Extract metadata for Docker images (default latest tag)
344
- id: meta
345
- uses: docker/metadata-action@v5
346
- with:
347
- images: ${{ env.FULL_IMAGE_NAME }}
348
- tags: |
349
- type=ref,event=branch
350
- type=ref,event=tag
351
- type=sha,prefix=git-
352
- type=semver,pattern={{version}}
353
- type=semver,pattern={{major}}.{{minor}}
354
- flavor: |
355
- latest=${{ github.ref == 'refs/heads/main' }}
356
-
357
- - name: Create manifest list and push
358
- working-directory: /tmp/digests
359
- run: |
360
- docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
361
- $(printf '${{ env.FULL_IMAGE_NAME }}@sha256:%s ' *)
362
-
363
- - name: Inspect image
364
- run: |
365
- docker buildx imagetools inspect ${{ env.FULL_IMAGE_NAME }}:${{ steps.meta.outputs.version }}
366
-
367
- merge-cuda-images:
368
- runs-on: ubuntu-latest
369
- needs: [build-cuda-image]
370
- steps:
371
- # GitHub Packages requires the entire repository name to be in lowercase
372
- # although the repository owner has a lowercase username, this prevents some people from running actions after forking
373
- - name: Set repository and image name to lowercase
374
- run: |
375
- echo "IMAGE_NAME=${IMAGE_NAME,,}" >>${GITHUB_ENV}
376
- echo "FULL_IMAGE_NAME=ghcr.io/${IMAGE_NAME,,}" >>${GITHUB_ENV}
377
- env:
378
- IMAGE_NAME: '${{ github.repository }}'
379
-
380
- - name: Download digests
381
- uses: actions/download-artifact@v4
382
- with:
383
- pattern: digests-cuda-*
384
- path: /tmp/digests
385
- merge-multiple: true
386
-
387
- - name: Set up Docker Buildx
388
- uses: docker/setup-buildx-action@v3
389
-
390
- - name: Log in to the Container registry
391
- uses: docker/login-action@v3
392
- with:
393
- registry: ${{ env.REGISTRY }}
394
- username: ${{ github.actor }}
395
- password: ${{ secrets.GITHUB_TOKEN }}
396
-
397
- - name: Extract metadata for Docker images (default latest tag)
398
- id: meta
399
- uses: docker/metadata-action@v5
400
- with:
401
- images: ${{ env.FULL_IMAGE_NAME }}
402
- tags: |
403
- type=ref,event=branch
404
- type=ref,event=tag
405
- type=sha,prefix=git-
406
- type=semver,pattern={{version}}
407
- type=semver,pattern={{major}}.{{minor}}
408
- type=raw,enable=${{ github.ref == 'refs/heads/main' }},prefix=,suffix=,value=cuda
409
- flavor: |
410
- latest=${{ github.ref == 'refs/heads/main' }}
411
- suffix=-cuda,onlatest=true
412
-
413
- - name: Create manifest list and push
414
- working-directory: /tmp/digests
415
- run: |
416
- docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
417
- $(printf '${{ env.FULL_IMAGE_NAME }}@sha256:%s ' *)
418
-
419
- - name: Inspect image
420
- run: |
421
- docker buildx imagetools inspect ${{ env.FULL_IMAGE_NAME }}:${{ steps.meta.outputs.version }}
422
-
423
- merge-ollama-images:
424
- runs-on: ubuntu-latest
425
- needs: [build-ollama-image]
426
- steps:
427
- # GitHub Packages requires the entire repository name to be in lowercase
428
- # although the repository owner has a lowercase username, this prevents some people from running actions after forking
429
- - name: Set repository and image name to lowercase
430
- run: |
431
- echo "IMAGE_NAME=${IMAGE_NAME,,}" >>${GITHUB_ENV}
432
- echo "FULL_IMAGE_NAME=ghcr.io/${IMAGE_NAME,,}" >>${GITHUB_ENV}
433
- env:
434
- IMAGE_NAME: '${{ github.repository }}'
435
-
436
- - name: Download digests
437
- uses: actions/download-artifact@v4
438
- with:
439
- pattern: digests-ollama-*
440
- path: /tmp/digests
441
- merge-multiple: true
442
-
443
- - name: Set up Docker Buildx
444
- uses: docker/setup-buildx-action@v3
445
-
446
- - name: Log in to the Container registry
447
- uses: docker/login-action@v3
448
- with:
449
- registry: ${{ env.REGISTRY }}
450
- username: ${{ github.actor }}
451
- password: ${{ secrets.GITHUB_TOKEN }}
452
-
453
- - name: Extract metadata for Docker images (default ollama tag)
454
- id: meta
455
- uses: docker/metadata-action@v5
456
- with:
457
- images: ${{ env.FULL_IMAGE_NAME }}
458
- tags: |
459
- type=ref,event=branch
460
- type=ref,event=tag
461
- type=sha,prefix=git-
462
- type=semver,pattern={{version}}
463
- type=semver,pattern={{major}}.{{minor}}
464
- type=raw,enable=${{ github.ref == 'refs/heads/main' }},prefix=,suffix=,value=ollama
465
- flavor: |
466
- latest=${{ github.ref == 'refs/heads/main' }}
467
- suffix=-ollama,onlatest=true
468
-
469
- - name: Create manifest list and push
470
- working-directory: /tmp/digests
471
- run: |
472
- docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
473
- $(printf '${{ env.FULL_IMAGE_NAME }}@sha256:%s ' *)
474
-
475
- - name: Inspect image
476
- run: |
477
- docker buildx imagetools inspect ${{ env.FULL_IMAGE_NAME }}:${{ steps.meta.outputs.version }}
 
1
+ name: Create and publish Docker images with specific build args
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ push:
6
+ branches:
7
+ - main
8
+ - dev
9
+ tags:
10
+ - v*
11
+
12
+ env:
13
+ REGISTRY: ghcr.io
14
+
15
+ jobs:
16
+ build-main-image:
17
+ runs-on: ubuntu-latest
18
+ permissions:
19
+ contents: read
20
+ packages: write
21
+ strategy:
22
+ fail-fast: false
23
+ matrix:
24
+ platform:
25
+ - linux/amd64
26
+ - linux/arm64
27
+
28
+ steps:
29
+ # GitHub Packages requires the entire repository name to be in lowercase
30
+ # although the repository owner has a lowercase username, this prevents some people from running actions after forking
31
+ - name: Set repository and image name to lowercase
32
+ run: |
33
+ echo "IMAGE_NAME=${IMAGE_NAME,,}" >>${GITHUB_ENV}
34
+ echo "FULL_IMAGE_NAME=ghcr.io/${IMAGE_NAME,,}" >>${GITHUB_ENV}
35
+ env:
36
+ IMAGE_NAME: '${{ github.repository }}'
37
+
38
+ - name: Prepare
39
+ run: |
40
+ platform=${{ matrix.platform }}
41
+ echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
42
+
43
+ - name: Checkout repository
44
+ uses: actions/checkout@v4
45
+
46
+ - name: Set up QEMU
47
+ uses: docker/setup-qemu-action@v3
48
+
49
+ - name: Set up Docker Buildx
50
+ uses: docker/setup-buildx-action@v3
51
+
52
+ - name: Log in to the Container registry
53
+ uses: docker/login-action@v3
54
+ with:
55
+ registry: ${{ env.REGISTRY }}
56
+ username: ${{ github.actor }}
57
+ password: ${{ secrets.GITHUB_TOKEN }}
58
+
59
+ - name: Extract metadata for Docker images (default latest tag)
60
+ id: meta
61
+ uses: docker/metadata-action@v5
62
+ with:
63
+ images: ${{ env.FULL_IMAGE_NAME }}
64
+ tags: |
65
+ type=ref,event=branch
66
+ type=ref,event=tag
67
+ type=sha,prefix=git-
68
+ type=semver,pattern={{version}}
69
+ type=semver,pattern={{major}}.{{minor}}
70
+ flavor: |
71
+ latest=${{ github.ref == 'refs/heads/main' }}
72
+
73
+ - name: Extract metadata for Docker cache
74
+ id: cache-meta
75
+ uses: docker/metadata-action@v5
76
+ with:
77
+ images: ${{ env.FULL_IMAGE_NAME }}
78
+ tags: |
79
+ type=ref,event=branch
80
+ ${{ github.ref_type == 'tag' && 'type=raw,value=main' || '' }}
81
+ flavor: |
82
+ prefix=cache-${{ matrix.platform }}-
83
+ latest=false
84
+
85
+ - name: Build Docker image (latest)
86
+ uses: docker/build-push-action@v5
87
+ id: build
88
+ with:
89
+ context: .
90
+ push: true
91
+ platforms: ${{ matrix.platform }}
92
+ labels: ${{ steps.meta.outputs.labels }}
93
+ outputs: type=image,name=${{ env.FULL_IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true
94
+ cache-from: type=registry,ref=${{ steps.cache-meta.outputs.tags }}
95
+ cache-to: type=registry,ref=${{ steps.cache-meta.outputs.tags }},mode=max
96
+ build-args: |
97
+ BUILD_HASH=${{ github.sha }}
98
+
99
+ - name: Export digest
100
+ run: |
101
+ mkdir -p /tmp/digests
102
+ digest="${{ steps.build.outputs.digest }}"
103
+ touch "/tmp/digests/${digest#sha256:}"
104
+
105
+ - name: Upload digest
106
+ uses: actions/upload-artifact@v4
107
+ with:
108
+ name: digests-main-${{ env.PLATFORM_PAIR }}
109
+ path: /tmp/digests/*
110
+ if-no-files-found: error
111
+ retention-days: 1
112
+
113
+ build-cuda-image:
114
+ runs-on: ubuntu-latest
115
+ permissions:
116
+ contents: read
117
+ packages: write
118
+ strategy:
119
+ fail-fast: false
120
+ matrix:
121
+ platform:
122
+ - linux/amd64
123
+ - linux/arm64
124
+
125
+ steps:
126
+ # GitHub Packages requires the entire repository name to be in lowercase
127
+ # although the repository owner has a lowercase username, this prevents some people from running actions after forking
128
+ - name: Set repository and image name to lowercase
129
+ run: |
130
+ echo "IMAGE_NAME=${IMAGE_NAME,,}" >>${GITHUB_ENV}
131
+ echo "FULL_IMAGE_NAME=ghcr.io/${IMAGE_NAME,,}" >>${GITHUB_ENV}
132
+ env:
133
+ IMAGE_NAME: '${{ github.repository }}'
134
+
135
+ - name: Prepare
136
+ run: |
137
+ platform=${{ matrix.platform }}
138
+ echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
139
+
140
+ - name: Checkout repository
141
+ uses: actions/checkout@v4
142
+
143
+ - name: Set up QEMU
144
+ uses: docker/setup-qemu-action@v3
145
+
146
+ - name: Set up Docker Buildx
147
+ uses: docker/setup-buildx-action@v3
148
+
149
+ - name: Log in to the Container registry
150
+ uses: docker/login-action@v3
151
+ with:
152
+ registry: ${{ env.REGISTRY }}
153
+ username: ${{ github.actor }}
154
+ password: ${{ secrets.GITHUB_TOKEN }}
155
+
156
+ - name: Extract metadata for Docker images (cuda tag)
157
+ id: meta
158
+ uses: docker/metadata-action@v5
159
+ with:
160
+ images: ${{ env.FULL_IMAGE_NAME }}
161
+ tags: |
162
+ type=ref,event=branch
163
+ type=ref,event=tag
164
+ type=sha,prefix=git-
165
+ type=semver,pattern={{version}}
166
+ type=semver,pattern={{major}}.{{minor}}
167
+ type=raw,enable=${{ github.ref == 'refs/heads/main' }},prefix=,suffix=,value=cuda
168
+ flavor: |
169
+ latest=${{ github.ref == 'refs/heads/main' }}
170
+ suffix=-cuda,onlatest=true
171
+
172
+ - name: Extract metadata for Docker cache
173
+ id: cache-meta
174
+ uses: docker/metadata-action@v5
175
+ with:
176
+ images: ${{ env.FULL_IMAGE_NAME }}
177
+ tags: |
178
+ type=ref,event=branch
179
+ ${{ github.ref_type == 'tag' && 'type=raw,value=main' || '' }}
180
+ flavor: |
181
+ prefix=cache-cuda-${{ matrix.platform }}-
182
+ latest=false
183
+
184
+ - name: Build Docker image (cuda)
185
+ uses: docker/build-push-action@v5
186
+ id: build
187
+ with:
188
+ context: .
189
+ push: true
190
+ platforms: ${{ matrix.platform }}
191
+ labels: ${{ steps.meta.outputs.labels }}
192
+ outputs: type=image,name=${{ env.FULL_IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true
193
+ cache-from: type=registry,ref=${{ steps.cache-meta.outputs.tags }}
194
+ cache-to: type=registry,ref=${{ steps.cache-meta.outputs.tags }},mode=max
195
+ build-args: |
196
+ BUILD_HASH=${{ github.sha }}
197
+ USE_CUDA=true
198
+
199
+ - name: Export digest
200
+ run: |
201
+ mkdir -p /tmp/digests
202
+ digest="${{ steps.build.outputs.digest }}"
203
+ touch "/tmp/digests/${digest#sha256:}"
204
+
205
+ - name: Upload digest
206
+ uses: actions/upload-artifact@v4
207
+ with:
208
+ name: digests-cuda-${{ env.PLATFORM_PAIR }}
209
+ path: /tmp/digests/*
210
+ if-no-files-found: error
211
+ retention-days: 1
212
+
213
+ build-ollama-image:
214
+ runs-on: ubuntu-latest
215
+ permissions:
216
+ contents: read
217
+ packages: write
218
+ strategy:
219
+ fail-fast: false
220
+ matrix:
221
+ platform:
222
+ - linux/amd64
223
+ - linux/arm64
224
+
225
+ steps:
226
+ # GitHub Packages requires the entire repository name to be in lowercase
227
+ # although the repository owner has a lowercase username, this prevents some people from running actions after forking
228
+ - name: Set repository and image name to lowercase
229
+ run: |
230
+ echo "IMAGE_NAME=${IMAGE_NAME,,}" >>${GITHUB_ENV}
231
+ echo "FULL_IMAGE_NAME=ghcr.io/${IMAGE_NAME,,}" >>${GITHUB_ENV}
232
+ env:
233
+ IMAGE_NAME: '${{ github.repository }}'
234
+
235
+ - name: Prepare
236
+ run: |
237
+ platform=${{ matrix.platform }}
238
+ echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
239
+
240
+ - name: Checkout repository
241
+ uses: actions/checkout@v4
242
+
243
+ - name: Set up QEMU
244
+ uses: docker/setup-qemu-action@v3
245
+
246
+ - name: Set up Docker Buildx
247
+ uses: docker/setup-buildx-action@v3
248
+
249
+ - name: Log in to the Container registry
250
+ uses: docker/login-action@v3
251
+ with:
252
+ registry: ${{ env.REGISTRY }}
253
+ username: ${{ github.actor }}
254
+ password: ${{ secrets.GITHUB_TOKEN }}
255
+
256
+ - name: Extract metadata for Docker images (ollama tag)
257
+ id: meta
258
+ uses: docker/metadata-action@v5
259
+ with:
260
+ images: ${{ env.FULL_IMAGE_NAME }}
261
+ tags: |
262
+ type=ref,event=branch
263
+ type=ref,event=tag
264
+ type=sha,prefix=git-
265
+ type=semver,pattern={{version}}
266
+ type=semver,pattern={{major}}.{{minor}}
267
+ type=raw,enable=${{ github.ref == 'refs/heads/main' }},prefix=,suffix=,value=ollama
268
+ flavor: |
269
+ latest=${{ github.ref == 'refs/heads/main' }}
270
+ suffix=-ollama,onlatest=true
271
+
272
+ - name: Extract metadata for Docker cache
273
+ id: cache-meta
274
+ uses: docker/metadata-action@v5
275
+ with:
276
+ images: ${{ env.FULL_IMAGE_NAME }}
277
+ tags: |
278
+ type=ref,event=branch
279
+ ${{ github.ref_type == 'tag' && 'type=raw,value=main' || '' }}
280
+ flavor: |
281
+ prefix=cache-ollama-${{ matrix.platform }}-
282
+ latest=false
283
+
284
+ - name: Build Docker image (ollama)
285
+ uses: docker/build-push-action@v5
286
+ id: build
287
+ with:
288
+ context: .
289
+ push: true
290
+ platforms: ${{ matrix.platform }}
291
+ labels: ${{ steps.meta.outputs.labels }}
292
+ outputs: type=image,name=${{ env.FULL_IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true
293
+ cache-from: type=registry,ref=${{ steps.cache-meta.outputs.tags }}
294
+ cache-to: type=registry,ref=${{ steps.cache-meta.outputs.tags }},mode=max
295
+ build-args: |
296
+ BUILD_HASH=${{ github.sha }}
297
+ USE_OLLAMA=true
298
+
299
+ - name: Export digest
300
+ run: |
301
+ mkdir -p /tmp/digests
302
+ digest="${{ steps.build.outputs.digest }}"
303
+ touch "/tmp/digests/${digest#sha256:}"
304
+
305
+ - name: Upload digest
306
+ uses: actions/upload-artifact@v4
307
+ with:
308
+ name: digests-ollama-${{ env.PLATFORM_PAIR }}
309
+ path: /tmp/digests/*
310
+ if-no-files-found: error
311
+ retention-days: 1
312
+
313
+ merge-main-images:
314
+ runs-on: ubuntu-latest
315
+ needs: [build-main-image]
316
+ steps:
317
+ # GitHub Packages requires the entire repository name to be in lowercase
318
+ # although the repository owner has a lowercase username, this prevents some people from running actions after forking
319
+ - name: Set repository and image name to lowercase
320
+ run: |
321
+ echo "IMAGE_NAME=${IMAGE_NAME,,}" >>${GITHUB_ENV}
322
+ echo "FULL_IMAGE_NAME=ghcr.io/${IMAGE_NAME,,}" >>${GITHUB_ENV}
323
+ env:
324
+ IMAGE_NAME: '${{ github.repository }}'
325
+
326
+ - name: Download digests
327
+ uses: actions/download-artifact@v4
328
+ with:
329
+ pattern: digests-main-*
330
+ path: /tmp/digests
331
+ merge-multiple: true
332
+
333
+ - name: Set up Docker Buildx
334
+ uses: docker/setup-buildx-action@v3
335
+
336
+ - name: Log in to the Container registry
337
+ uses: docker/login-action@v3
338
+ with:
339
+ registry: ${{ env.REGISTRY }}
340
+ username: ${{ github.actor }}
341
+ password: ${{ secrets.GITHUB_TOKEN }}
342
+
343
+ - name: Extract metadata for Docker images (default latest tag)
344
+ id: meta
345
+ uses: docker/metadata-action@v5
346
+ with:
347
+ images: ${{ env.FULL_IMAGE_NAME }}
348
+ tags: |
349
+ type=ref,event=branch
350
+ type=ref,event=tag
351
+ type=sha,prefix=git-
352
+ type=semver,pattern={{version}}
353
+ type=semver,pattern={{major}}.{{minor}}
354
+ flavor: |
355
+ latest=${{ github.ref == 'refs/heads/main' }}
356
+
357
+ - name: Create manifest list and push
358
+ working-directory: /tmp/digests
359
+ run: |
360
+ docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
361
+ $(printf '${{ env.FULL_IMAGE_NAME }}@sha256:%s ' *)
362
+
363
+ - name: Inspect image
364
+ run: |
365
+ docker buildx imagetools inspect ${{ env.FULL_IMAGE_NAME }}:${{ steps.meta.outputs.version }}
366
+
367
+ merge-cuda-images:
368
+ runs-on: ubuntu-latest
369
+ needs: [build-cuda-image]
370
+ steps:
371
+ # GitHub Packages requires the entire repository name to be in lowercase
372
+ # although the repository owner has a lowercase username, this prevents some people from running actions after forking
373
+ - name: Set repository and image name to lowercase
374
+ run: |
375
+ echo "IMAGE_NAME=${IMAGE_NAME,,}" >>${GITHUB_ENV}
376
+ echo "FULL_IMAGE_NAME=ghcr.io/${IMAGE_NAME,,}" >>${GITHUB_ENV}
377
+ env:
378
+ IMAGE_NAME: '${{ github.repository }}'
379
+
380
+ - name: Download digests
381
+ uses: actions/download-artifact@v4
382
+ with:
383
+ pattern: digests-cuda-*
384
+ path: /tmp/digests
385
+ merge-multiple: true
386
+
387
+ - name: Set up Docker Buildx
388
+ uses: docker/setup-buildx-action@v3
389
+
390
+ - name: Log in to the Container registry
391
+ uses: docker/login-action@v3
392
+ with:
393
+ registry: ${{ env.REGISTRY }}
394
+ username: ${{ github.actor }}
395
+ password: ${{ secrets.GITHUB_TOKEN }}
396
+
397
+ - name: Extract metadata for Docker images (default latest tag)
398
+ id: meta
399
+ uses: docker/metadata-action@v5
400
+ with:
401
+ images: ${{ env.FULL_IMAGE_NAME }}
402
+ tags: |
403
+ type=ref,event=branch
404
+ type=ref,event=tag
405
+ type=sha,prefix=git-
406
+ type=semver,pattern={{version}}
407
+ type=semver,pattern={{major}}.{{minor}}
408
+ type=raw,enable=${{ github.ref == 'refs/heads/main' }},prefix=,suffix=,value=cuda
409
+ flavor: |
410
+ latest=${{ github.ref == 'refs/heads/main' }}
411
+ suffix=-cuda,onlatest=true
412
+
413
+ - name: Create manifest list and push
414
+ working-directory: /tmp/digests
415
+ run: |
416
+ docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
417
+ $(printf '${{ env.FULL_IMAGE_NAME }}@sha256:%s ' *)
418
+
419
+ - name: Inspect image
420
+ run: |
421
+ docker buildx imagetools inspect ${{ env.FULL_IMAGE_NAME }}:${{ steps.meta.outputs.version }}
422
+
423
+ merge-ollama-images:
424
+ runs-on: ubuntu-latest
425
+ needs: [build-ollama-image]
426
+ steps:
427
+ # GitHub Packages requires the entire repository name to be in lowercase
428
+ # although the repository owner has a lowercase username, this prevents some people from running actions after forking
429
+ - name: Set repository and image name to lowercase
430
+ run: |
431
+ echo "IMAGE_NAME=${IMAGE_NAME,,}" >>${GITHUB_ENV}
432
+ echo "FULL_IMAGE_NAME=ghcr.io/${IMAGE_NAME,,}" >>${GITHUB_ENV}
433
+ env:
434
+ IMAGE_NAME: '${{ github.repository }}'
435
+
436
+ - name: Download digests
437
+ uses: actions/download-artifact@v4
438
+ with:
439
+ pattern: digests-ollama-*
440
+ path: /tmp/digests
441
+ merge-multiple: true
442
+
443
+ - name: Set up Docker Buildx
444
+ uses: docker/setup-buildx-action@v3
445
+
446
+ - name: Log in to the Container registry
447
+ uses: docker/login-action@v3
448
+ with:
449
+ registry: ${{ env.REGISTRY }}
450
+ username: ${{ github.actor }}
451
+ password: ${{ secrets.GITHUB_TOKEN }}
452
+
453
+ - name: Extract metadata for Docker images (default ollama tag)
454
+ id: meta
455
+ uses: docker/metadata-action@v5
456
+ with:
457
+ images: ${{ env.FULL_IMAGE_NAME }}
458
+ tags: |
459
+ type=ref,event=branch
460
+ type=ref,event=tag
461
+ type=sha,prefix=git-
462
+ type=semver,pattern={{version}}
463
+ type=semver,pattern={{major}}.{{minor}}
464
+ type=raw,enable=${{ github.ref == 'refs/heads/main' }},prefix=,suffix=,value=ollama
465
+ flavor: |
466
+ latest=${{ github.ref == 'refs/heads/main' }}
467
+ suffix=-ollama,onlatest=true
468
+
469
+ - name: Create manifest list and push
470
+ working-directory: /tmp/digests
471
+ run: |
472
+ docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
473
+ $(printf '${{ env.FULL_IMAGE_NAME }}@sha256:%s ' *)
474
+
475
+ - name: Inspect image
476
+ run: |
477
+ docker buildx imagetools inspect ${{ env.FULL_IMAGE_NAME }}:${{ steps.meta.outputs.version }}
.github/workflows/format-backend.yaml CHANGED
@@ -1,39 +1,39 @@
1
- name: Python CI
2
-
3
- on:
4
- push:
5
- branches:
6
- - main
7
- - dev
8
- pull_request:
9
- branches:
10
- - main
11
- - dev
12
-
13
- jobs:
14
- build:
15
- name: 'Format Backend'
16
- runs-on: ubuntu-latest
17
-
18
- strategy:
19
- matrix:
20
- python-version: [3.11]
21
-
22
- steps:
23
- - uses: actions/checkout@v4
24
-
25
- - name: Set up Python
26
- uses: actions/setup-python@v5
27
- with:
28
- python-version: ${{ matrix.python-version }}
29
-
30
- - name: Install dependencies
31
- run: |
32
- python -m pip install --upgrade pip
33
- pip install black
34
-
35
- - name: Format backend
36
- run: npm run format:backend
37
-
38
- - name: Check for changes after format
39
- run: git diff --exit-code
 
1
+ name: Python CI
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ - dev
8
+ pull_request:
9
+ branches:
10
+ - main
11
+ - dev
12
+
13
+ jobs:
14
+ build:
15
+ name: 'Format Backend'
16
+ runs-on: ubuntu-latest
17
+
18
+ strategy:
19
+ matrix:
20
+ python-version: [3.11]
21
+
22
+ steps:
23
+ - uses: actions/checkout@v4
24
+
25
+ - name: Set up Python
26
+ uses: actions/setup-python@v5
27
+ with:
28
+ python-version: ${{ matrix.python-version }}
29
+
30
+ - name: Install dependencies
31
+ run: |
32
+ python -m pip install --upgrade pip
33
+ pip install black
34
+
35
+ - name: Format backend
36
+ run: npm run format:backend
37
+
38
+ - name: Check for changes after format
39
+ run: git diff --exit-code
.github/workflows/format-build-frontend.yaml CHANGED
@@ -1,57 +1,57 @@
1
- name: Frontend Build
2
-
3
- on:
4
- push:
5
- branches:
6
- - main
7
- - dev
8
- pull_request:
9
- branches:
10
- - main
11
- - dev
12
-
13
- jobs:
14
- build:
15
- name: 'Format & Build Frontend'
16
- runs-on: ubuntu-latest
17
- steps:
18
- - name: Checkout Repository
19
- uses: actions/checkout@v4
20
-
21
- - name: Setup Node.js
22
- uses: actions/setup-node@v4
23
- with:
24
- node-version: '22' # Or specify any other version you want to use
25
-
26
- - name: Install Dependencies
27
- run: npm install
28
-
29
- - name: Format Frontend
30
- run: npm run format
31
-
32
- - name: Run i18next
33
- run: npm run i18n:parse
34
-
35
- - name: Check for Changes After Format
36
- run: git diff --exit-code
37
-
38
- - name: Build Frontend
39
- run: npm run build
40
-
41
- test-frontend:
42
- name: 'Frontend Unit Tests'
43
- runs-on: ubuntu-latest
44
- steps:
45
- - name: Checkout Repository
46
- uses: actions/checkout@v4
47
-
48
- - name: Setup Node.js
49
- uses: actions/setup-node@v4
50
- with:
51
- node-version: '22'
52
-
53
- - name: Install Dependencies
54
- run: npm ci
55
-
56
- - name: Run vitest
57
- run: npm run test:frontend
 
1
+ name: Frontend Build
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ - dev
8
+ pull_request:
9
+ branches:
10
+ - main
11
+ - dev
12
+
13
+ jobs:
14
+ build:
15
+ name: 'Format & Build Frontend'
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - name: Checkout Repository
19
+ uses: actions/checkout@v4
20
+
21
+ - name: Setup Node.js
22
+ uses: actions/setup-node@v4
23
+ with:
24
+ node-version: '22' # Or specify any other version you want to use
25
+
26
+ - name: Install Dependencies
27
+ run: npm install
28
+
29
+ - name: Format Frontend
30
+ run: npm run format
31
+
32
+ - name: Run i18next
33
+ run: npm run i18n:parse
34
+
35
+ - name: Check for Changes After Format
36
+ run: git diff --exit-code
37
+
38
+ - name: Build Frontend
39
+ run: npm run build
40
+
41
+ test-frontend:
42
+ name: 'Frontend Unit Tests'
43
+ runs-on: ubuntu-latest
44
+ steps:
45
+ - name: Checkout Repository
46
+ uses: actions/checkout@v4
47
+
48
+ - name: Setup Node.js
49
+ uses: actions/setup-node@v4
50
+ with:
51
+ node-version: '22'
52
+
53
+ - name: Install Dependencies
54
+ run: npm ci
55
+
56
+ - name: Run vitest
57
+ run: npm run test:frontend
.github/workflows/integration-test.yml CHANGED
@@ -1,253 +1,253 @@
1
- name: Integration Test
2
-
3
- on:
4
- push:
5
- branches:
6
- - main
7
- - dev
8
- pull_request:
9
- branches:
10
- - main
11
- - dev
12
-
13
- jobs:
14
- cypress-run:
15
- name: Run Cypress Integration Tests
16
- runs-on: ubuntu-latest
17
- steps:
18
- - name: Maximize build space
19
- uses: AdityaGarg8/[email protected]
20
- with:
21
- remove-android: 'true'
22
- remove-haskell: 'true'
23
- remove-codeql: 'true'
24
-
25
- - name: Checkout Repository
26
- uses: actions/checkout@v4
27
-
28
- - name: Build and run Compose Stack
29
- run: |
30
- docker compose \
31
- --file docker-compose.yaml \
32
- --file docker-compose.api.yaml \
33
- --file docker-compose.a1111-test.yaml \
34
- up --detach --build
35
-
36
- - name: Delete Docker build cache
37
- run: |
38
- docker builder prune --all --force
39
-
40
- - name: Wait for Ollama to be up
41
- timeout-minutes: 5
42
- run: |
43
- until curl --output /dev/null --silent --fail http://localhost:11434; do
44
- printf '.'
45
- sleep 1
46
- done
47
- echo "Service is up!"
48
-
49
- - name: Preload Ollama model
50
- run: |
51
- docker exec ollama ollama pull qwen:0.5b-chat-v1.5-q2_K
52
-
53
- - name: Cypress run
54
- uses: cypress-io/github-action@v6
55
- with:
56
- browser: chrome
57
- wait-on: 'http://localhost:3000'
58
- config: baseUrl=http://localhost:3000
59
-
60
- - uses: actions/upload-artifact@v4
61
- if: always()
62
- name: Upload Cypress videos
63
- with:
64
- name: cypress-videos
65
- path: cypress/videos
66
- if-no-files-found: ignore
67
-
68
- - name: Extract Compose logs
69
- if: always()
70
- run: |
71
- docker compose logs > compose-logs.txt
72
-
73
- - uses: actions/upload-artifact@v4
74
- if: always()
75
- name: Upload Compose logs
76
- with:
77
- name: compose-logs
78
- path: compose-logs.txt
79
- if-no-files-found: ignore
80
-
81
- # pytest:
82
- # name: Run Backend Tests
83
- # runs-on: ubuntu-latest
84
- # steps:
85
- # - uses: actions/checkout@v4
86
-
87
- # - name: Set up Python
88
- # uses: actions/setup-python@v5
89
- # with:
90
- # python-version: ${{ matrix.python-version }}
91
-
92
- # - name: Install dependencies
93
- # run: |
94
- # python -m pip install --upgrade pip
95
- # pip install -r backend/requirements.txt
96
-
97
- # - name: pytest run
98
- # run: |
99
- # ls -al
100
- # cd backend
101
- # PYTHONPATH=. pytest . -o log_cli=true -o log_cli_level=INFO
102
-
103
- migration_test:
104
- name: Run Migration Tests
105
- runs-on: ubuntu-latest
106
- services:
107
- postgres:
108
- image: postgres
109
- env:
110
- POSTGRES_PASSWORD: postgres
111
- options: >-
112
- --health-cmd pg_isready
113
- --health-interval 10s
114
- --health-timeout 5s
115
- --health-retries 5
116
- ports:
117
- - 5432:5432
118
- # mysql:
119
- # image: mysql
120
- # env:
121
- # MYSQL_ROOT_PASSWORD: mysql
122
- # MYSQL_DATABASE: mysql
123
- # options: >-
124
- # --health-cmd "mysqladmin ping -h localhost"
125
- # --health-interval 10s
126
- # --health-timeout 5s
127
- # --health-retries 5
128
- # ports:
129
- # - 3306:3306
130
- steps:
131
- - name: Checkout Repository
132
- uses: actions/checkout@v4
133
-
134
- - name: Set up Python
135
- uses: actions/setup-python@v5
136
- with:
137
- python-version: ${{ matrix.python-version }}
138
-
139
- - name: Set up uv
140
- uses: yezz123/setup-uv@v4
141
- with:
142
- uv-venv: venv
143
-
144
- - name: Activate virtualenv
145
- run: |
146
- . venv/bin/activate
147
- echo PATH=$PATH >> $GITHUB_ENV
148
-
149
- - name: Install dependencies
150
- run: |
151
- uv pip install -r backend/requirements.txt
152
-
153
- - name: Test backend with SQLite
154
- id: sqlite
155
- env:
156
- WEBUI_SECRET_KEY: secret-key
157
- GLOBAL_LOG_LEVEL: debug
158
- run: |
159
- cd backend
160
- uvicorn open_webui.main:app --port "8080" --forwarded-allow-ips '*' &
161
- UVICORN_PID=$!
162
- # Wait up to 40 seconds for the server to start
163
- for i in {1..40}; do
164
- curl -s http://localhost:8080/api/config > /dev/null && break
165
- sleep 1
166
- if [ $i -eq 40 ]; then
167
- echo "Server failed to start"
168
- kill -9 $UVICORN_PID
169
- exit 1
170
- fi
171
- done
172
- # Check that the server is still running after 5 seconds
173
- sleep 5
174
- if ! kill -0 $UVICORN_PID; then
175
- echo "Server has stopped"
176
- exit 1
177
- fi
178
-
179
- - name: Test backend with Postgres
180
- if: success() || steps.sqlite.conclusion == 'failure'
181
- env:
182
- WEBUI_SECRET_KEY: secret-key
183
- GLOBAL_LOG_LEVEL: debug
184
- DATABASE_URL: postgresql://postgres:postgres@localhost:5432/postgres
185
- DATABASE_POOL_SIZE: 10
186
- DATABASE_POOL_MAX_OVERFLOW: 10
187
- DATABASE_POOL_TIMEOUT: 30
188
- run: |
189
- cd backend
190
- uvicorn open_webui.main:app --port "8081" --forwarded-allow-ips '*' &
191
- UVICORN_PID=$!
192
- # Wait up to 20 seconds for the server to start
193
- for i in {1..20}; do
194
- curl -s http://localhost:8081/api/config > /dev/null && break
195
- sleep 1
196
- if [ $i -eq 20 ]; then
197
- echo "Server failed to start"
198
- kill -9 $UVICORN_PID
199
- exit 1
200
- fi
201
- done
202
- # Check that the server is still running after 5 seconds
203
- sleep 5
204
- if ! kill -0 $UVICORN_PID; then
205
- echo "Server has stopped"
206
- exit 1
207
- fi
208
-
209
- # Check that service will reconnect to postgres when connection will be closed
210
- status_code=$(curl --write-out %{http_code} -s --output /dev/null http://localhost:8081/health/db)
211
- if [[ "$status_code" -ne 200 ]] ; then
212
- echo "Server has failed before postgres reconnect check"
213
- exit 1
214
- fi
215
-
216
- echo "Terminating all connections to postgres..."
217
- python -c "import os, psycopg2 as pg2; \
218
- conn = pg2.connect(dsn=os.environ['DATABASE_URL'].replace('+pool', '')); \
219
- cur = conn.cursor(); \
220
- cur.execute('SELECT pg_terminate_backend(psa.pid) FROM pg_stat_activity psa WHERE datname = current_database() AND pid <> pg_backend_pid();')"
221
-
222
- status_code=$(curl --write-out %{http_code} -s --output /dev/null http://localhost:8081/health/db)
223
- if [[ "$status_code" -ne 200 ]] ; then
224
- echo "Server has not reconnected to postgres after connection was closed: returned status $status_code"
225
- exit 1
226
- fi
227
-
228
- # - name: Test backend with MySQL
229
- # if: success() || steps.sqlite.conclusion == 'failure' || steps.postgres.conclusion == 'failure'
230
- # env:
231
- # WEBUI_SECRET_KEY: secret-key
232
- # GLOBAL_LOG_LEVEL: debug
233
- # DATABASE_URL: mysql://root:mysql@localhost:3306/mysql
234
- # run: |
235
- # cd backend
236
- # uvicorn open_webui.main:app --port "8083" --forwarded-allow-ips '*' &
237
- # UVICORN_PID=$!
238
- # # Wait up to 20 seconds for the server to start
239
- # for i in {1..20}; do
240
- # curl -s http://localhost:8083/api/config > /dev/null && break
241
- # sleep 1
242
- # if [ $i -eq 20 ]; then
243
- # echo "Server failed to start"
244
- # kill -9 $UVICORN_PID
245
- # exit 1
246
- # fi
247
- # done
248
- # # Check that the server is still running after 5 seconds
249
- # sleep 5
250
- # if ! kill -0 $UVICORN_PID; then
251
- # echo "Server has stopped"
252
- # exit 1
253
- # fi
 
1
+ name: Integration Test
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ - dev
8
+ pull_request:
9
+ branches:
10
+ - main
11
+ - dev
12
+
13
+ jobs:
14
+ cypress-run:
15
+ name: Run Cypress Integration Tests
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - name: Maximize build space
19
+ uses: AdityaGarg8/[email protected]
20
+ with:
21
+ remove-android: 'true'
22
+ remove-haskell: 'true'
23
+ remove-codeql: 'true'
24
+
25
+ - name: Checkout Repository
26
+ uses: actions/checkout@v4
27
+
28
+ - name: Build and run Compose Stack
29
+ run: |
30
+ docker compose \
31
+ --file docker-compose.yaml \
32
+ --file docker-compose.api.yaml \
33
+ --file docker-compose.a1111-test.yaml \
34
+ up --detach --build
35
+
36
+ - name: Delete Docker build cache
37
+ run: |
38
+ docker builder prune --all --force
39
+
40
+ - name: Wait for Ollama to be up
41
+ timeout-minutes: 5
42
+ run: |
43
+ until curl --output /dev/null --silent --fail http://localhost:11434; do
44
+ printf '.'
45
+ sleep 1
46
+ done
47
+ echo "Service is up!"
48
+
49
+ - name: Preload Ollama model
50
+ run: |
51
+ docker exec ollama ollama pull qwen:0.5b-chat-v1.5-q2_K
52
+
53
+ - name: Cypress run
54
+ uses: cypress-io/github-action@v6
55
+ with:
56
+ browser: chrome
57
+ wait-on: 'http://localhost:3000'
58
+ config: baseUrl=http://localhost:3000
59
+
60
+ - uses: actions/upload-artifact@v4
61
+ if: always()
62
+ name: Upload Cypress videos
63
+ with:
64
+ name: cypress-videos
65
+ path: cypress/videos
66
+ if-no-files-found: ignore
67
+
68
+ - name: Extract Compose logs
69
+ if: always()
70
+ run: |
71
+ docker compose logs > compose-logs.txt
72
+
73
+ - uses: actions/upload-artifact@v4
74
+ if: always()
75
+ name: Upload Compose logs
76
+ with:
77
+ name: compose-logs
78
+ path: compose-logs.txt
79
+ if-no-files-found: ignore
80
+
81
+ # pytest:
82
+ # name: Run Backend Tests
83
+ # runs-on: ubuntu-latest
84
+ # steps:
85
+ # - uses: actions/checkout@v4
86
+
87
+ # - name: Set up Python
88
+ # uses: actions/setup-python@v5
89
+ # with:
90
+ # python-version: ${{ matrix.python-version }}
91
+
92
+ # - name: Install dependencies
93
+ # run: |
94
+ # python -m pip install --upgrade pip
95
+ # pip install -r backend/requirements.txt
96
+
97
+ # - name: pytest run
98
+ # run: |
99
+ # ls -al
100
+ # cd backend
101
+ # PYTHONPATH=. pytest . -o log_cli=true -o log_cli_level=INFO
102
+
103
+ migration_test:
104
+ name: Run Migration Tests
105
+ runs-on: ubuntu-latest
106
+ services:
107
+ postgres:
108
+ image: postgres
109
+ env:
110
+ POSTGRES_PASSWORD: postgres
111
+ options: >-
112
+ --health-cmd pg_isready
113
+ --health-interval 10s
114
+ --health-timeout 5s
115
+ --health-retries 5
116
+ ports:
117
+ - 5432:5432
118
+ # mysql:
119
+ # image: mysql
120
+ # env:
121
+ # MYSQL_ROOT_PASSWORD: mysql
122
+ # MYSQL_DATABASE: mysql
123
+ # options: >-
124
+ # --health-cmd "mysqladmin ping -h localhost"
125
+ # --health-interval 10s
126
+ # --health-timeout 5s
127
+ # --health-retries 5
128
+ # ports:
129
+ # - 3306:3306
130
+ steps:
131
+ - name: Checkout Repository
132
+ uses: actions/checkout@v4
133
+
134
+ - name: Set up Python
135
+ uses: actions/setup-python@v5
136
+ with:
137
+ python-version: ${{ matrix.python-version }}
138
+
139
+ - name: Set up uv
140
+ uses: yezz123/setup-uv@v4
141
+ with:
142
+ uv-venv: venv
143
+
144
+ - name: Activate virtualenv
145
+ run: |
146
+ . venv/bin/activate
147
+ echo PATH=$PATH >> $GITHUB_ENV
148
+
149
+ - name: Install dependencies
150
+ run: |
151
+ uv pip install -r backend/requirements.txt
152
+
153
+ - name: Test backend with SQLite
154
+ id: sqlite
155
+ env:
156
+ WEBUI_SECRET_KEY: secret-key
157
+ GLOBAL_LOG_LEVEL: debug
158
+ run: |
159
+ cd backend
160
+ uvicorn open_webui.main:app --port "8080" --forwarded-allow-ips '*' &
161
+ UVICORN_PID=$!
162
+ # Wait up to 40 seconds for the server to start
163
+ for i in {1..40}; do
164
+ curl -s http://localhost:8080/api/config > /dev/null && break
165
+ sleep 1
166
+ if [ $i -eq 40 ]; then
167
+ echo "Server failed to start"
168
+ kill -9 $UVICORN_PID
169
+ exit 1
170
+ fi
171
+ done
172
+ # Check that the server is still running after 5 seconds
173
+ sleep 5
174
+ if ! kill -0 $UVICORN_PID; then
175
+ echo "Server has stopped"
176
+ exit 1
177
+ fi
178
+
179
+ - name: Test backend with Postgres
180
+ if: success() || steps.sqlite.conclusion == 'failure'
181
+ env:
182
+ WEBUI_SECRET_KEY: secret-key
183
+ GLOBAL_LOG_LEVEL: debug
184
+ DATABASE_URL: postgresql://postgres:postgres@localhost:5432/postgres
185
+ DATABASE_POOL_SIZE: 10
186
+ DATABASE_POOL_MAX_OVERFLOW: 10
187
+ DATABASE_POOL_TIMEOUT: 30
188
+ run: |
189
+ cd backend
190
+ uvicorn open_webui.main:app --port "8081" --forwarded-allow-ips '*' &
191
+ UVICORN_PID=$!
192
+ # Wait up to 20 seconds for the server to start
193
+ for i in {1..20}; do
194
+ curl -s http://localhost:8081/api/config > /dev/null && break
195
+ sleep 1
196
+ if [ $i -eq 20 ]; then
197
+ echo "Server failed to start"
198
+ kill -9 $UVICORN_PID
199
+ exit 1
200
+ fi
201
+ done
202
+ # Check that the server is still running after 5 seconds
203
+ sleep 5
204
+ if ! kill -0 $UVICORN_PID; then
205
+ echo "Server has stopped"
206
+ exit 1
207
+ fi
208
+
209
+ # Check that service will reconnect to postgres when connection will be closed
210
+ status_code=$(curl --write-out %{http_code} -s --output /dev/null http://localhost:8081/health/db)
211
+ if [[ "$status_code" -ne 200 ]] ; then
212
+ echo "Server has failed before postgres reconnect check"
213
+ exit 1
214
+ fi
215
+
216
+ echo "Terminating all connections to postgres..."
217
+ python -c "import os, psycopg2 as pg2; \
218
+ conn = pg2.connect(dsn=os.environ['DATABASE_URL'].replace('+pool', '')); \
219
+ cur = conn.cursor(); \
220
+ cur.execute('SELECT pg_terminate_backend(psa.pid) FROM pg_stat_activity psa WHERE datname = current_database() AND pid <> pg_backend_pid();')"
221
+
222
+ status_code=$(curl --write-out %{http_code} -s --output /dev/null http://localhost:8081/health/db)
223
+ if [[ "$status_code" -ne 200 ]] ; then
224
+ echo "Server has not reconnected to postgres after connection was closed: returned status $status_code"
225
+ exit 1
226
+ fi
227
+
228
+ # - name: Test backend with MySQL
229
+ # if: success() || steps.sqlite.conclusion == 'failure' || steps.postgres.conclusion == 'failure'
230
+ # env:
231
+ # WEBUI_SECRET_KEY: secret-key
232
+ # GLOBAL_LOG_LEVEL: debug
233
+ # DATABASE_URL: mysql://root:mysql@localhost:3306/mysql
234
+ # run: |
235
+ # cd backend
236
+ # uvicorn open_webui.main:app --port "8083" --forwarded-allow-ips '*' &
237
+ # UVICORN_PID=$!
238
+ # # Wait up to 20 seconds for the server to start
239
+ # for i in {1..20}; do
240
+ # curl -s http://localhost:8083/api/config > /dev/null && break
241
+ # sleep 1
242
+ # if [ $i -eq 20 ]; then
243
+ # echo "Server failed to start"
244
+ # kill -9 $UVICORN_PID
245
+ # exit 1
246
+ # fi
247
+ # done
248
+ # # Check that the server is still running after 5 seconds
249
+ # sleep 5
250
+ # if ! kill -0 $UVICORN_PID; then
251
+ # echo "Server has stopped"
252
+ # exit 1
253
+ # fi
.github/workflows/lint-backend.disabled CHANGED
@@ -1,27 +1,27 @@
1
- name: Python CI
2
- on:
3
- push:
4
- branches: ['main']
5
- pull_request:
6
- jobs:
7
- build:
8
- name: 'Lint Backend'
9
- env:
10
- PUBLIC_API_BASE_URL: ''
11
- runs-on: ubuntu-latest
12
- strategy:
13
- matrix:
14
- node-version:
15
- - latest
16
- steps:
17
- - uses: actions/checkout@v4
18
- - name: Use Python
19
- uses: actions/setup-python@v5
20
- - name: Use Bun
21
- uses: oven-sh/setup-bun@v1
22
- - name: Install dependencies
23
- run: |
24
- python -m pip install --upgrade pip
25
- pip install pylint
26
- - name: Lint backend
27
- run: bun run lint:backend
 
1
+ name: Python CI
2
+ on:
3
+ push:
4
+ branches: ['main']
5
+ pull_request:
6
+ jobs:
7
+ build:
8
+ name: 'Lint Backend'
9
+ env:
10
+ PUBLIC_API_BASE_URL: ''
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ node-version:
15
+ - latest
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+ - name: Use Python
19
+ uses: actions/setup-python@v5
20
+ - name: Use Bun
21
+ uses: oven-sh/setup-bun@v1
22
+ - name: Install dependencies
23
+ run: |
24
+ python -m pip install --upgrade pip
25
+ pip install pylint
26
+ - name: Lint backend
27
+ run: bun run lint:backend
.github/workflows/lint-frontend.disabled CHANGED
@@ -1,21 +1,21 @@
1
- name: Bun CI
2
- on:
3
- push:
4
- branches: ['main']
5
- pull_request:
6
- jobs:
7
- build:
8
- name: 'Lint Frontend'
9
- env:
10
- PUBLIC_API_BASE_URL: ''
11
- runs-on: ubuntu-latest
12
- steps:
13
- - uses: actions/checkout@v4
14
- - name: Use Bun
15
- uses: oven-sh/setup-bun@v1
16
- - run: bun --version
17
- - name: Install frontend dependencies
18
- run: bun install --frozen-lockfile
19
- - run: bun run lint:frontend
20
- - run: bun run lint:types
21
  if: success() || failure()
 
1
+ name: Bun CI
2
+ on:
3
+ push:
4
+ branches: ['main']
5
+ pull_request:
6
+ jobs:
7
+ build:
8
+ name: 'Lint Frontend'
9
+ env:
10
+ PUBLIC_API_BASE_URL: ''
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v4
14
+ - name: Use Bun
15
+ uses: oven-sh/setup-bun@v1
16
+ - run: bun --version
17
+ - name: Install frontend dependencies
18
+ run: bun install --frozen-lockfile
19
+ - run: bun run lint:frontend
20
+ - run: bun run lint:types
21
  if: success() || failure()
.github/workflows/release-pypi.yml CHANGED
@@ -1,32 +1,32 @@
1
- name: Release to PyPI
2
-
3
- on:
4
- push:
5
- branches:
6
- - main # or whatever branch you want to use
7
- - pypi-release
8
-
9
- jobs:
10
- release:
11
- runs-on: ubuntu-latest
12
- environment:
13
- name: pypi
14
- url: https://pypi.org/p/open-webui
15
- permissions:
16
- id-token: write
17
- steps:
18
- - name: Checkout repository
19
- uses: actions/checkout@v4
20
- - uses: actions/setup-node@v4
21
- with:
22
- node-version: 18
23
- - uses: actions/setup-python@v5
24
- with:
25
- python-version: 3.11
26
- - name: Build
27
- run: |
28
- python -m pip install --upgrade pip
29
- pip install build
30
- python -m build .
31
- - name: Publish package distributions to PyPI
32
- uses: pypa/gh-action-pypi-publish@release/v1
 
1
+ name: Release to PyPI
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main # or whatever branch you want to use
7
+ - pypi-release
8
+
9
+ jobs:
10
+ release:
11
+ runs-on: ubuntu-latest
12
+ environment:
13
+ name: pypi
14
+ url: https://pypi.org/p/open-webui
15
+ permissions:
16
+ id-token: write
17
+ steps:
18
+ - name: Checkout repository
19
+ uses: actions/checkout@v4
20
+ - uses: actions/setup-node@v4
21
+ with:
22
+ node-version: 18
23
+ - uses: actions/setup-python@v5
24
+ with:
25
+ python-version: 3.11
26
+ - name: Build
27
+ run: |
28
+ python -m pip install --upgrade pip
29
+ pip install build
30
+ python -m build .
31
+ - name: Publish package distributions to PyPI
32
+ uses: pypa/gh-action-pypi-publish@release/v1