Skip to content

Commit

Permalink
Handle previously failed indexing jobs (#206)
Browse files Browse the repository at this point in the history
Co-authored-by: Josh Bradley <[email protected]>
  • Loading branch information
clarked-msft and jgbradley1 authored Dec 30, 2024
1 parent c7b5f96 commit 900c503
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
1 change: 0 additions & 1 deletion backend/indexing-job-manager-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ spec:
schedule: "*/5 * * * *"
jobTemplate:
spec:
ttlSecondsAfterFinished: 30
template:
metadata:
labels:
Expand Down
4 changes: 2 additions & 2 deletions backend/indexing-job-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ spec:
imagePullPolicy: Always
resources:
requests:
cpu: "6"
memory: "56Gi"
cpu: "5"
memory: "36Gi"
limits:
cpu: "8"
memory: "64Gi"
Expand Down
5 changes: 3 additions & 2 deletions backend/manage-indexing-jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ def list_k8s_jobs(namespace: str) -> list[str]:
jobs = batch_v1.list_namespaced_job(namespace=namespace)
job_list = []
for job in jobs.items:
job_list.append(job.metadata.name)
if job.metadata.name.startswith("indexing-job-") and job.status.active:
job_list.append(job.metadata.name)
return job_list


Expand Down Expand Up @@ -124,7 +125,7 @@ def main():
)
pipelinejob = PipelineJob()
pipeline_job = pipelinejob.load_item(item["sanitized_index_name"])
pipeline_job["status"] = PipelineJobState.FAILED.value
pipeline_job.status = PipelineJobState.FAILED
else:
print(
f"Indexing job for '{item['human_readable_index_name']}' already running. Will not schedule another. Exiting..."
Expand Down

0 comments on commit 900c503

Please sign in to comment.