Skip to content

Commit

Permalink
Make the Helm chart work with smokescreen
Browse files Browse the repository at this point in the history
  • Loading branch information
SpecLad committed Jun 23, 2023
1 parent aa89178 commit 7e29781
Show file tree
Hide file tree
Showing 13 changed files with 41 additions and 12 deletions.
3 changes: 2 additions & 1 deletion cvat/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -691,4 +691,5 @@ class CVAT_QUEUES(Enum):
ASSET_SUPPORTED_TYPES = ('image/jpeg', 'image/png', 'image/webp', 'image/gif', 'application/pdf', )
ASSET_MAX_COUNT_PER_GUIDE = 10

USE_SMOKESCREEN = True
SMOKESCREEN_ENABLED = True
SMOKESCREEN_URL = os.getenv('CVAT_SMOKESCREEN_URL', 'http://smokescreen:4750')
2 changes: 1 addition & 1 deletion cvat/settings/development.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@

QUALITY_CHECK_JOB_DELAY = 5

USE_SMOKESCREEN = False
SMOKESCREEN_ENABLED = False
6 changes: 3 additions & 3 deletions cvat/utils/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
# proxies= parameter.
PROXIES_FOR_UNTRUSTED_URLS = None

if settings.USE_SMOKESCREEN:
if settings.SMOKESCREEN_ENABLED:
PROXIES_FOR_UNTRUSTED_URLS = {
'http': 'http://smokescreen:4750',
'https': 'http://smokescreen:4750',
'http': settings.SMOKESCREEN_URL,
'https': settings.SMOKESCREEN_URL,
}

def make_requests_session() -> requests.Session:
Expand Down
2 changes: 1 addition & 1 deletion helm-chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.7.3
version: 0.8.0

# 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
Expand Down
4 changes: 3 additions & 1 deletion helm-chart/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ Create the name of the service account to use
{{- end }}
{{- end }}

{{- define "cvat.nuclioEnv" }}
{{- define "cvat.sharedBackendEnv" }}
- name: CVAT_SMOKESCREEN_URL
value: "http://{{ .Release.Name }}-smokescreen:4750/"
{{- if .Values.nuclio.enabled }}
- name: CVAT_SERVERLESS
value: "1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ spec:
secretKeyRef:
name: "{{ tpl (.Values.postgresql.secret.name) . }}"
key: password
{{ include "cvat.sharedBackendEnv" . | indent 10 }}
{{- with .Values.cvat.backend.worker.webhooks.additionalEnv }}
{{- toYaml . | nindent 10 }}
{{- end }}
Expand Down
2 changes: 1 addition & 1 deletion helm-chart/templates/cvat_backend/server/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ spec:
secretKeyRef:
name: "{{ tpl (.Values.postgresql.secret.name) . }}"
key: password
{{ include "cvat.nuclioEnv" . | indent 10 }}
{{ include "cvat.sharedBackendEnv" . | indent 10 }}
{{- if .Values.analytics.enabled}}
- name: CVAT_ANALYTICS
value: "1"
Expand Down
4 changes: 3 additions & 1 deletion helm-chart/templates/cvat_backend/utils/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ spec:
secretKeyRef:
name: "{{ tpl (.Values.postgresql.secret.name) . }}"
key: password
{{ include "cvat.nuclioEnv" . | indent 10 }}
{{ include "cvat.sharedBackendEnv" . | indent 10 }}
{{- if .Values.analytics.enabled}}
- name: CVAT_ANALYTICS
value: "1"
Expand All @@ -102,6 +102,8 @@ spec:
- name: CLICKHOUSE_HOST
value: "{{ .Release.Name }}-clickhouse"
{{- end }}
- name: SMOKESCREEN_OPTS
value: {{ .Values.smokescreen.opts }}
{{- with .Values.cvat.backend.utils.additionalEnv }}
{{- toYaml . | nindent 10 }}
{{- end }}
Expand Down
20 changes: 20 additions & 0 deletions helm-chart/templates/cvat_backend/utils/service-smokescreen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}-smokescreen
namespace: {{ .Release.Namespace }}
labels:
{{- include "cvat.labels" . | nindent 4 }}
app: cvat-app
tier: backend
spec:
selector:
app: cvat-app
tier: backend
component: utils
{{- include "cvat.labels" . | nindent 4 }}
ports:
- port: 4750
targetPort: 4750
protocol: TCP
name: http
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ spec:
secretKeyRef:
name: "{{ tpl (.Values.postgresql.secret.name) . }}"
key: password
{{ include "cvat.nuclioEnv" . | indent 10 }}
{{ include "cvat.sharedBackendEnv" . | indent 10 }}
{{- if .Values.analytics.enabled}}
- name: CVAT_ANALYTICS
value: "1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ spec:
secretKeyRef:
name: "{{ tpl (.Values.postgresql.secret.name) . }}"
key: password
{{ include "cvat.nuclioEnv" . | indent 10 }}
{{ include "cvat.sharedBackendEnv" . | indent 10 }}
{{- if .Values.analytics.enabled}}
- name: CVAT_ANALYTICS
value: "1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ spec:
secretKeyRef:
name: "{{ tpl (.Values.postgresql.secret.name) . }}"
key: password
{{ include "cvat.nuclioEnv" . | indent 10 }}
{{ include "cvat.sharedBackendEnv" . | indent 10 }}
{{- if .Values.analytics.enabled}}
- name: CVAT_ANALYTICS
value: "1"
Expand Down
3 changes: 3 additions & 0 deletions helm-chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -385,3 +385,6 @@ traefik:
service:
externalIPs:
# - "192.168.49.2"

smokescreen:
opts: ''

0 comments on commit 7e29781

Please sign in to comment.