###########
# aarch64 #
###########
docker rm -f docker01
docker run -tid --net=host --name=docker01 --entrypoint "/bin/bash"  swr.cn-north-4.myhuaweicloud.com/mindspore/mindspore_centos_aarch64:centos8.2.2004-20210116
docker exec -ti docker01 bash
alias ll='ls -la --color=auto'
alias ls='ls --color=auto'

docker rm -f docker02
docker run -tid --net=host --name=docker02 --entrypoint "/bin/bash"  swr.cn-north-4.myhuaweicloud.com/mindspore/mindspore_euleros_aarch64:euleros2.8-20210116
docker exec -ti docker02 bash
alias ll='ls -la --color=auto'
alias ls='ls --color=auto'

docker rm -f docker03
docker run -tid --net=host --name=docker03 --entrypoint "/bin/bash"  swr.cn-north-4.myhuaweicloud.com/mindspore/mindspore_ubuntu_aarch64:ubuntu18.04.2-20210116
docker exec -ti docker03 bash
alias ll='ls -la --color=auto'



##########
# x86_64 #
##########
docker rm -f docker01
docker run -tid --net=host --name=docker01 --entrypoint "/bin/bash"  swr.cn-north-4.myhuaweicloud.com/mindspore/mindspore_centos_x86:centos8.2.2004-20210116
docker exec -ti docker01 bash
alias ll='ls -la --color=auto'
alias ls='ls --color=auto'

docker rm -f docker02
docker run -tid --net=host --name=docker02 --entrypoint "/bin/bash"  swr.cn-north-4.myhuaweicloud.com/mindspore/mindspore_euleros_x86:euleros2.5-20210116
docker exec -ti docker02 bash
alias ll='ls -la --color=auto'
alias ls='ls --color=auto'

docker rm -f docker03
docker run -tid --net=host --name=docker03 --entrypoint "/bin/bash"  swr.cn-north-4.myhuaweicloud.com/mindspore/mindspore_ubuntu_x86:ubuntu18.04.2-20210116
docker exec -ti docker03 bash
alias ll='ls -la --color=auto'
alias ls='ls --color=auto'

docker rm -f docker04
docker run -tid --net=host --name=docker04 --entrypoint "/bin/bash"  swr.cn-north-4.myhuaweicloud.com/mindspore/mindspore_check:ubuntu18.04.2-20210116
docker exec -ti docker04 bash
alias ll='ls -la --color=auto'
alias ls='ls --color=auto'


##########
# ascend #
##########
# Ascend
cd /usr/local
#sudo wget http://59.36.11.51/ascend910_lib/20201223/centos_aarch64/ascend_centos_aarch64.tar.gz
sudo wget http://59.36.11.51/ascend910_lib/20201223/centos_x86/ascend_centos_x86.tar.gz
#sudo wget http://59.36.11.51/ascend910_lib/20201223/euleros_aarch64/ascend_euleros_aarch64.tar.gz
#sudo wget http://59.36.11.51/ascend910_lib/20201223/euleros_x86/ascend_euleros_x86.tar.gz
#sudo wget http://59.36.11.51/ascend910_lib/20201223/ubuntu_x86/ascend_ubuntu_x86.tar.gz
sudo tar zxf ascend_*.tar.gz
ls -l /usr/local



###########
# compile #
###########
# mindinsight
cd /home/jenkins/agent
rm -rf mindinsight
git clone https://gitee.com/mindspore/mindinsight.git
cd /home/jenkins/agent/mindinsight/build
sh build.sh
ls -l ../output

# mindarmour
cd /home/jenkins/agent
rm -rf mindarmour
git clone https://gitee.com/mindspore/mindarmour.git
cd /home/jenkins/agent/mindarmour
sh package.sh
ls -l output

# hub
cd /home/jenkins/agent
rm -rf hub
git clone https://gitee.com/mindspore/hub.git
cd /home/jenkins/agent/hub
sh build.sh
ls -l output

# mindspore
cd /home/jenkins/agent
rm -rf mindspore
git clone https://gitee.com/mindspore/mindspore.git
cd /home/jenkins/agent/mindspore
sh build.sh -e ascend -j8
ls -l output



######
# UT #
######
export LD_LIBRARY_PATH=/home/jenkins/python/python375/lib:$LD_LIBRARY_PATH
export PATH=/home/jenkins/python/python375/bin:$PATH

export LD_LIBRARY_PATH=/usr/local/python/python375/lib:/usr/local/gcc/gcc730/lib64:$LD_LIBRARY_PATH
export PATH=/usr/local/cmake/bin:/usr/local/python/python375/bin:/usr/local/gcc/gcc730/bin:$PATH

