Extend helm to support Serverless functions and Analytics (#110)
parent
7e20b279af
commit
5e2eda7601
@ -1,5 +1,4 @@
|
|||||||
server.host: 0.0.0.0
|
server.host: 0.0.0.0
|
||||||
elasticsearch.url: http://elasticsearch:9200
|
|
||||||
elasticsearch.requestHeadersWhitelist: ['cookie', 'authorization', 'x-forwarded-user']
|
elasticsearch.requestHeadersWhitelist: ['cookie', 'authorization', 'x-forwarded-user']
|
||||||
kibana.defaultAppId: 'discover'
|
kibana.defaultAppId: 'discover'
|
||||||
server.basePath: /analytics
|
server.basePath: /analytics
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
queue.type: persisted
|
queue.type: persisted
|
||||||
queue.max_bytes: 1gb
|
queue.max_bytes: 1gb
|
||||||
queue.checkpoint.writes: 20
|
queue.checkpoint.writes: 20
|
||||||
|
http.host: 0.0.0.0
|
||||||
|
|||||||
@ -0,0 +1 @@
|
|||||||
|
../serverless/common/openvino
|
||||||
@ -0,0 +1,56 @@
|
|||||||
|
{{- $version := .Capabilities.KubeVersion.GitVersion -}}
|
||||||
|
{{- if and .Values.ingress.enabled .Values.analytics.enabled -}}
|
||||||
|
{{- $fullName := include "cvat.fullname" . -}}
|
||||||
|
{{- if semverCompare ">=1.19-0" $version -}}
|
||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
{{- else if semverCompare ">=1.14-0" $version -}}
|
||||||
|
apiVersion: networking.k8s.io/v1beta1
|
||||||
|
{{- else -}}
|
||||||
|
apiVersion: extensions/v1beta1
|
||||||
|
{{- end }}
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: {{ $fullName }}-analytics
|
||||||
|
namespace: {{ .Release.Namespace }}
|
||||||
|
labels:
|
||||||
|
{{- include "cvat.labels" . | nindent 4 }}
|
||||||
|
annotations:
|
||||||
|
traefik.ingress.kubernetes.io/router.middlewares: {{ $.Release.Namespace }}-stripprefix@kubernetescrd,
|
||||||
|
{{ $.Release.Namespace }}-forwardauth@kubernetescrd
|
||||||
|
{{- with .Values.analytics.ingress.annotations }}
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
{{- if semverCompare ">=1.19-0" $version }}
|
||||||
|
ingressClassName: {{ .Values.ingress.className }}
|
||||||
|
{{- end }}
|
||||||
|
rules:
|
||||||
|
{{- range .Values.ingress.hosts }}
|
||||||
|
- host: {{ .host | quote }}
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- path: {{ $.Values.analytics.ingress.path }}
|
||||||
|
{{- if $.Values.analytics.ingress.pathType }}
|
||||||
|
pathType: {{ $.Values.analytics.ingress.pathType }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if semverCompare ">=1.19-0" $version }}
|
||||||
|
backend:
|
||||||
|
service:
|
||||||
|
{{- if $.Values.analytics.external.useExternal }}
|
||||||
|
name: {{ $.Values.analytics.ingress.service.name }}
|
||||||
|
{{- else }}
|
||||||
|
name: {{ $.Release.Name }}-{{ $.Values.analytics.ingress.service.name }}
|
||||||
|
{{- end }}
|
||||||
|
port:
|
||||||
|
number: {{ $.Values.analytics.ingress.service.port }}
|
||||||
|
{{- else }}
|
||||||
|
backend:
|
||||||
|
{{- if $.Values.analytics.external.useExternal }}
|
||||||
|
serviceName: {{ $.Values.analytics.ingress.service.name }}
|
||||||
|
{{- else }}
|
||||||
|
serviceName: {{ $.Release.Name }}-{{ $.Values.analytics.ingress.service.name }}
|
||||||
|
{{- end }}
|
||||||
|
servicePort: {{ $.Values.analytics.ingress.service.port }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
@ -0,0 +1,18 @@
|
|||||||
|
{{- if and .Values.ingress.enabled .Values.analytics.enabled }}
|
||||||
|
|
||||||
|
apiVersion: traefik.containo.us/v1alpha1
|
||||||
|
kind: Middleware
|
||||||
|
metadata:
|
||||||
|
name: forwardauth
|
||||||
|
namespace: {{ .Release.Namespace }}
|
||||||
|
annotations:
|
||||||
|
labels:
|
||||||
|
{{- include "cvat.labels" . | nindent 4 }}
|
||||||
|
spec:
|
||||||
|
forwardAuth:
|
||||||
|
address: http://{{ .Release.Name }}-backend-service:8080/analytics
|
||||||
|
authRequestHeaders:
|
||||||
|
- "Cookie"
|
||||||
|
- "Authorization"
|
||||||
|
|
||||||
|
{{- end }}
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
{{- if and .Values.ingress.enabled .Values.analytics.enabled }}
|
||||||
|
|
||||||
|
apiVersion: traefik.containo.us/v1alpha1
|
||||||
|
kind: Middleware
|
||||||
|
metadata:
|
||||||
|
name: stripprefix
|
||||||
|
namespace: {{ .Release.Namespace }}
|
||||||
|
annotations:
|
||||||
|
labels:
|
||||||
|
{{- include "cvat.labels" . | nindent 4 }}
|
||||||
|
spec:
|
||||||
|
stripPrefix:
|
||||||
|
prefixes:
|
||||||
|
- /analytics
|
||||||
|
{{- end }}
|
||||||
@ -0,0 +1,192 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: {{ .Release.Name }}-backend-server
|
||||||
|
namespace: {{ .Release.Namespace }}
|
||||||
|
labels:
|
||||||
|
app: cvat-app
|
||||||
|
tier: backend
|
||||||
|
component: server
|
||||||
|
{{- include "cvat.labels" . | nindent 4 }}
|
||||||
|
{{- with .Values.cvat.backend.server.labels }}
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.cvat.backend.server.annotations }}
|
||||||
|
annotations:
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
replicas: {{ .Values.cvat.backend.server.replicas }}
|
||||||
|
strategy:
|
||||||
|
type: Recreate
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
{{- include "cvat.labels" . | nindent 6 }}
|
||||||
|
{{- with .Values.cvat.backend.server.labels }}
|
||||||
|
{{- toYaml . | nindent 6 }}
|
||||||
|
{{- end }}
|
||||||
|
app: cvat-app
|
||||||
|
tier: backend
|
||||||
|
component: server
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: cvat-app
|
||||||
|
tier: backend
|
||||||
|
component: server
|
||||||
|
{{- include "cvat.labels" . | nindent 8 }}
|
||||||
|
{{- with .Values.cvat.backend.server.labels }}
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.cvat.backend.server.annotations }}
|
||||||
|
annotations:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: cvat-app-backend-server-container
|
||||||
|
image: {{ .Values.cvat.backend.image }}:{{ .Values.cvat.backend.tag }}
|
||||||
|
{{- with .Values.cvat.backend.server.resources }}
|
||||||
|
resources:
|
||||||
|
{{- toYaml . | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
args: ["-c", "supervisord/server.conf"]
|
||||||
|
env:
|
||||||
|
- name: ALLOWED_HOSTS
|
||||||
|
value: {{ .Values.cvat.backend.server.envs.ALLOWED_HOSTS | squote}}
|
||||||
|
- name: DJANGO_MODWSGI_EXTRA_ARGS
|
||||||
|
value: {{ .Values.cvat.backend.server.envs.DJANGO_MODWSGI_EXTRA_ARGS}}
|
||||||
|
{{- if .Values.redis.enabled }}
|
||||||
|
- name: CVAT_REDIS_HOST
|
||||||
|
value: "{{ .Release.Name }}-redis-master"
|
||||||
|
{{- else }}
|
||||||
|
- name: CVAT_REDIS_HOST
|
||||||
|
value: "{{ .Values.redis.external.host }}"
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.postgresql.enabled }}
|
||||||
|
- name: CVAT_POSTGRES_HOST
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: "{{ .Release.Name }}-{{ .Values.postgresql.secret.name }}"
|
||||||
|
key: postgresql-hostname
|
||||||
|
- name: CVAT_POSTGRES_USER
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: "{{ .Release.Name }}-{{ .Values.postgresql.secret.name }}"
|
||||||
|
key: postgresql-username
|
||||||
|
- name: CVAT_POSTGRES_DBNAME
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: "{{ .Release.Name }}-{{ .Values.postgresql.secret.name }}"
|
||||||
|
key: postgresql-database
|
||||||
|
- name: CVAT_POSTGRES_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: "{{ .Release.Name }}-{{ .Values.postgresql.secret.name }}"
|
||||||
|
key: postgresql-password
|
||||||
|
{{- else }}
|
||||||
|
- name: CVAT_POSTGRES_HOST
|
||||||
|
value: "{{ .Values.postgresql.external.host }}"
|
||||||
|
- name: CVAT_POSTGRES_USER
|
||||||
|
value: "{{ .Values.postgresql.external.user }}"
|
||||||
|
- name: CVAT_POSTGRES_DBNAME
|
||||||
|
value: "{{ .Values.postgresql.external.dbname }}"
|
||||||
|
- name: CVAT_POSTGRES_PASSWORD
|
||||||
|
value: "{{ .Values.postgresql.external.password }}"
|
||||||
|
- name: CVAT_POSTGRES_PORT
|
||||||
|
value: "{{ .Values.postgresql.external.port }}"
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.nuclio.enabled }}
|
||||||
|
- name: CVAT_SERVERLESS
|
||||||
|
value: "1"
|
||||||
|
- name: CVAT_NUCLIO_HOST
|
||||||
|
value: "{{ .Release.Name }}-nuclio-dashboard"
|
||||||
|
- name: CVAT_NUCLIO_FUNCTION_NAMESPACE
|
||||||
|
value: "{{ .Release.Namespace }}"
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.analytics.enabled}}
|
||||||
|
- name: CVAT_ANALYTICS
|
||||||
|
value: "1"
|
||||||
|
- name: DJANGO_LOG_SERVER_HOST
|
||||||
|
{{- if .Values.analytics.external.useExternal }}
|
||||||
|
value: "{{ .Values.analytics.logServerHost }}"
|
||||||
|
{{- else}}
|
||||||
|
value: "{{ .Release.Name }}-logstash"
|
||||||
|
{{- end}}
|
||||||
|
- name: DJANGO_LOG_SERVER_PORT
|
||||||
|
{{- if .Values.analytics.external.useExternal }}
|
||||||
|
value: "{{ .Values.analytics.logServerPort }}"
|
||||||
|
{{- else}}
|
||||||
|
value: "8080"
|
||||||
|
{{- end}}
|
||||||
|
{{- end}}
|
||||||
|
{{- with .Values.cvat.backend.server.additionalEnv }}
|
||||||
|
{{- toYaml . | nindent 10 }}
|
||||||
|
{{- end }}
|
||||||
|
ports:
|
||||||
|
- containerPort: 8080
|
||||||
|
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
|
||||||
|
{{- with .Values.cvat.backend.server.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.server.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.server.additionalVolumeMounts }}
|
||||||
|
{{- toYaml . | nindent 10 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.cvat.backend.server.affinity }}
|
||||||
|
affinity:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.cvat.backend.server.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.server.additionalVolumes }}
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.imagePullSecrets }}
|
||||||
|
imagePullSecrets:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
@ -0,0 +1,173 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: {{ .Release.Name }}-backend-worker-default
|
||||||
|
namespace: {{ .Release.Namespace }}
|
||||||
|
labels:
|
||||||
|
app: cvat-app
|
||||||
|
tier: backend
|
||||||
|
component: worker-default
|
||||||
|
{{- include "cvat.labels" . | nindent 4 }}
|
||||||
|
{{- with .Values.cvat.backend.worker.default.labels }}
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.cvat.backend.worker.default.annotations }}
|
||||||
|
annotations:
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
replicas: {{ .Values.cvat.backend.worker.default.replicas }}
|
||||||
|
strategy:
|
||||||
|
type: Recreate
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
{{- include "cvat.labels" . | nindent 6 }}
|
||||||
|
{{- with .Values.cvat.backend.worker.default.labels }}
|
||||||
|
{{- toYaml . | nindent 6 }}
|
||||||
|
{{- end }}
|
||||||
|
app: cvat-app-worker-default
|
||||||
|
tier: backend
|
||||||
|
component: worker-default
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: cvat-app-worker-default
|
||||||
|
tier: backend
|
||||||
|
component: worker-default
|
||||||
|
{{- include "cvat.labels" . | nindent 8 }}
|
||||||
|
{{- with .Values.cvat.backend.worker.default.labels }}
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.cvat.backend.worker.default.annotations }}
|
||||||
|
annotations:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: cvat-app-backend-worker-default-container
|
||||||
|
image: {{ .Values.cvat.backend.image }}:{{ .Values.cvat.backend.tag }}
|
||||||
|
{{- with .Values.cvat.backend.worker.default.resources }}
|
||||||
|
resources:
|
||||||
|
{{- toYaml . | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
args: ["-c", "supervisord/worker.default.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 }}
|
||||||
|
{{- if .Values.postgresql.enabled }}
|
||||||
|
- name: CVAT_POSTGRES_HOST
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: "{{ .Release.Name }}-{{ .Values.postgresql.secret.name }}"
|
||||||
|
key: postgresql-hostname
|
||||||
|
- name: CVAT_POSTGRES_USER
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: "{{ .Release.Name }}-{{ .Values.postgresql.secret.name }}"
|
||||||
|
key: postgresql-username
|
||||||
|
- name: CVAT_POSTGRES_DBNAME
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: "{{ .Release.Name }}-{{ .Values.postgresql.secret.name }}"
|
||||||
|
key: postgresql-database
|
||||||
|
- name: CVAT_POSTGRES_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: "{{ .Release.Name }}-{{ .Values.postgresql.secret.name }}"
|
||||||
|
key: postgresql-password
|
||||||
|
{{- else }}
|
||||||
|
- name: CVAT_POSTGRES_HOST
|
||||||
|
value: "{{ .Values.postgresql.external.host }}"
|
||||||
|
- name: CVAT_POSTGRES_USER
|
||||||
|
value: "{{ .Values.postgresql.external.user }}"
|
||||||
|
- name: CVAT_POSTGRES_DBNAME
|
||||||
|
value: "{{ .Values.postgresql.external.dbname }}"
|
||||||
|
- name: CVAT_POSTGRES_PASSWORD
|
||||||
|
value: "{{ .Values.postgresql.external.password }}"
|
||||||
|
- name: CVAT_POSTGRES_PORT
|
||||||
|
value: "{{ .Values.postgresql.external.port }}"
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.nuclio }}
|
||||||
|
- name: CVAT_SERVERLESS
|
||||||
|
value: "1"
|
||||||
|
- name: CVAT_NUCLIO_HOST
|
||||||
|
value: "{{ .Release.Name }}-nuclio-dashboard"
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.cvat.backend.worker.default.additionalEnv }}
|
||||||
|
{{- toYaml . | nindent 10 }}
|
||||||
|
{{- end }}
|
||||||
|
ports:
|
||||||
|
- containerPort: 8080
|
||||||
|
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.default.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.default.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.default.additionalVolumeMounts }}
|
||||||
|
{{- toYaml . | nindent 10 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.cvat.backend.worker.default.affinity }}
|
||||||
|
affinity:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.cvat.backend.worker.default.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.default.additionalVolumes }}
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.imagePullSecrets }}
|
||||||
|
imagePullSecrets:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
@ -0,0 +1,173 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: {{ .Release.Name }}-backend-worker-low
|
||||||
|
namespace: {{ .Release.Namespace }}
|
||||||
|
labels:
|
||||||
|
app: cvat-app
|
||||||
|
tier: backend
|
||||||
|
component: worker-low
|
||||||
|
{{- include "cvat.labels" . | nindent 4 }}
|
||||||
|
{{- with .Values.cvat.backend.worker.low.labels }}
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.cvat.backend.worker.low.annotations }}
|
||||||
|
annotations:
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
replicas: {{ .Values.cvat.backend.worker.low.replicas }}
|
||||||
|
strategy:
|
||||||
|
type: Recreate
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
{{- include "cvat.labels" . | nindent 6 }}
|
||||||
|
{{- with .Values.cvat.backend.worker.low.labels }}
|
||||||
|
{{- toYaml . | nindent 6 }}
|
||||||
|
{{- end }}
|
||||||
|
app: cvat-app
|
||||||
|
tier: backend
|
||||||
|
component: worker-low
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: cvat-app
|
||||||
|
tier: backend
|
||||||
|
component: worker-low
|
||||||
|
{{- include "cvat.labels" . | nindent 8 }}
|
||||||
|
{{- with .Values.cvat.backend.worker.low.labels }}
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.cvat.backend.worker.low.annotations }}
|
||||||
|
annotations:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: cvat-app-backend-worker-low-container
|
||||||
|
image: {{ .Values.cvat.backend.image }}:{{ .Values.cvat.backend.tag }}
|
||||||
|
{{- with .Values.cvat.backend.worker.low.resources }}
|
||||||
|
resources:
|
||||||
|
{{- toYaml . | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
args: ["-c", "supervisord/worker.low.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 }}
|
||||||
|
{{- if .Values.postgresql.enabled }}
|
||||||
|
- name: CVAT_POSTGRES_HOST
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: "{{ .Release.Name }}-{{ .Values.postgresql.secret.name }}"
|
||||||
|
key: postgresql-hostname
|
||||||
|
- name: CVAT_POSTGRES_USER
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: "{{ .Release.Name }}-{{ .Values.postgresql.secret.name }}"
|
||||||
|
key: postgresql-username
|
||||||
|
- name: CVAT_POSTGRES_DBNAME
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: "{{ .Release.Name }}-{{ .Values.postgresql.secret.name }}"
|
||||||
|
key: postgresql-database
|
||||||
|
- name: CVAT_POSTGRES_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: "{{ .Release.Name }}-{{ .Values.postgresql.secret.name }}"
|
||||||
|
key: postgresql-password
|
||||||
|
{{- else }}
|
||||||
|
- name: CVAT_POSTGRES_HOST
|
||||||
|
value: "{{ .Values.postgresql.external.host }}"
|
||||||
|
- name: CVAT_POSTGRES_USER
|
||||||
|
value: "{{ .Values.postgresql.external.user }}"
|
||||||
|
- name: CVAT_POSTGRES_DBNAME
|
||||||
|
value: "{{ .Values.postgresql.external.dbname }}"
|
||||||
|
- name: CVAT_POSTGRES_PASSWORD
|
||||||
|
value: "{{ .Values.postgresql.external.password }}"
|
||||||
|
- name: CVAT_POSTGRES_PORT
|
||||||
|
value: "{{ .Values.postgresql.external.port }}"
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.nuclio }}
|
||||||
|
- name: CVAT_SERVERLESS
|
||||||
|
value: "1"
|
||||||
|
- name: CVAT_NUCLIO_HOST
|
||||||
|
value: "{{ .Release.Name }}-nuclio-dashboard"
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.cvat.backend.worker.low.additionalEnv }}
|
||||||
|
{{- toYaml . | nindent 10 }}
|
||||||
|
{{- end }}
|
||||||
|
ports:
|
||||||
|
- containerPort: 8080
|
||||||
|
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.low.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.low.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.low.additionalVolumeMounts }}
|
||||||
|
{{- toYaml . | nindent 10 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.cvat.backend.worker.low.affinity }}
|
||||||
|
affinity:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.cvat.backend.worker.low.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.low.additionalVolumes }}
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.imagePullSecrets }}
|
||||||
|
imagePullSecrets:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
{{- if .Values.nuclio.enabled }}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: cvat-nuclio-openvino-common
|
||||||
|
namespace: {{ .Release.Namespace }}
|
||||||
|
labels:
|
||||||
|
{{- include "cvat.labels" . | nindent 4 }}
|
||||||
|
app: cvat-app
|
||||||
|
tier: nuclio
|
||||||
|
{{- if semverCompare ">=1.21-0" .Capabilities.KubeVersion.GitVersion }}
|
||||||
|
immutable: true
|
||||||
|
{{- end }}
|
||||||
|
binaryData:
|
||||||
|
python3: |-
|
||||||
|
{{ .Files.Get "nuclio_func_common_files/python3" | b64enc }}
|
||||||
|
model_loader.py:
|
||||||
|
{{ .Files.Get "nuclio_func_common_files/model_loader.py" | b64enc }}
|
||||||
|
{{- end}}
|
||||||
@ -0,0 +1,37 @@
|
|||||||
|
[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:clamav_update]
|
||||||
|
command=bash -c "if [ \"${CLAM_AV}\" = 'yes' ]; then /usr/bin/freshclam -d \
|
||||||
|
-l %(ENV_HOME)s/logs/freshclam.log --foreground=true; fi"
|
||||||
|
|
||||||
|
[program:runserver]
|
||||||
|
; Here need to run a couple of commands to initialize DB and copy static files.
|
||||||
|
; We cannot initialize DB on build because the DB should be online. Also some
|
||||||
|
; apps are dynamically loaded by an environment variable. It can lead to issues
|
||||||
|
; with docker cache. Thus it is necessary to run collectstatic here for such
|
||||||
|
; apps.
|
||||||
|
command=%(ENV_HOME)s/wait-for-it.sh %(ENV_CVAT_POSTGRES_HOST)s:5432 -t 0 -- bash -ic \
|
||||||
|
"rm -f /tmp/cvat-server/httpd.pid && python3 ~/manage.py migrate && \
|
||||||
|
python3 ~/manage.py collectstatic --no-input && \
|
||||||
|
exec python3 $HOME/manage.py runmodwsgi --log-to-terminal --port 8080 \
|
||||||
|
--limit-request-body 1073741824 --log-level INFO --include-file ~/mod_wsgi.conf \
|
||||||
|
%(ENV_DJANGO_MODWSGI_EXTRA_ARGS)s --locale %(ENV_LC_ALL)s \
|
||||||
|
--server-root /tmp/cvat-server"
|
||||||
|
numprocs=%(ENV_NUMPROCS)s
|
||||||
@ -0,0 +1,37 @@
|
|||||||
|
[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:git_status_updater]
|
||||||
|
command=%(ENV_HOME)s/wait-for-it.sh %(ENV_CVAT_REDIS_HOST)s:6379 -t 0 -- bash -ic \
|
||||||
|
"python3 ~/manage.py update_git_states"
|
||||||
|
environment=SSH_AUTH_SOCK="/tmp/ssh-agent.sock"
|
||||||
|
numprocs=1
|
||||||
|
|
||||||
|
[program:rqscheduler]
|
||||||
|
command=%(ENV_HOME)s/wait-for-it.sh %(ENV_CVAT_REDIS_HOST)s:6379 -t 0 -- bash -ic \
|
||||||
|
"python3 /opt/venv/bin/rqscheduler --host %(ENV_CVAT_REDIS_HOST)s -i 30"
|
||||||
|
environment=SSH_AUTH_SOCK="/tmp/ssh-agent.sock"
|
||||||
|
numprocs=1
|
||||||
|
|
||||||
|
environment=SSH_AUTH_SOCK="/tmp/ssh-agent.sock"
|
||||||
@ -0,0 +1,37 @@
|
|||||||
|
[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_default]
|
||||||
|
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 default"
|
||||||
|
environment=SSH_AUTH_SOCK="/tmp/ssh-agent.sock"
|
||||||
|
numprocs=%(ENV_NUMPROCS)s
|
||||||
|
process_name=rqworker_default_%(process_num)s
|
||||||
|
|
||||||
|
environment=SSH_AUTH_SOCK="/tmp/ssh-agent.sock"
|
||||||
|
|
||||||
|
[program:clamav_update]
|
||||||
|
command=bash -c "if [ \"${CLAM_AV}\" = 'yes' ]; then /usr/bin/freshclam -d \
|
||||||
|
-l %(ENV_HOME)s/logs/freshclam.log --foreground=true; fi"
|
||||||
|
numprocs=1
|
||||||
@ -0,0 +1,36 @@
|
|||||||
|
[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_low]
|
||||||
|
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 low"
|
||||||
|
environment=SSH_AUTH_SOCK="/tmp/ssh-agent.sock"
|
||||||
|
numprocs=%(ENV_NUMPROCS)s
|
||||||
|
|
||||||
|
[program:clamav_update]
|
||||||
|
command=bash -c "if [ \"${CLAM_AV}\" = 'yes' ]; then /usr/bin/freshclam -d \
|
||||||
|
-l %(ENV_HOME)s/logs/freshclam.log --foreground=true; fi"
|
||||||
|
numprocs=1
|
||||||
|
|
||||||
|
environment=SSH_AUTH_SOCK="/tmp/ssh-agent.sock"
|
||||||
@ -1,6 +1,6 @@
|
|||||||
version: '3.3'
|
version: '3.3'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
cvat:
|
cvat_server:
|
||||||
environment:
|
environment:
|
||||||
DJANGO_SETTINGS_MODULE: cvat.settings.email_settings
|
DJANGO_SETTINGS_MODULE: cvat.settings.email_settings
|
||||||
|
|||||||
@ -1,8 +1,6 @@
|
|||||||
version: '3.3'
|
version: '3.3'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
cvat:
|
cvat_worker_default:
|
||||||
environment:
|
|
||||||
CVAT_SHARE_URL: 'Mounted from asset for case 107 host directory'
|
|
||||||
volumes:
|
volumes:
|
||||||
- ./tests/cypress/integration/actions_tasks3/assets/case_107:/home/django/share:rw
|
- ./tests/cypress/integration/actions_tasks3/assets/case_107:/home/django/share:rw
|
||||||
|
|||||||
Loading…
Reference in New Issue