diff --git a/applications/data-captor/Chart.yaml b/applications/data-captor/Chart.yaml new file mode 100644 index 00000000..fda0639c --- /dev/null +++ b/applications/data-captor/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +name: ai-pipeline +description: A Helm chart for vsblty ai pipeline(data captor application) +type: application +version: 0.1.0 +appVersion: 1.16.0 diff --git a/applications/data-captor/Readme.md b/applications/data-captor/Readme.md new file mode 100644 index 00000000..39dbf5b5 --- /dev/null +++ b/applications/data-captor/Readme.md @@ -0,0 +1,83 @@ + +# **Data Captor Application Overview** +DataCaptor leverages camera and sensor technology through AI tools (machine learning and computer vision), enabling real-time analytics and anonymous audience data based on who and what the camera sees + +## **Pre Requisites – Resources Required** + +| **Resource Information** | | +|------------------------------------|----------------------| +| Application Type | Data Captor | +| Compute (vCores) | 8 | +| Memory (RAM) | 8 GB | +| Storage | 128 GB | +| Host OS | Ubuntu 20 or higher | +| Physical Display | | +| Connected cameras(USB/IP/Network) | With RTSP URL | + + + +## **Where to Purchase** +Contact info@vsblty.net + + +## Pre Requisites - Installing OpenNESS +|**Configuration** | | +| ----------------------------------|-----------------------| +| OpenNESS Version | 20.12.02 | +| Flavor Used | Minimal | +| Distribution | OpenSource | + + +Follow below link to setup controller and edge-node for installing OpenNESS. + +https://github.com/open-ness/specs/blob/openness-20.12.02/doc/getting-started/network-edge/controller-edge-node-setup.md + +* Go to openness-experience-kits/ directory and comment out the grub role (role: machine_setup/grub) in the **network_edge.yml** file. +* Run the deployment script as ./deploy_ne.sh + + +## Pre Requisites - Installing Data Captor +|**Configuration** | | +| ----------------------------------|------------------------------------| +| Ubuntu | 20 or later | +| Folder to create on system | /home/vedge/models | +| Folder to create on system | /home/vedge/gallery | +| Folder to create on system | /home/vedge/videos | + + + +## Loading Docker Images +docker image load -i data-captor.tar.gz + +## Installing Data Captor Application using helm + +Run the following commands to deploy through helm: + +`helm install data-captor ./data-captor` + + Sample Output would look like: + +> `NAME: data-captor` +> +> `LAST DEPLOYED:` +> +> `NAMESPACE: default` +> +> `STATUS: deployed` +> +> `REVISION: 1` +> +> `TEST SUITE: None` + + + +## Uninstall Data captor application +To uninstall application run below command: + +`helm uninstall data-captor` + +## Testing Steps +For further instructions about steps for testing, contact VSBLTY Team (info@vsblty.net) + +## **Related material** +* https://vsblty.net/ \ No newline at end of file diff --git a/applications/data-captor/templates/_helpers.tpl b/applications/data-captor/templates/_helpers.tpl new file mode 100644 index 00000000..1958b1dd --- /dev/null +++ b/applications/data-captor/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "ai-pipeline.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "ai-pipeline.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "ai-pipeline.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "ai-pipeline.labels" -}} +helm.sh/chart: {{ include "ai-pipeline.chart" . }} +{{ include "ai-pipeline.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "ai-pipeline.selectorLabels" -}} +app.kubernetes.io/name: {{ include "ai-pipeline.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "ai-pipeline.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "ai-pipeline.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/applications/data-captor/templates/configmap.yaml b/applications/data-captor/templates/configmap.yaml new file mode 100644 index 00000000..bc0f4ff9 --- /dev/null +++ b/applications/data-captor/templates/configmap.yaml @@ -0,0 +1,69 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: config-json-volume +data: + config.json: |- + { + "default": { + "logLevel": "INFO", + "pipeline": { + "template": [ + "rtspsrc location={input} ! rtph264depay ! queue ! avdec_h264 ! videoconvert ! video/x-raw,format=BGRx !", + "gvadetect model={personDetection[model]} threshold=0.8 model_proc={personDetection[proc]} device={personDetection[device]} ! queue !", + "gvadetect model={faceDetection[model]} threshold=0.8 reshape=true reshape-width=600 reshape-height=600 model-proc={faceDetection[proc]} device={faceDetection[device]} ! gvatrack ! queue !", + "gvaclassify reclassify-interval=5 model={landmark[model]} model-proc={landmark[proc]} device={landmark[device]} batch-size=1 pre-process-backend=opencv object-class=face ! queue !", + "gvaclassify reclassify-interval=5 model={faceReidentification[model]} model-proc={faceReidentification[proc]} device={faceReidentification[device]} batch-size=1 pre-process-backend=opencv object-class=face ! queue !", + "gvaidentify cosine-distance-threshold={reidThreshold} gallery=/home/vedge/gallery/gallery.json ! queue name=frame-process !", + "videoconvert ! video/x-raw,format=NV12 ! fpsdisplaysink" + ], + "params": { + "reidThreshold": 0.6, + "faceDetection": { + "model": "/home/vedge/models/face-detection-adas-0001/FP32/face-detection-adas-0001.xml", + "proc": "/home/vedge/models/face-detection-adas-0001/PROC/face-detection-adas-0001.json", + "device": "CPU" + }, + "personDetection": { + "model": "/home/vedge/models/person-detection-0201/FP32/person-detection-0201.xml", + "proc": "/home/vedge/models/person-detection-0201/PROC/person-detection-0201.json", + "device": "CPU" + }, + "landmark": { + "model": "/home/vedge/models/landmarks-regression-retail-0009/FP32/landmarks-regression-retail-0009.xml", + "proc": "/home/vedge/models/landmarks-regression-retail-0009/PROC/landmarks-regression-retail-0009.json", + "device": "CPU" + }, + "faceReidentification": { + "model": "/home/vedge/models/face-reidentification-retail-0095/FP32/face-reidentification-retail-0095.xml", + "proc": "/home/vedge/models/face-reidentification-retail-0095/PROC/face-reidentification-retail-0095.json", + "device": "CPU" + } + } + } + }, + "cameras": { + "camerap-1": { + "logLevel": "DEBUG", + "cloudCredential": "{{ .Values.device.accessToken }}", + "cloudEnv": "DEV", + "pipeline": { + "params": { + "input": "{{ .Values.camera.rtsp }}" + } + }, + "services": [ + { + "type": "face-recognition", + "pipelineElement": "frame-process", + "objectType": "face", + "outputImageSize": [ + 240, + 180 + ], + "trackedFaceDuration": 10 + } + ] + } + } + } \ No newline at end of file diff --git a/applications/data-captor/templates/deployment.yaml b/applications/data-captor/templates/deployment.yaml new file mode 100644 index 00000000..447fd83e --- /dev/null +++ b/applications/data-captor/templates/deployment.yaml @@ -0,0 +1,107 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "ai-pipeline.fullname" . }} + labels: + {{- include "ai-pipeline.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + strategy: + type: Recreate + selector: + matchLabels: + {{- include "ai-pipeline.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "ai-pipeline.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "ai-pipeline.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + volumes: + - name: config-map-volume + configMap: + name: config-json-volume + - name: gallery-map-volume + hostPath: + path: /home/vedge/gallery + type: Directory + - name: media-map-volume + hostPath: + path: /home/vedge/videos + type: Directory + - name: models-volume + hostPath: + path: /home/vedge/models + type: Directory + - name: x11-vol + hostPath: + path: /tmp + type: Directory + - name: var-temp + hostPath: + path: /var/tmp + type: Directory + - name: var-dev + hostPath: + path: /dev + type: Directory + hostNetwork: true + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + command: + - python3 + - /home/vedge/ai-pipeline/main.py + - -c + - /home/vedge/config/config.json + - -id + - camerap-1 + env: + - name: DISPLAY + value: "{{ .Values.display.displayName }}" + - name: PYTHONUNBUFFERED + value: "{{ .Values.display.pythonVar }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + volumeMounts: + - mountPath: /home/vedge/config + name: config-map-volume + - mountPath: /home/vedge/gallery + name: gallery-map-volume + - mountPath: /home/vedge/videos + name: media-map-volume + - mountPath: /home/vedge/models + name: models-volume + - mountPath: /tmp + name: x11-vol + - mountPath: /var/tmp + name: var-temp + - mountPath: /dev + name: var-dev + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/applications/data-captor/templates/hpa.yaml b/applications/data-captor/templates/hpa.yaml new file mode 100644 index 00000000..6dc406f6 --- /dev/null +++ b/applications/data-captor/templates/hpa.yaml @@ -0,0 +1,28 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2beta1 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "ai-pipeline.fullname" . }} + labels: + {{- include "ai-pipeline.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "ai-pipeline.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/applications/data-captor/templates/serviceaccount.yaml b/applications/data-captor/templates/serviceaccount.yaml new file mode 100644 index 00000000..5772f523 --- /dev/null +++ b/applications/data-captor/templates/serviceaccount.yaml @@ -0,0 +1,12 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "ai-pipeline.serviceAccountName" . }} + labels: + {{- include "ai-pipeline.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/applications/data-captor/values.yaml b/applications/data-captor/values.yaml new file mode 100644 index 00000000..49ae2ae8 --- /dev/null +++ b/applications/data-captor/values.yaml @@ -0,0 +1,47 @@ +replicaCount: 1 + +image: + repository: vsblty.azurecr.io/vedge/ai-pipeline + pullPolicy: IfNotPresent + tag: "1.2.75" + +device: + accessToken: "" + +camera: + rtsp: "" + +imagePullSecrets: [name: regcred] +nameOverride: "" +fullnameOverride: "" + +display: + displayName: unix:0 + pythonVar: 1 + +serviceAccount: + create: true + annotations: {} + name: "" + +podAnnotations: {} + +podSecurityContext: {} + +securityContext: + privileged: true + +resources: {} + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + targetMemoryUtilizationPercentage: 80 + +nodeSelector: {} + +tolerations: [] + +affinity: {} diff --git a/applications/vc-app/Chart.yaml b/applications/vc-app/Chart.yaml new file mode 100644 index 00000000..db3e0418 --- /dev/null +++ b/applications/vc-app/Chart.yaml @@ -0,0 +1,15 @@ +apiVersion: v2 +name: vc-app +description: A Helm chart for Vsblty Vision Captor application + +type: application + +version: 0.1.0 + +appVersion: "1.16.0" + +dependencies: + - name: ai-pipeline + condition: ai-pipeline.enabled + - name: vclite + condition: vclite.enabled \ No newline at end of file diff --git a/applications/vc-app/Readme.md b/applications/vc-app/Readme.md new file mode 100644 index 00000000..25bcb9b3 --- /dev/null +++ b/applications/vc-app/Readme.md @@ -0,0 +1,85 @@ + +# **Vision Captor Application Overview** +Using artificial intelligence and machine learning, VisionCaptor delivers targeted display content at the point of purchase. + +## **Pre Requisites – Resources Required** + +| **Resource Information** | | +|------------------------------------|----------------------| +| Application Type | Vision Captor | +| Compute (vCores) | 8 | +| Memory (RAM) | 8 GB | +| Storage | 128 GB | +| Host OS | Ubuntu 20 or higher | +| Physical Display | | +| Connected cameras(USB/IP/Network) | With RTSP URL | + + + +## **Where to Purchase** +Contact info@vsblty.net + + +## Pre Requisites - Installing OpenNESS +|**Configuration** | | +| ----------------------------------|-----------------------| +| OpenNESS Version | 20.12.02 | +| Flavor Used | Minimal | +| Distribution | OpenSource | + + +Follow below link to setup controller and edge-node for installing OpenNESS. + +https://github.com/open-ness/specs/blob/openness-20.12.02/doc/getting-started/network-edge/controller-edge-node-setup.md + +* Go to openness-experience-kits/ directory and comment out the grub role (role: machine_setup/grub) in the **network_edge.yml** file. +* Run the deployment script as ./deploy_ne.sh + +## Pre Requisites - Installing Vision Captor +|**Configuration** | | +| ----------------------------------|------------------------------------| +| Ubuntu | 20 or later | +| Folder to create on system | /home/vedge/models | +| Folder to create on system | /home/vedge/gallery | +| Folder to create on system | /home/vedge/videos | +| Folder to create on system | /root/.Xauthority | +| Folder to create on system | /home/vclite/Usage | +| Folder to create on system | /home/vclite/KioskServicesMedia | + + + +## Loading Docker Images +docker image load -i vc-app.tar.gz + +## Installing Vision Captor Application using helm + +Run the following commands to deploy through helm: + +`helm install vc-app ./vc-app` + + Sample Output would look like: + +> `NAME: vc-app` +> +> `LAST DEPLOYED:` +> +> `NAMESPACE: default` +> +> `STATUS: deployed` +> +> `REVISION: 1` +> +> `TEST SUITE: None` + + + +## Uninstall Vision captor application +To uninstall application run below command: + +`helm uninstall vc-app` + +## Testing Steps +For further instructions about steps for testing, contact VSBLTY Team (info@vsblty.net) + +## **Related material** +* https://vsblty.net/ \ No newline at end of file diff --git a/applications/vc-app/charts/ai-pipeline/Chart.yaml b/applications/vc-app/charts/ai-pipeline/Chart.yaml new file mode 100644 index 00000000..258419f7 --- /dev/null +++ b/applications/vc-app/charts/ai-pipeline/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +name: ai-pipeline +description: A Helm chart for vsblty ai pipeline +type: application +version: 0.1.0 +appVersion: 1.16.0 diff --git a/applications/vc-app/charts/ai-pipeline/templates/_helpers.tpl b/applications/vc-app/charts/ai-pipeline/templates/_helpers.tpl new file mode 100644 index 00000000..1958b1dd --- /dev/null +++ b/applications/vc-app/charts/ai-pipeline/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "ai-pipeline.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "ai-pipeline.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "ai-pipeline.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "ai-pipeline.labels" -}} +helm.sh/chart: {{ include "ai-pipeline.chart" . }} +{{ include "ai-pipeline.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "ai-pipeline.selectorLabels" -}} +app.kubernetes.io/name: {{ include "ai-pipeline.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "ai-pipeline.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "ai-pipeline.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/applications/vc-app/charts/ai-pipeline/templates/configmap.yaml b/applications/vc-app/charts/ai-pipeline/templates/configmap.yaml new file mode 100644 index 00000000..7436f6a5 --- /dev/null +++ b/applications/vc-app/charts/ai-pipeline/templates/configmap.yaml @@ -0,0 +1,72 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: config-json-volume +data: + config.json: |- + { + "default": { + "vclite": { + "hostUrl": "{{ .Values.vcapp.dns }}", + "hostPort": "{{ .Values.vcapp.port }}" + }, + "logLevel": "DEBUG", + "pipeline": { + "template": [ + "rtspsrc location={input} ! rtph264depay ! decodebin ! videoconvert ! video/x-raw,format=BGRx !", + "gvadetect model={faceDetection[model]} model-proc={faceDetection[proc]} device={faceDetection[device]} ! gvatrack ! queue !", + "gvaclassify reclassify-interval=5 model={headPose[model]} device={headPose[device]} batch-size=1 pre-process-backend=opencv object-class=face ! queue !", + "gvaclassify reclassify-interval=5 model={ageGender[model]} device={ageGender[device]} batch-size=1 pre-process-backend=opencv object-class=face ! queue name=frame-process !", + "videoconvert name=videoconvert ! video/x-raw,format=NV12 ! autovideosink name=autovideosink" + ], + "params": { + "faceDetection": { + "model": "/home/vedge/models/face-detection-adas-0001/FP32/face-detection-adas-0001.xml", + "proc": "/home/vedge/models/face-detection-adas-0001/PROC/face-detection-adas-0001.json", + "device": "CPU" + }, + "ageGender": { + "model": "/home/vedge/models/age-gender-recognition-retail-0013/FP32/age-gender-recognition-retail-0013.xml", + "device": "CPU" + }, + "headPose": { + "model": "/home/vedge/models/head-pose-estimation-adas-0001/FP32/head-pose-estimation-adas-0001.xml", + "device": "CPU" + }, + "reidThreshold": 0.6 + } + } + }, + "cameras": { + "camerap-1": { + "logLevel": "DEBUG", + "cloudCredential": "{{ .Values.device.accessToken }}", + "cloudEnv": "DEV", + "pipeline": { + "params": { + "input": "{{ .Values.camera.rtsp }}" + } + }, + "services": [ + { + "type": "age-gender-counting", + "pipelineElement": "frame-process", + "objectType": [ + "face" + ], + "layerType": [ + [ + "prob", + "age_conv3" + ] + ], + "alwaysCount": true, + "data_interval": 10, + "yaw_threshold": 30, + "pitch_threshold": 30, + "roll_threshold": 30 + } + ] + } + } + } \ No newline at end of file diff --git a/applications/vc-app/charts/ai-pipeline/templates/deployment.yaml b/applications/vc-app/charts/ai-pipeline/templates/deployment.yaml new file mode 100644 index 00000000..447fd83e --- /dev/null +++ b/applications/vc-app/charts/ai-pipeline/templates/deployment.yaml @@ -0,0 +1,107 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "ai-pipeline.fullname" . }} + labels: + {{- include "ai-pipeline.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + strategy: + type: Recreate + selector: + matchLabels: + {{- include "ai-pipeline.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "ai-pipeline.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "ai-pipeline.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + volumes: + - name: config-map-volume + configMap: + name: config-json-volume + - name: gallery-map-volume + hostPath: + path: /home/vedge/gallery + type: Directory + - name: media-map-volume + hostPath: + path: /home/vedge/videos + type: Directory + - name: models-volume + hostPath: + path: /home/vedge/models + type: Directory + - name: x11-vol + hostPath: + path: /tmp + type: Directory + - name: var-temp + hostPath: + path: /var/tmp + type: Directory + - name: var-dev + hostPath: + path: /dev + type: Directory + hostNetwork: true + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + command: + - python3 + - /home/vedge/ai-pipeline/main.py + - -c + - /home/vedge/config/config.json + - -id + - camerap-1 + env: + - name: DISPLAY + value: "{{ .Values.display.displayName }}" + - name: PYTHONUNBUFFERED + value: "{{ .Values.display.pythonVar }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + volumeMounts: + - mountPath: /home/vedge/config + name: config-map-volume + - mountPath: /home/vedge/gallery + name: gallery-map-volume + - mountPath: /home/vedge/videos + name: media-map-volume + - mountPath: /home/vedge/models + name: models-volume + - mountPath: /tmp + name: x11-vol + - mountPath: /var/tmp + name: var-temp + - mountPath: /dev + name: var-dev + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/applications/vc-app/charts/ai-pipeline/templates/hpa.yaml b/applications/vc-app/charts/ai-pipeline/templates/hpa.yaml new file mode 100644 index 00000000..6dc406f6 --- /dev/null +++ b/applications/vc-app/charts/ai-pipeline/templates/hpa.yaml @@ -0,0 +1,28 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2beta1 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "ai-pipeline.fullname" . }} + labels: + {{- include "ai-pipeline.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "ai-pipeline.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/applications/vc-app/charts/ai-pipeline/templates/serviceaccount.yaml b/applications/vc-app/charts/ai-pipeline/templates/serviceaccount.yaml new file mode 100644 index 00000000..5772f523 --- /dev/null +++ b/applications/vc-app/charts/ai-pipeline/templates/serviceaccount.yaml @@ -0,0 +1,12 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "ai-pipeline.serviceAccountName" . }} + labels: + {{- include "ai-pipeline.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/applications/vc-app/charts/ai-pipeline/values.yaml b/applications/vc-app/charts/ai-pipeline/values.yaml new file mode 100644 index 00000000..775ea9de --- /dev/null +++ b/applications/vc-app/charts/ai-pipeline/values.yaml @@ -0,0 +1,51 @@ +replicaCount: 1 + +image: + repository: vsblty.azurecr.io/vedge/ai-pipeline + pullPolicy: IfNotPresent + tag: "1.1.18" + +device: + accessToken: "" + +camera: + rtsp: "" + +vcapp: + dns: "localhost" + port: 5051 + +imagePullSecrets: [name: regcred] +nameOverride: "" +fullnameOverride: "" + +display: + displayName: unix:0 + pythonVar: 1 + +serviceAccount: + create: true + annotations: {} + name: "" + +podAnnotations: {} + +podSecurityContext: {} + +securityContext: + privileged: true + +resources: {} + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + targetMemoryUtilizationPercentage: 80 + +nodeSelector: {} + +tolerations: [] + +affinity: {} diff --git a/applications/vc-app/charts/vclite/Chart.yaml b/applications/vc-app/charts/vclite/Chart.yaml new file mode 100644 index 00000000..465451be --- /dev/null +++ b/applications/vc-app/charts/vclite/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +name: vclite +description: A Helm chart for vsblty vclite app +type: application +version: 0.1.0 +appVersion: 1.16.0 diff --git a/applications/vc-app/charts/vclite/templates/_helpers.tpl b/applications/vc-app/charts/vclite/templates/_helpers.tpl new file mode 100644 index 00000000..8e296436 --- /dev/null +++ b/applications/vc-app/charts/vclite/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "vclite.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "vclite.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "vclite.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "vclite.labels" -}} +helm.sh/chart: {{ include "vclite.chart" . }} +{{ include "vclite.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "vclite.selectorLabels" -}} +app.kubernetes.io/name: {{ include "vclite.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "vclite.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "vclite.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/applications/vc-app/charts/vclite/templates/deployment.yaml b/applications/vc-app/charts/vclite/templates/deployment.yaml new file mode 100644 index 00000000..cb9544e0 --- /dev/null +++ b/applications/vc-app/charts/vclite/templates/deployment.yaml @@ -0,0 +1,109 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "vclite.fullname" . }} + labels: + {{- include "vclite.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + strategy: + type: Recreate + selector: + matchLabels: + {{- include "vclite.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "vclite.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "vclite.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + volumes: + - name: dshm + emptyDir: + medium: Memory + - name: x-authority-volume + hostPath: + path: /root/.Xauthority + type: Directory + - name: tmp-x11-volume + hostPath: + path: /tmp/.X11-unix/ + type: Directory + - name: etc-timezone-volume + hostPath: + path: /etc/timezone + type: File + - name: etc-localtime-volume + hostPath: + path: /etc/localtime + type: File + - name: usage + hostPath: + path: /home/vclite/Usage + type: Directory + - name: kiosk-services-media + hostPath: + path: /home/vclite/KioskServicesMedia + type: Directory + hostNetwork: true + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - containerPort: 8001 + name: port-8001 + protocol: TCP + - containerPort: 5051 + name: port-5051 + protocol: TCP + env: + - name: DISPLAY + value: "{{ .Values.display.displayName }}" + - name: WorkerServiceSetup__EndpointId + value: "{{ .Values.display.EndpointId }}" + - name: WorkerServiceSetup__BaseCmsUrl + value: "{{ .Values.display.BaseCmsUrl }}" + volumeMounts: + - mountPath: /dev/shm + name: dshm + - mountPath: /root/.Xauthority + name: x-authority-volume + - mountPath: /tmp/.X11-unix/ + name: tmp-x11-volume + - mountPath: /etc/timezone + name: etc-timezone-volume + - mountPath: /etc/localtime + name: etc-localtime-volume + - mountPath: /opt/Vsblty/KioskFramework/Usage + name: usage + - mountPath: /opt/Vsblty/KioskServicesMedia/ + name: kiosk-services-media + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/applications/vc-app/charts/vclite/templates/hpa.yaml b/applications/vc-app/charts/vclite/templates/hpa.yaml new file mode 100644 index 00000000..114a20ab --- /dev/null +++ b/applications/vc-app/charts/vclite/templates/hpa.yaml @@ -0,0 +1,28 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2beta1 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "vclite.fullname" . }} + labels: + {{- include "vclite.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "vclite.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/applications/vc-app/charts/vclite/templates/serviceaccount.yaml b/applications/vc-app/charts/vclite/templates/serviceaccount.yaml new file mode 100644 index 00000000..2eaa95b6 --- /dev/null +++ b/applications/vc-app/charts/vclite/templates/serviceaccount.yaml @@ -0,0 +1,12 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "vclite.serviceAccountName" . }} + labels: + {{- include "vclite.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/applications/vc-app/charts/vclite/values.yaml b/applications/vc-app/charts/vclite/values.yaml new file mode 100644 index 00000000..94d80a3a --- /dev/null +++ b/applications/vc-app/charts/vclite/values.yaml @@ -0,0 +1,46 @@ +replicaCount: 1 + +image: + repository: vsblty.azurecr.io/vsblty/vclight + pullPolicy: IfNotPresent + tag: "1.7.17" + +display: + displayName: unix:0 + EndpointId: + BaseCmsUrl: "" + +imagePullSecrets: [name: regcred] +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + create: true + annotations: {} + name: "" + +podAnnotations: {} + +podSecurityContext: {} + +securityContext: + privileged: true + +resources: + limits: + memory: "3072Mi" + requests: + memory: "3072Mi" + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + targetMemoryUtilizationPercentage: 80 + +nodeSelector: {} + +tolerations: [] + +affinity: {} diff --git a/applications/vc-app/templates/_helpers.tpl b/applications/vc-app/templates/_helpers.tpl new file mode 100644 index 00000000..8ba0de8f --- /dev/null +++ b/applications/vc-app/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "vc-app.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "vc-app.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "vc-app.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "vc-app.labels" -}} +helm.sh/chart: {{ include "vc-app.chart" . }} +{{ include "vc-app.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "vc-app.selectorLabels" -}} +app.kubernetes.io/name: {{ include "vc-app.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "vc-app.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "vc-app.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/applications/vc-app/values.yaml b/applications/vc-app/values.yaml new file mode 100644 index 00000000..ef3dc9fc --- /dev/null +++ b/applications/vc-app/values.yaml @@ -0,0 +1,27 @@ +ai-pipeline: + enabled: true + image: + repository: vsblty.azurecr.io/vedge/ai-pipeline + pullPolicy: IfNotPresent + tag: "1.2.75" + display: + displayName: unix:0 + pythonVar: 1 + device: + accessToken: "" + camera: + rtsp: "" + vcapp: + dns: "localhost" + port: 5051 + +vclite: + enabled: true + image: + repository: vsblty.azurecr.io/vsblty/vclight + pullPolicy: IfNotPresent + tag: "1.7.26" + display: + displayName: unix:0 + EndpointId: + BaseCmsUrl: "" \ No newline at end of file