Splitted default queue to import/export, fixed django-rq admin page (#5555)
parent
0ea14d23a8
commit
fd7d8024f9
@ -0,0 +1,170 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ .Release.Name }}-backend-worker-annotation
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
app: cvat-app
|
||||
tier: backend
|
||||
component: worker-annotation
|
||||
{{- include "cvat.labels" . | nindent 4 }}
|
||||
{{- with .Values.cvat.backend.worker.annotation.labels }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- with .Values.cvat.backend.worker.annotation.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
replicas: {{ .Values.cvat.backend.worker.annotation.replicas }}
|
||||
strategy:
|
||||
type: Recreate
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "cvat.labels" . | nindent 6 }}
|
||||
{{- with .Values.cvat.backend.worker.annotation.labels }}
|
||||
{{- toYaml . | nindent 6 }}
|
||||
{{- end }}
|
||||
app: cvat-app
|
||||
tier: backend
|
||||
component: worker-annotation
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: cvat-app
|
||||
tier: backend
|
||||
component: worker-annotation
|
||||
{{- include "cvat.labels" . | nindent 8 }}
|
||||
{{- with .Values.cvat.backend.worker.annotation.labels }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.cvat.backend.worker.annotation.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
containers:
|
||||
- name: cvat-app-backend-worker-annotation-container
|
||||
image: {{ .Values.cvat.backend.image }}:{{ .Values.cvat.backend.tag }}
|
||||
imagePullPolicy: {{ .Values.cvat.backend.imagePullPolicy }}
|
||||
{{- with .Values.cvat.backend.worker.annotation.resources }}
|
||||
resources:
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
args: ["-c", "supervisord/worker.annotation.conf"]
|
||||
env:
|
||||
{{- if .Values.redis.enabled }}
|
||||
- name: CVAT_REDIS_HOST
|
||||
value: "{{ .Release.Name }}-redis-master"
|
||||
{{- else }}
|
||||
- name: CVAT_REDIS_HOST
|
||||
value: "{{ .Values.redis.external.host }}"
|
||||
{{- end }}
|
||||
- name: CVAT_REDIS_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: "{{ tpl (.Values.redis.secret.name) . }}"
|
||||
key: redis-password
|
||||
{{- if .Values.postgresql.enabled }}
|
||||
- name: CVAT_POSTGRES_HOST
|
||||
value: "{{ .Release.Name }}-postgresql"
|
||||
- name: CVAT_POSTGRES_PORT
|
||||
value: "{{ .Values.postgresql.service.ports.postgresql }}"
|
||||
{{- else }}
|
||||
- name: CVAT_POSTGRES_HOST
|
||||
value: "{{ .Values.postgresql.external.host }}"
|
||||
- name: CVAT_POSTGRES_PORT
|
||||
value: "{{ .Values.postgresql.external.port }}"
|
||||
{{- end }}
|
||||
- name: CVAT_POSTGRES_USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: "{{ tpl (.Values.postgresql.secret.name) . }}"
|
||||
key: username
|
||||
- name: CVAT_POSTGRES_DBNAME
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: "{{ tpl (.Values.postgresql.secret.name) . }}"
|
||||
key: database
|
||||
- name: CVAT_POSTGRES_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: "{{ tpl (.Values.postgresql.secret.name) . }}"
|
||||
key: password
|
||||
{{- if .Values.nuclio }}
|
||||
- name: CVAT_SERVERLESS
|
||||
value: "1"
|
||||
- name: CVAT_NUCLIO_HOST
|
||||
value: "{{ .Release.Name }}-nuclio-dashboard"
|
||||
{{- end }}
|
||||
{{- with .Values.cvat.backend.worker.annotation.additionalEnv }}
|
||||
{{- toYaml . | nindent 10 }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
- mountPath: /home/django/data
|
||||
name: cvat-backend-data
|
||||
subPath: data
|
||||
- mountPath: /home/django/keys
|
||||
name: cvat-backend-data
|
||||
subPath: keys
|
||||
- mountPath: /home/django/logs
|
||||
name: cvat-backend-data
|
||||
subPath: logs
|
||||
- mountPath: /home/django/models
|
||||
name: cvat-backend-data
|
||||
subPath: models
|
||||
- mountPath: /home/django/tmp_storage
|
||||
name: cvat-backend-data
|
||||
subPath: tmp_storage
|
||||
{{- with .Values.cvat.backend.worker.annotation.additionalVolumeMounts }}
|
||||
{{- toYaml . | nindent 10 }}
|
||||
{{- end }}
|
||||
initContainers:
|
||||
{{- if .Values.cvat.backend.permissionFix.enabled }}
|
||||
- name: user-data-permission-fix
|
||||
image: busybox
|
||||
command: ["/bin/chmod", "-R", "777", "/home/django"]
|
||||
{{- with .Values.cvat.backend.worker.annotation.resources }}
|
||||
resources:
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
{{- if .Values.cvat.backend.defaultStorage.enabled }}
|
||||
- mountPath: /home/django/data
|
||||
name: cvat-backend-data
|
||||
subPath: data
|
||||
- mountPath: /home/django/keys
|
||||
name: cvat-backend-data
|
||||
subPath: keys
|
||||
- mountPath: /home/django/logs
|
||||
name: cvat-backend-data
|
||||
subPath: logs
|
||||
- mountPath: /home/django/models
|
||||
name: cvat-backend-data
|
||||
subPath: models
|
||||
{{- end }}
|
||||
{{- with .Values.cvat.backend.worker.annotation.additionalVolumeMounts }}
|
||||
{{- toYaml . | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- with .Values.cvat.backend.worker.annotation.affinity }}
|
||||
affinity:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.cvat.backend.worker.annotation.tolerations }}
|
||||
tolerations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
volumes:
|
||||
{{- if .Values.cvat.backend.defaultStorage.enabled }}
|
||||
- name: cvat-backend-data
|
||||
persistentVolumeClaim:
|
||||
claimName: "{{ .Release.Name }}-backend-data"
|
||||
{{- end }}
|
||||
{{- with .Values.cvat.backend.worker.annotation.additionalVolumes }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
@ -0,0 +1,32 @@
|
||||
[unix_http_server]
|
||||
file = /tmp/supervisord/supervisor.sock
|
||||
|
||||
[supervisorctl]
|
||||
serverurl = unix:///tmp/supervisord/supervisor.sock
|
||||
|
||||
|
||||
[rpcinterface:supervisor]
|
||||
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
|
||||
|
||||
[supervisord]
|
||||
nodaemon=true
|
||||
logfile=%(ENV_HOME)s/logs/supervisord.log ; supervisord log file
|
||||
logfile_maxbytes=50MB ; maximum size of logfile before rotation
|
||||
logfile_backups=10 ; number of backed up logfiles
|
||||
loglevel=debug ; info, debug, warn, trace
|
||||
pidfile=/tmp/supervisord/supervisord.pid ; pidfile location
|
||||
childlogdir=%(ENV_HOME)s/logs/ ; where child log files will live
|
||||
|
||||
[program:ssh-agent]
|
||||
command=bash -c "rm /tmp/ssh-agent.sock -f && /usr/bin/ssh-agent -d -a /tmp/ssh-agent.sock"
|
||||
priority=1
|
||||
autorestart=true
|
||||
|
||||
[program:rqworker_export]
|
||||
command=%(ENV_HOME)s/wait-for-it.sh %(ENV_CVAT_REDIS_HOST)s:6379 -t 0 -- bash -ic " \
|
||||
exec python3 %(ENV_HOME)s/manage.py rqworker -v 3 export \
|
||||
--worker-class cvat.rqworker.DefaultWorker \
|
||||
"
|
||||
environment=SSH_AUTH_SOCK="/tmp/ssh-agent.sock"
|
||||
numprocs=%(ENV_NUMPROCS)s
|
||||
process_name=rqworker_export_%(process_num)s
|
||||
Loading…
Reference in New Issue