feat(k8s): Add pure migration option for api component#22750
Merged
laipz8200 merged 2 commits intolanggenius:mainfrom Jul 23, 2025
Merged
feat(k8s): Add pure migration option for api component#22750laipz8200 merged 2 commits intolanggenius:mainfrom
api component#22750laipz8200 merged 2 commits intolanggenius:mainfrom
Conversation
api componentapi component for to ease k8s maintenance
api component for to ease k8s maintenanceapi component
api componentapi component
api componentapi component
api componentapi component
Contributor
Author
|
As alternative solution, we may also change the Lines 29 to 41 in e9c9c5d |
Member
|
cc @laipz8200 |
laipz8200
approved these changes
Jul 23, 2025
tutkun
pushed a commit
to tutkun/dify
that referenced
this pull request
Aug 15, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Important
Fixes #<issue number>.Summary
This PR ease maintenance in k8s scenario by adding pure migration mode that execute data migration logic and exit normally without launching the web server. This is useful when upgrading
difyversion, as it enable the maintainer to launch a separate container that execute theflask upgrade-dblogic viaentrypoint.shinstead of tampering with the actualapiorworkerWithout this mode, this logic will be executed in both
apiandworkercomponent instead of a standalone, single replica logic. This will case dead lock in case there are multiple replica ofapiorworker, or if theworkerstarts beforeapiand tries to execute the migration logic that end up with issues like #19910. With this migration only mode, it's possible to disable auto migration forapiandworkerand bring up a standalone container that does the migration beforehand (via aJobdefined with pre-installation hook annotation that recognized byHelm).Screenshots
flask upgrade-dbflask upgrade-dbonly without launching server whenMODE=migrationChecklist
dev/reformat(backend) andcd web && npx lint-staged(frontend) to appease the lint gods