You've already forked DataMate
fix(kg): 修复知识图谱部署流程问题
修复从全新部署到运行的完整流程中的配置和路由问题。 ## P0 修复(功能失效) ### P0-1: GraphRAG KG 服务 URL 错误 - config.py - GRAPHRAG_KG_SERVICE_URL 从 http://datamate-kg:8080 改为 http://datamate-backend:8080(容器名修正) - kg_client.py - 修复 API 路径:/knowledge-graph/... → /api/knowledge-graph/... - kb_access.py - 同类问题修复:/knowledge-base/... → /api/knowledge-base/... - test_kb_access.py - 测试断言同步更新 根因:容器名 datamate-kg 不存在,且 httpx 绝对路径会丢弃 base_url 中的 /api 路径 ### P0-2: Vite 开发代理剥离 /api 前缀 - vite.config.ts - 删除 /api/knowledge-graph 专用代理规则(剥离 /api 导致 404),统一走 ^/api 规则 ## P1 修复(功能受损) ### P1-1: Gateway 缺少 KG Python 端点路由 - ApiGatewayApplication.java - 添加 /api/kg/** 路由(指向 kg-extraction Python 服务) - ApiGatewayApplication.java - 添加 /api/graphrag/** 路由(指向 GraphRAG 服务) ### P1-2: DATA_MANAGEMENT_URL 默认值缺 /api - KnowledgeGraphProperties.java - dataManagementUrl 默认值 http://localhost:8080 → http://localhost:8080/api - KnowledgeGraphProperties.java - annotationServiceUrl 默认值 http://localhost:8081 → http://localhost:8080/api(同 JVM) - application-knowledgegraph.yml - YAML 默认值同步更新 ### P1-3: Neo4j k8s 安装链路失败 - Makefile - VALID_K8S_TARGETS 添加 neo4j - Makefile - %-k8s-install 添加 neo4j case(显式 skip,提示使用 Docker 或外部实例) - Makefile - %-k8s-uninstall 添加 neo4j case(显式 skip) 根因:install 目标无条件调用 neo4j-$(INSTALLER)-install,但 k8s 模式下 neo4j 不在 VALID_K8S_TARGETS 中,导致 "Unknown k8s target 'neo4j'" 错误 ## P2 修复(次要) ### P2-1: Neo4j 加入 Docker install 流程 - Makefile - install target 增加 neo4j-$(INSTALLER)-install,在 datamate 之前启动 - Makefile - VALID_SERVICE_TARGETS 增加 neo4j - Makefile - %-docker-install / %-docker-uninstall 增加 neo4j case ## 验证结果 - mvn test: 311 tests, 0 failures ✅ - eslint: 0 errors ✅ - tsc --noEmit: 通过 ✅ - vite build: 成功 (17.71s) ✅ - Python tests: 46 passed ✅ - make -n install INSTALLER=k8s: 不再报 unknown target ✅ - make -n neo4j-k8s-install: 正确显示 skip 消息 ✅
This commit is contained in:
@@ -57,10 +57,10 @@ public class KnowledgeGraphProperties {
|
||||
public static class Sync {
|
||||
|
||||
/** 数据管理服务基础 URL */
|
||||
private String dataManagementUrl = "http://localhost:8080";
|
||||
private String dataManagementUrl = "http://localhost:8080/api";
|
||||
|
||||
/** 标注服务基础 URL */
|
||||
private String annotationServiceUrl = "http://localhost:8081";
|
||||
private String annotationServiceUrl = "http://localhost:8080/api";
|
||||
|
||||
/** 同步每页拉取数量 */
|
||||
private int pageSize = 200;
|
||||
|
||||
@@ -47,9 +47,9 @@ datamate:
|
||||
# MySQL → Neo4j 同步配置
|
||||
sync:
|
||||
# 数据管理服务地址
|
||||
data-management-url: ${DATA_MANAGEMENT_URL:http://localhost:8080}
|
||||
data-management-url: ${DATA_MANAGEMENT_URL:http://localhost:8080/api}
|
||||
# 标注服务地址
|
||||
annotation-service-url: ${ANNOTATION_SERVICE_URL:http://localhost:8081}
|
||||
annotation-service-url: ${ANNOTATION_SERVICE_URL:http://localhost:8080/api}
|
||||
# 每页拉取数量
|
||||
page-size: ${KG_SYNC_PAGE_SIZE:200}
|
||||
# HTTP 连接超时(毫秒)
|
||||
|
||||
Reference in New Issue
Block a user