Skip to content

Commit

Permalink
Merge pull request #38 from innovatrics/SMAR-2979-add-warm-up-config-…
Browse files Browse the repository at this point in the history
…and-extra-vars

SMAR-2979 make configurable, warmup algorithms for detector, extra va…
  • Loading branch information
egid-fertal-inno authored Nov 13, 2024
2 parents 7697d5c + 53e088e commit 98e0791
Show file tree
Hide file tree
Showing 28 changed files with 238 additions and 26 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## [v0.8.6]

### Added

- Added configuration options for specifying arbitrary environment variables.
- Added configurable settings to define working hours, non-working hours, and weekends for time-based scaling.
- Made `warmupDetectionAlgorithms` configurable for the detector component.

## [v0.8.5]

### Added
Expand Down
2 changes: 1 addition & 1 deletion Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ maintainers:
- name: Innovatrics
url: https://www.innovatrics.com/

version: 0.8.5
version: 0.8.6

appVersion: "v5_4.28.1"
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# smartface

![Version: 0.8.5](https://img.shields.io/badge/Version-0.8.5-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v5_4.28.1](https://img.shields.io/badge/AppVersion-v5_4.28.1-informational?style=flat-square)
![Version: 0.8.6](https://img.shields.io/badge/Version-0.8.6-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v5_4.28.1](https://img.shields.io/badge/AppVersion-v5_4.28.1-informational?style=flat-square)

SmartFace is a Scalable Facial Recognition Server Platform Able to Process Multiple Real-Time Video Streams. Currently the helm chart supports edge stream and Lightweight Face Identification System (LFIS) deployments

Expand Down Expand Up @@ -287,6 +287,7 @@ metadata:
| autoscaling.cron.extractor.workHoursReplicas | int | `2` | |
| autoscaling.cron.objectDetector.nonWorkHoursReplicas | int | `1` | |
| autoscaling.cron.objectDetector.workHoursReplicas | int | `2` | |
| autoscaling.cron.schedules | object | `{"nonWorkHours":{"end":"0 8 * * 1-5","start":"0 17 * * 1-5"},"weekend":{"end":"0 8 * * 1","start":"0 0 * * 6,0"},"workHours":{"end":"0 17 * * 1-5","start":"0 8 * * 1-5"}}` | Schedules for scaling, cron expression format: "minute hour day-of-month month day-of-week" |
| autoscaling.cron.timezone | string | `"Europe/Bratislava"` | see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones |
| autoscaling.detector.enabled | bool | `true` | enables ScaledObject for detector |
| autoscaling.detector.maxReplicas | int | `3` | |
Expand Down Expand Up @@ -403,6 +404,7 @@ metadata:
| detector.resources.requests.cpu | string | `"750m"` | |
| detector.resources.requests.memory | string | `"600M"` | |
| detector.tolerations | list | `[]` | |
| detector.warmupDetectionAlgorithms | list | `["balanced_mask"]` | Determines which face detection models are loaded at startup. You can specify one or more detection modes. |
| edgeStreamProcessor.annotations | object | `{}` | Annotations for edgeStreamProcessor deployment |
| edgeStreamProcessor.image.digest | string | `nil` | Overrides the image tag with an image digest |
| edgeStreamProcessor.image.pullPolicy | string | `"IfNotPresent"` | Docker image pull policy |
Expand Down
3 changes: 3 additions & 0 deletions templates/_matcher.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ spec:
{{- include "smartface.commonEnv" . | nindent 8 }}
{{- include "smartface.rmqConfig" . | nindent 8 }}
{{- include "smartface.dbConfig" . | nindent 8 }}
{{- with .Values.matcher.extraVars }}
{{- toYaml . | nindent 8 }}
{{- end }}
resources:
{{- toYaml .Values.matcher.resources | nindent 10 }}
volumeMounts:
Expand Down
3 changes: 3 additions & 0 deletions templates/api-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ spec:
{{- end }}
{{- include "smartface.apiFeaturesConfig" . | nindent 8 }}
{{- include "smartface.statisticsPublish" . | nindent 8 }}
{{- with .Values.api.extraVars }}
{{- toYaml . | nindent 8 }}
{{- end }}
- name: "Hosting__Host"
value: "http://0.0.0.0"
- name: "Hosting__Port"
Expand Down
3 changes: 3 additions & 0 deletions templates/auth-api-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ spec:
value: {{ .Values.authApi.containerPort | quote }}
- name: "Totp__QrCodeImageEndpointEnabled"
value: {{ .Values.experimentalFeatures.qr.enabled | quote }}
{{- with .Values.authApi.extraVars }}
{{- toYaml . | nindent 8 }}
{{- end }}
resources:
{{- toYaml .Values.authApi.resources | nindent 10 }}
volumeMounts:
Expand Down
12 changes: 6 additions & 6 deletions templates/autoscaling/api-scaledobject.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,22 @@ spec:
- type: "cron"
metadata:
timezone: {{ .Values.autoscaling.cron.timezone | quote }}
start: "0 8 * * 1-5"
end: "0 17 * * 1-5"
start: {{ .Values.autoscaling.cron.schedules.workHours.start | quote }}
end: {{ .Values.autoscaling.cron.schedules.workHours.end | quote }}
desiredReplicas: {{ .Values.autoscaling.cron.api.workHoursReplicas | quote }}
# outside work hours
- type: "cron"
metadata:
timezone: {{ .Values.autoscaling.cron.timezone | quote }}
start: "0 17 * * 1-5"
end: "0 8 * * 1-5"
start: {{ .Values.autoscaling.cron.schedules.nonWorkHours.start | quote }}
end: {{ .Values.autoscaling.cron.schedules.nonWorkHours.end | quote }}
desiredReplicas: {{ .Values.autoscaling.cron.api.nonWorkHoursReplicas | quote }}
# during weekend
- type: "cron"
metadata:
timezone: {{ .Values.autoscaling.cron.timezone | quote }}
start: "0 0 * * 0,6"
end: "0 0 * * 1-5"
start: {{ .Values.autoscaling.cron.schedules.weekend.start | quote }}
end: {{ .Values.autoscaling.cron.schedules.weekend.end | quote }}
desiredReplicas: {{ .Values.autoscaling.cron.api.nonWorkHoursReplicas | quote }}
{{- end }}
{{- with .Values.autoscaling.api.triggers }}
Expand Down
12 changes: 6 additions & 6 deletions templates/autoscaling/detector-scaledobject.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,22 @@ spec:
- type: "cron"
metadata:
timezone: {{ .Values.autoscaling.cron.timezone | quote }}
start: "0 8 * * 1-5"
end: "0 17 * * 1-5"
start: {{ .Values.autoscaling.cron.schedules.workHours.start | quote }}
end: {{ .Values.autoscaling.cron.schedules.workHours.end | quote }}
desiredReplicas: {{ .Values.autoscaling.cron.detector.workHoursReplicas | quote }}
# outside work hours
- type: "cron"
metadata:
timezone: {{ .Values.autoscaling.cron.timezone | quote }}
start: "0 17 * * 1-5"
end: "0 8 * * 1-5"
start: {{ .Values.autoscaling.cron.schedules.nonWorkHours.start | quote }}
end: {{ .Values.autoscaling.cron.schedules.nonWorkHours.end | quote }}
desiredReplicas: {{ .Values.autoscaling.cron.detector.nonWorkHoursReplicas | quote }}
# during weekend
- type: "cron"
metadata:
timezone: {{ .Values.autoscaling.cron.timezone | quote }}
start: "0 0 * * 0,6"
end: "0 0 * * 1-5"
start: {{ .Values.autoscaling.cron.schedules.weekend.start | quote }}
end: {{ .Values.autoscaling.cron.schedules.weekend.end | quote }}
desiredReplicas: {{ .Values.autoscaling.cron.detector.nonWorkHoursReplicas | quote }}
{{- end }}
{{- with .Values.autoscaling.detector.triggers }}
Expand Down
12 changes: 6 additions & 6 deletions templates/autoscaling/extractor-scaledobject.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,22 @@ spec:
- type: "cron"
metadata:
timezone: {{ .Values.autoscaling.cron.timezone | quote }}
start: "0 8 * * 1-5"
end: "0 17 * * 1-5"
start: {{ .Values.autoscaling.cron.schedules.workHours.start | quote }}
end: {{ .Values.autoscaling.cron.schedules.workHours.end | quote }}
desiredReplicas: {{ .Values.autoscaling.cron.extractor.workHoursReplicas | quote }}
# outside work hours
- type: "cron"
metadata:
timezone: {{ .Values.autoscaling.cron.timezone | quote }}
start: "0 17 * * 1-5"
end: "0 8 * * 1-5"
start: {{ .Values.autoscaling.cron.schedules.nonWorkHours.start | quote }}
end: {{ .Values.autoscaling.cron.schedules.nonWorkHours.end | quote }}
desiredReplicas: {{ .Values.autoscaling.cron.extractor.nonWorkHoursReplicas | quote }}
# during weekend
- type: "cron"
metadata:
timezone: {{ .Values.autoscaling.cron.timezone | quote }}
start: "0 0 * * 0,6"
end: "0 0 * * 1-5"
start: {{ .Values.autoscaling.cron.schedules.weekend.start | quote }}
end: {{ .Values.autoscaling.cron.schedules.weekend.end | quote }}
desiredReplicas: {{ .Values.autoscaling.cron.extractor.nonWorkHoursReplicas | quote }}
{{- end }}
{{- with .Values.autoscaling.extractor.triggers }}
Expand Down
14 changes: 8 additions & 6 deletions templates/autoscaling/object-detector-scaleobject.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.features.objectDetection.enabled }}
{{- $predefinedTriggerUsed := (or .Values.autoscaling.rmq.enabled .Values.autoscaling.cron.enabled) -}}
{{- $customTriggerUsed := .Values.autoscaling.objectDetector.triggers -}}
{{- if and .Values.autoscaling.objectDetector.enabled (or $predefinedTriggerUsed $customTriggerUsed) }}
Expand Down Expand Up @@ -29,25 +30,26 @@ spec:
- type: "cron"
metadata:
timezone: {{ .Values.autoscaling.cron.timezone | quote }}
start: "0 8 * * 1-5"
end: "0 17 * * 1-5"
start: {{ .Values.autoscaling.cron.schedules.workHours.start | quote }}
end: {{ .Values.autoscaling.cron.schedules.workHours.end | quote }}
desiredReplicas: {{ .Values.autoscaling.cron.objectDetector.workHoursReplicas | quote }}
# outside work hours
- type: "cron"
metadata:
timezone: {{ .Values.autoscaling.cron.timezone | quote }}
start: "0 17 * * 1-5"
end: "0 8 * * 1-5"
start: {{ .Values.autoscaling.cron.schedules.nonWorkHours.start | quote }}
end: {{ .Values.autoscaling.cron.schedules.nonWorkHours.end | quote }}
desiredReplicas: {{ .Values.autoscaling.cron.objectDetector.nonWorkHoursReplicas | quote }}
# during weekend
- type: "cron"
metadata:
timezone: {{ .Values.autoscaling.cron.timezone | quote }}
start: "0 0 * * 0,6"
end: "0 0 * * 1-5"
start: {{ .Values.autoscaling.cron.schedules.weekend.start | quote }}
end: {{ .Values.autoscaling.cron.schedules.weekend.end | quote }}
desiredReplicas: {{ .Values.autoscaling.cron.objectDetector.nonWorkHoursReplicas | quote }}
{{- end }}
{{- with .Values.autoscaling.objectDetector.triggers }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
{{- end }}
3 changes: 3 additions & 0 deletions templates/db-synchronization-leader-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ spec:
value: "http://0.0.0.0"
- name: "Hosting__Port"
value: {{ .Values.dbSynchronizationLeader.containerPort | quote }}
{{- with .Values.dbSynchronizationLeader.extraVars }}
{{- toYaml . | nindent 8 }}
{{- end }}
resources:
{{- toYaml .Values.dbSynchronizationLeader.resources | nindent 10 }}
{{- with .Values.dbSynchronizationLeader.nodeSelector }}
Expand Down
5 changes: 5 additions & 0 deletions templates/detector-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ spec:
env:
{{- include "smartface.commonEnv" . | nindent 8 }}
{{- include "smartface.rmqConfig" . | nindent 8 }}
- name: Warmup__DetectionAlgorithms
value: {{ .Values.detector.warmupDetectionAlgorithms | join "," | quote }}
{{- with .Values.detector.extraVars }}
{{- toYaml . | nindent 8 }}
{{- end }}
resources:
{{- toYaml .Values.detector.resources | nindent 10 }}
volumeMounts:
Expand Down
3 changes: 3 additions & 0 deletions templates/edge-streams/access-controller-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ spec:
value: {{ .Values.accessController.filterConfiguration.spoofCheckConfiguration.enabled | quote }}
- name: "FilterConfiguration__SpoofCheckConfiguration__DenyingDebounceMs"
value: {{ .Values.accessController.filterConfiguration.spoofCheckConfiguration.denyingDebounceMs | quote }}
{{- with .Values.accessController.extraVars }}
{{- toYaml . | nindent 8 }}
{{- end }}
resources:
{{- toYaml .Values.accessController.resources | nindent 10 }}
volumeMounts:
Expand Down
3 changes: 3 additions & 0 deletions templates/edge-streams/base-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ spec:
{{- include "smartface.rmqConfig" . | nindent 8 }}
{{- include "smartface.dbConfig" . | nindent 8 }}
{{- include "smartface.s3Config" . | nindent 8 }}
{{- with .Values.base.extraVars }}
{{- toYaml . | nindent 8 }}
{{- end }}
resources:
{{- toYaml .Values.base.resources | nindent 10 }}
volumeMounts:
Expand Down
3 changes: 3 additions & 0 deletions templates/edge-streams/edge-stream-processor-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ spec:
{{- include "smartface.commonEnv" . | nindent 8 }}
{{- include "smartface.rmqConfig" . | nindent 8 }}
{{- include "smartface.dbConfig" . | nindent 8 }}
{{- with .Values.edgeStreamProcessor.extraVars }}
{{- toYaml . | nindent 8 }}
{{- end }}
resources:
{{- toYaml .Values.edgeStreamProcessor.resources | nindent 10 }}
volumeMounts:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ spec:
{{- include "smartface.rmqConfig" . | nindent 8 }}
{{- include "smartface.mqttConfig" . | nindent 8 }}
{{- include "smartface.dbConfig" . | nindent 8 }}
{{- with .Values.edgeStreamsStateSync.extraVars }}
{{- toYaml . | nindent 8 }}
{{- end }}
resources:
{{- toYaml .Values.edgeStreamsStateSync.resources | nindent 10 }}
volumeMounts:
Expand Down
3 changes: 3 additions & 0 deletions templates/edge-streams/face-matcher-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ spec:
{{- include "smartface.commonEnv" . | nindent 8 }}
{{- include "smartface.rmqConfig" . | nindent 8 }}
{{- include "smartface.dbConfig" . | nindent 8 }}
{{- with .Values.faceMatcher.extraVars }}
{{- toYaml . | nindent 8 }}
{{- end }}
resources:
{{- toYaml .Values.faceMatcher.resources | nindent 10 }}
volumeMounts:
Expand Down
3 changes: 3 additions & 0 deletions templates/edge-streams/relay-controller-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ spec:
env:
{{- include "smartface.mqttConfig" . | nindent 8 }}
{{- include "smartface.authenticationConfig" . | nindent 8 }}
{{- with .Values.relayController.extraVars }}
{{- toYaml . | nindent 8 }}
{{- end }}
resources:
{{- toYaml .Values.relayController.resources | nindent 10 }}
{{- with .Values.relayController.nodeSelector }}
Expand Down
3 changes: 3 additions & 0 deletions templates/edge-streams/stream-data-db-worker-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ spec:
{{- include "smartface.dbConfig" . | nindent 8 }}
{{- include "smartface.s3Config" . | nindent 8 }}
{{- include "smartface.rmqConfig" . | nindent 8 }}
{{- with .Values.streamDataDbWorker.extraVars }}
{{- toYaml . | nindent 8 }}
{{- end }}
resources:
{{- toYaml .Values.streamDataDbWorker.resources | nindent 10 }}
volumeMounts:
Expand Down
3 changes: 3 additions & 0 deletions templates/extractor-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ spec:
env:
{{- include "smartface.commonEnv" . | nindent 8 }}
{{- include "smartface.rmqConfig" . | nindent 8 }}
{{- with .Values.extractor.extraVars }}
{{- toYaml . | nindent 8 }}
{{- end }}
resources:
{{- toYaml .Values.extractor.resources | nindent 10 }}
volumeMounts:
Expand Down
3 changes: 3 additions & 0 deletions templates/graphql-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ spec:
value: "http://0.0.0.0"
- name: "Hosting__Port"
value: {{ .Values.graphqlApi.containerPort | quote }}
{{- with .Values.graphqlApi.extraVars }}
{{- toYaml . | nindent 8 }}
{{- end }}
resources:
{{- toYaml .Values.graphqlApi.resources | nindent 10 }}
volumeMounts:
Expand Down
3 changes: 3 additions & 0 deletions templates/liveness-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ spec:
env:
{{- include "smartface.commonEnv" . | nindent 8 }}
{{- include "smartface.rmqConfig" . | nindent 8 }}
{{- with .Values.liveness.extraVars }}
{{- toYaml . | nindent 8 }}
{{- end }}
resources:
{{- toYaml .Values.liveness.resources | nindent 10 }}
volumeMounts:
Expand Down
3 changes: 3 additions & 0 deletions templates/object-detector-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ spec:
{{- include "smartface.rmqConfig" . | nindent 8 }}
- name: "Detection__Algorithm"
value: {{ .Values.objectDetector.detectionAlgorithm | quote }}
{{- with .Values.objectDetector.extraVars }}
{{- toYaml . | nindent 8 }}
{{- end }}
resources:
{{- toYaml .Values.objectDetector.resources | nindent 10 }}
volumeMounts:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ spec:
{{- include "smartface.rmqConfig" . | nindent 8 }}
{{- include "smartface.dbConfig" . | nindent 8 }}
{{- include "smartface.s3Config" . | nindent 8 }}
{{- with .Values.VideoAggregator.extraVars }}
{{- toYaml . | nindent 8 }}
{{- end }}
resources:
{{- toYaml .Values.VideoAggregator.resources | nindent 10 }}
volumeMounts:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ spec:
{{- include "smartface.rmqConfig" . | nindent 8 }}
{{- include "smartface.dbConfig" . | nindent 8 }}
{{- include "smartface.s3Config" . | nindent 8 }}
{{- with .Values.VideoCollector.extraVars }}
{{- toYaml . | nindent 8 }}
{{- end }}
resources:
{{- toYaml .Values.VideoCollector.resources | nindent 10 }}
volumeMounts:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ spec:
{{- include "smartface.commonEnv" . | nindent 8 }}
{{- include "smartface.rmqConfig" . | nindent 8 }}
{{- include "smartface.s3Config" . | nindent 8 }}
{{- with .Values.VideoReader.extraVars }}
{{- toYaml . | nindent 8 }}
{{- end }}
resources:
{{- toYaml .Values.VideoReader.resources | nindent 10 }}
volumeMounts:
Expand Down
4 changes: 4 additions & 0 deletions templates/station-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ spec:
value: "{{ $label.displayName }}"
{{- end }}

{{- with .Values.station.extraVars }}
{{- toYaml . | nindent 8 }}
{{- end }}

resources:
{{- toYaml .Values.station.resources | nindent 10 }}
volumeMounts:
Expand Down
Loading

0 comments on commit 98e0791

Please sign in to comment.