Introduce CI infra neurun build and test scripts (#4611)
author오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Thu, 7 Mar 2019 04:36:44 +0000 (13:36 +0900)
committer이춘석/On-Device Lab(SR)/Staff Engineer/삼성전자 <chunseok.lee@samsung.com>
Thu, 7 Mar 2019 04:36:44 +0000 (13:36 +0900)
* Introduce CI infra neurun build and test scripts

Introduce neurun build scripts
Introduce neurun cpu and acl_cl test

Signed-off-by: Hyeongseok Oh <hseok82.oh@samsung.com>
* Backend setting for acl_cl

scripts/standalone/docker_build_cross_arm_neurun.sh [new file with mode: 0755]
scripts/standalone/docker_build_cross_arm_neurun_release.sh [new file with mode: 0755]
scripts/standalone/test_arm_neurun_acl_cl.sh [new file with mode: 0755]
scripts/standalone/test_arm_neurun_cpu.sh [new file with mode: 0755]

diff --git a/scripts/standalone/docker_build_cross_arm_neurun.sh b/scripts/standalone/docker_build_cross_arm_neurun.sh
new file mode 100755 (executable)
index 0000000..82ed717
--- /dev/null
@@ -0,0 +1,45 @@
+#!/bin/bash
+
+CURRENT_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+ROOT_PATH="$CURRENT_PATH/../../"
+
+# prepare rootfs
+if [[ ! -d $ROOTFS_DIR ]]; then
+  echo "cannot find rootfs"
+  exit 1
+fi
+
+# prepare external acl binary
+if [[ ! -d $EXT_ACL_FOLDER ]]; then
+  echo "cannot find external acl binary"
+  exit 1
+fi
+
+# docker image name
+if [[ -z $DOCKER_IMAGE_NAME ]]; then
+  echo "It will use default docker image name"
+fi
+
+# Mirror server setting
+if [[ -z $EXTERNAL_DOWNLOAD_SERVER ]]; then
+  echo "It will not use mirror server"
+fi
+
+DOCKER_VOLUMES=" -v $ROOTFS_DIR:/opt/rootfs"
+DOCKER_VOLUMES+=" -v $EXT_ACL_FOLDER:/opt/acl"
+
+DOCKER_ENV_VARS=" -e TARGET_ARCH=armv7l"
+DOCKER_ENV_VARS+=" -e CROSS_BUILD=1"
+DOCKER_ENV_VARS+=" -e ROOTFS_DIR=/opt/rootfs"
+DOCKER_ENV_VARS+=" -e EXT_ACL_FOLDER=/opt/acl"
+
+pushd $ROOT_PATH > /dev/null
+
+# TODO use command instead of makefile
+CMD="export OPTIONS='-DBUILD_NEURUN=ON -DBUILD_PURE_ARM_COMPUTE=OFF' && \
+     make && \
+     make install && \
+     make build_test_suite"
+source nnfw docker-run-user bash -c "$CMD"
+
+popd > /dev/null
diff --git a/scripts/standalone/docker_build_cross_arm_neurun_release.sh b/scripts/standalone/docker_build_cross_arm_neurun_release.sh
new file mode 100755 (executable)
index 0000000..ea453e0
--- /dev/null
@@ -0,0 +1,46 @@
+#!/bin/bash
+
+CURRENT_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+ROOT_PATH="$CURRENT_PATH/../../"
+
+# prepare rootfs
+if [[ ! -d $ROOTFS_DIR ]]; then
+  echo "cannot find rootfs"
+  exit 1
+fi
+
+# prepare external acl binary
+if [[ ! -d $EXT_ACL_FOLDER ]]; then
+  echo "cannot find external acl binary"
+  exit 1
+fi
+
+# docker image name
+if [[ -z $DOCKER_IMAGE_NAME ]]; then
+  echo "It will use default docker image name"
+fi
+
+# Mirror server setting
+if [[ -z $EXTERNAL_DOWNLOAD_SERVER ]]; then
+  echo "It will not use mirror server"
+fi
+
+DOCKER_VOLUMES=" -v $ROOTFS_DIR:/opt/rootfs"
+DOCKER_VOLUMES+=" -v $EXT_ACL_FOLDER:/opt/acl"
+
+DOCKER_ENV_VARS=" -e TARGET_ARCH=armv7l"
+DOCKER_ENV_VARS+=" -e CROSS_BUILD=1"
+DOCKER_ENV_VARS+=" -e ROOTFS_DIR=/opt/rootfs"
+DOCKER_ENV_VARS+=" -e EXT_ACL_FOLDER=/opt/acl"
+DOCKER_ENV_VARS+=" -e BUILD_TYPE=release"
+
+pushd $ROOT_PATH > /dev/null
+
+# TODO use command instead of makefile
+CMD="export OPTIONS='-DBUILD_NEURUN=ON -DBUILD_PURE_ARM_COMPUTE=OFF' && \
+     make && \
+     make install && \
+     make build_test_suite"
+source nnfw docker-run-user bash -c "$CMD"
+
+popd > /dev/null
diff --git a/scripts/standalone/test_arm_neurun_acl_cl.sh b/scripts/standalone/test_arm_neurun_acl_cl.sh
new file mode 100755 (executable)
index 0000000..2655a43
--- /dev/null
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+CURRENT_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+ROOT_PATH="$CURRENT_PATH/../../"
+
+# Model download server setting
+if [[ -z $MODELFILE_SERVER ]]; then
+  echo "Need model file server setting"
+  exit 1
+fi
+
+pushd $ROOT_PATH > /dev/null
+
+export OP_BACKEND_ALLOPS=acl_cl
+
+cp -v ./Product/out/unittest/nnapi_gtest.skip.armv7l-linux.neurun ./Product/out/unittest/nnapi_gtest.skip
+source ./tests/scripts/test_driver.sh \
+        --frameworktest_list_file=tests/scripts/neurun_frameworktest_list.armv7l.acl_cl.txt \
+        --ldlibrarypath="$ROOT_PATH/Product/out/lib/neurun:$ROOT_PATH/Product/out/lib" \
+        --reportdir="$ROOT_PATH/report/acl_cl" \
+
+popd > /dev/null
diff --git a/scripts/standalone/test_arm_neurun_cpu.sh b/scripts/standalone/test_arm_neurun_cpu.sh
new file mode 100755 (executable)
index 0000000..3710d08
--- /dev/null
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+CURRENT_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+ROOT_PATH="$CURRENT_PATH/../../"
+
+# Model download server setting
+if [[ -z $MODELFILE_SERVER ]]; then
+  echo "Need model file server setting"
+  exit 1
+fi
+
+pushd $ROOT_PATH > /dev/null
+
+export OP_BACKEND_ALLOPS=cpu
+
+cp -v ./Product/out/unittest/nnapi_gtest.skip.armv7l-linux.neurun.cpu ./Product/out/unittest/nnapi_gtest.skip
+source ./tests/scripts/test_driver.sh \
+        --frameworktest_list_file=tests/scripts/neurun_frameworktest_list.armv7l.cpu.txt \
+        --ldlibrarypath="$ROOT_PATH/Product/out/lib/neurun:$ROOT_PATH/Product/out/lib" \
+        --reportdir="$ROOT_PATH/report/cpu" \
+
+popd > /dev/null