diff --git a/backend_entrypoint.sh b/backend_entrypoint.sh index dfc692c48350..aca873ed9400 100755 --- a/backend_entrypoint.sh +++ b/backend_entrypoint.sh @@ -33,7 +33,7 @@ cmd_run() { echo "waiting for migrations to complete..." while ! ~/manage.py migrate --check; do - sleep 1 + sleep 10 done exec supervisord -c "supervisord/$1.conf" diff --git a/helm-chart/Chart.yaml b/helm-chart/Chart.yaml index 405c02ab74e5..959369cee08f 100644 --- a/helm-chart/Chart.yaml +++ b/helm-chart/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.9.0 +version: 0.9.1 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/helm-chart/templates/_helpers.tpl b/helm-chart/templates/_helpers.tpl index 2e8ba26b0d63..2781a411797b 100644 --- a/helm-chart/templates/_helpers.tpl +++ b/helm-chart/templates/_helpers.tpl @@ -62,6 +62,59 @@ Create the name of the service account to use {{- end }} {{- define "cvat.sharedBackendEnv" }} +{{- 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.analytics.enabled}} +- name: CVAT_ANALYTICS + value: "1" +- name: DJANGO_LOG_SERVER_HOST + value: "{{ .Release.Name }}-vector" +- name: DJANGO_LOG_SERVER_PORT + value: "80" +- name: CLICKHOUSE_HOST + value: "{{ .Release.Name }}-clickhouse" +{{- end }} + - name: SMOKESCREEN_OPTS value: {{ .Values.smokescreen.opts | toJson }} {{- if .Values.nuclio.enabled }} diff --git a/helm-chart/templates/cvat_backend/cvat_worker_webhooks/deployment.yml b/helm-chart/templates/cvat_backend/cvat_worker_webhooks/deployment.yml index a11665790c43..a7496e500186 100644 --- a/helm-chart/templates/cvat_backend/cvat_worker_webhooks/deployment.yml +++ b/helm-chart/templates/cvat_backend/cvat_worker_webhooks/deployment.yml @@ -53,44 +53,6 @@ spec: {{- end }} args: ["run", "worker.webhooks"] 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 {{ include "cvat.sharedBackendEnv" . | indent 10 }} {{- with .Values.cvat.backend.worker.webhooks.additionalEnv }} {{- toYaml . | nindent 10 }} diff --git a/helm-chart/templates/cvat_backend/server/deployment.yml b/helm-chart/templates/cvat_backend/server/deployment.yml index 6e0b909b6bce..4a79c2cce917 100644 --- a/helm-chart/templates/cvat_backend/server/deployment.yml +++ b/helm-chart/templates/cvat_backend/server/deployment.yml @@ -59,55 +59,7 @@ spec: value: {{ .Values.cvat.backend.server.envs.DJANGO_MODWSGI_EXTRA_ARGS}} - name: IAM_OPA_BUNDLE value: "1" - {{- 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 {{ include "cvat.sharedBackendEnv" . | indent 10 }} - {{- if .Values.analytics.enabled}} - - name: CVAT_ANALYTICS - value: "1" - - name: DJANGO_LOG_SERVER_HOST - value: "{{ .Release.Name }}-vector" - - name: DJANGO_LOG_SERVER_PORT - value: "80" - - name: CLICKHOUSE_HOST - value: "{{ .Release.Name }}-clickhouse" - {{- end }} {{- with .Values.cvat.backend.server.additionalEnv }} {{- toYaml . | nindent 10 }} {{- end }} diff --git a/helm-chart/templates/cvat_backend/utils/deployment.yml b/helm-chart/templates/cvat_backend/utils/deployment.yml index 32aed6ed283c..b7f48fe8de06 100644 --- a/helm-chart/templates/cvat_backend/utils/deployment.yml +++ b/helm-chart/templates/cvat_backend/utils/deployment.yml @@ -53,55 +53,7 @@ spec: {{- end }} args: ["run", "utils"] 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 {{ include "cvat.sharedBackendEnv" . | indent 10 }} - {{- if .Values.analytics.enabled}} - - name: CVAT_ANALYTICS - value: "1" - - name: DJANGO_LOG_SERVER_HOST - value: "{{ .Release.Name }}-vector" - - name: DJANGO_LOG_SERVER_PORT - value: "80" - - name: CLICKHOUSE_HOST - value: "{{ .Release.Name }}-clickhouse" - {{- end }} {{- with .Values.cvat.backend.utils.additionalEnv }} {{- toYaml . | nindent 10 }} {{- end }} diff --git a/helm-chart/templates/cvat_backend/worker_analyticsreports/deployment.yml b/helm-chart/templates/cvat_backend/worker_analyticsreports/deployment.yml index 50476ecaa3c2..71204bae6ae6 100644 --- a/helm-chart/templates/cvat_backend/worker_analyticsreports/deployment.yml +++ b/helm-chart/templates/cvat_backend/worker_analyticsreports/deployment.yml @@ -53,53 +53,7 @@ spec: {{- end }} args: ["run", "worker.analytics_reports"] 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 {{ include "cvat.sharedBackendEnv" . | indent 10 }} - {{- if .Values.analytics.enabled}} - - name: DJANGO_LOG_SERVER_HOST - value: "{{ .Release.Name }}-vector" - - name: DJANGO_LOG_SERVER_PORT - value: "80" - - name: CLICKHOUSE_HOST - value: "{{ .Release.Name }}-clickhouse" - {{- end }} {{- with .Values.cvat.backend.worker.analyticsreports.additionalEnv }} {{- toYaml . | nindent 10 }} {{- end }} diff --git a/helm-chart/templates/cvat_backend/worker_annotation/deployment.yml b/helm-chart/templates/cvat_backend/worker_annotation/deployment.yml index a9460dc7651f..7f6560f85a2a 100644 --- a/helm-chart/templates/cvat_backend/worker_annotation/deployment.yml +++ b/helm-chart/templates/cvat_backend/worker_annotation/deployment.yml @@ -53,55 +53,7 @@ spec: {{- end }} args: ["run", "worker.annotation"] 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 {{ include "cvat.sharedBackendEnv" . | indent 10 }} - {{- if .Values.analytics.enabled}} - - name: CVAT_ANALYTICS - value: "1" - - name: DJANGO_LOG_SERVER_HOST - value: "{{ .Release.Name }}-vector" - - name: DJANGO_LOG_SERVER_PORT - value: "80" - - name: CLICKHOUSE_HOST - value: "{{ .Release.Name }}-clickhouse" - {{- end }} {{- with .Values.cvat.backend.worker.annotation.additionalEnv }} {{- toYaml . | nindent 10 }} {{- end }} diff --git a/helm-chart/templates/cvat_backend/worker_export/deployment.yml b/helm-chart/templates/cvat_backend/worker_export/deployment.yml index c6d15b5c80b5..9e0d4cada48a 100644 --- a/helm-chart/templates/cvat_backend/worker_export/deployment.yml +++ b/helm-chart/templates/cvat_backend/worker_export/deployment.yml @@ -53,55 +53,7 @@ spec: {{- end }} args: ["run", "worker.export"] 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 {{ include "cvat.sharedBackendEnv" . | indent 10 }} - {{- if .Values.analytics.enabled}} - - name: CVAT_ANALYTICS - value: "1" - - name: DJANGO_LOG_SERVER_HOST - value: "{{ .Release.Name }}-vector" - - name: DJANGO_LOG_SERVER_PORT - value: "80" - - name: CLICKHOUSE_HOST - value: "{{ .Release.Name }}-clickhouse" - {{- end }} {{- with .Values.cvat.backend.worker.export.additionalEnv }} {{- toYaml . | nindent 10 }} {{- end }} diff --git a/helm-chart/templates/cvat_backend/worker_import/deployment.yml b/helm-chart/templates/cvat_backend/worker_import/deployment.yml index 821083960238..c6d757623d4d 100644 --- a/helm-chart/templates/cvat_backend/worker_import/deployment.yml +++ b/helm-chart/templates/cvat_backend/worker_import/deployment.yml @@ -53,55 +53,7 @@ spec: {{- end }} args: ["run", "worker.import"] 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 {{ include "cvat.sharedBackendEnv" . | indent 10 }} - {{- if .Values.analytics.enabled}} - - name: CVAT_ANALYTICS - value: "1" - - name: DJANGO_LOG_SERVER_HOST - value: "{{ .Release.Name }}-vector" - - name: DJANGO_LOG_SERVER_PORT - value: "80" - - name: CLICKHOUSE_HOST - value: "{{ .Release.Name }}-clickhouse" - {{- end }} {{- with .Values.cvat.backend.worker.import.additionalEnv }} {{- toYaml . | nindent 10 }} {{- end }} diff --git a/helm-chart/templates/cvat_backend/worker_qualityreports/deployment.yml b/helm-chart/templates/cvat_backend/worker_qualityreports/deployment.yml index 15ad2e49cae4..9d0360a8eeea 100644 --- a/helm-chart/templates/cvat_backend/worker_qualityreports/deployment.yml +++ b/helm-chart/templates/cvat_backend/worker_qualityreports/deployment.yml @@ -53,44 +53,7 @@ spec: {{- end }} args: ["run", "worker.quality_reports"] 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 + {{ include "cvat.sharedBackendEnv" . | indent 10 }} {{- with .Values.cvat.backend.worker.qualityreports.additionalEnv }} {{- toYaml . | nindent 10 }} {{- end }}