browsertrix/backend/btrixcloud/k8s/templates/crawl_job.yaml
Ilya Kreymer 30bda8c75d
VNC-Based Profile Browser (#433)
* profile browser vnc support + fixes:
- switch profile browser rendering to use VNC
- frontend: add @novnc/novnc as dependency, create separate bundle novnc.js to load into vnc browser (to avoid loading from each container)
- frontend: update proxy paths to proxy websocket, index page to crawler
- frontend: allow browser profiles in all browsers, remove browser compatibility check
- frontend: update webpack dev config, apply prettier
- frontend: node version fix
- backend: get vncpassword, build new URL for proxying to crawler iframe
- backend: fix profile / crawl job pull policy from 'Always' -> 'Never', should use existing image for job
- backend: fix kill signal to use bash -c to work with latest backend image
- backend/chart: add 'profile_browser_timeout_seconds' to chart values to control how long profile browser to remain when idle (default to 60)
- backend: remove utils.py, now using secret.token_hex() for random suffix
Co-authored-by: sua yoo <sua@suayoo.com>
2023-01-10 14:42:42 -08:00

107 lines
2.6 KiB
YAML

apiVersion: batch/v1
kind: Job
metadata:
name: job-{{ id }}
annotations:
btrix.run.manual: "{{ manual }}"
labels:
btrix.user: {{ userid }}
btrix.archive: {{ aid }}
btrix.crawlconfig: {{ cid }}
spec:
backoffLimit: 1000
ttlSecondsAfterFinished: 20
template:
metadata:
labels:
btrix.user: {{ userid }}
btrix.archive: {{ aid }}
btrix.crawlconfig: {{ cid }}
spec:
restartPolicy: OnFailure
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
preference:
matchExpressions:
- key: nodeType
operator: In
values:
- "{{ crawler_node_type }}"
tolerations:
- key: "nodeType"
operator: "Equal"
value: "crawling"
effect: "NoSchedule"
containers:
- name: crawl-job
image: {{ job_image }}
imagePullPolicy: Never
command: ["uvicorn", "btrixcloud.k8s.crawl_job:app", "--host", "0.0.0.0", "--access-log", "--log-level", "info"]
volumeMounts:
- name: config-volume
mountPath: /config
envFrom:
- secretRef:
name: mongo-auth
env:
- name: JOB_ID
valueFrom:
fieldRef:
fieldPath: metadata.labels['job-name']
- name: RUN_MANUAL
value: "{{ manual }}"
- name: USER_ID
value: "{{ userid }}"
- name: ARCHIVE_ID
value: "{{ aid }}"
- name: CRAWL_CONFIG_ID
value: "{{ cid }}"
- name: STORE_PATH
valueFrom:
configMapKeyRef:
name: crawl-config-{{ cid }}
key: STORE_PATH
- name: STORE_FILENAME
valueFrom:
configMapKeyRef:
name: crawl-config-{{ cid }}
key: STORE_FILENAME
- name: STORAGE_NAME
valueFrom:
configMapKeyRef:
name: crawl-config-{{ cid }}
key: STORAGE_NAME
- name: PROFILE_FILENAME
valueFrom:
configMapKeyRef:
name: crawl-config-{{ cid }}
key: PROFILE_FILENAME
volumes:
- name: config-volume
configMap:
name: shared-job-config
items:
- key: config.yaml
path: config.yaml