Files
oval 33997778f6 Prepare for public git: .gitignore, .env, sanitized configs
- Add .gitignore excluding .env, __pycache__, test_files (copyrighted PDFs),
  session logs, marker/ submodule, and other generated/private files
- Add .env with local config (gitignored); expand .env.example with all
  supported environment variables
- docker-compose.yml: all hardcoded values now use default pattern
- Containerfile: install marker-pdf from GitHub instead of local submodule;
  fix AMD_COMPUTE default to false; sanitize default OLLAMA_HOST
- Remove marker/ submodule from git tracking (keep local checkout via .gitignore)
- Remove session transcript and copyrighted ENISA PDFs from git tracking
- Sanitize local IPs in README, kubernetes deployment, deploy-podman.sh
- Fix hardcoded paths in convert_both.py and compare_conversions.py
- Update requirements.txt to reference GitHub instead of local --editable
2026-06-08 12:29:43 +02:00

164 lines
4.0 KiB
YAML

# ==================================================
# kubernetes/deployment.yaml -- marker-api (Kubernetes)
# ==================================================
apiVersion: v1
kind: ConfigMap
metadata:
name: marker-api-config
data:
OLLAMA_HOST: "http://ollama-service:11434" # adjust to your Ollama endpoint
DEESEEK_OCR_MODEL: "deepseek-ocr"
AMD_COMPUTE: "false"
TORCH_DEVICE: ""
MODEL_DTYPE: "float32"
PORT: "8000"
HOST: "0.0.0.0"
GUNICORN_WORKERS: "2"
GUNICORN_THREADS: "4"
GUNICORN_TIMEOUT: "300"
FLASK_DEBUG: "0"
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: marker-api
labels:
app: marker-api
spec:
replicas: 1
selector:
matchLabels:
app: marker-api
template:
metadata:
labels:
app: marker-api
spec:
containers:
- name: marker-api
image: marker-api:latest # build/push your own image
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8000
name: http
protocol: TCP
envFrom:
- configMapRef:
name: marker-api-config
resources:
requests:
cpu: "2"
memory: "4Gi"
# Set to marker.nvidia.com/gpu or amd.com/gpu if using GPU plugin
nvidia.com/gpu: "0" # remove if using AMD/ROCm via volume mounts
volumeMounts:
- name: conversion-results
mountPath: /app/conversion_results
- name: uploads
mountPath: /app/uploads
livenessProbe:
httpGet:
path: /health
port: 8000
initialDelaySeconds: 120
periodSeconds: 30
timeoutSeconds: 5
failureThreshold: 3
readinessProbe:
httpGet:
path: /health
port: 8000
initialDelaySeconds: 60
periodSeconds: 10
timeoutSeconds: 3
failureThreshold: 3
volumes:
- name: conversion-results
persistentVolumeClaim:
claimName: marker-api-pvc
- name: uploads
emptyDir:
sizeLimit: 2Gi # adjustable; use PVC for larger data
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: marker-api-pvc
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 10Gi
---
apiVersion: v1
kind: Service
metadata:
name: marker-api
labels:
app: marker-api
spec:
selector:
app: marker-api
ports:
- port: 8000
targetPort: 8000
protocol: TCP
name: http
type: ClusterIP
---
# For node-local AMD GPU support in K8s, bind /dev/kfd and /dev/dri:
# Use a DaemonSet with hostPaths instead, or mount via GPU plugin.
# Example DaemonSet for AMD GPU nodes:
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: marker-api-gpu
labels:
app: marker-api
spec:
selector:
matchLabels:
app: marker-api
template:
metadata:
labels:
app: marker-api
spec:
hostNetwork: true
hostPID: true
containers:
- name: marker-api
image: marker-api:latest
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8000
hostPort: 8000
envFrom:
- configMapRef:
name: marker-api-config
resources:
requests:
cpu: "2"
memory: "4Gi"
limits:
cpu: "4"
memory: "8Gi"
volumeMounts:
- name: conversion-results
mountPath: /app/conversion_results
- name: kfd
mountPath: /dev/kfd
- name: dri
mountPath: /dev/dri
volumes:
- name: conversion-results
persistentVolumeClaim:
claimName: marker-api-pvc
- name: kfd
hostPath:
path: /dev/kfd
- name: dri
hostPath:
path: /dev/dri