Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync dev to main #5

Merged
merged 3 commits into from
May 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
123 changes: 123 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
name: Build CRB

on:
pull_request:
branches:
- develop
- master
- main
- dev

env:
PULL_REQUEST_ID: ${{ github.event.number }}
CI_ROOT_PATH: /data/github-actions
TFTP_ROOT_PATH: /data/tftp_server
NFS_ROOT_PATH: /data/nfs_server

defaults:
run:
shell: bash

jobs:
build_image:
name: Build
runs-on: [self-hosted, k510_buildroot]
timeout-minutes: 60
container:
image: ai.b-bug.org:5000/k510_sdk_github
env:
CONF: k510_${{ matrix.cfg }}_defconfig
ENV: development
volumes:
- /data:/data
strategy:
matrix:
cfg: ["crb_lp3_v0_1", "crb_lp3_v1_2"]
steps:
- uses: actions/checkout@v3
with:
clean: false

- name: Install toolchain
run: |
set -x
test -f toolchain/nds64le-linux-glibc-v5d.txz || wget -c https://ai.b-bug.org/k510_buildroot/toolchain/nds64le-linux-glibc-v5d.txz -O toolchain/nds64le-linux-glibc-v5d.txz
test -f toolchain/nds64le-elf-mculib-v5d.txz || wget -c https://ai.b-bug.org/k510_buildroot/toolchain/nds64le-elf-mculib-v5d.txz -O toolchain/nds64le-elf-mculib-v5d.txz
- name: Download package
run: |
set -x
test -f pkg-download/dl.tar.gz && rm pkg-download/dl.tar.gz
wget -qc https://ai.b-bug.org/k510_buildroot/pkg-download/dl.tar.gz -O pkg-download/dl.tar.gz
echo "dl.tar.gz file md5 check"
md5sum pkg-download/dl.tar.gz
test -d dl_bak && rm -rf dl_bak
test -d dl && mv dl dl_bak
tar -xvf pkg-download/dl.tar.gz
test -d dl/ai/ || mkdir -p dl/ai/
wget -qc https://ai.b-bug.org/k510_buildroot/pkg-download/ai_kmodel_data.tar.xz -O dl/ai/ai_kmodel_data.tar.xz
echo "ai_kmodel_data.tar.xz file md5 check"
md5sum dl/ai/ai_kmodel_data.tar.xz
test -d dl/riscv-pk-k510 && (test -d dl/riscv-pk-k510 || mv dl_bak/riscv-pk-k510 dl/)
test -d dl_bak && rm -rf dl_bak

- name: Build image
run: |
sed -i "s/BR2_JLEVEL=5/BR2_JLEVEL=14/g" configs/$CONF
rm -rf $CONF
make CONF=$CONF

