From 184b3b2d2eff26e8cc0f73eeb8579363c2a38e7f Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EC=98=A4=ED=98=95=EC=84=9D/On-Device=20Lab=28SR=29/Staff?= =?utf8?q?=20Engineer/=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Thu, 7 Mar 2019 13:36:44 +0900 Subject: [PATCH] Introduce CI infra neurun build and test scripts (#4611) * Introduce CI infra neurun build and test scripts Introduce neurun build scripts Introduce neurun cpu and acl_cl test Signed-off-by: Hyeongseok Oh * Backend setting for acl_cl --- .../standalone/docker_build_cross_arm_neurun.sh | 45 +++++++++++++++++++++ .../docker_build_cross_arm_neurun_release.sh | 46 ++++++++++++++++++++++ scripts/standalone/test_arm_neurun_acl_cl.sh | 22 +++++++++++ scripts/standalone/test_arm_neurun_cpu.sh | 22 +++++++++++ 4 files changed, 135 insertions(+) create mode 100755 scripts/standalone/docker_build_cross_arm_neurun.sh create mode 100755 scripts/standalone/docker_build_cross_arm_neurun_release.sh create mode 100755 scripts/standalone/test_arm_neurun_acl_cl.sh create mode 100755 scripts/standalone/test_arm_neurun_cpu.sh diff --git a/scripts/standalone/docker_build_cross_arm_neurun.sh b/scripts/standalone/docker_build_cross_arm_neurun.sh new file mode 100755 index 0000000..82ed717 --- /dev/null +++ b/scripts/standalone/docker_build_cross_arm_neurun.sh @@ -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 index 0000000..ea453e0 --- /dev/null +++ b/scripts/standalone/docker_build_cross_arm_neurun_release.sh @@ -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 index 0000000..2655a43 --- /dev/null +++ b/scripts/standalone/test_arm_neurun_acl_cl.sh @@ -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 index 0000000..3710d08 --- /dev/null +++ b/scripts/standalone/test_arm_neurun_cpu.sh @@ -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 -- 2.7.4