Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
4961a9e
Merge pull request #234 from huangjiafengx/dev_hjf
LewisLiuPub Sep 23, 2022
7fca4fb
Adding the jenkinsfile for galactic branch
huangjiafengx Sep 23, 2022
ebcdc60
Updating the Jenkinsfile for PR test
huangjiafengx Sep 26, 2022
5cbe980
Merge pull request #235 from huangjiafengx/dev_hjf
LewisLiuPub Sep 26, 2022
4df6af5
Enable environment information for email.
huangjiafengx Sep 29, 2022
472c8d6
Merge pull request #236 from huangjiafengx/dev_hjf_env
LewisLiuPub Sep 29, 2022
65346db
Upgrade Code to support OpenVINO API2.0 (ver 2022.1/2)
fantao015 Nov 16, 2022
3f3a62a
add dockerfile and instruction (#247)
ChloeWu1 Dec 6, 2022
526c61b
Add the pipeline of segmentation_maskrcnn (#249)
ChloeWu1 Dec 6, 2022
3403405
Update ros2 doc for quick start (#248)
ChloeWu1 Dec 6, 2022
00d9a63
fix vehicle attribs and license plate (#252)
fantao015 Dec 13, 2022
53e7200
Enable klocwork checking for Jenkins CI (#250)
huangjiafengx Dec 13, 2022
ccd1aed
Update Documents and related build files (#253)
ChloeWu1 Dec 22, 2022
ea62fa6
Support yolov5n (#256)
ChloeWu1 Dec 31, 2022
3f2a295
Fixing the bug of conflict resources for Jenkins CI (#257)
huangjiafengx Dec 31, 2022
ee8709a
rename package for release
ChloeWu1 Jan 3, 2023
77dedc1
rename to openvino_node
ChloeWu1 Jan 5, 2023
c336e63
disable face reidentification pipeline
ChloeWu1 Feb 6, 2023
69245bf
rename package for release (#258)
ChloeWu1 Feb 14, 2023
b6ddd46
fix merging errors after renaming package.
LewisLiuPub Feb 14, 2023
e98846e
Merge branch 'ChloeWu1-disable_face_reidentification_pipeline' into ros2
LewisLiuPub Feb 14, 2023
fdaeafe
Update the openvino2022.1 to 2022.3 for the docker (#264)
huangjiafengx Feb 15, 2023
065b5f1
Enable GitHub action ci (#267)
huangjiafengx Mar 8, 2023
8e68092
Setting the version for XTestRunner update. (#268)
huangjiafengx Mar 10, 2023
a072b84
Fix segmentation (#269)
LewisLiuPub Mar 10, 2023
94f5111
Use object_msgs instead of openvino_people_msgs (#265)
LewisLiuPub Mar 21, 2023
c1dd0a7
Enable segmentation and yolov5 for github action. (#271)
huangjiafengx Mar 22, 2023
8fab6bc
Update the Document for openvino version (#272)
huangjiafengx Mar 27, 2023
eb31758
fix merge issues master-->ros2
LewisLiuPub Mar 28, 2023
58a51c4
Enable ci for master (#274)
LewisLiuPub Apr 6, 2023
994c2fe
Removing the picture no using. (#277)
huangjiafengx Apr 21, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
52 changes: 43 additions & 9 deletions .ci_local_test/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,62 @@ pipeline {
environment {
// Test_Server is the local test machine.
Test_Server = "robotics-testNUC11"
WORKSPACE_PATH = "/home/intel/ros2_openvino_toolkit"
Test_WORKSPACE = "/home/intel/ros2_openvino_toolkit_test"
}
stages {
stage('Test Ros2 Galatic') {
stage('Check The Conflict') {
steps {
script {
def flag = sh script: "ssh intel@$Test_Server 'cd $WORKSPACE_PATH && docker images | grep ros2_openvino_test'", returnStatus: true
if (flag == 0) {
docker rmi -f ros2_openvino_test
}
def test_result = sh script: "ssh intel@$Test_Server 'cd $WORKSPACE_PATH && ./self_host_test_ros2_openvino.sh '", returnStatus: true
sh script: "ssh intel@$Test_Server 'cd $Test_WORKSPACE && ./check_conflict.sh'", returnStatus: true
echo "no conflict, the task continue"
}
}
}
stage('Get The env') {
steps {
script {
// rm the old env
sh script: "ssh intel@$Test_Server 'rm -rf $Test_WORKSPACE/env'", returnStatus: true
// get new env
sh script: "export | tee -a env", returnStatus: true
sh script: "scp -r env intel@$Test_Server:$Test_WORKSPACE", returnStatus: true
}
}
}
stage('Moving The Code To Test Machine') {
steps {
script {
sh script: "ssh intel@$Test_Server 'rm -rf $Test_WORKSPACE/ros2_openvino_toolkit'", returnStatus: true
sh script: "scp -r $WORKSPACE intel@$Test_Server:$Test_WORKSPACE/ros2_openvino_toolkit", returnStatus: true
// sh script: "ssh intel@$Test_Server 'docker cp $Test_WORKSPACE/ros2_openvino_toolkit:/root/catkin_ws/src'", returnStatus: true
}
}
}
stage('Klocwork Code check') {
steps {
script {
echo 'klocwork code check'
sh script: "sudo docker cp $WORKSPACE klocwork_test:/home/intel/catkin_ws/src/ros2_openvino_toolkit", returnStatus: true
sh script: "sudo docker exec -i klocwork_test bash -c 'source ~/.bashrc && cd catkin_ws && ./klocwork_scan.sh'", returnStatus: true
}

}
}
stage('The Ros2_openvino container run') {
steps {
script {
def test_result = sh script: "ssh intel@$Test_Server 'cd $Test_WORKSPACE && ./self_container_ros2_openvino_test.sh '", returnStatus: true
if (test_result == 0) {
echo "test pass"
} else {
echo "test fail"
exit -1
}

}

}
}

}

}
68 changes: 68 additions & 0 deletions .ci_local_test/ros2_openvino_toolkit_test/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# ros2 openvino toolkit env master f1b1ca4d914186a1881b87f103be9c6e910c9d80

ARG ROS_PRE_INSTALLED_PKG
FROM osrf/ros:${ROS_PRE_INSTALLED_PKG}
ARG VERSION

# setting proxy env --option
# If needed, enable the below ENV setting by correct proxies.
# ENV HTTP_PROXY="your_proxy"
# ENV HTTPS_PROXY="your_proxy"
# ENV FTP_PROXY="your_proxy"

# author information
LABEL author="Jiawei Wu <[email protected]>"

# default shell type
SHELL ["/bin/bash", "-c"]

# ignore the warning
ARG DEBIAN_FRONTEND=noninteractive
ARG APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1
RUN apt-get update && apt-get install --assume-yes apt-utils

# install openvino 2022.3
# https://docs.openvino.ai/2022.3/openvino_docs_install_guides_installing_openvino_apt.html
RUN apt update && apt install --assume-yes curl wget gnupg2 lsb-release
RUN wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB && \
apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB && echo "deb https://apt.repos.intel.com/openvino/2022 focal main" | tee /etc/apt/sources.list.d/intel-openvino-2022.list
RUN apt update && apt-cache search openvino && apt install -y openvino-2022.3.0

# install librealsense2
RUN apt-get install -y --no-install-recommends \
software-properties-common
# https://github.com/IntelRealSense/librealsense/blob/master/doc/distribution_linux.md
# Make sure you set http-proxy in below commands if your environment needs.
# RUN apt-key adv --keyserver-options http-proxy=your_proxy --keyserver keys.gnupg.net --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE || apt-key adv --keyserver-options http-proxy=your_proxy --keyserver hkp://keyserver.ubuntu.com:80 --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE || apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE
RUN add-apt-repository "deb https://librealsense.intel.com/Debian/apt-repo $(lsb_release -cs) main" -u \
&& apt-get install -y --no-install-recommends \
librealsense2-dkms \
librealsense2-utils \
librealsense2-dev \
librealsense2-dbg \
libgflags-dev \
libboost-all-dev \
&& rm -rf /var/lib/apt/lists/*

# other dependencies
RUN apt-get update && apt-get install -y python3-pip && python3 -m pip install -U \
numpy \
networkx \
pyyaml \
requests \
&& apt-get install -y --no-install-recommends libboost-all-dev
WORKDIR /usr/lib/x86_64-linux-gnu
RUN pip install --upgrade pip
RUN pip install openvino-dev[tensorflow2]==2022.3

# build ros2 openvino toolkit
WORKDIR /root
RUN mkdir -p catkin_ws/src
WORKDIR /root/catkin_ws/src
RUN git init && git clone https://github.com/intel/ros2_object_msgs.git \
&& git clone -b ros2 https://github.com/intel/ros2_openvino_toolkit.git
RUN apt-get install ros-${VERSION}-diagnostic-updater
WORKDIR /root/catkin_ws
RUN source /opt/ros/${VERSION}/setup.bash && colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release

42 changes: 42 additions & 0 deletions .ci_local_test/ros2_openvino_toolkit_test/docker_run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/bash

export DISPLAY=:0

export work_dir=$PWD


function run_container() {

docker images | grep ros2_openvino_docker

if [ $? -eq 0 ]
then
echo "the image of ros2_openvino_docker:01 existence"
docker rmi -f ros2_openvino_docker:01
fi

docker ps -a | grep ros2_openvino_container
if [ $? -eq 0 ]
then
docker rm -f ros2_openvino_container
fi
# Using jenkins server ros2_openvino_toolkit code instead of git clone code.
cd $work_dir && sed -i '/ros2_openvino_toolkit.git/d' Dockerfile
# remove the "\"
cd $work_dir && sed -i 's#ros2_object_msgs.git \\#ros2_object_msgs.git#' Dockerfile
# add the jpg for test.
cd $work_dir && sed -i '$i COPY jpg /root/jpg' Dockerfile

cd $work_dir && docker build --build-arg ROS_PRE_INSTALLED_PKG=galactic-desktop --build-arg VERSION=galactic -t ros2_openvino_docker:01 .
docker run -i --privileged=true --device=/dev/dri -v $work_dir/ros2_openvino_toolkit:/root/catkin_ws/src/ros2_openvino_toolkit -v /tmp/.X11-unix:/tmp/.X11-unix -v $HOME/.Xauthority:/root/.Xauthority -e GDK_SCALE -v $work_dir/test_cases:/root/test_cases --name ros2_openvino_container ros2_openvino_docker:01 bash -c "cd /root/test_cases && ./run.sh galactic"

}

run_container
if [ $? -ne 0 ]
then
echo "Test fail"
exit -1
fi


Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions .ci_local_test/ros2_openvino_toolkit_test/test_cases/config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#/bin/bash

if [[ $1 == '' ]]
then
export ros2_branch=galactic
else
export ros2_branch=$1
fi

export dynamic_vino_sample=/root/catkin_ws/install/openvino_node/share/openvino_node


source /opt/ros/$ros2_branch/setup.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

mkdir -p /opt/openvino_toolkit/models
#apt install -y python-pip
apt install -y python3.8-venv
cd ~ && python3 -m venv openvino_env && source openvino_env/bin/activate
python -m pip install --upgrade pip
pip install openvino-dev[tensorflow2,mxnet,caffe]


#Download the optimized Intermediate Representation (IR) of model (execute once)
cd ~/catkin_ws/src/ros2_openvino_toolkit/data/model_list && omz_downloader --list download_model.lst -o /opt/openvino_toolkit/models/

cd ~/catkin_ws/src/ros2_openvino_toolkit/data/model_list && omz_converter --list convert_model.lst -d /opt/openvino_toolkit/models/ -o /opt/openvino_toolkit/models/convert


#Copy label files (execute once)
cp ~/catkin_ws/src/ros2_openvino_toolkit/data/labels/face_detection/face-detection-adas-0001.labels /opt/openvino_toolkit/models/intel/face-detection-adas-0001/FP32/
cp ~/catkin_ws/src/ros2_openvino_toolkit/data/labels/face_detection/face-detection-adas-0001.labels /opt/openvino_toolkit/models/intel/face-detection-adas-0001/FP16/
cp ~/catkin_ws/src/ros2_openvino_toolkit/data/labels/emotions-recognition/FP32/emotions-recognition-retail-0003.labels /opt/openvino_toolkit/models/intel/emotions-recognition-retail-0003/FP32/
cp ~/catkin_ws/src/ros2_openvino_toolkit/data/labels/object_segmentation/frozen_inference_graph.labels /opt/openvino_toolkit/models/intel/semantic-segmentation-adas-0001/FP32/
cp ~/catkin_ws/src/ros2_openvino_toolkit/data/labels/object_segmentation/frozen_inference_graph.labels /opt/openvino_toolkit/models/intel/semantic-segmentation-adas-0001/FP16/
cp ~/catkin_ws/src/ros2_openvino_toolkit/data/labels/object_detection/vehicle-license-plate-detection-barrier-0106.labels /opt/openvino_toolkit/models/intel/vehicle-license-plate-detection-barrier-0106/FP32

mkdir -p /opt/openvino_toolkit/models/public/mask_rcnn_inception_resnet_v2_atrous_coco/FP16/
cp /opt/openvino_toolkit/models/convert/public/mask_rcnn_inception_resnet_v2_atrous_coco/FP16/* /opt/openvino_toolkit/models/public/mask_rcnn_inception_resnet_v2_atrous_coco/FP16/

cd /root/test_cases/ && ./yolov5_model_download.sh

34 changes: 34 additions & 0 deletions .ci_local_test/ros2_openvino_toolkit_test/test_cases/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash

export ros2_branch=$1
if [[ $1 == '' ]]
then
export ros2_branch=galactic
else
export ros2_branch=$1
fi
source /root/test_cases/config.sh $ros2_branch

cd /root/catkin_ws && colcon build --symlink-install
cd /root/catkin_ws && source ./install/local_setup.bash

apt-get update
# apt-get install -y ros-$ros2_branch-diagnostic-updater
apt-get install python3-defusedxml
apt-get install -y python3-pip
pip3 install XTestRunner==1.5.0

cd /root/test_cases && ./ros2_openvino_tool_model_download.sh
mkdir -p /root/test_cases/log
echo "===cat pipeline_people_ci.yaml"
cat /root/catkin_ws/install/openvino_node/share/openvino_node/param/pipeline_people_ci.yaml

cd /root/test_cases/unittest && python3 run_all.py
result=$?
#echo "cat segmentation maskrcnn"
#cat /root/test_cases/log/pipeline_segmentation_maskrcnn_test_ci.log
if [ $result -ne 0 ]
then
exit -1
fi

Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/usr/opt/python3
import unittest
from test_cases import Test_Cases
from XTestRunner import HTMLTestRunner

def main():

suite = unittest.TestSuite()

all_cases = [Test_Cases('test_1_pipeline_people_ci'),
Test_Cases('test_2_pipeline_reidentification_ci'),
Test_Cases('test_3_pipeline_image_ci'),
Test_Cases('test_4_pipeline_segmentation_ci'),
Test_Cases('test_5_pipeline_vehicle_detection_ci'),
Test_Cases('test_6_pipeline_person_attributes_ci'),
Test_Cases('test_7_pipeline_segmentation_image_ci'),
Test_Cases('test_8_pipeline_object_yolo_ci')]
suite.addTests(all_cases)

with (open('./result.html', 'wb')) as fp:
runner = HTMLTestRunner(
stream=fp,
title='ROS2 Openvino Test Report',
description='Test ROS2-galactic openvino all cases',
language='en',
)
result = runner.run(
testlist=suite,
rerun=1,
save_last_run=False
)

failure_count = len(all_cases) - result.success_count
print(f"all count: {len(all_cases)}")
print(f"success count: {result.success_count}")
print(f"failure count: {failure_count}")
if result.success_count == len(all_cases) and failure_count == 0:
print(f"Test ALL PASS")
else:
print(f"Test FAIL")
exit(-1)

if __name__=="__main__":
main()

Loading