feat: auto-select plugin registry based on timezone#239
Merged
Conversation
Auto-detect timezone and select the geographically closest plugin registry for faster plugin downloads. Changes: 1. Add detectPluginRegistry() function to auto-select registry: - Asia/Shanghai & China → Hangzhou mirror - Southeast Asia → Singapore mirror - Americas → North America mirror - Default → Hangzhou mirror 2. Add PLUGIN_REGISTRY to config file generation 3. Update plugin templates to use PLUGIN_REGISTRY variable: - scripts/config-template/ai-gateway.sh (ai-proxy, ai-statistics, model-router) - scripts/config-template/ai-proxy.sh 4. Support manual override via PLUGIN_REGISTRY environment variable Available registries: - higress-registry.cn-hangzhou.cr.aliyuncs.com (default) - higress-registry.ap-southeast-7.cr.aliyuncs.com (Southeast Asia) - higress-registry.us-west-1.cr.aliyuncs.com (North America)
johnlanni
added a commit
to higress-group/higress
that referenced
this pull request
Feb 2, 2026
Update higress-clawdbot-integration skill to reflect automatic timezone-based registry selection for both container images and WASM plugins. Changes: - Simplify Step 3 (remove manual timezone detection) - Document automatic IMAGE_REPO and PLUGIN_REGISTRY selection - Update Environment Variables section with both variables - Add manual override examples - Update all examples to show auto-detection output - Renumber steps (Step 3→4→5→6 become 3→4→5→6) Related: higress-group/higress-standalone#239
4 tasks
|
CodeReview流程已终止 |
4 tasks
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.
Summary
Auto-detect timezone and select the geographically closest plugin registry for faster WASM plugin downloads.
Problem
Currently, all plugin OCI URLs are hardcoded to use the Hangzhou registry (
higress-registry.cn-hangzhou.cr.aliyuncs.com), which causes slow downloads for users in other regions.Solution
Auto-detect timezone and select optimal registry:
higress-registry.cn-hangzhou.cr.aliyuncs.comhigress-registry.ap-southeast-7.cr.aliyuncs.comhigress-registry.us-west-1.cr.aliyuncs.comhigress-registry.cn-hangzhou.cr.aliyuncs.comChanges
1. Script Updates (
get-ai-gateway.sh)Add
detectPluginRegistry()function:timedatectlor/etc/timezonePLUGIN_REGISTRYenvironment variableAdd
DEFAULT_PLUGIN_REGISTRYconstant:Update
resetEnv()function:detectPluginRegistry()during initializationPLUGIN_REGISTRYvariableUpdate config file generation:
PLUGIN_REGISTRYtodefault.cfg2. Template Updates
scripts/config-template/ai-gateway.sh:oci://higress-registry.cn-hangzhou.cr.aliyuncs.comwithoci://${PLUGIN_REGISTRY:-higress-registry.cn-hangzhou.cr.aliyuncs.com}ai-proxypluginai-statisticspluginmodel-routerpluginscripts/config-template/ai-proxy.sh:ai-proxyplugin URL with variableUsage
Auto-detection (default):
Manual override:
PLUGIN_REGISTRY="higress-registry.ap-southeast-7.cr.aliyuncs.com" \ ./get-ai-gateway.sh start --non-interactive --dashscope-key sk-xxxBenefits
Testing
bash -n)PLUGIN_REGISTRYenv varRelated
Improves deployment experience for the higress-clawdbot-integration skill, which currently documents manual
IMAGE_REPOselection for the all-in-one container image. Now plugins also benefit from the same geographic optimization.