Skip to content
This repository was archived by the owner on May 27, 2025. It is now read-only.

Commit a8bf673

Browse files
committed
refactor and reorganize indexing code out of api code
1 parent e85c9c0 commit a8bf673

38 files changed

+730
-595
lines changed

backend/indexing-job-manager-template.yaml renamed to backend/index-job-manager.yaml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,19 @@ spec:
2020
serviceAccountName: PLACEHOLDER
2121
restartPolicy: OnFailure
2222
containers:
23-
- name: index-job-manager
24-
image: PLACEHOLDER
25-
imagePullPolicy: Always
26-
resources:
27-
requests:
28-
cpu: "0.5"
29-
memory: "0.5Gi"
30-
limits:
31-
cpu: "1"
32-
memory: "1Gi"
33-
envFrom:
34-
- configMapRef:
35-
name: graphrag
36-
command:
37-
- python
38-
- "manage-indexing-jobs.py"
23+
- name: index-job-manager
24+
image: PLACEHOLDER
25+
imagePullPolicy: Always
26+
resources:
27+
requests:
28+
cpu: "0.5"
29+
memory: "0.5Gi"
30+
limits:
31+
cpu: "1"
32+
memory: "1Gi"
33+
envFrom:
34+
- configMapRef:
35+
name: graphrag
36+
command:
37+
- python
38+
- "manage-indexing-jobs.py"
Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ spec:
2121
nodeSelector:
2222
workload: graphrag-indexing
2323
containers:
24-
- name: graphrag
25-
image: PLACEHOLDER
26-
imagePullPolicy: Always
27-
resources:
28-
requests:
29-
cpu: "5"
30-
memory: "36Gi"
31-
limits:
32-
cpu: "8"
33-
memory: "64Gi"
34-
envFrom:
35-
- configMapRef:
36-
name: graphrag
37-
command: [PLACEHOLDER]
24+
- name: graphrag
25+
image: PLACEHOLDER
26+
imagePullPolicy: Always
27+
resources:
28+
requests:
29+
cpu: "5"
30+
memory: "36Gi"
31+
limits:
32+
cpu: "8"
33+
memory: "64Gi"
34+
envFrom:
35+
- configMapRef:
36+
name: graphrag
37+
command: [PLACEHOLDER]

backend/manage-indexing-jobs.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
)
1919

2020
from src.api.azure_clients import AzureClientManager
21-
from src.api.common import sanitize_name
2221
from src.logger.logger_singleton import LoggerSingleton
2322
from src.typing.pipeline import PipelineJobState
23+
from src.utils.common import sanitize_name
2424
from src.utils.pipeline import PipelineJob
2525

2626

@@ -48,7 +48,7 @@ def schedule_indexing_job(index_name: str):
4848
)
4949
except Exception:
5050
reporter = LoggerSingleton().get_instance()
51-
reporter.on_error(
51+
reporter.error(
5252
"Index job manager encountered error scheduling indexing job",
5353
)
5454
# In the event of a catastrophic scheduling failure, something in k8s or the job manifest is likely broken.
@@ -68,14 +68,14 @@ def _generate_aks_job_manifest(
6868
The manifest must be valid YAML with certain values replaced by the provided arguments.
6969
"""
7070
# NOTE: this file location is relative to the WORKDIR set in Dockerfile-backend
71-
with open("indexing-job-template.yaml", "r") as f:
71+
with open("index-job.yaml", "r") as f:
7272
manifest = yaml.safe_load(f)
7373
manifest["metadata"]["name"] = f"indexing-job-{sanitize_name(index_name)}"
7474
manifest["spec"]["template"]["spec"]["serviceAccountName"] = service_account_name
7575
manifest["spec"]["template"]["spec"]["containers"][0]["image"] = docker_image_name
7676
manifest["spec"]["template"]["spec"]["containers"][0]["command"] = [
7777
"python",
78-
"run-indexing-job.py",
78+
"src/indexer/indexer.py",
7979
f"-i={index_name}",
8080
]
8181
return manifest

0 commit comments

Comments
 (0)