d94ad4a0dc
The work-queue OOM is fixed in code (bounded queue), but a deep search still loads up to 15000 Crossref records and the accumulating result JSONs into RAM. Give 2Gi of headroom so a big search isn't OOM-killed; raise the request to 512Mi to match its real baseline. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
62 lines
2.5 KiB
YAML
62 lines
2.5 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: librarian
|
|
namespace: conjurer
|
|
spec:
|
|
replicas: 1
|
|
selector: { matchLabels: { app: librarian } }
|
|
template:
|
|
metadata: { labels: { app: librarian } }
|
|
spec:
|
|
imagePullSecrets: [{ name: gitea-registry }]
|
|
containers:
|
|
- name: librarian
|
|
image: gitea.czernobog.pl/gitea/conjurer-librarian:e243777e
|
|
ports: [{ containerPort: 5001 }]
|
|
env:
|
|
- { name: CONJURER_LIBRARIAN_HOST, value: "0.0.0.0" }
|
|
- { name: CONJURER_LIBRARIAN_PORT, value: "5001" }
|
|
- { name: CONJURER_LIBRARIAN_DB_PATH, value: "/doi/" }
|
|
- { name: CONJURER_API_KEY, value: "d97008b3-7a5a-11f1-acd1-000b0e0f00ed" }
|
|
- { name: CONJURER_LIBRARIAN_MAXTHREADS, value: "40" }
|
|
- { name: CONJURER_CROSSREF_MAILTO, value: "mtuszowski@gmail.com" }
|
|
- { name: CONJURER_LIBRARIAN_CHUNK, value: "_chunk.txt" }
|
|
# Librarian jest W TYM SAMYM klastrze/namespace co bot - gada z nim
|
|
# po DNS Service'u, nie przez nodePort węzła (ten zostaje tylko dla
|
|
# zewnętrznych musician/betoniarka z Dockera). Odporne na przetasowania.
|
|
- { name: CONJURER_MAIN_BOT, value: "http://bot:5000" }
|
|
|
|
- { name: CONJURER_LIBRARIAN_STATE_DIR, value: "/lib_temp_files" }
|
|
|
|
volumeMounts:
|
|
- { name: doi, mountPath: /doi, readOnly: true }
|
|
- { name: state, mountPath: /lib_temp_files }
|
|
resources:
|
|
requests: { cpu: "100m", memory: "512Mi" }
|
|
# Headroom bump: the work-queue OOM is fixed in code, but a deep
|
|
# search still pulls up to 15000 Crossref records into RAM and the
|
|
# accumulating result JSONs are loaded whole. 2Gi gives margin so a
|
|
# big search isn't OOM-killed. Tune down if the node is tight.
|
|
limits: { cpu: "1", memory: "2Gi" }
|
|
volumes:
|
|
- name: doi
|
|
nfs:
|
|
server: 192.168.1.34
|
|
path: /mnt/Tank1/conjurer_swap/librarian_data/base_it1
|
|
- name: state
|
|
persistentVolumeClaim: { claimName: librarian-state }
|
|
---
|
|
apiVersion: v1
|
|
kind: PersistentVolumeClaim
|
|
metadata: { name: librarian-state, namespace: conjurer }
|
|
spec:
|
|
accessModes: [ReadWriteOnce]
|
|
resources: { requests: { storage: 1Gi } }
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata: { name: librarian, namespace: conjurer }
|
|
spec:
|
|
selector: { app: librarian }
|
|
ports: [{ port: 5001, targetPort: 5001 }] |