Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:add apollo configuration to load env file #11210

Merged
merged 16 commits into from
Dec 9, 2024

Conversation

huanshare
Copy link
Contributor

@huanshare huanshare commented Nov 29, 2024

Summary

Please note:dify supports loading env file configuration from the configuration-center(apollo). If you use apollo, first configure the dify configuration on apollo, and then before starting the project, configure the following parameters in the environment variables:
CONFIGURATION_TYPE=apollo,APOLLO_APP_ID=xxx,APOLLO_CLUSTER=xxx,APOLLO_CONFIG_URL=xxx,APOLLO_NAMESPACE=xxx

Close #11064

Tip

Close issue syntax: Fixes #<issue number> or Resolves #<issue number>, see documentation for more details.

Screenshots

Before: After:
... ...

Checklist

Important

Please review the checklist below before submitting your pull request.

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods

@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. 💪 enhancement New feature or request 📚 documentation Improvements or additions to documentation labels Nov 29, 2024
@laipz8200
Copy link
Member

Please check the CI results.

@huanshare
Copy link
Contributor Author

Please check the CI results.

It's all done.

api/configs/middleware/configuration/apollo/__init__.py Outdated Show resolved Hide resolved
api/configs/middleware/configuration/__init__.py Outdated Show resolved Hide resolved
api/configs/middleware/configuration/apollo/__init__.py Outdated Show resolved Hide resolved
api/configs/middleware/configuration/apollo/__init__.py Outdated Show resolved Hide resolved
api/configs/middleware/configuration/apollo/__init__.py Outdated Show resolved Hide resolved
api/extensions/configuration/apollo_configuration.py Outdated Show resolved Hide resolved
api/extensions/configuration/apollo_configuration.py Outdated Show resolved Hide resolved
@huanshare
Copy link
Contributor Author

@laipz8200
WX20241205-165420@2x
Does this blockage have anything to do with the code I submitted?

@laipz8200
Copy link
Member

@laipz8200 WX20241205-165420@2x Does this blockage have anything to do with the code I submitted?

nope, I've re-run the tests.

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:XL This PR changes 500-999 lines, ignoring generated files. labels Dec 5, 2024
@laipz8200
Copy link
Member

Please check the test results.

@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Dec 5, 2024
@huanshare
Copy link
Contributor Author

Please check the test results.

done

Signed-off-by: -LAN- <laipz8200@outlook.com>
Signed-off-by: -LAN- <laipz8200@outlook.com>
Signed-off-by: -LAN- <laipz8200@outlook.com>
Signed-off-by: -LAN- <laipz8200@outlook.com>
@laipz8200
Copy link
Member

Hello, I have reorganized the code structure to make the configuration center easier to integrate, but I noticed that there is some code in the Apollo Client that cannot pass type checking. Could you modify it?

image

…ettings_source`

Signed-off-by: -LAN- <laipz8200@outlook.com>
Signed-off-by: -LAN- <laipz8200@outlook.com>
@huanshare
Copy link
Contributor Author

Hello, I have reorganized the code structure to make the configuration center easier to integrate, but I noticed that there is some code in the Apollo Client that cannot pass type checking. Could you modify it?

image

Done

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Dec 9, 2024
@laipz8200
Copy link
Member

Thank you very much for your continued follow-up.

@laipz8200 laipz8200 merged commit 967b7d8 into langgenius:main Dec 9, 2024
5 checks passed
@huanshare huanshare deleted the feat/add_apollo_configuration branch December 10, 2024 01:42
@huanshare
Copy link
Contributor Author

Thank you very much for your continued follow-up.

Thank you too, I learned a lot of development standards from you.

iamjoel pushed a commit that referenced this pull request Dec 16, 2024
Signed-off-by: -LAN- <laipz8200@outlook.com>
Co-authored-by: huanshare <liuhuan101@longfor.com>
Co-authored-by: -LAN- <laipz8200@outlook.com>
@luckylhb90
Copy link
Contributor

How does this thing work? No example??

@laipz8200
Copy link
Member

@luckylhb90 add new configurations shown in api/configs/remote_settings_sources/__init__.py and api/configs/remote_settings_sources/apollo/__init__.py, then it should work.

@huanshare
Copy link
Contributor Author

How does this thing work? No example??
Put it in the environment variable according to your configuration.
APOLLO_APP_ID="APOLLO_APP_ID";APOLLO_CLUSTER="APOLLO_CLUSTER";APOLLO_CONFIG_URL="APOLLO_CONFIG_URL";APOLLO_NAMESPACE="APOLLO_NAMESPACE";REMOTE_SETTINGS_SOURCE_NAME=apollo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📚 documentation Improvements or additions to documentation 💪 enhancement New feature or request lgtm This PR has been approved by a maintainer size:XL This PR changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

.env configuration pull from "configuration center"
3 participants