- name: Save image to CI root
run: |
set -x
export HW=`echo ${{ matrix.cfg }}|awk -F '_' '{print $1"_"$3"_"$4}'`
export SAVE_DIR=$PULL_REQUEST_ID"_"$GITHUB_RUN_ID
echo $HW
echo $SAVE_DIR
sudo mkdir -p $CI_ROOT_PATH/k510_buildroot/$HW/$SAVE_DIR/
sudo cp -r $CONF/images/* $CI_ROOT_PATH/k510_buildroot/$HW/$SAVE_DIR/

- name: Save image to TFTP
run: |
set -x
export FILE_SUFFIX=`echo ${{ matrix.cfg }}|awk -F '_' '{print $1"-"$3"_"$4}'`-$PULL_REQUEST_ID-$GITHUB_RUN_ID
echo $FILE_SUFFIX
sudo cp $CONF/images/bootm-bbl.img $TFTP_ROOT_PATH/bootm-bbl-$FILE_SUFFIX.img
sudo cp $CONF/images/k510.dtb $TFTP_ROOT_PATH/k510-$FILE_SUFFIX.dtb

- name: Save image to NFS
run: |
set -x
export HW=`echo ${{ matrix.cfg }}|awk -F '_' '{print $1"_"$3"_"$4}'`
export SAVE_DIR=$PULL_REQUEST_ID"_"$GITHUB_RUN_ID
echo $HW
echo $SAVE_DIR
sudo mkdir -p $NFS_ROOT_PATH/k510_buildroot/$HW/$SAVE_DIR/
sudo tar -xf $CONF/images/rootfs.tar -C $NFS_ROOT_PATH/k510_buildroot/$HW/$PULL_REQUEST_ID"_"$GITHUB_RUN_ID

load_image:
name: Load
needs: build_image
timeout-minutes: 10
runs-on: [self-hosted, k510_buildroot]
container:
image: ai.b-bug.org:5000/k510_sdk_github
volumes:
- /data:/data
strategy:
matrix:
cfg: ["crb_lp3_v0_1", "crb_lp3_v1_2"]
steps:
- name: Load image
run: |
set -x
test -d bin && rm -rf bin
mkdir ./bin
wget -qc https://ai.b-bug.org/k510_buildroot/github/ci -O ./bin/ci
chmod +x ./bin/ci
export HW_MODEL=`echo ${{ matrix.cfg }}|awk -F '_' '{print $1}'`
export HW_VER=`echo ${{ matrix.cfg }}|awk -F '_' '{print $3"_"$4}'`
echo $HW_MODEL
echo $HW_VER
echo $PULL_REQUEST_ID
echo $GITHUB_RUN_ID
./bin/ci --project k510_buildroot --merge_id $PULL_REQUEST_ID --pipeline_id $GITHUB_RUN_ID --hw_ver $HW_VER --hw_model $HW_MODEL
13 changes: 13 additions & 0 deletions Makefile
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,19 @@ dl:
wget -c https://github.com/kendryte/k510_buildroot/releases/download/v1.5/dl.tar.gz -O pkg-download/dl.tar.gz;
tar -zxf pkg-download/dl.tar.gz;
mkdir -p dl/ai/; wget -c https://github.com/kendryte/k510_buildroot/releases/download/v1.5/ai_kmodel_data.tar.xz -O dl/ai/ai_kmodel_data.tar.xz;
(set -x; NNCASE_VER=v1.6.0 ;\
NNCASE_SITE=https://github.com/kendryte/nncase/releases/download;\
NNCASE_PIP_VD=1.6.0.20220505 ;\
mkdir -p dl/nncase_linux_runtime; cd dl/nncase_linux_runtime; \
wget -c $${NNCASE_SITE}/$${NNCASE_VER}/nncase-k510-1.6.0.tgz ; \
wget -c $${NNCASE_SITE}/$${NNCASE_VER}/nncase-$${NNCASE_PIP_VD}-cp310-cp310-manylinux_2_24_x86_64.whl; \
wget -c $${NNCASE_SITE}/$${NNCASE_VER}/nncase-$${NNCASE_PIP_VD}-cp36-cp36m-manylinux_2_24_x86_64.whl;\
wget -c $${NNCASE_SITE}/$${NNCASE_VER}/nncase-$${NNCASE_PIP_VD}-cp37-cp37m-manylinux_2_24_x86_64.whl;\
wget -c $${NNCASE_SITE}/$${NNCASE_VER}/nncase-$${NNCASE_PIP_VD}-cp38-cp38-manylinux_2_24_x86_64.whl;\
wget -c $${NNCASE_SITE}/$${NNCASE_VER}/nncase-$${NNCASE_PIP_VD}-cp39-cp39-manylinux_2_24_x86_64.whl; \
)




down_toolchain:
Expand Down
24 changes: 0 additions & 24 deletions package/ai/code/openpose/pafprocess.cc
Original file line number Diff line number Diff line change
@@ -1,27 +1,3 @@
/* Copyright (c) 2022, Canaan Bright Sight Co., Ltd
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <iostream>
#include <algorithm>
#include <math.h>
Expand Down
Loading