Introduce CI test and build script (#4561)
author오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Tue, 5 Mar 2019 00:26:15 +0000 (09:26 +0900)
committer박세희/On-Device Lab(SR)/Principal Engineer/삼성전자 <saehie.park@samsung.com>
Tue, 5 Mar 2019 00:26:15 +0000 (09:26 +0900)
- Introduce directory for CI
- Introduce build script for pure acl release/debug build
- Introduce test script for pure acl

Signed-off-by: Hyeongseok Oh <hseok82.oh@samsung.com>
scripts/ci/docker_build_cross_arm_ubuntu.sh [new file with mode: 0755]
scripts/ci/docker_build_cross_arm_ubuntu_release.sh [new file with mode: 0644]
scripts/ci/test_arm_ubuntu.sh [new file with mode: 0755]

diff --git a/scripts/ci/docker_build_cross_arm_ubuntu.sh b/scripts/ci/docker_build_cross_arm_ubuntu.sh
new file mode 100755 (executable)
index 0000000..dfa2ed9
--- /dev/null
@@ -0,0 +1,49 @@
+#!/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_VOLUMES=" -v $ROOTFS_DIR:/opt/rootfs"
+DOCKER_VOLUMES+=" -v $EXT_ACL_FOLDER:/opt/acl"
+export DOCKER_VOLUMES
+
+# docker image name
+if [[ -z $DOCKER_IMAGE_NAME ]]; then
+  echo "It will use default docker image name"
+else
+  export DOCKER_IMAGE_NAME
+fi
+
+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 BENCHMARK_ACL_BUILD=1"
+
+# Mirror server setting
+if [[ -z $EXTERNAL_DOWNLOAD_SERVER ]]; then
+  echo "It will not use mirror server"
+else
+  DOCKER_ENV_VARS+=" -e EXTERNAL_DOWNLOAD_SERVER=$EXTERNAL_DOWNLOAD_SERVER"
+fi
+export DOCKER_ENV_VARS
+
+pushd $ROOT_PATH > /dev/null
+
+# TODO use command instead of makefile
+CMD="make && make install && make build_test_suite"
+source nnfw docker-run-user bash -c "${CMD}"
+
+popd > /dev/null
diff --git a/scripts/ci/docker_build_cross_arm_ubuntu_release.sh b/scripts/ci/docker_build_cross_arm_ubuntu_release.sh
new file mode 100644 (file)
index 0000000..94d1272
--- /dev/null
@@ -0,0 +1,50 @@
+#!/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_VOLUMES=" -v $ROOTFS_DIR:/opt/rootfs"
+DOCKER_VOLUMES+=" -v $EXT_ACL_FOLDER:/opt/acl"
+export DOCKER_VOLUMES
+
+# docker image name
+if [[ -z $DOCKER_IMAGE_NAME ]]; then
+  echo "It will use default docker image name"
+else
+  export DOCKER_IMAGE_NAME
+fi
+
+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 BENCHMARK_ACL_BUILD=1"
+DOCKER_ENV_VARS+=" -e BUILD_TYPE=release"
+
+# Mirror server setting
+if [[ -z $EXTERNAL_DOWNLOAD_SERVER ]]; then
+  echo "It will not use mirror server"
+else
+  DOCKER_ENV_VARS+=" -e EXTERNAL_DOWNLOAD_SERVER=$EXTERNAL_DOWNLOAD_SERVER"
+fi
+export DOCKER_ENV_VARS
+
+pushd $ROOT_PATH > /dev/null
+
+# TODO use command instead of makefile
+CMD="make && make install && make build_test_suite"
+source nnfw docker-run-user bash -c "${CMD}"
+
+popd > /dev/null
diff --git a/scripts/ci/test_arm_ubuntu.sh b/scripts/ci/test_arm_ubuntu.sh
new file mode 100755 (executable)
index 0000000..34dc935
--- /dev/null
@@ -0,0 +1,17 @@
+#!/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
+export $MODELFILE_SERVER
+
+pushd $ROOT_PATH > /dev/null
+
+source ./tests/scripts/test_driver.sh .
+
+popd > /dev/null