-
Notifications
You must be signed in to change notification settings - Fork 2
perf(rag): 사전 계산 query embedding 기반 KB fan-out 병렬화 #632
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
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
c164b51
perf(rag): KB 검색 fan-out을 제한 병렬화
HyungminYoon1 120d120
docs(rag): fan-out 실행과 지연 계측 계약 정리
HyungminYoon1 287742a
test(ci): Gateway의 Workflow runtime import 경계 검증
HyungminYoon1 93744c2
fix(ci): LLM node runtime import를 지연 로딩
HyungminYoon1 56959b4
fix(rag): fan-out 프로세스 자원 경계 보강
HyungminYoon1 ed111a9
test(rag): safe-no-result 지연 비노출 경계 보강
HyungminYoon1 c9a3b65
docs(rag): fan-out 운영 및 추적 경계 갱신
HyungminYoon1 70c32cd
fix(rag): 후속 SQL 취소와 절대 기한을 강제
HyungminYoon1 b14d771
docs(rag): SQL별 절대 기한 계약을 명시
HyungminYoon1 efcd1c8
fix(rag): DB checkout와 주입 세션 경계를 보강
HyungminYoon1 47c621d
docs(rag): checkout 및 주입 세션 계약을 명시
HyungminYoon1 305be27
fix(ci): Gateway와 RAG worker import 경계를 분리
HyungminYoon1 80d6904
docs(rag): CI import 경계 검증 기준을 갱신
HyungminYoon1 ff076ee
fix(rag): fan-out admission과 계약 CI 선택을 보강
HyungminYoon1 236ce4b
docs(rag): fan-out admission과 CI 계약을 명시
HyungminYoon1 0dcc923
test(rag): public history 검색 계약을 최신화
HyungminYoon1 2b485b9
docs(rag): 최신 dev 검증 기준을 갱신
HyungminYoon1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
83 changes: 83 additions & 0 deletions
83
apps/gateway/tests/architecture/test_workflow_node_import_boundary.py
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| """Gateway와 Workflow worker 패키지의 import 경계를 검증한다.""" | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| import os | ||
| from pathlib import Path | ||
| import subprocess | ||
| import sys | ||
|
|
||
|
|
||
| REPOSITORY_ROOT = Path(__file__).resolve().parents[4] | ||
|
|
||
|
|
||
| def test_llm_entity_import_does_not_load_worker_runtime() -> None: | ||
| """Data-only schema import must not require worker-only dependencies.""" | ||
|
|
||
| script = """ | ||
| import sys | ||
|
|
||
| from apps.workflow_engine.workflow.nodes.llm.entities import LLMNodeData | ||
|
|
||
| assert LLMNodeData.__name__ == "LLMNodeData" | ||
| assert "apps.workflow_engine.workflow.nodes.llm.llm_node" not in sys.modules | ||
| """ | ||
| environment = os.environ.copy() | ||
| existing_pythonpath = environment.get("PYTHONPATH") | ||
| environment["PYTHONPATH"] = os.pathsep.join( | ||
| value | ||
| for value in (str(REPOSITORY_ROOT), existing_pythonpath) | ||
| if value | ||
| ) | ||
|
|
||
| completed = subprocess.run( | ||
| [sys.executable, "-c", script], | ||
| cwd=REPOSITORY_ROOT, | ||
| env=environment, | ||
| capture_output=True, | ||
| text=True, | ||
| check=False, | ||
| ) | ||
|
|
||
| assert completed.returncode == 0, completed.stderr | ||
|
|
||
|
|
||
| def test_node_factory_import_does_not_require_gevent_runtime() -> None: | ||
| """Gateway-side graph validation must not require worker-only gevent.""" | ||
|
|
||
| script = """ | ||
| import sys | ||
|
|
||
|
|
||
| class BlockGeventImport: | ||
| def find_spec(self, fullname, path=None, target=None): | ||
| if fullname == "gevent" or fullname.startswith("gevent."): | ||
| raise ModuleNotFoundError("blocked worker-only gevent dependency") | ||
| return None | ||
|
|
||
|
|
||
| sys.meta_path.insert(0, BlockGeventImport()) | ||
|
|
||
| from apps.workflow_engine.workflow.core.workflow_node_factory import NodeFactory | ||
|
|
||
| assert "llmNode" in NodeFactory.NODE_REGISTRY | ||
| assert "gevent" not in sys.modules | ||
| """ | ||
| environment = os.environ.copy() | ||
| existing_pythonpath = environment.get("PYTHONPATH") | ||
| environment["PYTHONPATH"] = os.pathsep.join( | ||
| value | ||
| for value in (str(REPOSITORY_ROOT), existing_pythonpath) | ||
| if value | ||
| ) | ||
|
|
||
| completed = subprocess.run( | ||
| [sys.executable, "-c", script], | ||
| cwd=REPOSITORY_ROOT, | ||
| env=environment, | ||
| capture_output=True, | ||
| text=True, | ||
| check=False, | ||
| ) | ||
|
|
||
| assert completed.returncode == 0, completed.stderr | ||
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
apps/workflow_engine/workflow/nodes/llm/__init__.py나 새 RAG 어댑터만 수정하는 후속 PR은classify_paths()에서workflow_tests만 선택하므로,apps/gateway/tests에 둔 이 회귀 테스트는 실행되지 않습니다. 그 결과LLMNode가 다시 eager import되어 Gateway에 worker 전용gevent의존성이 유입되는 변경도 선택 CI를 통과할 수 있으므로, 이 테스트를 Workflow Engine 선택 대상에 두거나 해당 import-boundary 소스가 바뀌면 Gateway 테스트도 선택해야 합니다.AGENTS.md reference: AGENTS.md:L206-L207
Useful? React with 👍 / 👎.