6acfb0b9d0
build-and-deploy / deploy (push) Successful in 2m34s
Crawl only ayah text/notes/messages; API falls back to episode audio.
46 lines
1.6 KiB
YAML
46 lines
1.6 KiB
YAML
# One-shot crawl of Tafsir Noor into tafsirquran-audio PVC.
|
|
# Scale API to 0 first (RWO PVC), then create ConfigMap + Job:
|
|
# kubectl -n tafsirquran create configmap tafsirquran-gharaati-scripts \
|
|
# --from-file=crawl-gharaati.py=scripts/crawl-gharaati.py --dry-run=client -o yaml | kubectl apply -f -
|
|
# kubectl -n tafsirquran apply -f k8s/gharaati-crawl-job.yaml
|
|
# kubectl -n tafsirquran logs -f job/tafsirquran-gharaati-crawl
|
|
apiVersion: batch/v1
|
|
kind: Job
|
|
metadata:
|
|
name: tafsirquran-gharaati-crawl
|
|
namespace: tafsirquran
|
|
spec:
|
|
backoffLimit: 2
|
|
ttlSecondsAfterFinished: 86400
|
|
template:
|
|
spec:
|
|
restartPolicy: Never
|
|
containers:
|
|
- name: crawl
|
|
image: python:3.12-slim
|
|
command: ["/bin/bash", "-lc"]
|
|
args:
|
|
- |
|
|
set -euo pipefail
|
|
apt-get update -qq
|
|
DEBIAN_FRONTEND=noninteractive apt-get install -y -qq ca-certificates >/dev/null
|
|
# Content only — PVC already has ~2997 Gooya MP3s; skip site audio re-download.
|
|
python3 /scripts/crawl-gharaati.py /data/audio --skip-existing-json --delay 0.15
|
|
volumeMounts:
|
|
- name: audio
|
|
mountPath: /data/audio
|
|
- name: scripts
|
|
mountPath: /scripts
|
|
resources:
|
|
requests:
|
|
memory: 256Mi
|
|
cpu: 250m
|
|
volumes:
|
|
- name: audio
|
|
persistentVolumeClaim:
|
|
claimName: tafsirquran-audio
|
|
- name: scripts
|
|
configMap:
|
|
name: tafsirquran-gharaati-scripts
|
|
defaultMode: 0755
|