Skip to content

Commit 6d6e28b

Browse files
adding chart multimodal-data-visualization-3.0.0
1 parent 412e60c commit 6d6e28b

13 files changed

+652
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: v2
2+
appVersion: 3.0.0
3+
description: A Helm chart for deploying multimodal data visualization service in k8s
4+
name: multimodal-data-visualization
5+
type: application
6+
version: 3.0.0
Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
pipeline {
2+
3+
agent {
4+
node {
5+
label 'aws-ec2'
6+
}
7+
}
8+
9+
environment {
10+
MC_URL = 'https://esh-mc.intel.com' // API url to validate branch exists in mc
11+
HELMCHART_ID = '_' // ID associated with the Service Layer
12+
HELMCHART_NAME = 'Multimodal_Data_Visualization_Helm_Chart' // Name which goes to Service Layer
13+
HELMCHART_FILE_NAME = 'Multimodal_Data_Visualization_Helm_Chart' //Installation file name associated in the repo
14+
AWS_S3_BUCKET = 'eshs3bucket' // AWS S3 BUCKET NAME
15+
AWS_S3_REGION = 'us-west-2' // AWS REGION NAME
16+
AWS_S3_SOURCE = 'esh/jenkins' // AWS SOURCE Path for Jenkins upload
17+
AWS_S3_CRED = 'AWS_S3_Upload' // AWS Global Credentials in Jekins
18+
CURRENT_DATE = sh(script: 'date +%Y%m%d', returnStdout: true).trim()
19+
GITLAB_LOGIN = credentials('Intel-Gitlab')
20+
}
21+
22+
stages {
23+
stage('Setup') {
24+
steps {
25+
sh '''
26+
echo "--------------------------------------------"
27+
echo " Agent setup "
28+
echo "--------------------------------------------"
29+
while pgrep apt > /dev/null; do
30+
sleep 11
31+
done
32+
sudo apt-get update
33+
echo "--------------------------------------------"
34+
'''
35+
}
36+
}
37+
38+
stage('Install certs') {
39+
steps {
40+
sh '''
41+
wget https://gitlab.devtools.intel.com/dse-public/devops-scripts/-/raw/master/install-certs.sh --no-check-certificate
42+
chmod a+x install-certs.sh
43+
./install-certs.sh
44+
'''
45+
}
46+
}
47+
48+
stage('Create Package') {
49+
steps {
50+
sh '''#!/bin/bash
51+
echo "--------------------------------------------"
52+
echo " Creating ${HELMCHART_NAME} tgz"
53+
echo "--------------------------------------------"
54+
echo "Helm Chart Name: ${HELMCHART_NAME}"
55+
echo "Helm Chart ID: ${HELMCHART_ID}"
56+
echo "Helm Chart File: ${HELMCHART_FILE_NAME}"
57+
rm -rf .git* build
58+
59+
echo "-------------Copy dependencies--------------"
60+
rsync -av --exclude IntelSHA2RootChain-Base64 --exclude __MACOSX --exclude IntelSHA2RootChain-Base64.tgz --exclude IntelSHA2RootChain-Base64.zip \
61+
--exclude '*.crt' --exclude '*certs*' --exclude 'Jenkinsfile' ./ ${HELMCHART_ID}
62+
cd ${HELMCHART_ID}
63+
echo "---------------Create tgz-------------------"
64+
touch ${HELMCHART_ID}.tgz
65+
tar --exclude=${HELMCHART_ID}.tgz -zcvf ${HELMCHART_ID}.tgz .
66+
retval=$?
67+
if [ $retval -ne 0 ]; then
68+
echo "Failed create helm tgz"
69+
exit $retval
70+
fi
71+
echo "--------------------------------------------"
72+
'''
73+
}
74+
}
75+
stage('Push to S3'){
76+
steps{
77+
script {
78+
def res = "";
79+
withAWS(region:"${AWS_S3_REGION}",credentials:"${AWS_S3_CRED}") {
80+
def identity=awsIdentity();//Log AWS credentials
81+
echo "--------------------------------------------"
82+
echo " Pushing ${HELMCHART_NAME} to DAL"
83+
echo "--------------------------------------------"
84+
echo "${HELMCHART_NAME} : ${HELMCHART_ID}.tgz"
85+
86+
87+
def MC_VERSION = sh(script: "wget --server-response --method POST --timeout=0 --header 'Content-Type: application/json' \
88+
--ca-directory=/etc/ssl/certs/ --no-proxy --no-check-certificate \
89+
--body-data '{\"id\":\"'${HELMCHART_ID}'\",\"version\":\"'$GIT_BRANCH'\"}' \
90+
\${MC_URL}/helmchart/validateVersion 2>&1 | grep \"HTTP/\" | awk '{print \$2}'", returnStdout: true).trim();
91+
92+
echo "ID: $HELMCHART_ID, version: $GIT_BRANCH"
93+
94+
echo "----------------mc version is : ${}MC_VERSION ------------"
95+
96+
if ( MC_VERSION != '200' ) {
97+
echo "-------Push to S3 skipped-------"
98+
echo "--------------------------------------------"
99+
sh(script: "exit 0")
100+
}
101+
def TGZ_FILE_PATH = pwd();
102+
103+
echo TGZ_FILE_PATH;
104+
res = s3Upload(file:"${TGZ_FILE_PATH}/${HELMCHART_ID}/${HELMCHART_ID}.tgz", bucket:"${AWS_S3_BUCKET}", path:"${AWS_S3_SOURCE}/helm/${HELMCHART_ID}.tgz");
105+
}
106+
if ( res != "s3://${AWS_S3_BUCKET}/${AWS_S3_SOURCE}/helm/${HELMCHART_ID}.tgz" ) {
107+
error("AWS S3 Upload Failed.");
108+
}
109+
110+
echo "-----------Generate MD5sum------------------"
111+
def MD5SUM = sh(script: "md5sum \${HELMCHART_ID}/\${HELMCHART_ID}.tgz | cut -d ' ' -f1",returnStdout:true).trim();;
112+
if ( !MD5SUM ){
113+
error("Failed to generate md5sum")
114+
}
115+
echo "original md5sum: ${MD5SUM}"
116+
}
117+
}
118+
}
119+
stage('Update MD5Sum'){
120+
steps{
121+
script {
122+
def TGZ_FILE_PATH = pwd();
123+
124+
withAWS(region:"${AWS_S3_REGION}",credentials:"${AWS_S3_CRED}") {
125+
def identity=awsIdentity();//Log AWS credentials
126+
echo "--------------------------------------------"
127+
echo " Downloading ${HELMCHART_NAME} from S3"
128+
echo "--------------------------------------------"
129+
echo "${HELMCHART_NAME} : ${HELMCHART_ID}.tgz"
130+
131+
sh(script: "sudo mkdir -p \${TGZ_FILE_PATH}/\${HELMCHART_ID}/download",returnStdout:true);
132+
res = s3Download(file:"${TGZ_FILE_PATH}/${HELMCHART_ID}/download/${HELMCHART_ID}.tgz", bucket:"${AWS_S3_BUCKET}", path:"${AWS_S3_SOURCE}/helm/${HELMCHART_ID}.tgz", force:true)
133+
}
134+
echo "-----------Generate MD5sum------------------"
135+
def MD5SUM = sh(script: "md5sum \${HELMCHART_ID}/download/\${HELMCHART_ID}.tgz | cut -d ' ' -f1",returnStdout:true).trim();
136+
if ( !MD5SUM ){
137+
error("Failed to generate md5sum")
138+
}
139+
echo "md5sum(s3): ${MD5SUM}"
140+
141+
echo "--------------Post MD5sum-------------------"
142+
def RETVAL = sh(script: "wget --method POST --timeout=0 --header 'Content-Type: application/json' --body-data '{\"id\":\"'$HELMCHART_ID'\",\"hashValue\":\"'$MD5SUM'\"}' \${MC_URL}/helmchart/updateMD5Hash --ca-directory=/etc/ssl/certs/ --no-proxy --no-check-certificate",returnStatus:true);
143+
if ( RETVAL != 0 ) {
144+
error("Failed to post md5sum");
145+
}
146+
echo "--------------------------------------------"
147+
}
148+
}
149+
}
150+
151+
}
152+
153+
post {
154+
success {
155+
emailext(
156+
attachmentsPattern: "bandit_report.txt, pep8_output.txt",
157+
replyTo: '$DEFAULT_REPLYTO',
158+
subject: "Status of pipeline: ${currentBuild.fullDisplayName}",
159+
body: "${env.BUILD_URL} has result ${currentBuild.result}",
160+
recipientProviders: [[$class: 'DevelopersRecipientProvider']]
161+
)
162+
updateGitlabCommitStatus state: 'success'
163+
}
164+
165+
failure {
166+
emailext(
167+
replyTo: '$DEFAULT_REPLYTO',
168+
subject: "Status of pipeline: ${currentBuild.fullDisplayName}",
169+
body: "${env.BUILD_URL} has result ${currentBuild.result}",
170+
recipientProviders: [[$class: 'DevelopersRecipientProvider']]
171+
)
172+
updateGitlabCommitStatus state: 'failed'
173+
}
174+
}
175+
176+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Copyright (C) 2022 Intel Corporation
2+
SPDX-License-Identifier: MIT
3+
4+
Permission is hereby granted, free of charge, to any person obtaining a copy
5+
of this software and associated documentation files (the "Software"), to deal
6+
in the Software without restriction, including without limitation the rights
7+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
copies of the Software, and to permit persons to whom the Software is
9+
furnished to do so, subject to the following conditions:
10+
11+
The above copyright notice and this permission notice shall be included in
12+
all copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20+
SOFTWARE.
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# Multimodal Data Visualization Helm chart
2+
3+
This chart can be used to deploy [ Multimodal Data Visualization](https://www.intel.com/content/www/us/en/developer/articles/technical/multimodal-data-visualization.html) on Kubernetes cluster using Helm CLI.
4+
5+
## Usage
6+
7+
### Pre-requisite.
8+
9+
1. Install a [Kubernetes](https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/create-cluster-kubeadm/) cluster.
10+
11+
2. Install [Helm](https://helm.sh) CLI. Please refer to Helm's [documentation](https://helm.sh/docs/) to get started.
12+
13+
3. Add the system's host IP address in values.yaml file of EVAM helm chart folder.
14+
15+
4. Install [ EVAM Helm Chart](https://www.intel.com/content/www/us/en/developer/articles/technical/video-analytics-service.html) by following the steps mentioned this document under `Tutorial 4`.
16+
17+
5. Add the system's host IP address in values.yaml file of multimodal data visualization helm chart folder.
18+
19+
### Deployment
20+
21+
- Once the prerequisites are completed properly, install the chart as follows:
22+
23+
```console
24+
helm install multimodal-data-visualization ./<DownloadedChart>/
25+
```
26+
- Check the status of deployed application:
27+
28+
Command:-
29+
30+
```console
31+
helm ls
32+
```
33+
34+
Output:-
35+
36+
```console
37+
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
38+
evam default 1 2022-07-26 20:58:04.895323101 +0530 IST deployed evam-0.7.2 0.7.2
39+
multimodal-data-visualization default 1 2022-07-26 20:59:04.918583632 +0530 IST deployed multimodal-data-visualization-3.0.0 3.0.0
40+
```
41+
Command:-
42+
43+
```console
44+
kubectl get pods
45+
```
46+
Output:-
47+
48+
```console
49+
NAME READY STATUS RESTARTS AGE
50+
evam-deployment-57477d7d96-9t6xd 1/1 Running 0 4m7s
51+
mqtt-deployment-5577b74dc-k27xg 1/1 Running 0 4m7s
52+
multimodal-data-visualization-deployment-6459c7c47f-mz6lt 1/1 Running 0 3m9s
53+
multimodal-data-visualization-streaming-deployment-78fdbd8wlwpc 1/1 Running 0 3m9s
54+
```
55+
56+
### Sending Pipeline Server Requests
57+
58+
```console
59+
curl localhost:30007/pipelines/object_detection/person_vehicle_bike -X POST -H \
60+
'Content-Type: application/json' -d \
61+
'{
62+
"source": {
63+
"uri": "https://github.com/intel-iot-devkit/sample-videos/blob/master/person-bicycle-car-detection.mp4?raw=true",
64+
"type": "uri"
65+
},
66+
"destination": {
67+
"metadata": {
68+
"type": "file",
69+
"path": "/tmp/results.txt",
70+
"format": "json-lines"
71+
},
72+
"frame": {
73+
"type": "webrtc",
74+
"peer-id": "peerid_1"
75+
}
76+
}
77+
}'
78+
```
79+
### Perform the following steps to run Multimodal-Data-Visualization helm chart in EVAM mode:
80+
1. Go to http://<HOST_IP>:30000 to access Multimodal-Data-Visualization.
81+
2. On the Home Dashboard page, on the left corner, click the Dashboards icon.
82+
3. Click the Manage Dashboards tab, to view the list of all the preconfigured dashboards.
83+
4. Select Video Analytics Dashboard, to view the data from the Edge Video Analytics Microservice.
84+
5. Click the Refresh button on the webRTC Stream panel to get the streaming for running pipelines.
85+
86+
### Perform the following steps to run Multimodal-Data-Visualization helm chart in Standalone mode:
87+
88+
- Set the environment variable `MODE` in values.yaml file as empty present in Multimodal-Data-Visualization.folder.
89+
90+
```console
91+
MODE:
92+
```
93+
- install the helm chart as follows:
94+
95+
```console
96+
helm install multimodal-data-visualization ./<DownloadedChart>/
97+
```
98+
- Go to http://<HOST_IP>:30000 to access Multimodal-Data-Visualization.
99+
100+
- Select `Sample Visualization Dashboard`, to view the streaming on the Dashboard.
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "chart.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "chart.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- $name := default .Chart.Name .Values.nameOverride }}
18+
{{- if contains $name .Release.Name }}
19+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20+
{{- else }}
21+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22+
{{- end }}
23+
{{- end }}
24+
{{- end }}
25+
26+
{{/*
27+
Create chart name and version as used by the chart label.
28+
*/}}
29+
{{- define "chart.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "chart.labels" -}}
37+
helm.sh/chart: {{ include "chart.chart" . }}
38+
{{ include "chart.selectorLabels" . }}
39+
{{- if .Chart.AppVersion }}
40+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
41+
{{- end }}
42+
app.kubernetes.io/managed-by: {{ .Release.Service }}
43+
{{- end }}
44+
45+
{{/*
46+
Selector labels
47+
*/}}
48+
{{- define "chart.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "chart.name" . }}
50+
app.kubernetes.io/instance: {{ .Release.Name }}
51+
{{- end }}
52+
53+
{{/*
54+
Create the name of the service account to use
55+
*/}}
56+
{{- define "chart.serviceAccountName" -}}
57+
{{- if .Values.serviceAccount.create }}
58+
{{- default (include "chart.fullname" .) .Values.serviceAccount.name }}
59+
{{- else }}
60+
{{- default "default" .Values.serviceAccount.name }}
61+
{{- end }}
62+
{{- end }}
63+

0 commit comments

Comments
 (0)