From 0f2eb4b10baea8ac0181ded67ada4fe6cd5ba6ce Mon Sep 17 00:00:00 2001 From: Michael Kirpichev Date: Fri, 12 May 2023 13:47:12 +0200 Subject: [PATCH 01/20] [] multiple fixes to make it work --- helm-chart/Chart.yaml | 2 +- .../cvat_backend/server/deployment.yml | 6 + helm-chart/templates/cvat_backend/storage.yml | 3 +- .../cvat_backend/utils/deployment.yml | 6 + .../worker_annotation/deployment.yml | 6 + .../cvat_backend/worker_export/deployment.yml | 6 + .../cvat_backend/worker_import/deployment.yml | 6 + helm-chart/tests.values.yaml | 60 ++++++++++ helm-chart/values.yaml | 111 +++++++++--------- 9 files changed, 148 insertions(+), 58 deletions(-) create mode 100644 helm-chart/tests.values.yaml diff --git a/helm-chart/Chart.yaml b/helm-chart/Chart.yaml index 91c7a682e46a..c96e1cced548 100644 --- a/helm-chart/Chart.yaml +++ b/helm-chart/Chart.yaml @@ -58,4 +58,4 @@ dependencies: - name: traefik version: 10.24.0 repository: https://helm.traefik.io/traefik - condition: ingress.enabled + condition: traefik.enabled diff --git a/helm-chart/templates/cvat_backend/server/deployment.yml b/helm-chart/templates/cvat_backend/server/deployment.yml index d8add5a5e60a..a1acfc701c35 100644 --- a/helm-chart/templates/cvat_backend/server/deployment.yml +++ b/helm-chart/templates/cvat_backend/server/deployment.yml @@ -114,6 +114,8 @@ spec: ports: - containerPort: 8080 volumeMounts: + - mountPath: /home/django/data/cache + name: cvat-server-backend-cache - mountPath: /home/django/data name: cvat-backend-data subPath: data @@ -140,6 +142,8 @@ spec: {{- end }} volumeMounts: {{- if .Values.cvat.backend.defaultStorage.enabled }} + - mountPath: /home/django/data/cache + name: cvat-server-backend-cache - mountPath: /home/django/data name: cvat-backend-data subPath: data @@ -170,6 +174,8 @@ spec: - name: cvat-backend-data persistentVolumeClaim: claimName: "{{ .Release.Name }}-backend-data" + - name: cvat-server-backend-cache + emptyDir: {} {{- end }} {{- with .Values.cvat.backend.server.additionalVolumes }} {{- toYaml . | nindent 8 }} diff --git a/helm-chart/templates/cvat_backend/storage.yml b/helm-chart/templates/cvat_backend/storage.yml index f30b768ca39b..9999cb06e02f 100644 --- a/helm-chart/templates/cvat_backend/storage.yml +++ b/helm-chart/templates/cvat_backend/storage.yml @@ -10,7 +10,8 @@ metadata: tier: backend spec: accessModes: - - ReadWriteOnce + {{ .Values.cvat.backend.defaultStorage.accessModes | toYaml | nindent 4 }} + storageClassName: {{ .Values.cvat.backend.defaultStorage.storageClassName }} resources: requests: storage: {{ .Values.cvat.backend.defaultStorage.size }} diff --git a/helm-chart/templates/cvat_backend/utils/deployment.yml b/helm-chart/templates/cvat_backend/utils/deployment.yml index 9907e4e337a1..eda8cc8314d1 100644 --- a/helm-chart/templates/cvat_backend/utils/deployment.yml +++ b/helm-chart/templates/cvat_backend/utils/deployment.yml @@ -108,6 +108,8 @@ spec: ports: - containerPort: 8080 volumeMounts: + - mountPath: /home/django/data/cache + name: cvat-utils-backend-cache - mountPath: /home/django/data name: cvat-backend-data subPath: data @@ -134,6 +136,8 @@ spec: {{- end }} volumeMounts: {{- if .Values.cvat.backend.defaultStorage.enabled }} + - mountPath: /home/django/data/cache + name: cvat-utils-backend-cache - mountPath: /home/django/data name: cvat-backend-data subPath: data @@ -164,6 +168,8 @@ spec: - name: cvat-backend-data persistentVolumeClaim: claimName: "{{ .Release.Name }}-backend-data" + - name: cvat-utils-backend-cache + emptyDir: {} {{- end }} {{- with .Values.cvat.backend.utils.additionalVolumes }} {{- toYaml . | nindent 8 }} diff --git a/helm-chart/templates/cvat_backend/worker_annotation/deployment.yml b/helm-chart/templates/cvat_backend/worker_annotation/deployment.yml index 645453758247..6b5516051cee 100644 --- a/helm-chart/templates/cvat_backend/worker_annotation/deployment.yml +++ b/helm-chart/templates/cvat_backend/worker_annotation/deployment.yml @@ -106,6 +106,8 @@ spec: {{- toYaml . | nindent 10 }} {{- end }} volumeMounts: + - mountPath: /home/django/data/cache + name: cvat-worker-annotation-backend-cache - mountPath: /home/django/data name: cvat-backend-data subPath: data @@ -135,6 +137,8 @@ spec: {{- end }} volumeMounts: {{- if .Values.cvat.backend.defaultStorage.enabled }} + - mountPath: /home/django/data/cache + name: cvat-worker-annotation-backend-cache - mountPath: /home/django/data name: cvat-backend-data subPath: data @@ -165,6 +169,8 @@ spec: - name: cvat-backend-data persistentVolumeClaim: claimName: "{{ .Release.Name }}-backend-data" + - name: cvat-worker-annotation-backend-cache + emptyDir: {} {{- end }} {{- with .Values.cvat.backend.worker.annotation.additionalVolumes }} {{- toYaml . | nindent 8 }} diff --git a/helm-chart/templates/cvat_backend/worker_export/deployment.yml b/helm-chart/templates/cvat_backend/worker_export/deployment.yml index 1a02e2d57715..f5241b25bb1b 100644 --- a/helm-chart/templates/cvat_backend/worker_export/deployment.yml +++ b/helm-chart/templates/cvat_backend/worker_export/deployment.yml @@ -106,6 +106,8 @@ spec: {{- toYaml . | nindent 10 }} {{- end }} volumeMounts: + - mountPath: /home/django/data/cache + name: cvat-worker-export-backend-cache - mountPath: /home/django/data name: cvat-backend-data subPath: data @@ -135,6 +137,8 @@ spec: {{- end }} volumeMounts: {{- if .Values.cvat.backend.defaultStorage.enabled }} + - mountPath: /home/django/data/cache + name: cvat-worker-export-backend-cache - mountPath: /home/django/data name: cvat-backend-data subPath: data @@ -165,6 +169,8 @@ spec: - name: cvat-backend-data persistentVolumeClaim: claimName: "{{ .Release.Name }}-backend-data" + - name: cvat-worker-export-backend-cache + emptyDir: {} {{- end }} {{- with .Values.cvat.backend.worker.export.additionalVolumes }} {{- toYaml . | nindent 8 }} diff --git a/helm-chart/templates/cvat_backend/worker_import/deployment.yml b/helm-chart/templates/cvat_backend/worker_import/deployment.yml index 22597a9c1bd2..4ccba8657a23 100644 --- a/helm-chart/templates/cvat_backend/worker_import/deployment.yml +++ b/helm-chart/templates/cvat_backend/worker_import/deployment.yml @@ -106,6 +106,8 @@ spec: {{- toYaml . | nindent 10 }} {{- end }} volumeMounts: + - mountPath: /home/django/data/cache + name: cvat-worker-import-backend-cache - mountPath: /home/django/data name: cvat-backend-data subPath: data @@ -135,6 +137,8 @@ spec: {{- end }} volumeMounts: {{- if .Values.cvat.backend.defaultStorage.enabled }} + - mountPath: /home/django/data/cache + name: cvat-worker-import-backend-cache - mountPath: /home/django/data name: cvat-backend-data subPath: data @@ -165,6 +169,8 @@ spec: - name: cvat-backend-data persistentVolumeClaim: claimName: "{{ .Release.Name }}-backend-data" + - name: cvat-worker-import-backend-cache + emptyDir: {} {{- end }} {{- with .Values.cvat.backend.worker.import.additionalVolumes }} {{- toYaml . | nindent 8 }} diff --git a/helm-chart/tests.values.yaml b/helm-chart/tests.values.yaml new file mode 100644 index 000000000000..d3d67811a8b0 --- /dev/null +++ b/helm-chart/tests.values.yaml @@ -0,0 +1,60 @@ +analytics: + enabled: true + +ingress: + enabled: true + annotations: + traefik.ingress.kubernetes.io/router.entrypoints: web + kubernetes.io/ingress.class: traefik + hosts: + - host: cvat.local + paths: + - path: /api + pathType: "Prefix" + service: + name: backend-service + port: 8080 + - path: /admin + pathType: "Prefix" + service: + name: backend-service + port: 8080 + - path: /static + pathType: "Prefix" + service: + name: backend-service + port: 8080 + - path: /django-rq + pathType: "Prefix" + service: + name: backend-service + port: 8080 + - path: /git + pathType: "Prefix" + service: + name: backend-service + port: 8080 + - path: /opencv + pathType: "Prefix" + service: + name: backend-service + port: 8080 + - path: /profiler + pathType: "Prefix" + service: + name: backend-service + port: 8080 + - path : / + pathType: "Prefix" + service: + name: frontend-service + port: 80 + +traefik: + enabled: true + logs: + general: + level: INFO + service: + externalIPs: + # - "192.168.49.2" diff --git a/helm-chart/values.yaml b/helm-chart/values.yaml index ba8337013980..c20455a7a286 100644 --- a/helm-chart/values.yaml +++ b/helm-chart/values.yaml @@ -24,7 +24,7 @@ cvat: additionalVolumeMounts: [] worker: export: - replicas: 2 + replicas: 1 labels: {} annotations: {} resources: {} @@ -34,7 +34,7 @@ cvat: additionalVolumes: [] additionalVolumeMounts: [] import: - replicas: 2 + replicas: 1 labels: {} annotations: {} resources: {} @@ -91,6 +91,9 @@ cvat: name: http defaultStorage: enabled: true + storageClassName: default + accessModes: + - ReadWriteOnce size: 20Gi frontend: replicas: 1 @@ -225,7 +228,7 @@ nuclio: # password: somepass analytics: - enabled: true + enabled: false clickhouseDb: cvat clickhouseUser: user clickhousePassword: user @@ -319,62 +322,58 @@ grafana: enabled: false ingress: - enabled: true - annotations: - traefik.ingress.kubernetes.io/router.entrypoints: web - kubernetes.io/ingress.class: traefik - hosts: - - host: cvat.local - paths: - - path: /api - pathType: "Prefix" - service: - name: backend-service - port: 8080 - - path: /admin - pathType: "Prefix" - service: - name: backend-service - port: 8080 - - path: /static - pathType: "Prefix" - service: - name: backend-service - port: 8080 - - path: /django-rq - pathType: "Prefix" - service: - name: backend-service - port: 8080 - - path: /git - pathType: "Prefix" - service: - name: backend-service - port: 8080 - - path: /opencv - pathType: "Prefix" - service: - name: backend-service - port: 8080 - - path: /profiler - pathType: "Prefix" - service: - name: backend-service - port: 8080 - - path : / - pathType: "Prefix" - service: - name: frontend-service - port: 80 + enabled: false +# enabled: true +# annotations: +# traefik.ingress.kubernetes.io/router.entrypoints: web +# kubernetes.io/ingress.class: traefik +# hosts: +# - host: cvat.local +# paths: +# - path: /api +# pathType: "Prefix" +# service: +# name: backend-service +# port: 8080 +# - path: /admin +# pathType: "Prefix" +# service: +# name: backend-service +# port: 8080 +# - path: /static +# pathType: "Prefix" +# service: +# name: backend-service +# port: 8080 +# - path: /django-rq +# pathType: "Prefix" +# service: +# name: backend-service +# port: 8080 +# - path: /git +# pathType: "Prefix" +# service: +# name: backend-service +# port: 8080 +# - path: /opencv +# pathType: "Prefix" +# service: +# name: backend-service +# port: 8080 +# - path: /profiler +# pathType: "Prefix" +# service: +# name: backend-service +# port: 8080 +# - path : / +# pathType: "Prefix" +# service: +# name: frontend-service +# port: 80 # tls: # - hosts: # - # secretName: ingress-tls-cvat traefik: - logs: - general: - level: INFO - service: - externalIPs: - # - "192.168.49.2" + enabled: false From 24b60ab92ec52b93b5f1fb0780811c35c6a9bbe5 Mon Sep 17 00:00:00 2001 From: Michael Kirpichev Date: Mon, 15 May 2023 12:28:24 +0200 Subject: [PATCH 02/20] updated changelog --- CHANGELOG.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 030ddd22982e..2c555197d156 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## \[2.5.0] - Unreleased ### Added -- TDB +- [helm] Added confugurable default storage option to chart ### Changed - Running SAM masks decoder on frontend () @@ -18,12 +18,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 (). - OpenVINO-based Nuclio functions now use the OpenVINO 2022.3 runtime (). +- [helm] Moved test-related values to another values.file to separate it from default config +- ### Deprecated - TDB ### Removed -- TDB +- [helm] Removed hardcoded mandatory traefik ingress usage ### Fixed - Tracking of multiple objects (30 and more) with TransT tracker @@ -33,6 +35,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Invalid completed job count reporting () - OpenVINO-based Nuclio functions can now be deployed to Kubernetes (). +- [helm] fixed issue with multiple caches in same RWX volume, which prevents db migration to start ### Security - TDB From edf8d004becc54840eb989fceea12af241356cd2 Mon Sep 17 00:00:00 2001 From: Michael Kirpichev Date: Mon, 15 May 2023 13:00:05 +0200 Subject: [PATCH 03/20] updated changelog --- CHANGELOG.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c555197d156..7658beca796a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## \[2.5.0] - Unreleased ### Added -- [helm] Added confugurable default storage option to chart +- [helm] Added configurable default storage option to chart() ### Changed - Running SAM masks decoder on frontend () @@ -18,14 +18,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 (). - OpenVINO-based Nuclio functions now use the OpenVINO 2022.3 runtime (). -- [helm] Moved test-related values to another values.file to separate it from default config +- [helm] Moved test-related values to another values.file to separate it from default config() - ### Deprecated - TDB ### Removed -- [helm] Removed hardcoded mandatory traefik ingress usage +- [helm] Removed hardcoded mandatory traefik ingress usage() ### Fixed - Tracking of multiple objects (30 and more) with TransT tracker @@ -35,7 +35,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Invalid completed job count reporting () - OpenVINO-based Nuclio functions can now be deployed to Kubernetes (). -- [helm] fixed issue with multiple caches in same RWX volume, which prevents db migration to start +- [helm] fixed issue with multiple caches in same RWX volume, which prevents db migration to start() ### Security - TDB From 2da7f88bd9a70380b237efbe830977735699352e Mon Sep 17 00:00:00 2001 From: Michael Kirpichev Date: Thu, 25 May 2023 10:58:34 +0200 Subject: [PATCH 04/20] [NOTASK] change default volume accessmode, removed default storage class --- helm-chart/templates/cvat_backend/storage.yml | 4 +++- helm-chart/values.yaml | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/helm-chart/templates/cvat_backend/storage.yml b/helm-chart/templates/cvat_backend/storage.yml index 9999cb06e02f..31d0a816cce9 100644 --- a/helm-chart/templates/cvat_backend/storage.yml +++ b/helm-chart/templates/cvat_backend/storage.yml @@ -11,8 +11,10 @@ metadata: spec: accessModes: {{ .Values.cvat.backend.defaultStorage.accessModes | toYaml | nindent 4 }} + {{- if .Values.cvat.backend.defaultStorage.storageClassName }} storageClassName: {{ .Values.cvat.backend.defaultStorage.storageClassName }} + {{- end }} resources: requests: storage: {{ .Values.cvat.backend.defaultStorage.size }} -{{- end}} +{{- end }} diff --git a/helm-chart/values.yaml b/helm-chart/values.yaml index c20455a7a286..5128a7d7fe27 100644 --- a/helm-chart/values.yaml +++ b/helm-chart/values.yaml @@ -91,9 +91,9 @@ cvat: name: http defaultStorage: enabled: true - storageClassName: default + # storageClassName: default accessModes: - - ReadWriteOnce + - ReadWriteMany size: 20Gi frontend: replicas: 1 From deaf53b6d80b59008c800a2c0261692f93f75375 Mon Sep 17 00:00:00 2001 From: Michael Kirpichev Date: Fri, 26 May 2023 11:13:32 +0200 Subject: [PATCH 05/20] turn on analytics by default --- helm-chart/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm-chart/values.yaml b/helm-chart/values.yaml index 5128a7d7fe27..932b09aa060c 100644 --- a/helm-chart/values.yaml +++ b/helm-chart/values.yaml @@ -228,7 +228,7 @@ nuclio: # password: somepass analytics: - enabled: false + enabled: true clickhouseDb: cvat clickhouseUser: user clickhousePassword: user From 883a0db7bbb57734ac2e4c62cfeff241323a661f Mon Sep 17 00:00:00 2001 From: Michael Kirpichev Date: Fri, 26 May 2023 11:28:25 +0200 Subject: [PATCH 06/20] Add example comment for ingress --- helm-chart/values.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/helm-chart/values.yaml b/helm-chart/values.yaml index 932b09aa060c..30664ba0a3b0 100644 --- a/helm-chart/values.yaml +++ b/helm-chart/values.yaml @@ -323,6 +323,9 @@ grafana: ingress: enabled: false + +# In case you need an ingress, write them manually in your my.values.eml, see example below: + # enabled: true # annotations: # traefik.ingress.kubernetes.io/router.entrypoints: web From d25ce79cf38eeb90d26cbdbae3026c5b1b9f3f0d Mon Sep 17 00:00:00 2001 From: Michael Kirpichev Date: Fri, 26 May 2023 14:07:48 +0200 Subject: [PATCH 07/20] fix changelog formatting --- CHANGELOG.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f78e6498ce7..556c39b4d614 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,19 +12,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Support task creation with any type of data supported by the server by default from cloud storage without use_cache option () - Support task creation with cloud storage data and without use_cache option () -- [helm] Added configurable default storage option to chart() +- Helm: Added configurable default storage option to chart() ### Changed - Cloud storage manifest file is optional () ### Changed - Updated Django to 4.2.x version () -- [helm] Moved test-related values to another values.file to separate it from default config() +- Helm: Moved test-related values to another values.file to separate it from default config() ### Deprecated - The endpoint /cloudstorages/{id}/content was deprecated () ### Removed -- [helm] Removed hardcoded mandatory traefik ingress usage() +- Helm: Removed hardcoded mandatory traefik ingress usage() ### Fixed - Skeletons dumping on created tasks/projects () @@ -62,7 +62,7 @@ without use_cache option () () - Prevented sending of empty list of events. () -- - [helm] fixed issue with multiple caches in same RWX volume, which prevents db migration to start() +- Helm: fixed issue with multiple caches in same RWX volume, which prevents db migration to start() ## \[2.4.3] - 2023-04-24 ### Changed From 11fababb80a3f37ee1ed0b042f47e39ce8fb4a82 Mon Sep 17 00:00:00 2001 From: Michael Kirpichev Date: Wed, 19 Jul 2023 13:17:26 +0200 Subject: [PATCH 08/20] trying to fix helm check --- .github/workflows/helm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/helm.yml b/.github/workflows/helm.yml index 0fae48884c28..bd84ac705124 100644 --- a/.github/workflows/helm.yml +++ b/.github/workflows/helm.yml @@ -48,7 +48,7 @@ jobs: cd helm-chart helm dependency update cd .. - helm upgrade -n default release-${{ github.run_id }}-${{ github.run_attempt }} -i --create-namespace helm-chart -f helm-chart/values.yaml -f tests/values.test.yaml + helm upgrade -n default release-${{ github.run_id }}-${{ github.run_attempt }} -i --create-namespace helm-chart -f helm-chart/values.yaml -f helm-chart/tests.values.yaml -f tests/values.test.yaml - name: Update test config run: | From e76097f0c9f2e642db1be9df174a9fdb292cd979 Mon Sep 17 00:00:00 2001 From: Michael Kirpichev Date: Wed, 19 Jul 2023 14:20:33 +0200 Subject: [PATCH 09/20] [] moving all values files to the same directory --- .github/workflows/helm.yml | 2 +- helm-chart/{tests.values.yaml => cvat.values.yaml} | 0 tests/values.test.yaml => helm-chart/test.values.yaml | 0 3 files changed, 1 insertion(+), 1 deletion(-) rename helm-chart/{tests.values.yaml => cvat.values.yaml} (100%) rename tests/values.test.yaml => helm-chart/test.values.yaml (100%) diff --git a/.github/workflows/helm.yml b/.github/workflows/helm.yml index bd84ac705124..bade9aea7065 100644 --- a/.github/workflows/helm.yml +++ b/.github/workflows/helm.yml @@ -48,7 +48,7 @@ jobs: cd helm-chart helm dependency update cd .. - helm upgrade -n default release-${{ github.run_id }}-${{ github.run_attempt }} -i --create-namespace helm-chart -f helm-chart/values.yaml -f helm-chart/tests.values.yaml -f tests/values.test.yaml + helm upgrade -n default release-${{ github.run_id }}-${{ github.run_attempt }} -i --create-namespace helm-chart -f helm-chart/values.yaml -f helm-chart/cvat.values.yaml -f helm-chart/test.values.yaml - name: Update test config run: | diff --git a/helm-chart/tests.values.yaml b/helm-chart/cvat.values.yaml similarity index 100% rename from helm-chart/tests.values.yaml rename to helm-chart/cvat.values.yaml diff --git a/tests/values.test.yaml b/helm-chart/test.values.yaml similarity index 100% rename from tests/values.test.yaml rename to helm-chart/test.values.yaml From b0f0c2ef1d2c5cdc34b8032e9dc74fea0940c060 Mon Sep 17 00:00:00 2001 From: Michael Kirpichev Date: Wed, 19 Jul 2023 14:44:35 +0200 Subject: [PATCH 10/20] temporary remove distinct cache dir to check CI reaction --- helm-chart/templates/cvat_backend/server/deployment.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/helm-chart/templates/cvat_backend/server/deployment.yml b/helm-chart/templates/cvat_backend/server/deployment.yml index b1251c65255d..1d5c25f88982 100644 --- a/helm-chart/templates/cvat_backend/server/deployment.yml +++ b/helm-chart/templates/cvat_backend/server/deployment.yml @@ -114,8 +114,6 @@ spec: ports: - containerPort: 8080 volumeMounts: - - mountPath: /home/django/data/cache - name: cvat-server-backend-cache - mountPath: /home/django/data name: cvat-backend-data subPath: data @@ -142,8 +140,6 @@ spec: {{- end }} volumeMounts: {{- if .Values.cvat.backend.defaultStorage.enabled }} - - mountPath: /home/django/data/cache - name: cvat-server-backend-cache - mountPath: /home/django/data name: cvat-backend-data subPath: data @@ -174,8 +170,6 @@ spec: - name: cvat-backend-data persistentVolumeClaim: claimName: "{{ .Release.Name }}-backend-data" - - name: cvat-server-backend-cache - emptyDir: {} {{- end }} {{- with .Values.cvat.backend.server.additionalVolumes }} {{- toYaml . | nindent 8 }} From a8b40426272d10934fcd5f71cb6b3be88ff967ce Mon Sep 17 00:00:00 2001 From: Michael Kirpichev Date: Wed, 19 Jul 2023 14:56:22 +0200 Subject: [PATCH 11/20] trying to trigger helm linter --- helm-chart/templates/cvat_backend/server/deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm-chart/templates/cvat_backend/server/deployment.yml b/helm-chart/templates/cvat_backend/server/deployment.yml index 1d5c25f88982..e079da0bfad4 100644 --- a/helm-chart/templates/cvat_backend/server/deployment.yml +++ b/helm-chart/templates/cvat_backend/server/deployment.yml @@ -98,7 +98,7 @@ spec: name: "{{ tpl (.Values.postgresql.secret.name) . }}" key: password {{ include "cvat.sharedBackendEnv" . | indent 10 }} - {{- if .Values.analytics.enabled}} + {{- if .Values.analytics.enabled }} - name: CVAT_ANALYTICS value: "1" - name: DJANGO_LOG_SERVER_HOST From 67e524578e9e351bd411aa7ab3420c92a716b0eb Mon Sep 17 00:00:00 2001 From: Michael Kirpichev Date: Wed, 19 Jul 2023 14:59:02 +0200 Subject: [PATCH 12/20] trying to trigger helm linter --- helm-chart/values.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/helm-chart/values.yaml b/helm-chart/values.yaml index 084bd2499e41..153cebcee2ce 100644 --- a/helm-chart/values.yaml +++ b/helm-chart/values.yaml @@ -383,10 +383,10 @@ ingress: # service: # name: frontend-service # port: 80 - # tls: - # - hosts: - # - - # secretName: ingress-tls-cvat +# tls: +# - hosts: +# - +# secretName: ingress-tls-cvat traefik: enabled: false From 5973a763b7d071f0e0b9a5568b28f5764d18f70f Mon Sep 17 00:00:00 2001 From: Michael Kirpichev Date: Wed, 19 Jul 2023 15:27:52 +0200 Subject: [PATCH 13/20] trying to trigger helm linter --- helm-chart/values.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/helm-chart/values.yaml b/helm-chart/values.yaml index 153cebcee2ce..91952c8483e0 100644 --- a/helm-chart/values.yaml +++ b/helm-chart/values.yaml @@ -335,7 +335,6 @@ ingress: enabled: false # In case you need an ingress, write them manually in your my.values.eml, see example below: - # enabled: true # annotations: # traefik.ingress.kubernetes.io/router.entrypoints: web From ff85522f4a17205255799cf1045e8b47d51308ff Mon Sep 17 00:00:00 2001 From: Michael Kirpichev Date: Wed, 19 Jul 2023 16:41:36 +0200 Subject: [PATCH 14/20] trying to trigger helm linter --- helm-chart/values.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/helm-chart/values.yaml b/helm-chart/values.yaml index 91952c8483e0..432d2542a947 100644 --- a/helm-chart/values.yaml +++ b/helm-chart/values.yaml @@ -214,8 +214,9 @@ postgresql: postgres_password: cvat_postgresql_postgres replication_password: cvat_postgresql_replica + +# See https://github.com/bitnami/charts/blob/master/bitnami/redis/ for more info redis: - #See https://github.com/bitnami/charts/blob/master/bitnami/redis/ for more info enabled: true external: host: 127.0.0.1 From 3d2d4936c65da8f421d2ef65b75428eba234348f Mon Sep 17 00:00:00 2001 From: Michael Kirpichev Date: Thu, 20 Jul 2023 11:26:45 +0200 Subject: [PATCH 15/20] trying to fix kubectl cp --- helm-chart/templates/cvat_backend/storage.yml | 2 +- helm-chart/test.values.yaml | 4 +++- helm-chart/values.yaml | 6 +++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/helm-chart/templates/cvat_backend/storage.yml b/helm-chart/templates/cvat_backend/storage.yml index 31d0a816cce9..9ccca38d41b9 100644 --- a/helm-chart/templates/cvat_backend/storage.yml +++ b/helm-chart/templates/cvat_backend/storage.yml @@ -10,7 +10,7 @@ metadata: tier: backend spec: accessModes: - {{ .Values.cvat.backend.defaultStorage.accessModes | toYaml | nindent 4 }} + {{ .Values.cvat.backend.defaultStorage.accessModes | toYaml | nindent 4 | default "ReadWriteMany" }} {{- if .Values.cvat.backend.defaultStorage.storageClassName }} storageClassName: {{ .Values.cvat.backend.defaultStorage.storageClassName }} {{- end }} diff --git a/helm-chart/test.values.yaml b/helm-chart/test.values.yaml index 58c5b66ccf79..e4f8da12693a 100644 --- a/helm-chart/test.values.yaml +++ b/helm-chart/test.values.yaml @@ -1,5 +1,8 @@ cvat: backend: + defaultStorage: + accessModes: + - ReadWriteOnce server: additionalVolumeMounts: - mountPath: /home/django/share @@ -22,7 +25,6 @@ cvat: imagePullPolicy: Never frontend: imagePullPolicy: Never - traefik: logs: general: diff --git a/helm-chart/values.yaml b/helm-chart/values.yaml index 432d2542a947..9afec82e5583 100644 --- a/helm-chart/values.yaml +++ b/helm-chart/values.yaml @@ -101,9 +101,9 @@ cvat: name: http defaultStorage: enabled: true - # storageClassName: default - accessModes: - - ReadWriteMany +# storageClassName: default +# accessModes: +# - ReadWriteMany size: 20Gi frontend: replicas: 1 From 26550b264786e9e5fe24c7e763fb07c24cd8b7a7 Mon Sep 17 00:00:00 2001 From: Michael Kirpichev Date: Thu, 20 Jul 2023 12:16:49 +0200 Subject: [PATCH 16/20] fix default access mode for storage --- helm-chart/templates/cvat_backend/storage.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/helm-chart/templates/cvat_backend/storage.yml b/helm-chart/templates/cvat_backend/storage.yml index 9ccca38d41b9..b21e61df4b6d 100644 --- a/helm-chart/templates/cvat_backend/storage.yml +++ b/helm-chart/templates/cvat_backend/storage.yml @@ -10,7 +10,11 @@ metadata: tier: backend spec: accessModes: - {{ .Values.cvat.backend.defaultStorage.accessModes | toYaml | nindent 4 | default "ReadWriteMany" }} + {{- if .Values.cvat.backend.defaultStorage.accessModes }} + {{ .Values.cvat.backend.defaultStorage.accessModes | toYaml | nindent 4 }} + {{- else }} + - ReadWriteMany + {{- end }} {{- if .Values.cvat.backend.defaultStorage.storageClassName }} storageClassName: {{ .Values.cvat.backend.defaultStorage.storageClassName }} {{- end }} From 26db28be4a78dc07f6a2f8faa4c5de3ad1c58d7b Mon Sep 17 00:00:00 2001 From: Michael Kirpichev Date: Thu, 20 Jul 2023 13:05:39 +0200 Subject: [PATCH 17/20] fix add switch to turn off all cache dirs --- .../templates/cvat_backend/server/deployment.yml | 14 +++++++++++++- .../templates/cvat_backend/utils/deployment.yml | 7 +++++++ .../cvat_backend/worker_annotation/deployment.yml | 4 ++++ .../cvat_backend/worker_export/deployment.yml | 7 +++++++ .../cvat_backend/worker_import/deployment.yml | 4 ++++ .../worker_qualityreports/deployment.yml | 4 ++-- helm-chart/test.values.yaml | 1 + helm-chart/values.yaml | 1 + 8 files changed, 39 insertions(+), 3 deletions(-) diff --git a/helm-chart/templates/cvat_backend/server/deployment.yml b/helm-chart/templates/cvat_backend/server/deployment.yml index e079da0bfad4..4c75648d1779 100644 --- a/helm-chart/templates/cvat_backend/server/deployment.yml +++ b/helm-chart/templates/cvat_backend/server/deployment.yml @@ -98,7 +98,7 @@ spec: name: "{{ tpl (.Values.postgresql.secret.name) . }}" key: password {{ include "cvat.sharedBackendEnv" . | indent 10 }} - {{- if .Values.analytics.enabled }} + {{- if .Values.analytics.enabled}} - name: CVAT_ANALYTICS value: "1" - name: DJANGO_LOG_SERVER_HOST @@ -114,6 +114,10 @@ spec: ports: - containerPort: 8080 volumeMounts: + {{- if not .Values.cvat.backend.disableDistinctCachePerService }} + - mountPath: /home/django/data/cache + name: cvat-server-backend-cache + {{- end }} - mountPath: /home/django/data name: cvat-backend-data subPath: data @@ -140,6 +144,10 @@ spec: {{- end }} volumeMounts: {{- if .Values.cvat.backend.defaultStorage.enabled }} + {{- if not .Values.cvat.backend.disableDistinctCachePerService }} + - mountPath: /home/django/data/cache + name: cvat-server-backend-cache + {{- end }} - mountPath: /home/django/data name: cvat-backend-data subPath: data @@ -170,6 +178,10 @@ spec: - name: cvat-backend-data persistentVolumeClaim: claimName: "{{ .Release.Name }}-backend-data" + {{- if not .Values.cvat.backend.disableDistinctCachePerService }} + - name: cvat-server-backend-cache + emptyDir: {} + {{- end }} {{- end }} {{- with .Values.cvat.backend.server.additionalVolumes }} {{- toYaml . | nindent 8 }} diff --git a/helm-chart/templates/cvat_backend/utils/deployment.yml b/helm-chart/templates/cvat_backend/utils/deployment.yml index a9501e9a36de..12c5dcf0c5be 100644 --- a/helm-chart/templates/cvat_backend/utils/deployment.yml +++ b/helm-chart/templates/cvat_backend/utils/deployment.yml @@ -108,8 +108,10 @@ spec: ports: - containerPort: 8080 volumeMounts: + {{- if not .Values.cvat.backend.disableDistinctCachePerService }} - mountPath: /home/django/data/cache name: cvat-utils-backend-cache + {{- end }} - mountPath: /home/django/data name: cvat-backend-data subPath: data @@ -136,8 +138,10 @@ spec: {{- end }} volumeMounts: {{- if .Values.cvat.backend.defaultStorage.enabled }} + {{- if not .Values.cvat.backend.disableDistinctCachePerService }} - mountPath: /home/django/data/cache name: cvat-utils-backend-cache + {{- end }} - mountPath: /home/django/data name: cvat-backend-data subPath: data @@ -168,9 +172,12 @@ spec: - name: cvat-backend-data persistentVolumeClaim: claimName: "{{ .Release.Name }}-backend-data" + + {{- if not .Values.cvat.backend.disableDistinctCachePerService }} - name: cvat-utils-backend-cache emptyDir: {} {{- end }} + {{- end }} {{- with .Values.cvat.backend.utils.additionalVolumes }} {{- toYaml . | nindent 8 }} {{- end }} diff --git a/helm-chart/templates/cvat_backend/worker_annotation/deployment.yml b/helm-chart/templates/cvat_backend/worker_annotation/deployment.yml index dd340c76b58a..7432ff136d88 100644 --- a/helm-chart/templates/cvat_backend/worker_annotation/deployment.yml +++ b/helm-chart/templates/cvat_backend/worker_annotation/deployment.yml @@ -106,8 +106,10 @@ spec: {{- toYaml . | nindent 10 }} {{- end }} volumeMounts: + {{- if not .Values.cvat.backend.disableDistinctCachePerService }} - mountPath: /home/django/data/cache name: cvat-worker-annotation-backend-cache + {{- end }} - mountPath: /home/django/data name: cvat-backend-data subPath: data @@ -137,8 +139,10 @@ spec: {{- end }} volumeMounts: {{- if .Values.cvat.backend.defaultStorage.enabled }} + {{- if not .Values.cvat.backend.disableDistinctCachePerService }} - mountPath: /home/django/data/cache name: cvat-worker-annotation-backend-cache + {{- end }} - mountPath: /home/django/data name: cvat-backend-data subPath: data diff --git a/helm-chart/templates/cvat_backend/worker_export/deployment.yml b/helm-chart/templates/cvat_backend/worker_export/deployment.yml index 7fc254ca2f8e..4fd70182528a 100644 --- a/helm-chart/templates/cvat_backend/worker_export/deployment.yml +++ b/helm-chart/templates/cvat_backend/worker_export/deployment.yml @@ -106,8 +106,10 @@ spec: {{- toYaml . | nindent 10 }} {{- end }} volumeMounts: + {{- if not .Values.cvat.backend.disableDistinctCachePerService }} - mountPath: /home/django/data/cache name: cvat-worker-export-backend-cache + {{- end }} - mountPath: /home/django/data name: cvat-backend-data subPath: data @@ -137,8 +139,10 @@ spec: {{- end }} volumeMounts: {{- if .Values.cvat.backend.defaultStorage.enabled }} + {{- if not .Values.cvat.backend.disableDistinctCachePerService }} - mountPath: /home/django/data/cache name: cvat-worker-export-backend-cache + {{- end }} - mountPath: /home/django/data name: cvat-backend-data subPath: data @@ -169,9 +173,12 @@ spec: - name: cvat-backend-data persistentVolumeClaim: claimName: "{{ .Release.Name }}-backend-data" + + {{- if not .Values.cvat.backend.disableDistinctCachePerService }} - name: cvat-worker-export-backend-cache emptyDir: {} {{- end }} + {{- end }} {{- with .Values.cvat.backend.worker.export.additionalVolumes }} {{- toYaml . | nindent 8 }} {{- end }} diff --git a/helm-chart/templates/cvat_backend/worker_import/deployment.yml b/helm-chart/templates/cvat_backend/worker_import/deployment.yml index a684bc343fb0..11d80051d7da 100644 --- a/helm-chart/templates/cvat_backend/worker_import/deployment.yml +++ b/helm-chart/templates/cvat_backend/worker_import/deployment.yml @@ -106,8 +106,10 @@ spec: {{- toYaml . | nindent 10 }} {{- end }} volumeMounts: + {{- if not .Values.cvat.backend.disableDistinctCachePerService }} - mountPath: /home/django/data/cache name: cvat-worker-import-backend-cache + {{- end }} - mountPath: /home/django/data name: cvat-backend-data subPath: data @@ -137,8 +139,10 @@ spec: {{- end }} volumeMounts: {{- if .Values.cvat.backend.defaultStorage.enabled }} + {{- if not .Values.cvat.backend.disableDistinctCachePerService }} - mountPath: /home/django/data/cache name: cvat-worker-import-backend-cache + {{- end }} - mountPath: /home/django/data name: cvat-backend-data subPath: data diff --git a/helm-chart/templates/cvat_backend/worker_qualityreports/deployment.yml b/helm-chart/templates/cvat_backend/worker_qualityreports/deployment.yml index 490e8f8930a5..b7d05254d57c 100644 --- a/helm-chart/templates/cvat_backend/worker_qualityreports/deployment.yml +++ b/helm-chart/templates/cvat_backend/worker_qualityreports/deployment.yml @@ -25,13 +25,13 @@ spec: {{- with .Values.cvat.backend.worker.qualityreports.labels }} {{- toYaml . | nindent 6 }} {{- end }} - app: cvat-app-worker-qualityreports + app: cvat-app tier: backend component: worker-qualityreports template: metadata: labels: - app: cvat-app-worker-qualityreports + app: cvat-app tier: backend component: worker-qualityreports {{- include "cvat.labels" . | nindent 8 }} diff --git a/helm-chart/test.values.yaml b/helm-chart/test.values.yaml index e4f8da12693a..d2c68b712f18 100644 --- a/helm-chart/test.values.yaml +++ b/helm-chart/test.values.yaml @@ -3,6 +3,7 @@ cvat: defaultStorage: accessModes: - ReadWriteOnce + disableDistinctCachePerService: true server: additionalVolumeMounts: - mountPath: /home/django/share diff --git a/helm-chart/values.yaml b/helm-chart/values.yaml index 9afec82e5583..44c0d2366182 100644 --- a/helm-chart/values.yaml +++ b/helm-chart/values.yaml @@ -105,6 +105,7 @@ cvat: # accessModes: # - ReadWriteMany size: 20Gi + disableDistinctCachePerService: false frontend: replicas: 1 image: cvat/ui From 1c3a8b1722c846ebf177c3c72b4b284970c873e5 Mon Sep 17 00:00:00 2001 From: Michael Kirpichev Date: Mon, 24 Jul 2023 11:00:06 +0200 Subject: [PATCH 18/20] fix values formatting, fix minikube deployment --- .github/workflows/helm.yml | 2 +- helm-chart/cvat.values.yaml | 96 ++++++++++++++++++------------------- helm-chart/test.values.yaml | 1 + 3 files changed, 50 insertions(+), 49 deletions(-) diff --git a/.github/workflows/helm.yml b/.github/workflows/helm.yml index bade9aea7065..ffbde729a86e 100644 --- a/.github/workflows/helm.yml +++ b/.github/workflows/helm.yml @@ -44,7 +44,7 @@ jobs: - name: Deploy to minikube run: | - printf " service:\n externalIPs:\n - $(minikube ip)\n" >> tests/values.test.yaml + printf " service:\n externalIPs:\n - $(minikube ip)\n" >> helm-chart/test.values.yaml cd helm-chart helm dependency update cd .. diff --git a/helm-chart/cvat.values.yaml b/helm-chart/cvat.values.yaml index d3d67811a8b0..aa272dbbacec 100644 --- a/helm-chart/cvat.values.yaml +++ b/helm-chart/cvat.values.yaml @@ -1,54 +1,54 @@ analytics: - enabled: true + enabled: true ingress: - enabled: true - annotations: - traefik.ingress.kubernetes.io/router.entrypoints: web - kubernetes.io/ingress.class: traefik - hosts: - - host: cvat.local - paths: - - path: /api - pathType: "Prefix" - service: - name: backend-service - port: 8080 - - path: /admin - pathType: "Prefix" - service: - name: backend-service - port: 8080 - - path: /static - pathType: "Prefix" - service: - name: backend-service - port: 8080 - - path: /django-rq - pathType: "Prefix" - service: - name: backend-service - port: 8080 - - path: /git - pathType: "Prefix" - service: - name: backend-service - port: 8080 - - path: /opencv - pathType: "Prefix" - service: - name: backend-service - port: 8080 - - path: /profiler - pathType: "Prefix" - service: - name: backend-service - port: 8080 - - path : / - pathType: "Prefix" - service: - name: frontend-service - port: 80 + enabled: true + annotations: + traefik.ingress.kubernetes.io/router.entrypoints: web + kubernetes.io/ingress.class: traefik + hosts: + - host: cvat.local + paths: + - path: /api + pathType: "Prefix" + service: + name: backend-service + port: 8080 + - path: /admin + pathType: "Prefix" + service: + name: backend-service + port: 8080 + - path: /static + pathType: "Prefix" + service: + name: backend-service + port: 8080 + - path: /django-rq + pathType: "Prefix" + service: + name: backend-service + port: 8080 + - path: /git + pathType: "Prefix" + service: + name: backend-service + port: 8080 + - path: /opencv + pathType: "Prefix" + service: + name: backend-service + port: 8080 + - path: /profiler + pathType: "Prefix" + service: + name: backend-service + port: 8080 + - path : / + pathType: "Prefix" + service: + name: frontend-service + port: 80 traefik: enabled: true diff --git a/helm-chart/test.values.yaml b/helm-chart/test.values.yaml index d2c68b712f18..8e85e3944166 100644 --- a/helm-chart/test.values.yaml +++ b/helm-chart/test.values.yaml @@ -26,6 +26,7 @@ cvat: imagePullPolicy: Never frontend: imagePullPolicy: Never + traefik: logs: general: From fce4cdf99ecf981d31198dd250c347c76979014d Mon Sep 17 00:00:00 2001 From: Michael Kirpichev Date: Mon, 24 Jul 2023 11:04:41 +0200 Subject: [PATCH 19/20] change traefik config according to azhavoro suggest --- helm-chart/cvat.values.yaml | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/helm-chart/cvat.values.yaml b/helm-chart/cvat.values.yaml index aa272dbbacec..52aa54b2ff1d 100644 --- a/helm-chart/cvat.values.yaml +++ b/helm-chart/cvat.values.yaml @@ -47,14 +47,7 @@ ingress: - path : / pathType: "Prefix" service: - name: frontend-service - port: 80 - + name: frontend-service + port: 80 traefik: - enabled: true - logs: - general: - level: INFO - service: - externalIPs: - # - "192.168.49.2" + enabled: true From f00b1e9d1ce943bc9b9c656813c96a778d09b3ce Mon Sep 17 00:00:00 2001 From: Michael Kirpichev Date: Mon, 24 Jul 2023 12:41:20 +0200 Subject: [PATCH 20/20] fix formatting --- helm-chart/cvat.values.yaml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/helm-chart/cvat.values.yaml b/helm-chart/cvat.values.yaml index 95cc1fbc2188..9765325f3cc1 100644 --- a/helm-chart/cvat.values.yaml +++ b/helm-chart/cvat.values.yaml @@ -12,38 +12,38 @@ ingress: - path: /api pathType: "Prefix" service: - name: backend-service - port: 8080 + name: backend-service + port: 8080 - path: /admin pathType: "Prefix" service: - name: backend-service - port: 8080 + name: backend-service + port: 8080 - path: /static pathType: "Prefix" service: - name: backend-service - port: 8080 + name: backend-service + port: 8080 - path: /django-rq pathType: "Prefix" service: - name: backend-service - port: 8080 + name: backend-service + port: 8080 - path: /git pathType: "Prefix" service: - name: backend-service - port: 8080 + name: backend-service + port: 8080 - path: /opencv pathType: "Prefix" service: - name: backend-service - port: 8080 + name: backend-service + port: 8080 - path: /profiler pathType: "Prefix" service: - name: backend-service - port: 8080 + name: backend-service + port: 8080 - path : / pathType: "Prefix" service: