This patch adds github action fastmodel.
pr-build : unittests and apptests except apptest-bulk
daily-build : all tests
Signed-off-by: Yelin Jeong <yelini.jeong@samsung.com>
description: path of RPM packages
required: true
default: /tmp/rpms
- run_apptest:
- description: run apptest
- required: false
+ test_type:
+ description: fast test or full test
+ required: true
type: string
art_id:
description: artifactory id
shell: bash
# Download latest npu kernel
- run: |
- wget -r -np -nH --cut-dirs=5 https://bart.sec.samsung.net/artifactory/aip-generic-local/NPU_LinuxKernel/latest/aarch64/ --user ${{ inputs.art_id }} --password ${{ inputs.art_pw }}
+ wget -r -np -nH --cut-dirs=5 https://bart.sec.samsung.net/artifactory/aip-rpm-local/NPU_LinuxKernel/ --user ${{ inputs.art_id }} --password ${{ inputs.art_pw }}
mv *.rpm /opt/trinity/share/RPMS
shell: bash
# Set up test environment
- run: |
service ssh start
service ssh status
- export ARMLMD_LICENSE_FILE=8224@10.113.242.30
- su www-data --command /opt/trinity/run_taos &
+ cp $GITHUB_WORKSPACE/utils/trinity_test/check.sh /opt/trinity/share/check.sh
+ cp $GITHUB_WORKSPACE/utils/trinity_test/refresh.sh /opt/trinity/share/refresh.sh
+ cp $GITHUB_WORKSPACE/utils/trinity_test/connect_kernel.exp /opt/trinity/connect_kernel.exp
sed -i -e "s/\[IP]/$(hostname -i)/g" /opt/trinity/connect_kernel.exp
- sed -i -e "s/\[APPTEST]/${{ inputs.run_apptest }}/g" /opt/trinity/connect_kernel.exp
+ sed -i -e "s/\[TEST]/${{ inputs.test_type }}/g" /opt/trinity/connect_kernel.exp
+ chmod a+x /opt/trinity/connect_kernel.exp
+ shell: bash
+ # Test TRIV 2.4
+ - run: |
+ export ARMLMD_LICENSE_FILE=8224@10.113.242.30
+ su www-data --command "/opt/trinity/run_taos 2.4 &"
sleep 20
- su www-data --command /opt/trinity/connect_kernel.exp
+ su www-data --command "/opt/trinity/connect_kernel.exp"
shell: bash
+
+ # TODO : Check TRIV 2.3!
username: ${{ secrets.BART_ID }}
password: ${{ secrets.BART_PW }}
- timeout-minutes: 30
+ timeout-minutes: 120
steps:
- name: Clone your repository
with:
arch: aarch64
output_path: /tmp/rpms
- # - name: Fastmodel test
- # uses: ./.github/actions/test-fastmodel
- # with:
- # package_path: /tmp/rpms
- # art_id: ${{ secrets.BART_ID }}
- # art_pw: ${{ secrets.BART_PW }}
- # - name: Upload test result
- # uses: CODE-Actions/upload-artifact@v2
- # with:
- # name: fastmodel test log
- # path: |
- # /opt/trinity/share/log/err.txt
- # /opt/trinity/share/log/out.txt
- # - name: Check if apptest failed
- # run: |
- # echo $(cat /opt/trinity/share/log/result.txt)
- # if [[ "$(cat /opt/trinity/share/log/result.txt)" != 0 ]]; then
- # exit 1
- # fi
- # shell : bash
+ - name: Fastmodel test
+ uses: ./.github/actions/test-fastmodel
+ with:
+ package_path: /tmp/rpms
+ test_type: apptest
+ art_id: ${{ secrets.BART_ID }}
+ art_pw: ${{ secrets.BART_PW }}
+ - name: Upload test result
+ uses: CODE-Actions/upload-artifact@v2
+ with:
+ name: fastmodel test log
+ path: |
+ /opt/trinity/share/log/err.txt
+ /opt/trinity/share/log/out.txt
+ /opt/trinity/share/log/result.txt
- name: Upload artifacts
uses: CODE-Actions/upload-artifact@v2
with:
name: built-package
path: /tmp/rpms
+ - name: Check if apptest failed
+ run: |
+ echo $(cat /opt/trinity/share/log/result.txt)
+ if [[ "$(cat /opt/trinity/share/log/result.txt)" != 0 ]]; then
+ exit 1
+ fi
+ shell : bash
username: ${{ secrets.BART_ID }}
password: ${{ secrets.BART_PW }}
- timeout-minutes: 60
+ timeout-minutes: 180
steps:
- name: Get current date
with:
arch: aarch64
output_path: /tmp/rpms
+ - name: Fastmodel test
+ uses: ./.github/actions/test-fastmodel
+ with:
+ package_path: /tmp/rpms
+ test_type: apptest-bulk
+ art_id: ${{ secrets.BART_ID }}
+ art_pw: ${{ secrets.BART_PW }}
+ - name: Upload test result
+ uses: CODE-Actions/upload-artifact@v2
+ with:
+ name: fastmodel test log
+ path: |
+ /opt/trinity/share/log/err.txt
+ /opt/trinity/share/log/out.txt
+ /opt/trinity/share/log/result.txt
- name: Upload artifacts
uses: CODE-Actions/upload-artifact@v2
with:
#!/bin/sh
+TEST=$1
RPM_PATH=/mnt/RPMS
LOG_PATH=/mnt/log
TEST_PATH=/usr/lib64/npu-engine/bin/
DEVICE_PATH=/dev/triv2-0
-MODEL_PATH=/usr/share/npu-engine/testdata/TRIV238_2TOPS
+MODEL_PATH=/usr/share/npu-engine/testdata/TRIV242
function check_exit() {
echo "$1" > ${LOG_PATH}/result.txt
sleep 1
- exit
+ toybox rmmod trinity_vision2
+ toybox rmmod npu_sched
+ toybox poweroff
}
echo "" > ${LOG_PATH}/out.txt
echo "" > ${LOG_PATH}/err.txt
# Install npu-engine packages and modules.
-./mnt/trinity_test/load_modules.sh
-./mnt/trinity_test/refresh.sh 1>> ${LOG_PATH}/out.txt 2>> ${LOG_PATH}/err.txt
+./mnt/refresh.sh 1>> ${LOG_PATH}/out.txt 2>> ${LOG_PATH}/err.txt
# Check test directory
if [ ! -d "$TEST_PATH" ]; then
done
echo -e "\n[2/2] Checking AppTests..." >> ${LOG_PATH}/out.txt
-find apptests -maxdepth 1 -type f -perm 0755 -print0 | while IFS= read -r -d $'\0' apptest_exec; do
- if [ ${apptest_exec} == "apptests/apptest_tvn_triv2_bulk" ]; then
- echo -e "\n${apptest_exec} [TRIV238_2TOPS] is RUNNING" >> ${LOG_PATH}/out.txt
- ./${apptest_exec} ${MODEL_PATH} 1>> ${LOG_PATH}/out.txt 2>> ${LOG_PATH}/err.txt
- elif [ ${apptest_exec} == "apptests/apptest_tvn_triv2_aging" ]; then
- ./${apptest_exec} ${MODEL_PATH}/CONV_2D_300 1 10 1>> ${LOG_PATH}/out.txt 2>> ${LOG_PATH}/err.txt
- ./${apptest_exec} ${MODEL_PATH}/CONV_2D_300 2 10 1>> ${LOG_PATH}/out.txt 2>> ${LOG_PATH}/err.txt
- ./${apptest_exec} ${MODEL_PATH}/CONV_2D_300 3 10 1>> ${LOG_PATH}/out.txt 2>> ${LOG_PATH}/err.txt
- ./${apptest_exec} ${MODEL_PATH}/CONV_2D_300 4 10 1>> ${LOG_PATH}/out.txt 2>> ${LOG_PATH}/err.txt
- elif [ ${apptest_exec} == "apptests/apptest_tvn_triv2_preempt" ]; then
- ./${apptest_exec} ${MODEL_PATH}/ 1>> ${LOG_PATH}/out.txt 2>> ${LOG_PATH}/err.txt
- elif [ ${apptest_exec} == "apptests/apptest_tvn_triv2_interleave" ]; then
- ./${apptest_exec} 10 ${MODEL_PATH}/MAX_POOL_2D_000,${MODEL_PATH}/CONV_2D_300 1>> ${LOG_PATH}/out.txt 2>> ${LOG_PATH}/err.txt
- elif [ ${apptest_exec} == "apptests/apptest_tvn_triv2_xml" ]; then
- ./${apptest_exec} /mnt/trinity_test/model.xml 1>> ${LOG_PATH}/out.txt 2>> ${LOG_PATH}/err.txt
- elif [ ${apptest_exec} == "apptests/apptest_tvn_triv2_profile" ]; then
- ./${apptest_exec} ${MODEL_PATH}/ADD_000 -p visa 1>> ${LOG_PATH}/out.txt 2>> ${LOG_PATH}/err.txt
- else
- ./${apptest_exec} ${MODEL_PATH}/ADD_000 1>> ${LOG_PATH}/out.txt 2>> ${LOG_PATH}/err.txt
- fi
+echo -e "\n AppTests type : $TEST" >> ${LOG_PATH}/out.txt
+if [[ $TEST == apptest* ]]; then
+ find apptests -maxdepth 1 -type f -perm 0755 -print0 | while IFS= read -r -d $'\0' apptest_exec; do
+ if [ ${apptest_exec} == "apptests/apptest_tvn_triv2" ]; then
+ ./${apptest_exec} ${MODEL_PATH}/CONV_2D_300 1>> ${LOG_PATH}/out.txt 2>> ${LOG_PATH}/err.txt
+ elif [ ${apptest_exec} == "apptests/apptest_tvn_triv2_aging" ]; then
+ ./${apptest_exec} ${MODEL_PATH}/CONV_2D_300 1 10 1>> ${LOG_PATH}/out.txt 2>> ${LOG_PATH}/err.txt
+ ./${apptest_exec} ${MODEL_PATH}/CONV_2D_300 2 10 1>> ${LOG_PATH}/out.txt 2>> ${LOG_PATH}/err.txt
+ ./${apptest_exec} ${MODEL_PATH}/CONV_2D_300 3 10 1>> ${LOG_PATH}/out.txt 2>> ${LOG_PATH}/err.txt
+ ./${apptest_exec} ${MODEL_PATH}/CONV_2D_300 4 10 1>> ${LOG_PATH}/out.txt 2>> ${LOG_PATH}/err.txt
+ elif [ ${apptest_exec} == "apptests/apptest_tvn_triv2_interleave" ]; then
+ ./${apptest_exec} 10 ${MODEL_PATH}/MAX_POOL_2D_000,${MODEL_PATH}/CONV_2D_300 1>> ${LOG_PATH}/out.txt 2>> ${LOG_PATH}/err.txt
+ elif [ ${apptest_exec} == "apptests/apptest_tvn_triv2_profile" ]; then
+ ./${apptest_exec} ${MODEL_PATH}/ADD_000 -p visa 1>> ${LOG_PATH}/out.txt 2>> ${LOG_PATH}/err.txt
+ else
+ echo -e "\n${apptest_exec} is SKIPPED" >> ${LOG_PATH}/out.txt
+ fi
+
+ result=$?
+ if [[ ${result} -ne 0 ]]; then
+ echo -e "${apptest_exec} is FAILED" >> ${LOG_PATH}/out.txt
+ check_exit $result
+ else
+ echo -e "${apptest_exec} is PASSED" >> ${LOG_PATH}/out.txt
+ fi
+ done
+fi
+
+if [[ $TEST == "apptest-bulk" ]]; then
+ find apptests -maxdepth 1 -type f -perm 0755 -print0 | while IFS= read -r -d $'\0' apptest_exec; do
+ if [ ${apptest_exec} == "apptests/apptest_tvn_triv2_bulk" ]; then
+ echo -e "\n${apptest_exec} is RUNNING" >> ${LOG_PATH}/out.txt
+ ./${apptest_exec} ${MODEL_PATH} 1>> ${LOG_PATH}/out.txt 2>> ${LOG_PATH}/err.txt
+ fi
+
+ result=$?
+ if [[ ${result} -ne 0 ]]; then
+ echo -e "${apptest_exec} is FAILED" >> ${LOG_PATH}/out.txt
+ check_exit $result
+ else
+ echo -e "${apptest_exec} is PASSED" >> ${LOG_PATH}/out.txt
+ fi
+ done
+fi
- result=$?
- if [[ ${result} -ne 0 ]]; then
- echo -e "${apptest_exec} is FAILED" >> ${LOG_PATH}/out.txt
- check_exit $result
- else
- echo -e "${apptest_exec} is PASSED" >> ${LOG_PATH}/out.txt
- fi
-done
popd
check_exit 0
--- /dev/null
+#!/usr/bin/expect
+
+# wait until terminated
+set timeout -1
+
+# set npu version
+# set npu_ver [lindex $argv 0];
+
+spawn telnet localhost 5000
+sleep 20
+send "sshfs www-data@[IP]:/opt/trinity/share /mnt \r"
+sleep 10
+send "yes\r"
+sleep 10
+send "www-data\r"
+sleep 10
+send "./mnt/check.sh [TEST]\r"
+expect eof
+++ /dev/null
-#!/bin/sh
-
-pushd /mnt/modules
-
-toybox insmod npu_sched.ko
-toybox insmod trinity_vision2.ko
-mdev -s
-
-echo "2097152" > /sys/devices/platform/trinity/30410000.triv2/control/profile
-
-popd
pushd /mnt/RPMS
-rpm -ivh --force npu-engine-*
+rpm -ivh --force --nodeps *
+
+popd
+
+pushd /lib/modules/4.12.0-arm64/kernel/drivers/misc
+
+insmod sdp_npu_sched/npu_sched.ko
+insmod trinity/trinity_vision2.ko
+mdev -s
+
+echo "2097152" > /sys/devices/platform/trinity/32010000.triv2/control/profile
popd