Skip to content

Commit 412e60c

Browse files
adding chart evam-0.7.2
1 parent 0e2dd37 commit 412e60c

14 files changed

+672
-0
lines changed

charts/evam-0.7.2/.helmignore

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/

charts/evam-0.7.2/Chart.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
apiVersion: v2
2+
appVersion: 0.7.2
3+
description: A Helm chart for deploying Edge Video Analytics Microservice and Mosquitto
4+
Server in k8s
5+
name: evam
6+
type: application
7+
version: 0.7.2

charts/evam-0.7.2/Jenkinsfile

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 = '628cb03a254262002bf3d5e7' // ID associated with the Service Layer
12+
HELMCHART_NAME = 'Edge_Video_Analytics_Helm_Chart' // Name which goes to Service Layer
13+
HELMCHART_FILE_NAME = 'Edge_Video_Analytics_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+
}

charts/evam-0.7.2/LICENSE

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.

charts/evam-0.7.2/README.md

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
# Edge Video Analytics Helm chart
2+
3+
This chart can be used to deploy [Edge Video Analyics Microservice](https://www.intel.com/content/www/us/en/developer/articles/technical/video-analytics-service.html) on Kubernetes cluster using Helm CLI.
4+
5+
## Usage
6+
7+
### Pre-requisite.
8+
9+
1. Clone this [repo](https://github.com/intel/edge-video-analytics-microservice).
10+
2. Run the following command to make the following files executable:
11+
12+
```sh
13+
chmod +x tools/model_downloader/model_downloader.sh docker/run.sh
14+
```
15+
16+
3. Download the required models. From the cloned repo, run the following command:
17+
18+
```sh
19+
./tools/model_downloader/model_downloader.sh --model-list <Path to model-list.yml>
20+
```
21+
22+
4. After downloading the models, you will have the `models` directory in the base folder. Refer to the following:
23+
24+
```json
25+
models/
26+
├── action_recognition
27+
├── audio_detection
28+
├── emotion_recognition
29+
├── face_detection_retail
30+
├── object_classification
31+
└── object_detection
32+
```
33+
5. Copy the `models` , `pipelines` and `resources` folder to `/opt/intel/evam/` on the kubernetes worker nodes.
34+
35+
6. Install a [Kubernetes](https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/create-cluster-kubeadm/) cluster.
36+
37+
7. Install [Helm](https://helm.sh) CLI. Please refer to Helm's [documentation](https://helm.sh/docs/) to get started.
38+
39+
### Deployment
40+
41+
- Once the prerequisites are completed properly, install the chart as follows:
42+
43+
```console
44+
helm install evam ./chart/
45+
```
46+
- Check the status of deployed application:
47+
48+
Command:-
49+
50+
```console
51+
helm ls
52+
```
53+
54+
Output:-
55+
56+
```console
57+
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
58+
evam default 1 2022-05-16 16:30:09.118680429 +0530 IST deployed evam-0.7.2 0.7.2
59+
```
60+
Command:-
61+
62+
```console
63+
kubectl get pods
64+
```
65+
Output:-
66+
67+
```console
68+
NAME READY STATUS RESTARTS AGE
69+
evam-deployment-79b95cdc98-rdcdd 1/1 Running 0 3m2s
70+
mqtt-deployment-5b87d54794-8mlr6 1/1 Running 0 3m2s
71+
```
72+
73+
### Sending Pipeline Server Requests
74+
75+
- Get the IP addresses of the evam and mqtt pods running in the cluster.
76+
77+
```console
78+
kubectl get pods -o wide
79+
```
80+
81+
Sample Output:-
82+
83+
```console
84+
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
85+
evam-deployment-79b95cdc98-rdcdd 1/1 Running 0 6m11s 10.144.2.45 kubernetes-worker1 <none> <none>
86+
mqtt-deployment-5b87d54794-8mlr6 1/1 Running 0 6m11s 10.144.1.43 kubernetes-worker2 <none> <none>
87+
88+
```
89+
- From the above IPs trigger the pipeline request as below :-
90+
91+
```console
92+
curl --location -X POST 'http://10.144.2.45:8080/pipelines/object_detection/person_vehicle_bike' \
93+
--header 'Content-Type: application/json' \
94+
--data-raw '{
95+
"source": {
96+
"uri": "https://github.com/intel-iot-devkit/sample-videos/raw/master/person-bicycle-car-detection.mp4?raw=true",
97+
"type": "uri"
98+
},
99+
"destination": {
100+
"metadata": {
101+
"type": "mqtt",
102+
"host": "10.144.1.43:1883",
103+
"topic": "vaserving"
104+
}
105+
}
106+
}'
107+
```
108+
109+
- View Pipeline Results via MQTT
110+
111+
```console
112+
docker run -it --entrypoint mosquitto_sub eclipse-mosquitto:1.6 --topic vaserving -p 1883 -h 10.144.1.43
113+
```
114+
115+
116+
```console
117+
{"objects":[{"detection":{"bounding_box":{"x_max":0.0878419540822506,"x_min":0.0017804615199565887,"y_max":0.3632156252861023,"y_min":0.12948647141456604},"confidence":0.6258460283279419,"label":"vehicle","label_id":2},"h":101,"roi_type":"vehicle","w":66,"x":1,"y":56}],"resolution":{"height":432,"width":768},"source":"https://github.com/intel-iot-devkit/sample-videos/raw/master/person-bicycle-car-detection.mp4?raw=true","timestamp":49000000000}
118+
{"objects":[{"detection":{"bounding_box":{"x_max":0.0731869749724865,"x_min":0.004130329936742783,"y_max":0.35117650032043457,"y_min":0.14347273111343384},"confidence":0.6314214468002319,"label":"vehicle","label_id":2},"h":90,"roi_type":"vehicle","w":53,"x":3,"y":62}],"resolution":{"height":432,"width":768},"source":"https://github.com/intel-iot-devkit/sample-videos/raw/master/person-bicycle-car-detection.mp4?raw=true","timestamp":49083333333}
119+
{"objects":[{"detection":{"bounding_box":{"x_max":0.0626695342361927,"x_min":0.0,"y_max":0.34957605600357056,"y_min":0.14383465051651},"confidence":0.6896529197692871,"label":"vehicle","label_id":2},"h":89,"roi_type":"vehicle","w":48,"x":0,"y":62}],"resolution":{"height":432,"width":768},"source":"https://github.com/intel-iot-devkit/sample-videos/raw/master/person-bicycle-car-detection.mp4?raw=true","timestamp":49166666666}
120+
```
121+
122+
## License
123+
124+
[MIT License](../LICENSE)

charts/evam-0.7.2/evam-0.7.2.tgz

4.87 KB
Binary file not shown.

charts/evam-0.7.2/templates/NOTES.txt

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
1. Get the application URLs by running these commands:
2+
3+
kubectl get pods -o wide
4+
5+
2. Run a sample pipline on EVAM pods using the commmand below:
6+
7+
curl --location -X POST 'http://<EVAM_POD_IP>:8080/pipelines/object_detection/person_vehicle_bike' \
8+
--header 'Content-Type: application/json' \
9+
--data-raw '{
10+
"source": {
11+
"uri": "https://github.com/intel-iot-devkit/sample-videos/raw/master/person-bicycle-car-detection.mp4?raw=true",
12+
"type": "uri"
13+
},
14+
"destination": {
15+
"metadata": {
16+
"type": "mqtt",
17+
"host": "<MQTT_POD_IP>:1883",
18+
"topic": "vaserving"
19+
}
20+
}
21+
}'
22+
23+
3. Get the inference output on MQTT subscriber.
24+
25+
docker run -it --entrypoint mosquitto_sub eclipse-mosquitto:1.6 --topic vaserving -p 1883 -h <MQTT_POD_IP>
26+
27+

0 commit comments

Comments
 (0)