From 7c6660c14872a0522bf0b38a102aa8dcf49a7428 Mon Sep 17 00:00:00 2001 From: Nikolay Mahotkin Date: Mon, 29 Mar 2021 15:16:33 +0400 Subject: [PATCH 1/4] Add realtime heatmap and audience applications * Realtime heatmap - OpenNESS producer application * Audience analytics - OpenNESS consumer application --- applications/audience-analytics/README.md | 82 +++++++++ .../audience-analytics/helm/Chart.yaml | 12 ++ .../helm/templates/api-deploy.yaml | 174 ++++++++++++++++++ .../helm/templates/api-pvc.yaml | 13 ++ .../helm/templates/api-service.yaml | 22 +++ .../helm/templates/db-deploy.yaml | 36 ++++ .../helm/templates/db-pvc.yaml | 13 ++ .../helm/templates/db-service.yaml | 16 ++ .../helm/templates/images-pvc.yaml | 13 ++ .../helm/templates/ingress-tls.yaml | 39 ++++ .../helm/templates/requester-role.yaml | 46 +++++ .../helm/templates/ui-deploy.yaml | 30 +++ .../helm/templates/ui-service.yaml | 16 ++ .../audience-analytics/helm/values.yaml | 53 ++++++ applications/realtime-heatmap/README.md | 88 +++++++++ applications/realtime-heatmap/helm/Chart.yaml | 17 ++ .../realtime-heatmap/helm/templates/NOTES.txt | 28 +++ .../helm/templates/heatmap-deploy.yaml | 133 +++++++++++++ .../helm/templates/heatmap-svc.yaml | 21 +++ .../helm/templates/ingress.yaml | 42 +++++ .../helm/templates/requester-role.yaml | 46 +++++ .../helm/templates/streams-config.yaml | 122 ++++++++++++ .../realtime-heatmap/helm/values.yaml | 75 ++++++++ 23 files changed, 1137 insertions(+) create mode 100644 applications/audience-analytics/README.md create mode 100644 applications/audience-analytics/helm/Chart.yaml create mode 100644 applications/audience-analytics/helm/templates/api-deploy.yaml create mode 100644 applications/audience-analytics/helm/templates/api-pvc.yaml create mode 100644 applications/audience-analytics/helm/templates/api-service.yaml create mode 100644 applications/audience-analytics/helm/templates/db-deploy.yaml create mode 100644 applications/audience-analytics/helm/templates/db-pvc.yaml create mode 100644 applications/audience-analytics/helm/templates/db-service.yaml create mode 100644 applications/audience-analytics/helm/templates/images-pvc.yaml create mode 100644 applications/audience-analytics/helm/templates/ingress-tls.yaml create mode 100644 applications/audience-analytics/helm/templates/requester-role.yaml create mode 100644 applications/audience-analytics/helm/templates/ui-deploy.yaml create mode 100644 applications/audience-analytics/helm/templates/ui-service.yaml create mode 100644 applications/audience-analytics/helm/values.yaml create mode 100644 applications/realtime-heatmap/README.md create mode 100644 applications/realtime-heatmap/helm/Chart.yaml create mode 100644 applications/realtime-heatmap/helm/templates/NOTES.txt create mode 100644 applications/realtime-heatmap/helm/templates/heatmap-deploy.yaml create mode 100644 applications/realtime-heatmap/helm/templates/heatmap-svc.yaml create mode 100644 applications/realtime-heatmap/helm/templates/ingress.yaml create mode 100644 applications/realtime-heatmap/helm/templates/requester-role.yaml create mode 100644 applications/realtime-heatmap/helm/templates/streams-config.yaml create mode 100644 applications/realtime-heatmap/helm/values.yaml diff --git a/applications/audience-analytics/README.md b/applications/audience-analytics/README.md new file mode 100644 index 00000000..30a203d5 --- /dev/null +++ b/applications/audience-analytics/README.md @@ -0,0 +1,82 @@ +```text +Copyright (c) 2021 Kibernetika, Inc. All rights reserved. +``` + +# Audience analytics + +- [Audience analytics](#audience-analytics) + - [Application Description](#application-description) + - [Repository content](#repository-content) + - [Docker Images](#docker-images) + - [Pre Requisites](#pre-requisites) + - [Installation](#installation) + - [Install the Audience analytics](#install-the-audience-analytics) + - [Producer Application](#producer-application) + - [Check application logs to see if it is running](#check-application-logs-to-see-if-it-is-running) + +## Application Description + +The Application is a Audience analytics registered in OpenNESS as a consumer application. It uses +a web UI for visualizing heatmap pictures, aggregated heatmap pictures, heatmap video and person statistics from the timeline. +It receives the data and pictures from the producer application "Realtime Heatmap". + +## Repository content + +The repository contains: + +- Helm package for the installation + +## Docker Images + +Docker images are located at dockerhub: + +- kuberlab/audience:latest +- kuberlab/audience-ui:latest + +Pre Requisites +--- +The application has been tested on the following software, which is also required: + +* [OpenNESS](https://github.com/open-ness/specs) Network Edge v20.12 +* Kubernetes v1.18.4 +* Helm v3.1.2 +* Installed [nginx-ingress](https://kubernetes.github.io/ingress-nginx/deploy/#using-helm) controller in cluster with nodePort +* Available at least one storage class for storage + +## Installation + +### Install the Audience analytics + +The installation proccess leverage on helm chart. Go to the `helm` folder of the repository, and edit values.yaml: + +Notice environment variables: + +Notice chart variables: + +- api.dns: Domain name for nginx controller +- api.db.password: specify password for the database +- api.authKey: specify random auth key for root API user +- Uncomment persistence.*.storageClass variables and specify an appropriate storageClass used in your cluster + +Run the installation: + +```bash +helm install realtime-heatmap ./ +``` + +If the installation succeeds, you can check the logs. If everything is ok and DNS is pointed to edge node IP, +then check `:` for accessing audience UI using login/password: `admin/` + +### Producer Application + +The Producer application here is the "Realtime Heatmap" application which produces frames, heatmap labeling and +resulting video chunks and sends them to audience service. + +### Check application logs to see if it is running + +In order to check application logs, you can see directly the pod logs at: + +```bash +pod_name=$(kubectl get po -l component=audience-api --no-headers | awk '{print $1}') +kubectl logs -f $pod_name +``` diff --git a/applications/audience-analytics/helm/Chart.yaml b/applications/audience-analytics/helm/Chart.yaml new file mode 100644 index 00000000..f545691a --- /dev/null +++ b/applications/audience-analytics/helm/Chart.yaml @@ -0,0 +1,12 @@ +Description: Audience exploring system +Engine: gotpl +Home: https://kibernetika.ai +Keywords: +- Artificial Intelligence +- Audience +- Kibernetika +Maintainers: +- Email: vgrishin@kibernetika.ai + Name: Vadim Grishin +Name: audience +Version: 1.0.0 diff --git a/applications/audience-analytics/helm/templates/api-deploy.yaml b/applications/audience-analytics/helm/templates/api-deploy.yaml new file mode 100644 index 00000000..5f143d0f --- /dev/null +++ b/applications/audience-analytics/helm/templates/api-deploy.yaml @@ -0,0 +1,174 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: audience-api +spec: + selector: + matchLabels: + app: audience + component: audience-api + template: + metadata: + labels: + app: audience + component: audience-api + spec: + {{- if .Values.openness.enabled }} + serviceAccountName: heatmap-consumer + initContainers: + - name: certrequester + image: certrequester:1.0 + args: [ "--cfg", "/home/certrequester/config/certrequest.json" ] + imagePullPolicy: IfNotPresent + resources: + requests: + cpu: "0.1" + limits: + cpu: "0.1" + memory: "128Mi" + volumeMounts: + - name: config + mountPath: /home/certrequester/config/ + - name: certs + mountPath: /home/certrequester/certs/ + - name: alpine + image: alpine:3.12.0 + command: [ "/bin/sh" ] + args: [ "-c", "cp /root/ca-certrequester/cert.pem /root/certs/root.pem" ] + imagePullPolicy: IfNotPresent + resources: + requests: + cpu: "0.1" + limits: + cpu: "0.1" + memory: "128Mi" + volumeMounts: + - name: ca-certrequester + mountPath: /root/ca-certrequester + - name: certs + mountPath: /root/certs + {{- end }} + containers: + - name: audience-api + image: "{{ printf "%s:%s" .Values.api.Image.Name .Values.api.Image.Tag}}" + readinessProbe: + httpGet: + path: /probe + port: 8088 + initialDelaySeconds: 30 + periodSeconds: 10 + timeoutSeconds: 3 + successThreshold: 1 + failureThreshold: 3 + env: + - name: PG_HOST + value: audience-db + - name: PG_USER + value: {{ .Values.api.db.user }} + - name: PG_PWD + value: {{ .Values.api.db.password }} + - name: BASE_URL + value: {{ .Values.api.baseUrl }} + {{- if .Values.openness.enabled }} + - name: OPENNESS_ENABLED + value: "true" + {{- end }} + {{- if .Values.api.authKey }} + - name: AUTH_KEY + value: {{ .Values.api.authKey }} + {{- end }} + {{- if .Values.api.authAllowPublic }} + - name: AUTH_ALLOW_PUBLIC + value: "{{ .Values.api.authAllowPublic }}" + {{- end }} + {{- if .Values.api.dealer.enabled }} + - name: DEALER_ENABLED + value: "{{ .Values.api.dealer.enabled }}" + {{- end }} + {{- if .Values.api.dealer.host }} + - name: DEALER_HOST + value: {{ .Values.api.dealer.host }} + {{- end }} + {{- if .Values.api.dealer.apiPath }} + - name: DEALER_API_PATH + value: {{ .Values.api.dealer.apiPath }} + {{- end }} + {{- if .Values.api.dealer.disableHttps }} + - name: DEALER_DISABLE_HTTPS + value: {{ .Values.api.dealer.disableHttps }} + {{- end }} + {{- if .Values.api.dealer.inferenceWorkspace }} + - name: INFERENCE_WORKSPACE + value: {{ .Values.api.dealer.inferenceWorkspace }} + {{- end }} + {{- if .Values.api.dealer.inferenceName }} + - name: INFERENCE_NAME + value: {{ .Values.api.dealer.inferenceName }} + {{- end }} + {{- if .Values.api.dealer.inferenceVersion }} + - name: INFERENCE_VERSION + value: {{ .Values.api.dealer.inferenceVersion }} + {{- end }} + {{- if .Values.api.dealer.servingWorkspace }} + - name: SERVING_WORKSPACE + value: {{ .Values.api.dealer.servingWorkspace }} + {{- end }} + {{- if .Values.api.dealer.servingName }} + - name: SERVING_NAME + value: {{ .Values.api.dealer.servingName }} + {{- end }} + {{- if .Values.api.dealer.servingToken }} + - name: SERVING_TOKEN + value: {{ .Values.api.dealer.servingToken }} + {{- end }} + {{- if .Values.api.dealer.storageEndpoint }} + - name: STORAGE_ENDPOINT + value: {{ .Values.api.dealer.storageEndpoint }} + {{- end }} + {{- if .Values.api.dealer.storageId }} + - name: STORAGE_ID + value: {{ .Values.api.dealer.storageId }} + {{- end }} + {{- if .Values.api.dealer.storageSecret }} + - name: STORAGE_SECRET + value: {{ .Values.api.dealer.storageSecret }} + {{- end }} + {{- if .Values.api.dealer.storageRegion }} + - name: STORAGE_REGION + value: {{ .Values.api.dealer.storageRegion }} + {{- end }} + {{- if .Values.api.dealer.storageBucket }} + - name: STORAGE_BUCKET + value: {{ .Values.api.dealer.storageBucket }} + {{- end }} + ports: + - containerPort: 8088 + name: http + volumeMounts: + - name: images + mountPath: /images + subPath: audience-images + - name: api-upload + mountPath: /upload + subPath: audience-api-upload + {{- if .Values.openness.enabled }} + - name: certs + mountPath: /root/certs/ + {{- end }} + volumes: + - name: images + persistentVolumeClaim: + claimName: audience-images + - name: api-upload + persistentVolumeClaim: + claimName: audience-api-upload + {{- if .Values.openness.enabled }} + - name: certs + emptyDir: {} + - name: ca-certrequester + secret: + secretName: ca-certrequester + - name: config + configMap: + name: heatmap-consumer-csr-config + {{- end }} diff --git a/applications/audience-analytics/helm/templates/api-pvc.yaml b/applications/audience-analytics/helm/templates/api-pvc.yaml new file mode 100644 index 00000000..bd58fb03 --- /dev/null +++ b/applications/audience-analytics/helm/templates/api-pvc.yaml @@ -0,0 +1,13 @@ +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: audience-api-upload +spec: + {{- if .Values.persistence.apiUpload.storageClass }} + storageClassName: {{ .Values.persistence.apiUpload.storageClass | quote }} + {{- end }} + accessModes: + - "ReadWriteOnce" + resources: + requests: + storage: {{ .Values.persistence.apiUpload.size }} diff --git a/applications/audience-analytics/helm/templates/api-service.yaml b/applications/audience-analytics/helm/templates/api-service.yaml new file mode 100644 index 00000000..0a50bc7d --- /dev/null +++ b/applications/audience-analytics/helm/templates/api-service.yaml @@ -0,0 +1,22 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app: audience + component: audience-api + name: audience-api +spec: + type: {{ .Values.api.service.type }} + ports: + - name: http + port: 80 + {{- if eq .Values.api.service.type "NodePort" }} + {{- if .Values.api.service.nodePort }} + nodePort: {{ .api.service.nodePort }} + {{- end }} + {{- end }} + protocol: TCP + targetPort: 8088 + selector: + app: audience + component: audience-api diff --git a/applications/audience-analytics/helm/templates/db-deploy.yaml b/applications/audience-analytics/helm/templates/db-deploy.yaml new file mode 100644 index 00000000..79d71755 --- /dev/null +++ b/applications/audience-analytics/helm/templates/db-deploy.yaml @@ -0,0 +1,36 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: audience-db +spec: + selector: + matchLabels: + app: audience + component: audience-db + template: + metadata: + labels: + app: audience + component: audience-db + spec: + containers: + - name: audience-db + image: postgres:9.6.2 + env: + - name: POSTGRES_USER + value: {{ .Values.api.db.user }} + - name: POSTGRES_PASSWORD + value: {{ .Values.api.db.password }} + - name: PGDATA + value: /var/lib/postgresql/data/pgdata + ports: + - containerPort: 5432 + name: psql + volumeMounts: + - name: db + mountPath: /var/lib/postgresql/data/pgdata + subPath: audience-db + volumes: + - name: db + persistentVolumeClaim: + claimName: audience-db diff --git a/applications/audience-analytics/helm/templates/db-pvc.yaml b/applications/audience-analytics/helm/templates/db-pvc.yaml new file mode 100644 index 00000000..ff302bdf --- /dev/null +++ b/applications/audience-analytics/helm/templates/db-pvc.yaml @@ -0,0 +1,13 @@ +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: audience-db +spec: + {{- if .Values.persistence.db.storageClass }} + storageClassName: {{ .Values.persistence.db.storageClass | quote }} + {{- end }} + accessModes: + - "ReadWriteOnce" + resources: + requests: + storage: {{ .Values.persistence.db.size }} diff --git a/applications/audience-analytics/helm/templates/db-service.yaml b/applications/audience-analytics/helm/templates/db-service.yaml new file mode 100644 index 00000000..1f02998e --- /dev/null +++ b/applications/audience-analytics/helm/templates/db-service.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app: audience + component: audience-db + name: audience-db +spec: + ports: + - name: psql + port: 5432 + protocol: TCP + targetPort: 5432 + selector: + app: audience + component: audience-db diff --git a/applications/audience-analytics/helm/templates/images-pvc.yaml b/applications/audience-analytics/helm/templates/images-pvc.yaml new file mode 100644 index 00000000..d26e3f93 --- /dev/null +++ b/applications/audience-analytics/helm/templates/images-pvc.yaml @@ -0,0 +1,13 @@ +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: audience-images +spec: + {{- if .Values.persistence.db.storageClass }} + storageClassName: {{ .Values.persistence.images.storageClass | quote }} + {{- end }} + accessModes: + - "ReadWriteOnce" + resources: + requests: + storage: {{ .Values.persistence.images.size }} diff --git a/applications/audience-analytics/helm/templates/ingress-tls.yaml b/applications/audience-analytics/helm/templates/ingress-tls.yaml new file mode 100644 index 00000000..950bdc91 --- /dev/null +++ b/applications/audience-analytics/helm/templates/ingress-tls.yaml @@ -0,0 +1,39 @@ +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: audience-tls + annotations: + kubernetes.io/ingress.class: "nginx" + certmanager.k8s.io/cluster-issuer: kibernetika-cert-issuer + nginx.ingress.kubernetes.io/proxy-body-size: 16m +spec: + {{- if .Values.ingress.tls.enabled }} + tls: + - hosts: + {{- range $i, $dns := .Values.api.dns }} + - "{{ $dns }}" + {{- end }} + secretName: audience-tls + {{- end }} + rules: + {{- range $i, $dns := .Values.api.dns }} + - host: {{ $dns }} + http: + paths: + - path: /swagger + backend: + serviceName: audience-api + servicePort: 8088 + - path: /api + backend: + serviceName: audience-api + servicePort: 8088 + - path: /images + backend: + serviceName: audience-api + servicePort: 8088 + - path: / + backend: + serviceName: audience-ui + servicePort: 80 + {{- end }} diff --git a/applications/audience-analytics/helm/templates/requester-role.yaml b/applications/audience-analytics/helm/templates/requester-role.yaml new file mode 100644 index 00000000..a2403a84 --- /dev/null +++ b/applications/audience-analytics/helm/templates/requester-role.yaml @@ -0,0 +1,46 @@ +{{- if .Values.openness.enabled }} +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: heatmap-consumer + +--- +kind: ClusterRoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: heatmap-consumer-csr-requester + namespace: {{ .Release.Namespace }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: csr-requester +subjects: + - kind: ServiceAccount + name: heatmap-consumer + namespace: {{ .Release.Namespace }} + +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: heatmap-consumer-csr-config +data: + certrequest.json: | + { + "CSR": { + "Name": "heatmap-consumer", + "Subject": { + "CommonName": "heatmap:consumer", + "Organization": ["Kibernetika Inc."] + }, + "DNSSANs": [], + "IPSANs": [], + "KeyUsages": [ + "digital signature", "key encipherment", "client auth" + ] + }, + "Signer": "openness.org/certsigner", + "WaitTimeout": "5m" + } +{{- end }} \ No newline at end of file diff --git a/applications/audience-analytics/helm/templates/ui-deploy.yaml b/applications/audience-analytics/helm/templates/ui-deploy.yaml new file mode 100644 index 00000000..074df37b --- /dev/null +++ b/applications/audience-analytics/helm/templates/ui-deploy.yaml @@ -0,0 +1,30 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: audience-ui +spec: + selector: + matchLabels: + app: audience + component: audience-ui + template: + metadata: + labels: + app: audience + component: audience-ui + spec: + containers: + - name: audience-ui + image: "{{ printf "%s:%s" .Values.ui.Image.Name .Values.ui.Image.Tag}}" + readinessProbe: + httpGet: + path: / + port: 80 + initialDelaySeconds: 30 + periodSeconds: 10 + timeoutSeconds: 3 + successThreshold: 1 + failureThreshold: 3 + ports: + - containerPort: 80 + name: http diff --git a/applications/audience-analytics/helm/templates/ui-service.yaml b/applications/audience-analytics/helm/templates/ui-service.yaml new file mode 100644 index 00000000..1902735c --- /dev/null +++ b/applications/audience-analytics/helm/templates/ui-service.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app: audience + component: audience-ui + name: audience-ui +spec: + ports: + - name: http + port: 80 + protocol: TCP + targetPort: 80 + selector: + app: audience + component: audience-ui diff --git a/applications/audience-analytics/helm/values.yaml b/applications/audience-analytics/helm/values.yaml new file mode 100644 index 00000000..5e35a8d3 --- /dev/null +++ b/applications/audience-analytics/helm/values.yaml @@ -0,0 +1,53 @@ +api: + service: + type: NodePort + nodePort: 32288 + Image: + Name: kuberlab/audience + Tag: latest + db: + user: postgres + password: postgres + dns: + - audience.kibernetika.io + authKey: random-auth-key + authAllowPublic: false + baseUrl: https://audience.kibernetika.io + dealer: + enabled: false + host: dev.kibernetika.io + apiPath: /api/v0.2 + inferenceWorkspace: infws + inferenceName: infname + inferenceVersion: infversion + servingWorkspace: srvws + servingName: srvname + servingToken: ZZZ + storageEndpoint: https://storage.googleapis.com + storageId: XXX + storageSecret: YYY + storageRegion: us-west-2 + storageBucket: kibernetika-audience + +ui: + Image: + Name: kuberlab/audience-ui + Tag: latest + +persistence: + apiUpload: + #storageClass: nfs + size: 10G + db: + #storageClass: nfs + size: 10G + images: + #storageClass: nfs + size: 10G + +ingress: + tls: + enabled: false + +openness: + enabled: true diff --git a/applications/realtime-heatmap/README.md b/applications/realtime-heatmap/README.md new file mode 100644 index 00000000..1c3d4030 --- /dev/null +++ b/applications/realtime-heatmap/README.md @@ -0,0 +1,88 @@ +```text +Copyright (c) 2021 Kibernetika, Inc. All rights reserved. +``` + +# Realtime heatmap + +- [Realtime heatmap](#realtime-heatmap) + - [Application Description](#application-description) + - [Repository content](#repository-content) + - [Docker Images](#docker-images) + - [Pre Requisites](#pre-requisites) + - [Installation](#installation) + - [Install the Realtime heatmap](#install-the-realtime-heatmap) + - [Consumer Application](#consumer-application) + - [Check application logs to see if it is running](#check-application-logs-to-see-if-it-is-running) + +## Application Description + +The Application is a Heatmap computing registered in OpenNESS as a producer application. It uses +a streaming pipeline (either server reading from a stream or user pushing the stream to server) and RTMP server. +It utilizes OpenVINO person-detection and person-reidentification models. The application supports heatmap area +computing (general realtime heatmap) and track-heatmap (personal heatmap track connected to a corresponding person, uses +identity anchors). + +## Repository content + +The repository contains: + +- Helm package for the installation + +## Docker Images + +Docker images are located at dockerhub: + +- kuberlab/realtimeheatmap:1.0.4 +- kuberlab/realtimeheatmap:1.0.4-ffmpeg (this one is compiled with Intel-GPU decoding support for FFMpeg) + +Pre Requisites +--- +The application has been tested on the following software, which is also required: + +* [OpenNESS](https://github.com/open-ness/specs) Network Edge v20.12 +* Kubernetes v1.18.4 +* Helm v3.1.2 + +## Installation + +### Install the Realtime heatmap + +The installation proccess leverage on helm chart. Go to the `helm` folder of the repository, and edit values.yaml: + +Notice environment variables: + +- STREAM_COUNT=16 (default 16): Specify the needed number of supported streams. +- TRACKHEATMAP=no/yes (default no): Enable the track heatmap only. +- RUNTIME_HEATMAP=yes/no (default yes): Enable the general heatmap only. +- KSERVING=id (default ''): Specify `serving-id` for audience analytics integration + +Notice chart variables: + +- openness.heatmapId: Specify the producer application id. Needed in case of existing multiple heatmap applications +integrated with audience +- useHDDL=false/true: Load and run model on HDDL device (or not) +- useIntelGPU=false/true: Use Intel GPU for decoding or not +- runOnVCANode=false/true: Runs workload strictly on VCA card (node). + +Run the installation: + +```bash +helm install realtime-heatmap ./ +``` + +If the installation succeeds, you will see the additional instructions from `helm` output how to test it. + +### Consumer Application + +The Consumer application here is the Audience analytics application which consumes frames, heatmap labeling and +resulting video chunks generated by heatmap application. Or, alternatively, there is a way to see the output of heatmap +without consumer application, just see mjpg port (see helm outputs above). + +### Check application logs to see if it is running + +In order to check application logs, you can see directly the pod logs at: + +```bash +pod_name=$(kubectl get po -l app=runtime-heatmap --no-headers | awk '{print $1}') +kubectl logs -f $pod_name +``` diff --git a/applications/realtime-heatmap/helm/Chart.yaml b/applications/realtime-heatmap/helm/Chart.yaml new file mode 100644 index 00000000..b6e00dac --- /dev/null +++ b/applications/realtime-heatmap/helm/Chart.yaml @@ -0,0 +1,17 @@ +Description: Realtime person heatmap +Engine: gotpl +Home: http://kuberlab.com +Icon: https://storage.googleapis.com/kuberlab/static/favicon.ico +Keywords: +- kubernetes +- Artificial Intelligence +- tensorflow +- kibernetika +- pytorch +- kserving +- ml-serving +Maintainers: +- Email: nmahotkin@kibernetika.ai + Name: Mahotkin Nikolay +Name: realtime-heatmap +Version: 1.0.0 diff --git a/applications/realtime-heatmap/helm/templates/NOTES.txt b/applications/realtime-heatmap/helm/templates/NOTES.txt new file mode 100644 index 00000000..30f38234 --- /dev/null +++ b/applications/realtime-heatmap/helm/templates/NOTES.txt @@ -0,0 +1,28 @@ +Thank you for installing {{ .Chart.Name }}. + +Your release is named {{ .Release.Name }}. + +To forward RTMP port to the service, please use + +nodeport_rtmp=$(kubectl -n {{ .Release.Namespace }} get svc trackheatmap -o template --template '{{ "{{" }} (index .spec.ports 1).nodePort }}') +nodeport_http=$(kubectl -n {{ .Release.Namespace }} get svc trackheatmap -o template --template '{{ "{{" }} (index .spec.ports 0).nodePort }}') + +Then, forward rtmp port: + +ssh -NL 1935:kube-master-ip:$nodeport_rtmp + +To stream the video in the channel: + +ffmpeg -re -i -acodec aac -vcodec libx264 -f flv rtmp://localhost/live/stream1 + +If a video already encoded using H.264 (libx264) and AAC, then it could save the CPU resources: + +ffmpeg -re -i -acodec copy -vcodec copy -f flv rtmp://localhost/live/stream1 + +To view the resulting video, first forward http port: + +ssh -NL 8000:kube-master-ip:$nodeport_http + +Then open browser: + +http://localhost:8000 diff --git a/applications/realtime-heatmap/helm/templates/heatmap-deploy.yaml b/applications/realtime-heatmap/helm/templates/heatmap-deploy.yaml new file mode 100644 index 00000000..15ced01d --- /dev/null +++ b/applications/realtime-heatmap/helm/templates/heatmap-deploy.yaml @@ -0,0 +1,133 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: heatmap-{{ .Values.openness.heatmapId }} +spec: + replicas: 1 + revisionHistoryLimit: 1 + selector: + matchLabels: + app: {{ .Values.openness.heatmapId }} + vendor: kibernetika + template: + metadata: + labels: + app: {{ .Values.openness.heatmapId }} + vendor: kibernetika + spec: + {{- if .Values.runOnVCANode }} + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: vcac-pool + operator: Exists + {{- end }} + volumes: + - configMap: + defaultMode: 420 + name: streams + name: kstreams + {{- if .Values.openness.enabled }} + - name: certs + emptyDir: {} + - name: ca-certrequester + secret: + secretName: ca-certrequester + - name: config + configMap: + name: heatmap-{{ .Values.openness.heatmapId }}-csr-config + serviceAccountName: heatmap-{{ .Values.openness.heatmapId }} + initContainers: + - name: certrequester + image: certrequester:1.0 + args: [ "--cfg", "/home/certrequester/config/certrequest.json" ] + imagePullPolicy: IfNotPresent + resources: + requests: + cpu: "0.1" + limits: + cpu: "0.1" + memory: "128Mi" + volumeMounts: + - name: config + mountPath: /home/certrequester/config/ + - name: certs + mountPath: /home/certrequester/certs/ + - name: alpine + image: alpine:3.12.0 + command: [ "/bin/sh" ] + args: [ "-c", "cp /root/ca-certrequester/cert.pem /root/certs/root.pem" ] + imagePullPolicy: IfNotPresent + resources: + requests: + cpu: "0.1" + limits: + cpu: "0.1" + memory: "128Mi" + volumeMounts: + - name: ca-certrequester + mountPath: /root/ca-certrequester + - name: certs + mountPath: /root/certs + {{- end }} + containers: + - name: edge + volumeMounts: + - mountPath: /data.json + name: kstreams + subPath: streams.json + {{- if .Values.openness.enabled }} + - name: certs + mountPath: /root/certs/ + {{- end }} + image: "{{ printf "%s:%s" .Values.Image.Name .Values.Image.Tag }}" + imagePullPolicy: Always + command: ["/bin/bash", "-c"] + args: + - | + python /ponchik2/src/generate_streams.py $STREAM_COUNT /ponchik2/templates/data.json && /ponchik2/edge/start.sh + env: + {{- if .Values.useHDDL }} + - name: USE_DEVICE + value: "HDDL" + {{- end }} + {{- if .Values.openness.enabled }} + - name: OPENNESS_ENABLED + value: "true" + {{- end }} + {{- if .Values.useIntelGPU }} + - name: HWACCEL + value: "yes" + {{- end }} + {{- range .Values.env }} + - name: {{ .name }} + value: {{ .value | quote }} + {{- end }} + resources: + limits: + memory: "{{ .Values.resources.limits.memory }}" + cpu: "{{ .Values.resources.limits.cpu }}" + {{- if .Values.useHDDL }} + vpu.intel.com/hddl: "{{ .Values.resources.requests.hddl }}" + {{- end }} + {{- if .Values.useIntelGPU }} + gpu.intel.com/i915: "1" + {{- end }} + requests: + memory: "{{ .Values.resources.requests.memory }}" + cpu: "{{ .Values.resources.requests.cpu }}" + {{- if .Values.useHDDL }} + vpu.intel.com/hddl: "{{ .Values.resources.requests.hddl }}" + {{- end }} + {{- if .Values.useIntelGPU }} + gpu.intel.com/i915: "1" + {{- end }} + ports: + - containerPort: 8000 + protocol: TCP + name: http + - containerPort: 1935 + protocol: TCP + name: rtmp \ No newline at end of file diff --git a/applications/realtime-heatmap/helm/templates/heatmap-svc.yaml b/applications/realtime-heatmap/helm/templates/heatmap-svc.yaml new file mode 100644 index 00000000..7b9afc76 --- /dev/null +++ b/applications/realtime-heatmap/helm/templates/heatmap-svc.yaml @@ -0,0 +1,21 @@ +apiVersion: v1 +kind: Service +metadata: + name: heatmap-{{ .Values.openness.heatmapId }} + labels: + app: {{ .Values.openness.heatmapId }} + vendor: kibernetika +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.http.port }} + targetPort: 8000 + protocol: TCP + name: http + - port: {{ .Values.service.rtmp.port }} + targetPort: 1935 + protocol: TCP + name: rtmp + selector: + app: {{ .Values.openness.heatmapId }} + vendor: kibernetika \ No newline at end of file diff --git a/applications/realtime-heatmap/helm/templates/ingress.yaml b/applications/realtime-heatmap/helm/templates/ingress.yaml new file mode 100644 index 00000000..70596497 --- /dev/null +++ b/applications/realtime-heatmap/helm/templates/ingress.yaml @@ -0,0 +1,42 @@ +{{- if .Values.ingress.enabled -}} +{{- $httpPort := .Values.service.http.port -}} +{{- $rtmpPort := .Values.service.rtmp.port -}} +{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ .Values.openness.heatmapId }} + labels: + app: {{ .Values.openness.heatmapId }} + vendor: kibernetika + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: +{{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} +{{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ . }} + backend: + serviceName: heatmap-{{ .Values.openness.heatmapId }} + servicePort: {{ $httpPort }} + {{- end }} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/applications/realtime-heatmap/helm/templates/requester-role.yaml b/applications/realtime-heatmap/helm/templates/requester-role.yaml new file mode 100644 index 00000000..a3dbb66c --- /dev/null +++ b/applications/realtime-heatmap/helm/templates/requester-role.yaml @@ -0,0 +1,46 @@ +{{- if .Values.openness.enabled }} +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: heatmap-{{ .Values.openness.heatmapId }} + +--- +kind: ClusterRoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: heatmap-{{ .Values.openness.heatmapId }}-csr-requester + namespace: {{ .Release.Namespace }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: csr-requester +subjects: + - kind: ServiceAccount + name: heatmap-{{ .Values.openness.heatmapId }} + namespace: {{ .Release.Namespace }} + +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: heatmap-{{ .Values.openness.heatmapId }}-csr-config +data: + certrequest.json: | + { + "CSR": { + "Name": "heatmap-{{ .Values.openness.heatmapId }}", + "Subject": { + "CommonName": "heatmap:{{ .Values.openness.heatmapId }}", + "Organization": ["Kibernetika Inc."] + }, + "DNSSANs": [], + "IPSANs": [], + "KeyUsages": [ + "digital signature", "key encipherment", "client auth" + ] + }, + "Signer": "openness.org/certsigner", + "WaitTimeout": "5m" + } +{{- end }} \ No newline at end of file diff --git a/applications/realtime-heatmap/helm/templates/streams-config.yaml b/applications/realtime-heatmap/helm/templates/streams-config.yaml new file mode 100644 index 00000000..f5edc241 --- /dev/null +++ b/applications/realtime-heatmap/helm/templates/streams-config.yaml @@ -0,0 +1,122 @@ +apiVersion: v1 +data: + "streams.json": | + { + "keys": [ + { + "key": "stream1", + "output": "mjpg", + "input": "rtmp://127.0.0.1/live/stream1", + "description": null, + "params": {} + }, + { + "key": "stream2", + "output": "mjpg", + "input": "rtmp://127.0.0.1/live/stream2", + "description": null, + "params": {} + }, + { + "key": "stream3", + "output": "mjpg", + "input": "rtmp://127.0.0.1/live/stream3", + "description": null, + "params": {} + }, + { + "key": "stream4", + "output": "mjpg", + "input": "rtmp://127.0.0.1/live/stream4", + "description": null, + "params": {} + }, + { + "key": "stream5", + "output": "mjpg", + "input": "rtmp://127.0.0.1/live/stream5", + "description": null, + "params": {} + }, + { + "key": "stream6", + "output": "mjpg", + "input": "rtmp://127.0.0.1/live/stream6", + "description": null, + "params": {} + }, + { + "key": "stream7", + "output": "mjpg", + "input": "rtmp://127.0.0.1/live/stream7", + "description": null, + "params": {} + }, + { + "key": "stream8", + "output": "mjpg", + "input": "rtmp://127.0.0.1/live/stream8", + "description": null, + "params": {} + }, + { + "key": "stream9", + "output": "mjpg", + "input": "rtmp://127.0.0.1/live/stream9", + "description": null, + "params": {} + }, + { + "key": "stream10", + "output": "mjpg", + "input": "rtmp://127.0.0.1/live/stream10", + "description": null, + "params": {} + }, + { + "key": "stream11", + "output": "mjpg", + "input": "rtmp://127.0.0.1/live/stream11", + "description": null, + "params": {} + }, + { + "key": "stream12", + "output": "mjpg", + "input": "rtmp://127.0.0.1/live/stream12", + "description": null, + "params": {} + }, + { + "key": "stream13", + "output": "mjpg", + "input": "rtmp://127.0.0.1/live/stream13", + "description": null, + "params": {} + }, + { + "key": "stream14", + "output": "mjpg", + "input": "rtmp://127.0.0.1/live/stream14", + "description": null, + "params": {} + }, + { + "key": "stream15", + "output": "mjpg", + "input": "rtmp://127.0.0.1/live/stream15", + "description": null, + "params": {} + }, + { + "key": "stream16", + "output": "mjpg", + "input": "rtmp://127.0.0.1/live/stream16", + "description": null, + "params": {} + } + ] + } +kind: ConfigMap +metadata: + name: streams \ No newline at end of file diff --git a/applications/realtime-heatmap/helm/values.yaml b/applications/realtime-heatmap/helm/values.yaml new file mode 100644 index 00000000..6ce5e06f --- /dev/null +++ b/applications/realtime-heatmap/helm/values.yaml @@ -0,0 +1,75 @@ +Image: + Name: kuberlab/realtimeheatmap + Tag: 1.0.4 + +service: + type: NodePort + http: + port: 8000 + rtmp: + port: 1935 + +ingress: + enabled: false + annotations: {} + hosts: + - host: heatmap.local + paths: ["/"] + tls: [] + +resources: + requests: + cpu: "100m" + memory: "128M" + hddl: "8" + limits: + cpu: "8" + memory: "16G" + +# The parameters of the application is below. +# Please do not delete any of these. +env: + # The number of initial streams named as . + - name: STREAM_COUNT + value: 16 + # The flag which means either track heatmap or not. + - name: TRACKHEATMAP + value: "no" + # The flag which means either analyze each frame in video (without skipping) or not. + - name: RUNTIME_HEATMAP + value: "yes" + # The number of scale-crop-redetect person bodies in frames. Generally value 1 is sufficient and + # greater values will increase accuracy of detection of small bodies as well as the number of inference per frame. + - name: MULTIDETECT + value: 1 + # The output spec for all initial streams (can be 'hls', 'mjpg' or 'null' for now) + - name: OUTPUT + value: "mjpg" + # RTMP server to use. Only 'srs' supported for now. + - name: RTMP_BACKEND + value: srs +# --- +# Audience-related settings +# --- + # Serving key for channel + - name: KTOKEN + value: '' + # The host for audience in form scheme://host[:port], e.g. https://audience.host + - name: KHOST + value: '' + # Serving ID + - name: KSERVING + value: '' + # Leave as is + - name: KWORKSPACE + value: srvws + +openness: + enabled: true + heatmapId: 'runtime-heatmap' +# Load and run model on HDDL device (or not) +useHDDL: false +# Use Intel GPU for decoding or not +useIntelGPU: false +# Runs workload strictly on VCA card (node). +runOnVCANode: false From b830d611c534f3c7cf983d5f23cbd83ec6e3bf7a Mon Sep 17 00:00:00 2001 From: Nikolay Mahotkin Date: Mon, 29 Mar 2021 15:25:49 +0400 Subject: [PATCH 2/4] Add license headers --- applications/audience-analytics/README.md | 1 + applications/audience-analytics/helm/Chart.yaml | 6 ++++-- .../audience-analytics/helm/templates/api-deploy.yaml | 2 ++ applications/audience-analytics/helm/templates/api-pvc.yaml | 2 ++ .../audience-analytics/helm/templates/api-service.yaml | 2 ++ .../audience-analytics/helm/templates/db-deploy.yaml | 2 ++ applications/audience-analytics/helm/templates/db-pvc.yaml | 2 ++ .../audience-analytics/helm/templates/db-service.yaml | 2 ++ .../audience-analytics/helm/templates/images-pvc.yaml | 2 ++ .../audience-analytics/helm/templates/ingress-tls.yaml | 2 ++ .../audience-analytics/helm/templates/requester-role.yaml | 4 +++- .../audience-analytics/helm/templates/ui-deploy.yaml | 2 ++ .../audience-analytics/helm/templates/ui-service.yaml | 2 ++ applications/audience-analytics/helm/values.yaml | 2 ++ applications/realtime-heatmap/README.md | 1 + applications/realtime-heatmap/helm/Chart.yaml | 2 ++ applications/realtime-heatmap/helm/templates/NOTES.txt | 3 +++ .../realtime-heatmap/helm/templates/heatmap-deploy.yaml | 4 +++- .../realtime-heatmap/helm/templates/heatmap-svc.yaml | 4 +++- applications/realtime-heatmap/helm/templates/ingress.yaml | 4 +++- .../realtime-heatmap/helm/templates/requester-role.yaml | 4 +++- .../realtime-heatmap/helm/templates/streams-config.yaml | 4 +++- applications/realtime-heatmap/helm/values.yaml | 2 ++ 23 files changed, 53 insertions(+), 8 deletions(-) diff --git a/applications/audience-analytics/README.md b/applications/audience-analytics/README.md index 30a203d5..6ca33485 100644 --- a/applications/audience-analytics/README.md +++ b/applications/audience-analytics/README.md @@ -1,4 +1,5 @@ ```text +SPDX-License-Identifier: Apache-2.0 Copyright (c) 2021 Kibernetika, Inc. All rights reserved. ``` diff --git a/applications/audience-analytics/helm/Chart.yaml b/applications/audience-analytics/helm/Chart.yaml index f545691a..ee9da3d5 100644 --- a/applications/audience-analytics/helm/Chart.yaml +++ b/applications/audience-analytics/helm/Chart.yaml @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright (c) 2021 Kibernetika, Inc. All rights reserved. Description: Audience exploring system Engine: gotpl Home: https://kibernetika.ai @@ -6,7 +8,7 @@ Keywords: - Audience - Kibernetika Maintainers: -- Email: vgrishin@kibernetika.ai - Name: Vadim Grishin +- Email: nmahotkin@kibernetika.ai + Name: Nikolay Mahotkin Name: audience Version: 1.0.0 diff --git a/applications/audience-analytics/helm/templates/api-deploy.yaml b/applications/audience-analytics/helm/templates/api-deploy.yaml index 5f143d0f..6d7f8db1 100644 --- a/applications/audience-analytics/helm/templates/api-deploy.yaml +++ b/applications/audience-analytics/helm/templates/api-deploy.yaml @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright (c) 2021 Kibernetika, Inc. All rights reserved. apiVersion: apps/v1 kind: Deployment metadata: diff --git a/applications/audience-analytics/helm/templates/api-pvc.yaml b/applications/audience-analytics/helm/templates/api-pvc.yaml index bd58fb03..bcced7d7 100644 --- a/applications/audience-analytics/helm/templates/api-pvc.yaml +++ b/applications/audience-analytics/helm/templates/api-pvc.yaml @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright (c) 2021 Kibernetika, Inc. All rights reserved. kind: PersistentVolumeClaim apiVersion: v1 metadata: diff --git a/applications/audience-analytics/helm/templates/api-service.yaml b/applications/audience-analytics/helm/templates/api-service.yaml index 0a50bc7d..f7e6f285 100644 --- a/applications/audience-analytics/helm/templates/api-service.yaml +++ b/applications/audience-analytics/helm/templates/api-service.yaml @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright (c) 2021 Kibernetika, Inc. All rights reserved. apiVersion: v1 kind: Service metadata: diff --git a/applications/audience-analytics/helm/templates/db-deploy.yaml b/applications/audience-analytics/helm/templates/db-deploy.yaml index 79d71755..b67a683b 100644 --- a/applications/audience-analytics/helm/templates/db-deploy.yaml +++ b/applications/audience-analytics/helm/templates/db-deploy.yaml @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright (c) 2021 Kibernetika, Inc. All rights reserved. apiVersion: apps/v1 kind: Deployment metadata: diff --git a/applications/audience-analytics/helm/templates/db-pvc.yaml b/applications/audience-analytics/helm/templates/db-pvc.yaml index ff302bdf..34a26764 100644 --- a/applications/audience-analytics/helm/templates/db-pvc.yaml +++ b/applications/audience-analytics/helm/templates/db-pvc.yaml @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright (c) 2021 Kibernetika, Inc. All rights reserved. kind: PersistentVolumeClaim apiVersion: v1 metadata: diff --git a/applications/audience-analytics/helm/templates/db-service.yaml b/applications/audience-analytics/helm/templates/db-service.yaml index 1f02998e..c17a7961 100644 --- a/applications/audience-analytics/helm/templates/db-service.yaml +++ b/applications/audience-analytics/helm/templates/db-service.yaml @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright (c) 2021 Kibernetika, Inc. All rights reserved. apiVersion: v1 kind: Service metadata: diff --git a/applications/audience-analytics/helm/templates/images-pvc.yaml b/applications/audience-analytics/helm/templates/images-pvc.yaml index d26e3f93..85ac1b6e 100644 --- a/applications/audience-analytics/helm/templates/images-pvc.yaml +++ b/applications/audience-analytics/helm/templates/images-pvc.yaml @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright (c) 2021 Kibernetika, Inc. All rights reserved. kind: PersistentVolumeClaim apiVersion: v1 metadata: diff --git a/applications/audience-analytics/helm/templates/ingress-tls.yaml b/applications/audience-analytics/helm/templates/ingress-tls.yaml index 950bdc91..eb27babd 100644 --- a/applications/audience-analytics/helm/templates/ingress-tls.yaml +++ b/applications/audience-analytics/helm/templates/ingress-tls.yaml @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright (c) 2021 Kibernetika, Inc. All rights reserved. apiVersion: extensions/v1beta1 kind: Ingress metadata: diff --git a/applications/audience-analytics/helm/templates/requester-role.yaml b/applications/audience-analytics/helm/templates/requester-role.yaml index a2403a84..8412985f 100644 --- a/applications/audience-analytics/helm/templates/requester-role.yaml +++ b/applications/audience-analytics/helm/templates/requester-role.yaml @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright (c) 2021 Kibernetika, Inc. All rights reserved. {{- if .Values.openness.enabled }} --- apiVersion: v1 @@ -43,4 +45,4 @@ data: "Signer": "openness.org/certsigner", "WaitTimeout": "5m" } -{{- end }} \ No newline at end of file +{{- end }} diff --git a/applications/audience-analytics/helm/templates/ui-deploy.yaml b/applications/audience-analytics/helm/templates/ui-deploy.yaml index 074df37b..675c3724 100644 --- a/applications/audience-analytics/helm/templates/ui-deploy.yaml +++ b/applications/audience-analytics/helm/templates/ui-deploy.yaml @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright (c) 2021 Kibernetika, Inc. All rights reserved. apiVersion: apps/v1 kind: Deployment metadata: diff --git a/applications/audience-analytics/helm/templates/ui-service.yaml b/applications/audience-analytics/helm/templates/ui-service.yaml index 1902735c..2066d981 100644 --- a/applications/audience-analytics/helm/templates/ui-service.yaml +++ b/applications/audience-analytics/helm/templates/ui-service.yaml @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright (c) 2021 Kibernetika, Inc. All rights reserved. apiVersion: v1 kind: Service metadata: diff --git a/applications/audience-analytics/helm/values.yaml b/applications/audience-analytics/helm/values.yaml index 5e35a8d3..2f9cc2d4 100644 --- a/applications/audience-analytics/helm/values.yaml +++ b/applications/audience-analytics/helm/values.yaml @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright (c) 2021 Kibernetika, Inc. All rights reserved. api: service: type: NodePort diff --git a/applications/realtime-heatmap/README.md b/applications/realtime-heatmap/README.md index 1c3d4030..17ece6c9 100644 --- a/applications/realtime-heatmap/README.md +++ b/applications/realtime-heatmap/README.md @@ -1,4 +1,5 @@ ```text +SPDX-License-Identifier: Apache-2.0 Copyright (c) 2021 Kibernetika, Inc. All rights reserved. ``` diff --git a/applications/realtime-heatmap/helm/Chart.yaml b/applications/realtime-heatmap/helm/Chart.yaml index b6e00dac..2f204de8 100644 --- a/applications/realtime-heatmap/helm/Chart.yaml +++ b/applications/realtime-heatmap/helm/Chart.yaml @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright (c) 2021 Kibernetika, Inc. All rights reserved. Description: Realtime person heatmap Engine: gotpl Home: http://kuberlab.com diff --git a/applications/realtime-heatmap/helm/templates/NOTES.txt b/applications/realtime-heatmap/helm/templates/NOTES.txt index 30f38234..a67331e9 100644 --- a/applications/realtime-heatmap/helm/templates/NOTES.txt +++ b/applications/realtime-heatmap/helm/templates/NOTES.txt @@ -1,3 +1,6 @@ +SPDX-License-Identifier: Apache-2.0 +Copyright (c) 2021 Kibernetika, Inc. All rights reserved. + Thank you for installing {{ .Chart.Name }}. Your release is named {{ .Release.Name }}. diff --git a/applications/realtime-heatmap/helm/templates/heatmap-deploy.yaml b/applications/realtime-heatmap/helm/templates/heatmap-deploy.yaml index 15ced01d..e2ed911d 100644 --- a/applications/realtime-heatmap/helm/templates/heatmap-deploy.yaml +++ b/applications/realtime-heatmap/helm/templates/heatmap-deploy.yaml @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright (c) 2021 Kibernetika, Inc. All rights reserved. apiVersion: apps/v1 kind: Deployment metadata: @@ -130,4 +132,4 @@ spec: name: http - containerPort: 1935 protocol: TCP - name: rtmp \ No newline at end of file + name: rtmp diff --git a/applications/realtime-heatmap/helm/templates/heatmap-svc.yaml b/applications/realtime-heatmap/helm/templates/heatmap-svc.yaml index 7b9afc76..fc32b69c 100644 --- a/applications/realtime-heatmap/helm/templates/heatmap-svc.yaml +++ b/applications/realtime-heatmap/helm/templates/heatmap-svc.yaml @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright (c) 2021 Kibernetika, Inc. All rights reserved. apiVersion: v1 kind: Service metadata: @@ -18,4 +20,4 @@ spec: name: rtmp selector: app: {{ .Values.openness.heatmapId }} - vendor: kibernetika \ No newline at end of file + vendor: kibernetika diff --git a/applications/realtime-heatmap/helm/templates/ingress.yaml b/applications/realtime-heatmap/helm/templates/ingress.yaml index 70596497..a5cdb096 100644 --- a/applications/realtime-heatmap/helm/templates/ingress.yaml +++ b/applications/realtime-heatmap/helm/templates/ingress.yaml @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright (c) 2021 Kibernetika, Inc. All rights reserved. {{- if .Values.ingress.enabled -}} {{- $httpPort := .Values.service.http.port -}} {{- $rtmpPort := .Values.service.rtmp.port -}} @@ -39,4 +41,4 @@ spec: servicePort: {{ $httpPort }} {{- end }} {{- end }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/applications/realtime-heatmap/helm/templates/requester-role.yaml b/applications/realtime-heatmap/helm/templates/requester-role.yaml index a3dbb66c..1dc71460 100644 --- a/applications/realtime-heatmap/helm/templates/requester-role.yaml +++ b/applications/realtime-heatmap/helm/templates/requester-role.yaml @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright (c) 2021 Kibernetika, Inc. All rights reserved. {{- if .Values.openness.enabled }} --- apiVersion: v1 @@ -43,4 +45,4 @@ data: "Signer": "openness.org/certsigner", "WaitTimeout": "5m" } -{{- end }} \ No newline at end of file +{{- end }} diff --git a/applications/realtime-heatmap/helm/templates/streams-config.yaml b/applications/realtime-heatmap/helm/templates/streams-config.yaml index f5edc241..48e95107 100644 --- a/applications/realtime-heatmap/helm/templates/streams-config.yaml +++ b/applications/realtime-heatmap/helm/templates/streams-config.yaml @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright (c) 2021 Kibernetika, Inc. All rights reserved. apiVersion: v1 data: "streams.json": | @@ -119,4 +121,4 @@ data: } kind: ConfigMap metadata: - name: streams \ No newline at end of file + name: streams diff --git a/applications/realtime-heatmap/helm/values.yaml b/applications/realtime-heatmap/helm/values.yaml index 6ce5e06f..50389e8a 100644 --- a/applications/realtime-heatmap/helm/values.yaml +++ b/applications/realtime-heatmap/helm/values.yaml @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright (c) 2021 Kibernetika, Inc. All rights reserved. Image: Name: kuberlab/realtimeheatmap Tag: 1.0.4 From abf9bfd8da1e2a09bde6b51466115b859ead37c7 Mon Sep 17 00:00:00 2001 From: Nikolay Mahotkin Date: Wed, 31 Mar 2021 12:23:55 +0400 Subject: [PATCH 3/4] Fix streams config --- .../helm/templates/heatmap-deploy.yaml | 11 +- .../helm/templates/streams-config.yaml | 124 ------------------ 2 files changed, 2 insertions(+), 133 deletions(-) delete mode 100644 applications/realtime-heatmap/helm/templates/streams-config.yaml diff --git a/applications/realtime-heatmap/helm/templates/heatmap-deploy.yaml b/applications/realtime-heatmap/helm/templates/heatmap-deploy.yaml index e2ed911d..c759bd98 100644 --- a/applications/realtime-heatmap/helm/templates/heatmap-deploy.yaml +++ b/applications/realtime-heatmap/helm/templates/heatmap-deploy.yaml @@ -26,12 +26,8 @@ spec: - key: vcac-pool operator: Exists {{- end }} - volumes: - - configMap: - defaultMode: 420 - name: streams - name: kstreams {{- if .Values.openness.enabled }} + volumes: - name: certs emptyDir: {} - name: ca-certrequester @@ -76,11 +72,8 @@ spec: {{- end }} containers: - name: edge - volumeMounts: - - mountPath: /data.json - name: kstreams - subPath: streams.json {{- if .Values.openness.enabled }} + volumeMounts: - name: certs mountPath: /root/certs/ {{- end }} diff --git a/applications/realtime-heatmap/helm/templates/streams-config.yaml b/applications/realtime-heatmap/helm/templates/streams-config.yaml deleted file mode 100644 index 48e95107..00000000 --- a/applications/realtime-heatmap/helm/templates/streams-config.yaml +++ /dev/null @@ -1,124 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2021 Kibernetika, Inc. All rights reserved. -apiVersion: v1 -data: - "streams.json": | - { - "keys": [ - { - "key": "stream1", - "output": "mjpg", - "input": "rtmp://127.0.0.1/live/stream1", - "description": null, - "params": {} - }, - { - "key": "stream2", - "output": "mjpg", - "input": "rtmp://127.0.0.1/live/stream2", - "description": null, - "params": {} - }, - { - "key": "stream3", - "output": "mjpg", - "input": "rtmp://127.0.0.1/live/stream3", - "description": null, - "params": {} - }, - { - "key": "stream4", - "output": "mjpg", - "input": "rtmp://127.0.0.1/live/stream4", - "description": null, - "params": {} - }, - { - "key": "stream5", - "output": "mjpg", - "input": "rtmp://127.0.0.1/live/stream5", - "description": null, - "params": {} - }, - { - "key": "stream6", - "output": "mjpg", - "input": "rtmp://127.0.0.1/live/stream6", - "description": null, - "params": {} - }, - { - "key": "stream7", - "output": "mjpg", - "input": "rtmp://127.0.0.1/live/stream7", - "description": null, - "params": {} - }, - { - "key": "stream8", - "output": "mjpg", - "input": "rtmp://127.0.0.1/live/stream8", - "description": null, - "params": {} - }, - { - "key": "stream9", - "output": "mjpg", - "input": "rtmp://127.0.0.1/live/stream9", - "description": null, - "params": {} - }, - { - "key": "stream10", - "output": "mjpg", - "input": "rtmp://127.0.0.1/live/stream10", - "description": null, - "params": {} - }, - { - "key": "stream11", - "output": "mjpg", - "input": "rtmp://127.0.0.1/live/stream11", - "description": null, - "params": {} - }, - { - "key": "stream12", - "output": "mjpg", - "input": "rtmp://127.0.0.1/live/stream12", - "description": null, - "params": {} - }, - { - "key": "stream13", - "output": "mjpg", - "input": "rtmp://127.0.0.1/live/stream13", - "description": null, - "params": {} - }, - { - "key": "stream14", - "output": "mjpg", - "input": "rtmp://127.0.0.1/live/stream14", - "description": null, - "params": {} - }, - { - "key": "stream15", - "output": "mjpg", - "input": "rtmp://127.0.0.1/live/stream15", - "description": null, - "params": {} - }, - { - "key": "stream16", - "output": "mjpg", - "input": "rtmp://127.0.0.1/live/stream16", - "description": null, - "params": {} - } - ] - } -kind: ConfigMap -metadata: - name: streams From 6a8ec01b04d05e4150c1ceabc3c74172d3dee82d Mon Sep 17 00:00:00 2001 From: Nikolay Mahotkin Date: Thu, 8 Apr 2021 13:38:28 +0400 Subject: [PATCH 4/4] Update OpenNESS version --- applications/audience-analytics/README.md | 2 +- applications/realtime-heatmap/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/applications/audience-analytics/README.md b/applications/audience-analytics/README.md index 6ca33485..4dd5bc32 100644 --- a/applications/audience-analytics/README.md +++ b/applications/audience-analytics/README.md @@ -38,7 +38,7 @@ Pre Requisites --- The application has been tested on the following software, which is also required: -* [OpenNESS](https://github.com/open-ness/specs) Network Edge v20.12 +* [OpenNESS](https://github.com/open-ness/specs) Network Edge v20.12.02 * Kubernetes v1.18.4 * Helm v3.1.2 * Installed [nginx-ingress](https://kubernetes.github.io/ingress-nginx/deploy/#using-helm) controller in cluster with nodePort diff --git a/applications/realtime-heatmap/README.md b/applications/realtime-heatmap/README.md index 17ece6c9..d897c827 100644 --- a/applications/realtime-heatmap/README.md +++ b/applications/realtime-heatmap/README.md @@ -40,7 +40,7 @@ Pre Requisites --- The application has been tested on the following software, which is also required: -* [OpenNESS](https://github.com/open-ness/specs) Network Edge v20.12 +* [OpenNESS](https://github.com/open-ness/specs) Network Edge v20.12.02 * Kubernetes v1.18.4 * Helm v3.1.2