Commit fe80e80ed1db1b71fd6c26699100895f34ccfd14
1 parent
b754fd41
fix host config
Showing
4 changed files
with
23 additions
and
8 deletions
Show diff stats
.env.example
config/loader.py
| ... | ... | @@ -445,7 +445,7 @@ class AppConfigLoader: |
| 445 | 445 | api_port=int(os.getenv("API_PORT", 6002)), |
| 446 | 446 | indexer_host=os.getenv("INDEXER_HOST", "0.0.0.0"), |
| 447 | 447 | indexer_port=int(os.getenv("INDEXER_PORT", 6004)), |
| 448 | - embedding_host=os.getenv("EMBEDDING_HOST", "127.0.0.1"), | |
| 448 | + embedding_host=os.getenv("EMBEDDING_HOST", "0.0.0.0"), | |
| 449 | 449 | embedding_port=int(os.getenv("EMBEDDING_PORT", 6005)), |
| 450 | 450 | embedding_text_port=int(os.getenv("EMBEDDING_TEXT_PORT", 6005)), |
| 451 | 451 | embedding_image_port=int(os.getenv("EMBEDDING_IMAGE_PORT", 6008)), | ... | ... |
config/schema.py
| ... | ... | @@ -254,13 +254,13 @@ class RuntimeConfig: |
| 254 | 254 | api_port: int = 6002 |
| 255 | 255 | indexer_host: str = "0.0.0.0" |
| 256 | 256 | indexer_port: int = 6004 |
| 257 | - embedding_host: str = "127.0.0.1" | |
| 257 | + embedding_host: str = "0.0.0.0" | |
| 258 | 258 | embedding_port: int = 6005 |
| 259 | 259 | embedding_text_port: int = 6005 |
| 260 | 260 | embedding_image_port: int = 6008 |
| 261 | - translator_host: str = "127.0.0.1" | |
| 261 | + translator_host: str = "0.0.0.0" | |
| 262 | 262 | translator_port: int = 6006 |
| 263 | - reranker_host: str = "127.0.0.1" | |
| 263 | + reranker_host: str = "0.0.0.0" | |
| 264 | 264 | reranker_port: int = 6007 |
| 265 | 265 | |
| 266 | 266 | ... | ... |
docs/TODO.txt
| ... | ... | @@ -9,10 +9,9 @@ |
| 9 | 9 | priority == 0(默认,适合做索引之类的离线任务):仍走原有 TEXT_MAX_INFLIGHT / IMAGE_MAX_INFLIGHT 准入;超限返回过载状态码。 |
| 10 | 10 | priority > 0(或者==1)(适合在线请求):不会因准入被拒绝,但是仍然需要占用inflight,这样保证在线请求不被限制,并且在线请求很多的时候可以拒绝掉离线的请求。 |
| 11 | 11 | |
| 12 | -除了限制规则的修改,更进一步的,看有没有什么简单的机制,可以保证这种请求是优先处理的(priority=1的相比=0的更优先被处理)。 | |
| 13 | -关于技术方案,有Worker + 双队列、PriorityMutex等等。 | |
| 14 | -需要优先级的能力,但是只需要两档,并不需要多级的优先级。不过如果支持多级优先级的方案更成熟、稳定,那么仍然可以考虑多优先级的方案。 | |
| 15 | -在支持两档优先级的情况下,简单、成熟稳定、不带来复杂度、性能、稳定性方面的副作用,是最重要的。请先了解代码、需求,深度思考解决方案 | |
| 12 | +除了限制规则的修改,更进一步的,也需要保证这种请求是优先处理的(priority=1的相比=0的更优先被处理)。 | |
| 13 | +关于技术方案,有Worker + 双队列、PriorityMutex等等,除此之外,也请你思考合适的方案。 | |
| 14 | +成熟稳定、不带来复杂度、性能、稳定性方面的副作用,是最重要的。请先了解代码、需求,深度思考解决方案 | |
| 16 | 15 | |
| 17 | 16 | |
| 18 | 17 | |
| ... | ... | @@ -50,6 +49,20 @@ _VECTOR_PREVIEW_DIMS = max(1, int(os.getenv("EMBEDDING_VECTOR_PREVIEW_DIMS", "6" |
| 50 | 49 | _CACHE_PREFIX = str(REDIS_CONFIG.get("embedding_cache_prefix", "embedding")).strip() or "embedding" |
| 51 | 50 | |
| 52 | 51 | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | +还有这些写死的地址 @embedding/config.py | |
| 56 | + | |
| 57 | +self.TEI_BASE_URL = str(text_backend.get("base_url") or "http://127.0.0.1:8080") | |
| 58 | +self.TEI_TIMEOUT_SEC = int(text_backend.get("timeout_sec", 60)) | |
| 59 | + | |
| 60 | +self.USE_CLIP_AS_SERVICE = services.image_backend == "clip_as_service" | |
| 61 | +self.CLIP_AS_SERVICE_SERVER = str(image_backend.get("server") or "grpc://127.0.0.1:51000") | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 53 | 66 | 看起来似乎并没有完全遵循这些原则? |
| 54 | 67 | 4. 重新设计的设计原则 |
| 55 | 68 | 重新设计应遵循以下规则。 | ... | ... |