Skip to content
This repository has been archived by the owner on Nov 14, 2023. It is now read-only.

Commit

Permalink
multiple fixes to make helm work (cvat-ai#6137)
Browse files Browse the repository at this point in the history
<!-- Raise an issue to propose your change
(https://github.com/opencv/cvat/issues).
It helps to avoid duplication of efforts from multiple independent
contributors.
Discuss your ideas with maintainers to be sure that changes will be
approved and merged.
Read the [Contribution
guide](https://opencv.github.io/cvat/docs/contributing/). -->

<!-- Provide a general summary of your changes in the Title above -->

### Motivation and context
<!-- Why is this change required? What problem does it solve? If it
fixes an open
issue, please link to the issue here. Describe your changes in detail,
add
screenshots. -->
Right now helm chart is broken and not usable at least in my
environment, I trying to fix it to make it work
content: 

1. Moved test-related values to another values.file to separate it from
default config
2. fixed issue with multiple caches in same RWX volume, which prevents
db migration to start
3. Removed hardcoded mandatory traefik ingress usage
4. Added confugurable default storage option to chart

### How has this been tested?
<!-- Please describe in detail how you tested your changes.
Include details of your testing environment, and the tests you ran to
see how your change affects other areas of the code, etc. -->
We test it on our AKS with RWX volume

### Checklist
<!-- Go over all the following points, and put an `x` in all the boxes
that apply.
If an item isn't applicable for some reason, then ~~explicitly
strikethrough~~ the whole
line. If you don't do that, GitHub will show incorrect progress for the
pull request.
If you're unsure about any of these, don't hesitate to ask. We're here
to help! -->
- [x] I submit my changes into the `develop` branch
- [x] I have added a description of my changes into the
[CHANGELOG](https://github.com/opencv/cvat/blob/develop/CHANGELOG.md)
file
- [x] I have updated the documentation accordingly
- [x] I have added tests to cover my changes
- [x] I have linked related issues (see [GitHub docs](

https://help.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword))
- [x] I have increased versions of npm packages if it is necessary

([cvat-canvas](https://github.com/opencv/cvat/tree/develop/cvat-canvas#versioning),

[cvat-core](https://github.com/opencv/cvat/tree/develop/cvat-core#versioning),

[cvat-data](https://github.com/opencv/cvat/tree/develop/cvat-data#versioning)
and

[cvat-ui](https://github.com/opencv/cvat/tree/develop/cvat-ui#versioning))

### License

- [x] I submit _my code changes_ under the same [MIT License](
https://github.com/opencv/cvat/blob/develop/LICENSE) that covers the
project.
  Feel free to contact the maintainers if that's a concern.
  
closes cvat-ai#6043 
closes cvat-ai#6096 
closes cvat-ai#5733

---------

Co-authored-by: Michael Kirpichev <m.kirpichev@haut.ai>
Co-authored-by: Nikita Manovich <nikita@cvat.ai>
Co-authored-by: Andrey Zhavoronkov <andrey@cvat.ai>
  • Loading branch information
4 people authored and mikhail-treskin committed Oct 25, 2023
1 parent 98732d8 commit ef33c84
Show file tree
Hide file tree
Showing 13 changed files with 193 additions and 61 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/helm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ 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 ..
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/cvat.values.yaml -f helm-chart/test.values.yaml
- name: Update test config
run: |
Expand Down
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Analytics for Jobs, Tasks and Projects (<https://github.com/opencv/cvat/pull/6371>)

### Changed
- TDB
- \[Helm\] Added configurable default storage option to chart (<https://github.com/opencv/cvat/pull/6137>)

### Deprecated
- TDB

### Removed
- TDB
- \[Helm\] Removed hardcoded mandatory traefik ingress usage(<https://github.com/opencv/cvat/pull/6137>)

### Fixed
- Calculating number of objects on annotation view when frames are deleted
Expand All @@ -38,6 +38,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Server-side validation for attribute specifications
(<https://github.com/opencv/cvat/pull/6447>)
- \[API\] File downloading failures for filenames with special characters l(<https://github.com/opencv/cvat/pull/6492>)
- \[Helm\] fixed issue with multiple caches in same RWX volume, which prevents db migration to start (<https://github.com/opencv/cvat/pull/6137>)

### Security
- TDB
Expand Down
2 changes: 1 addition & 1 deletion helm-chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ dependencies:
- name: traefik
version: 10.24.0
repository: https://helm.traefik.io/traefik
condition: ingress.enabled
condition: traefik.enabled
53 changes: 53 additions & 0 deletions helm-chart/cvat.values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
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
12 changes: 12 additions & 0 deletions helm-chart/templates/cvat_backend/server/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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 }}
Expand Down
11 changes: 9 additions & 2 deletions helm-chart/templates/cvat_backend/storage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,15 @@ metadata:
tier: backend
spec:
accessModes:
- ReadWriteOnce
{{- 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 }}
resources:
requests:
storage: {{ .Values.cvat.backend.defaultStorage.size }}
{{- end}}
{{- end }}
13 changes: 13 additions & 0 deletions helm-chart/templates/cvat_backend/utils/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +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
Expand All @@ -134,6 +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
Expand Down Expand Up @@ -164,6 +172,11 @@ 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 }}
Expand Down
10 changes: 10 additions & 0 deletions helm-chart/templates/cvat_backend/worker_annotation/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +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
Expand Down Expand Up @@ -135,6 +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
Expand Down Expand Up @@ -165,6 +173,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 }}
Expand Down
13 changes: 13 additions & 0 deletions helm-chart/templates/cvat_backend/worker_export/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +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
Expand Down Expand Up @@ -135,6 +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
Expand Down Expand Up @@ -165,6 +173,11 @@ 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 }}
Expand Down
10 changes: 10 additions & 0 deletions helm-chart/templates/cvat_backend/worker_import/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +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
Expand Down Expand Up @@ -135,6 +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
Expand Down Expand Up @@ -165,6 +173,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 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
4 changes: 4 additions & 0 deletions tests/values.test.yaml → helm-chart/test.values.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
cvat:
backend:
defaultStorage:
accessModes:
- ReadWriteOnce
disableDistinctCachePerService: true
server:
additionalVolumeMounts:
- mountPath: /home/django/share
Expand Down
Loading

0 comments on commit ef33c84

Please sign in to comment.