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

Commit 715fcfa

Browse files
Use AKS_NAMESPACE env var when creating indexing manager (#145)
Co-authored-by: Josh Bradley <[email protected]>
1 parent 2d37680 commit 715fcfa

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

backend/src/api/index.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ async def setup_indexing_pipeline(
127127
)
128128
# if indexing job is in a failed state, delete the associated K8s job and pod to allow for a new job to be scheduled
129129
if PipelineJobState(existing_job.status) == PipelineJobState.FAILED:
130-
_delete_k8s_job(f"indexing-job-{sanitized_index_name}", "graphrag")
130+
_delete_k8s_job(f"indexing-job-{sanitized_index_name}", os.environ["AKS_NAMESPACE"])
131131
# reset the pipeline job details
132132
existing_job._status = PipelineJobState.SCHEDULED
133133
existing_job._percent_complete = 0

backend/src/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ async def lifespan(app: FastAPI):
6868
] = pod.spec.service_account_name
6969
# retrieve list of existing cronjobs
7070
batch_v1 = client.BatchV1Api()
71-
namespace_cronjobs = batch_v1.list_namespaced_cron_job(namespace="graphrag")
71+
namespace_cronjobs = batch_v1.list_namespaced_cron_job(namespace=os.environ["AKS_NAMESPACE"])
7272
cronjob_names = [cronjob.metadata.name for cronjob in namespace_cronjobs.items]
7373
# create cronjob if it does not exist
7474
if manifest["metadata"]["name"] not in cronjob_names:
75-
batch_v1.create_namespaced_cron_job(namespace="graphrag", body=manifest)
75+
batch_v1.create_namespaced_cron_job(namespace=os.environ["AKS_NAMESPACE"], body=manifest)
7676
except Exception as e:
7777
print("Failed to create graphrag cronjob.")
7878
reporter = ReporterSingleton().get_instance()

0 commit comments

Comments
 (0)