Match-id-e8e7507b05f98f0d66d3d8a4e7b2f6de64b98e81
302
README.md
@@ -1,23 +1,23 @@
|
||||
|
||||
# 简介
|
||||
容器引擎插件(Ascend Docker,又叫昇腾容器)是CANN的基础组件,为所有的AI训练/推理作业提供Ascend NPU(昇腾处理器)容器化支持,使用户AI作业能够以Docker容器的方式平滑运行在昇腾设备之上,如图2-1所示。Ascend Docker配套发布的软件包为Ascend-docker-runtime,已集成至实用工具包toolbox中。
|
||||
容器引擎插件(Ascend Docker,又叫昇腾容器)是CANN的基础组件,为所有的AI训练/推理作业提供Ascend NPU(昇腾处理器)容器化支持,使用户AI作业能够以Docker容器的方式平滑运行在昇腾设备之上,如图1-1所示。
|
||||
|
||||
图2-1 Ascend Docker
|
||||
图1-1 Ascend Docker
|
||||
|
||||

|
||||
## Ascend Docker价值
|
||||
- 充分解耦:与Docker解耦,无需修改Docker代码,Runtime可以独立演进。
|
||||
- 后向兼容:提供可选装的Runtime,不影响原生Docker使用方式。
|
||||
- 易适配:与客户现有平台和系统平滑适配,不影响原Docker的命令接口。
|
||||
- 易部署:提供rpm包部署,用户安装后即可用Docker创建挂载Ascend NPU的容器。
|
||||
- 易部署:提供run包部署,用户安装后即可用Docker创建挂载Ascend NPU的容器。
|
||||
|
||||
## Ascend Docker设计简介
|
||||
Ascend Docker本质上是基于OCI标准实现的Docker Runtime,不修改Docker引擎,对Docker以插件方式提供Ascend NPU适配功能。
|
||||
如图2-2所示,Ascend Docker通过OCI接口与原生Docker对接。在原生Docker的runc启动容器过程中,会调用prestart-hook对容器进行配置管理。
|
||||
如图1-2所示,Ascend Docker通过OCI接口与原生Docker对接。在原生Docker的runc启动容器过程中,会调用prestart-hook对容器进行配置管理。
|
||||
|
||||
图2-2 Docker适配原理
|
||||
图1-2 Docker适配原理
|
||||
|
||||

|
||||

|
||||
|
||||
其中,prestart-hook是OCI定义的容器生存状态,即created状态到running状态的一个中间过渡所设置的钩子函数。在这个过渡状态,容器的namespace已经被创建,但容器的作业还没有启动,因此可以对容器进行设备挂载,cgroup配置等操作。这样随后启动的作业便可以使用到这些配置。
|
||||
Ascend Docker在prestart-hook这个钩子函数中,对容器做了以下配置操作:
|
||||
@@ -25,20 +25,138 @@ Ascend Docker在prestart-hook这个钩子函数中,对容器做了以下配置
|
||||
2.在Host上配置该容器的device cgroup,确保该容器只可以使用指定的NPU,保证设备的隔离。
|
||||
3.将Host上的CANN Runtime Library挂载到容器的namespace。
|
||||
|
||||
# 下载和安装
|
||||
***
|
||||
# 安装、使用和卸载
|
||||
*注意:目前Ascend Docker Runtime只支持root用户安装Ascend Docker Runtime*
|
||||
## 安装前准备
|
||||
|
||||
- 安装大于18.03版本的docker,请参考[安装详情](https://mirrors.huaweicloud.com/)
|
||||
* 安装大于18.03版本的docker,请进入[安装详情](https://mirrors.tuna.tsinghua.edu.cn/help/docker-ce/)。
|
||||
* 宿主机已安装驱动和固件,详情请参见[《CANN 软件安装指南 (开发&运行场景, 通过命令行方式)》](https://support.huawei.com/enterprise/zh/doc/EDOC1100180788?idPath=23710424|251366513|22892968|251168373) 的“准备硬件环境”章节。
|
||||
|
||||
- 宿主机已安装驱动和固件,详情请参见[《CANN 软件安装指南 (开发&运行场景, 通过命令行方式)》](https://support.huawei.com/enterprise/zh/doc/EDOC1100180788?idPath=23710424|251366513|22892968|251168373) 的“准备硬件环境”章节。
|
||||
## 安装步骤
|
||||
### 下载源码
|
||||
```shell
|
||||
# 下载Ascend Docker Runtime源码
|
||||
git clone https://gitee.com/ascend/ascend-docker-runtime.git
|
||||
# 下载安全函数库
|
||||
cd ascend-docker-runtime/platform
|
||||
git clone https://gitee.com/openeuler/libboundscheck.git
|
||||
# 下载makeself
|
||||
cd ../opensource
|
||||
git clone https://gitee.com/src-openeuler/makeself.git
|
||||
tar -zxvf makeself/makeself-2.4.2.tar.gz
|
||||
```
|
||||
|
||||
## 下载
|
||||
### run包
|
||||
开发人员可从昇腾社区下载Toolbox,下载链接为:https://www.hiascend.com/software/mindx-dl/community,
|
||||
下载后安装Toolbox,Ascend-docker-runtime已集成至实用工具包toolbox中。
|
||||
### 编译
|
||||
```shell
|
||||
cd ../build
|
||||
# 编译
|
||||
bash build.sh
|
||||
```
|
||||
|
||||
### 安装
|
||||
```shell
|
||||
cd ../output
|
||||
chmod +x Ascend-docker-runtime_{version}_linux-{arch}.run
|
||||
./Ascend-docker-runtime_{version}_linux-{arch}.run --install
|
||||
```
|
||||
|
||||
### 安装成功后需要运行以下命令让Ascend Docker Runtime生效
|
||||
```shell
|
||||
systemctl daemon-reload && systemctl restart docker
|
||||
```
|
||||
|
||||
### 组件状态确认
|
||||
安装完成之后,验证Ascend Docker Runtime是否安装成功,可执行如下步骤:
|
||||
* 安装Ascend-docker-runtime后,配置文件“/etc/docker/daemon.json”中的内容会被修改,其中"default-runtime"与"runtimes"字段如下所示:
|
||||
```json
|
||||
{
|
||||
"default-runtime": "ascend",
|
||||
...
|
||||
"runtimes": {
|
||||
"ascend": {
|
||||
"path": "/usr/local/Ascend/Ascend-Docker-Runtime/ascend-docker-runtime",
|
||||
"runtimeArgs": []
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
* 执行docker info查看默认Runtime是否为ascend,若是则表示Ascend Docker Runtime安装成功,示例如下:
|
||||
```shell
|
||||
$docker info
|
||||
...
|
||||
Runtimes: ascend runc
|
||||
Default Runtime: ascend
|
||||
...
|
||||
```
|
||||
***
|
||||
### 说明
|
||||
```text
|
||||
· Atlas 200 AI加速模块(RC场景)、Atlas 200I SoC A1核心板和Atlas 500 智能小站支持Ascend-Docker-Runtime工具
|
||||
|
||||
安装时需指定--install-type=<type>用于设置Ascend-Docker-Runtime的默认挂载:
|
||||
|
||||
Atlas 200 AI加速模块(RC场景)安装时执行如下命令:
|
||||
|
||||
./Ascend-docker-runtime_{version}_linux-{arch}.run --install --install-type=A200
|
||||
|
||||
Atlas 200I SoC A1核心板安装时执行如下命令:
|
||||
|
||||
./Ascend-docker-runtime_{version}_linux-{arch}.run --install --install-type=A200ISoC
|
||||
|
||||
Atlas 500 智能小站安装时执行如下命令:
|
||||
|
||||
./Ascend-docker-runtime_{version}_linux-{arch}.run --install --whitelist=docker-runtime --install-type=A500
|
||||
|
||||
· 如果以root用户安装,建议不要安装在非root用户目录下,否则存在被非root用户替换root用户文件以达到提权目的的安全风险。
|
||||
|
||||
· 如果用户指定路径安装时,请确认指定路径符合所在组织的安全要求。
|
||||
|
||||
· 如果用户未指定安装路径,则软件会安装到默认路径下,默认安装路径为:/usr/local/Ascend
|
||||
```
|
||||
***
|
||||
|
||||
## 使用
|
||||
### 在Docker客户端使用
|
||||
* 示例1:启动容器时,挂载物理芯片ID为0的芯片。
|
||||
```shell
|
||||
docker run -it -e ASCEND_VISIBLE_DEVICES=0 image-name:tag /bin/bash
|
||||
```
|
||||
* 示例2:启动容器时,仅挂载NPU设备和管理设备,不挂载驱动相关目录。
|
||||
```shell
|
||||
docker run --rm -it -e ASCEND_VISIBLE_DEVICES=0 -e ASCEND_RUNTIME_OPTIONS=NODRV image-name:tag /bin/bash
|
||||
```
|
||||
* 示例3:启动容器时,挂载物理芯片ID为0的芯片,读取自定义配置文件hostlog中的挂载内容。
|
||||
```shell
|
||||
run --rm -it -e ASCEND_VISIBLE_DEVICES=0 -e ASCEND_RUNTIME_MOUNTS=hostlog image-name:tag /bin/bash
|
||||
```
|
||||
* 示例4:启动容器时,挂载虚拟芯片ID为100的芯片。
|
||||
```shell
|
||||
docker run -it -e ASCEND_VISIBLE_DEVICES=100 -e ASCEND_RUNTIME_OPTIONS=VIRTUAL image-name:tag /bin/bash
|
||||
```
|
||||
* 示例5:启动容器时,从物理芯片ID为0的芯片上,切分出4个AI Core作为虚拟设备并挂载至容器中。
|
||||
```shell
|
||||
docker run -it --rm -e ASCEND_VISIBLE_DEVICES=0 -e ASCEND_VNPU_SPECS=vir04 image-name:tag /bin/bash
|
||||
```
|
||||
容器启动后,可使用
|
||||
*ls /dev | grep davinci\* && ls /dev | grep devmm_svm && ls /dev | grep hisi_hdc && ls /usr/local/Ascend/driver && ls /usr/local/ |grep dcmi && ls /usr/local/bin*
|
||||
命令来检查相应设备和驱动是否挂载成功,每台机型具体的挂载目录参考Ascend Docker Runtime[默认挂载内容](##"默认挂载内容")。如下所示(具体内容因机型而异):
|
||||
```shell
|
||||
root@ee30eeda9058:/# ls /dev | grep davinci* && ls /dev | grep devmm_svm && ls /dev | grep hisi_hdc && ls /usr/local/Ascend/driver && ls /usr/local/ |grep dcmi && ls /usr/local/bin
|
||||
davinci0
|
||||
davinci1
|
||||
davinci2
|
||||
davinci4
|
||||
davinci_manager
|
||||
devmm_svm
|
||||
hisi_hdc
|
||||
include lib64
|
||||
dcmi
|
||||
npu-smi
|
||||
```
|
||||
|
||||
# 功能
|
||||
## 默认挂载内容
|
||||
|
||||
### Atlas 200 AI加速模块 RC场景
|
||||
| 挂载项 | 备注 |
|
||||
|:------------------------------:|:-----------------------:|
|
||||
@@ -68,7 +186,7 @@ Ascend Docker在prestart-hook这个钩子函数中,对容器做了以下配置
|
||||
| /dev/hisi_hdc | 管理设备 |
|
||||
| /dev/devmm_svm | 管理设备 |
|
||||
| /home/data/miniD/driver/lib64 | 目录,驱动提供的用户态库 |
|
||||
| /usr/local/dcmi | 目录,DCMI头文件和库 |
|
||||
| /usr/local/lib/libdcmi.so | 文件,DCMI的动态库 |
|
||||
| /usr/local/bin/npu-smi | 文件,npu-smi工具 |
|
||||
|
||||
### 其他设备
|
||||
@@ -82,131 +200,57 @@ Ascend Docker在prestart-hook这个钩子函数中,对容器做了以下配置
|
||||
| /usr/local/Ascend/driver/include | 目录,驱动提供的头文件 |
|
||||
| /usr/local/dcmi | 目录,DCMI头文件和库 |
|
||||
| /usr/local/bin/npu-smi | 文件,npu-smi工具 |
|
||||
## Ascend-Docker-runtime安装
|
||||
### 单独安装
|
||||
```shell
|
||||
chmod +x Ascend-mindx-toolbox_{version}_linux-{arch}.run
|
||||
./Ascend-mindx-toolbox_{version}_linux-{arch}.run --install --whitelist=docker-runtime
|
||||
systemctl daemon-reload
|
||||
systenctl restart docker
|
||||
```
|
||||
### 或者 集成工具toolboox安装
|
||||
```shell
|
||||
chmod +x Ascend-mindx-toolbox_{version}_linux-{arch}.run
|
||||
./Ascend-mindx-toolbox_{version}_linux-{arch}.run --install
|
||||
systemctl daemon-reload
|
||||
systemctl restart docker
|
||||
```
|
||||
### 说明
|
||||
```
|
||||
· Atlas 200 AI加速模块(RC场景)、Atlas 200I SoC A1核心板和Atlas 500 智能小站支持Ascend-Docker-Runtime工具
|
||||
|
||||
安装时需指定--install-type=<type>用于设置Ascend-Docker-Runtime的默认挂载:
|
||||
|
||||
Atlas 200 AI加速模块(RC场景)安装时执行如下命令:
|
||||
|
||||
./Ascend-mindx-toolbox_{version}_linux-{arch}.run --install --install-type=A200
|
||||
|
||||
Atlas 200I SoC A1核心板安装时执行如下命令:
|
||||
|
||||
./Ascend-mindx-toolbox_{version}_linux-{arch}.run --install --install-type=A200ISoC
|
||||
|
||||
Atlas 500 智能小站安装时执行如下命令:
|
||||
|
||||
./Ascend-mindx-toolbox_{version}_linux-{arch}.run --install --whitelist=docker-runtime --install-type=A500
|
||||
|
||||
· 如果以root用户安装,建议不要安装在非root用户目录下,否则存在被非root用户替换root用户文件以达到提权目的的安全风险。
|
||||
|
||||
· 如果用户指定路径安装时,请确认指定路径符合所在组织的安全要求。
|
||||
|
||||
· 如果用户未指定安装路径,则软件会安装到默认路径下,默认安装路径如下:
|
||||
|
||||
root用户:“/usr/local/Ascend”
|
||||
|
||||
非root用户:“${HOME}/Ascend”
|
||||
|
||||
其中${HOME}为当前用户目录。
|
||||
```
|
||||
|
||||
安装docker-runtime后会修改配置文件/etc/docker/daemon.json
|
||||
|
||||

|
||||
|
||||
同时自动生成默认挂载目录文件/etc/ascend-docker-runtime.d/base.list
|
||||
|
||||

|
||||
|
||||
## 挂载单芯片
|
||||
例子:
|
||||
```shell
|
||||
docker run -it -e ASCEND_VISIBLE_DEVICES=0 imageId /bin/bash
|
||||
```
|
||||
imageId 替换为实际镜像名或者ID
|
||||
|
||||
检查挂载成功:
|
||||
```shell
|
||||
ls /dev | grep davinci* && ls /dev | grep devmm_svm && ls /dev | grep hisi_hdc && ls /usr/local/Ascend/driver && ls /usr/local/ |grep dcmi && ls /usr/local/bin
|
||||
```
|
||||

|
||||
|
||||
ASCEND_VISIBLE_DEVICES=0,参数0替换为要挂载的芯片物理ID
|
||||
## 挂载多芯片
|
||||
例子:
|
||||
```shell
|
||||
docker run --rm -it -e ASCEND_VISIBLE_DEVICES=0-3 imageId /bin/bash
|
||||
或者
|
||||
docker run --rm -it -e ASCEND_VISIBLE_DEVICES=0,1,2,3 imageId /bin/bash
|
||||
或者
|
||||
docker run --rm -it -e ASCEND_VISIBLE_DEVICES=0-2,3 imageId /bin/bash
|
||||
```
|
||||
检查挂载成功:
|
||||
```shell
|
||||
ls /dev | grep davinci* && ls /dev | grep devmm_svm && ls /dev | grep hisi_hdc && ls /usr/local/Ascend/driver && ls /usr/local/ |grep dcmi && ls /usr/local/bin
|
||||
```
|
||||

|
||||
## 挂载虚拟芯片
|
||||
```shell
|
||||
docker run -it -e ASCEND_VISIBLE_DEVICES=100 -e ASCEND_RUNTIME_OPTIONS=VIRTUAL imageId /bin/bash
|
||||
```
|
||||
该命令会挂载虚拟芯片ID为100的芯片
|
||||
## 切分AI Core
|
||||
```shell
|
||||
docker run -it --rm -e ASCEND_VISIBLE_DEVICES=0 -e ASCEND_VNPU_SPECS=vir04 imageId /bin/bash
|
||||
```
|
||||
该命令表示,启动容器时,从物理芯片ID为0的芯片上,切分出4个AI Core作为虚拟设备并挂载至容器中。
|
||||
## 在默认的挂载的基础上新增挂载内容
|
||||
```
|
||||
在/etc/ascend-docker-runtime.d目录下新建挂载文件xxx.list,内容格式例子:
|
||||
/usr/bin/curl
|
||||
/usr/bin/gcc
|
||||
...
|
||||
|
||||
在命令中使用文件例子:
|
||||
docker run --rm -it -e ASCEND_VISIBLE_DEVICES=0 -e ASCEND_RUNTIME_MOUNTS=xxx imageId /bin/bash
|
||||
```
|
||||
xxx是新增挂载内容文件名,文件名必须是小写
|
||||
|
||||
检查挂载成功:
|
||||
|
||||

|
||||
|
||||
启动容器时docker客户端会根据/etc/docker/daemon.json配置文件调用docker-runtime,容器正常启动时修改
|
||||
/proc/当前进程id/cgroup 资源隔离文件
|
||||
## 卸载
|
||||
|
||||
集成工具toolboox卸载
|
||||
当不需要使用Ascend Docker Runtime时,可使用如下两种方法进行卸载
|
||||
***
|
||||
方法一:软件包卸载
|
||||
* 首先进入安装包(run包)所在路径
|
||||
```shell
|
||||
./Ascend-mindx-toolbox_{version}_linux-{arch}.run --uninstall
|
||||
cd <path to run package>
|
||||
```
|
||||
* 用户可通过以下命令卸载Ascend Docker Runtime
|
||||
```shell
|
||||
./Ascend-docker-runtime_{version}_linux-{arch}.run --uninstall
|
||||
```
|
||||
***
|
||||
方法二:脚本卸载
|
||||
* 首先进入Ascend Docker的安装路径下的“script”目录(默认安装路径为:“/usr/local/Ascend/Ascend-Docker-Runtime”)
|
||||
```shell
|
||||
cd /usr/local/Ascend/Ascend-Docker-Runtime/script
|
||||
```
|
||||
* 运行卸载的脚本进行卸载
|
||||
```shell
|
||||
./uninstall.sh
|
||||
```
|
||||
***
|
||||
卸载后需要运行以下命令使用默认的runc
|
||||
```shell
|
||||
systemctl daemon-reload && systemctl restart docker
|
||||
```
|
||||
卸载docker-runtime后会自动删除安装时配置文件/etc/docker/daemon.json中新增的内
|
||||
|
||||

|
||||
|
||||
同时删除默认挂载目录文件/etc/ascend-docker-runtime.d/base.list
|
||||
## 升级
|
||||
|
||||
集成工具toolboox安装方式升级
|
||||
在升级Ascend Docker Runtime时,可执行如下步骤升级
|
||||
* 安装包下载完成后,首先进入安装包(run包)所在路径。
|
||||
```shell
|
||||
./Ascend-mindx-toolbox_{version}_linux-{arch}.run --upgrade
|
||||
cd <path to run package>
|
||||
```
|
||||
* 可通过以下命令安装Ascend Docker Runtime。
|
||||
```shell
|
||||
chmod +x Ascend-docker-runtime_{version}_linux-{arch}.run
|
||||
./Ascend-docker-runtime_{version}_linux-{arch}.run --upgrade
|
||||
```
|
||||
* 安装成功后需要运行以下命令让Ascend Docker Runtime生效。
|
||||
```shell
|
||||
systemctl daemon-reload && systemctl restart docker
|
||||
```
|
||||
|
||||
## 版本更新记录
|
||||
| 版本 | 发布日期 | 修改说明 |
|
||||
|:------:|:----:|:-----:|
|
||||
| v3.0.0 | 1230 | 第一次发布 |
|
||||
|
||||
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 7.4 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 82 KiB |
BIN
assets/20230118566.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
@@ -49,8 +49,9 @@ HOOKSRCDIR=${HOOKSRCPATH%/${HOOKSRCNAME}}
|
||||
RUNTIMESRCPATH=$(find ${RUNTIMEDIR} -name "${RUNTIMESRCNAME}")
|
||||
RUNTIMESRCDIR=${RUNTIMESRCPATH%/${RUNTIMESRCNAME}}
|
||||
|
||||
VERSION=$(cat $TOP_DIR/Toolbox_CI/config/version.ini | grep "PackageName" | cut -d "=" -f 2)
|
||||
PACKAGENAME="Ascend-docker-runtime"
|
||||
VERSION="3.0.0"
|
||||
|
||||
CPUARCH=$(uname -m)
|
||||
|
||||
function build_bin()
|
||||
@@ -106,20 +107,29 @@ function build_bin()
|
||||
function copy_file_output()
|
||||
{
|
||||
cd ${BUILD}
|
||||
mkdir -p ${OUTPUT}
|
||||
|
||||
/bin/cp -f {${RUNTIMESRCDIR},${HOOKSRCDIR},${BUILD}/build/helper,${BUILD}/build/cli,${BUILD}/build/destroy}/build/ascend-docker* ${OUTPUT}
|
||||
/bin/cp -f scripts/base.list ${OUTPUT}
|
||||
/bin/cp -f scripts/base.list_A500 ${OUTPUT}
|
||||
/bin/cp -f scripts/base.list_A200 ${OUTPUT}
|
||||
/bin/cp -f scripts/base.list_A200ISoC ${OUTPUT}
|
||||
FILECNT=$(ls -l ${OUTPUT} |grep "^-"|wc -l)
|
||||
echo "prepare package $FILECNT bins"
|
||||
if [ $FILECNT -ne 9 ]; then
|
||||
exit 1
|
||||
if [ -d "run_pkg" ]; then
|
||||
rm -r run_pkg
|
||||
fi
|
||||
/bin/cp -rf ${ROOT}/assets ${OUTPUT}
|
||||
/bin/cp -f ${ROOT}/README.md ${OUTPUT}
|
||||
mkdir run_pkg
|
||||
|
||||
/bin/cp -f {${RUNTIMESRCDIR},${HOOKSRCDIR},${BUILD}/build/helper,${BUILD}/build/cli,${BUILD}/build/destroy}/build/ascend-docker* run_pkg
|
||||
/bin/cp -f scripts/uninstall.sh run_pkg
|
||||
/bin/cp -f scripts/base.list run_pkg
|
||||
/bin/cp -f scripts/base.list_A500 run_pkg
|
||||
/bin/cp -f scripts/base.list_A200 run_pkg
|
||||
/bin/cp -f scripts/base.list_A200ISoC run_pkg
|
||||
|
||||
/bin/cp -rf ${ROOT}/assets run_pkg
|
||||
/bin/cp -f ${ROOT}/README.md run_pkg
|
||||
/bin/cp -f scripts/run_main.sh run_pkg
|
||||
|
||||
chmod 550 run_pkg/run_main.sh
|
||||
|
||||
RUN_PKG_NAME="${PACKAGENAME}_${VERSION}_linux-${CPUARCH}.run"
|
||||
DATE=$(date -u "+%Y-%m-%d")
|
||||
bash ${OPENSRC}/makeself-release-2.4.2/makeself.sh --nomd5 --nocrc --help-header scripts/help.info --packaging-date ${DATE} \
|
||||
--tar-extra "--mtime=${DATE}" run_pkg "${RUN_PKG_NAME}" ascend-docker-runtime ./run_main.sh
|
||||
mv ${RUN_PKG_NAME} ${OUTPUT}
|
||||
}
|
||||
|
||||
function clean()
|
||||
|
||||
@@ -1,112 +0,0 @@
|
||||
component: ascend-docker-plugin
|
||||
product: ascend-docker-plugin
|
||||
systemEnv:
|
||||
- workspace
|
||||
- processor
|
||||
version: 3.0.RC2
|
||||
compile:
|
||||
## 组件名称
|
||||
name: ascend-docker-plugin
|
||||
version:
|
||||
## 构建输入源:皆为依赖如自研代码、开源软件、三方软件源码等
|
||||
## 构建准备:指定需要移动、删除、权限修改的文件
|
||||
input:
|
||||
dependency:
|
||||
- name: destroy
|
||||
offering: ascend-docker-plugin
|
||||
version:
|
||||
type: self-component
|
||||
src:
|
||||
des:
|
||||
buildType:
|
||||
buildFile: "{{ systemEnv.workspace }}/ascend-docker-plugin/build/conf/"
|
||||
- name: cli
|
||||
offering: ascend-docker-plugin
|
||||
version:
|
||||
type: self-component
|
||||
src:
|
||||
des:
|
||||
buildType:
|
||||
buildFile: "{{ systemEnv.workspace }}/ascend-docker-plugin/build/conf/"
|
||||
- name: installhelper
|
||||
offering: ascend-docker-plugin
|
||||
version:
|
||||
type: self-component
|
||||
src:
|
||||
des:
|
||||
buildType:
|
||||
buildFile: "{{ systemEnv.workspace }}/ascend-docker-plugin/build/conf/"
|
||||
- name: hook
|
||||
offering: ascend-docker-plugin
|
||||
version:
|
||||
type: self-component
|
||||
src:
|
||||
des:
|
||||
buildType:
|
||||
buildFile: "{{ systemEnv.workspace }}/ascend-docker-plugin/build/conf/"
|
||||
- name: runtime
|
||||
offering: ascend-docker-plugin
|
||||
version:
|
||||
type: self-component
|
||||
src:
|
||||
des:
|
||||
buildType:
|
||||
buildFile: "{{ systemEnv.workspace }}/ascend-docker-plugin/build/conf/"
|
||||
files: ""
|
||||
process:
|
||||
language: c
|
||||
compilerTool: make
|
||||
parameters: []
|
||||
sourcePath: ""
|
||||
buildPath: ""
|
||||
output:
|
||||
|
||||
package:
|
||||
name: Ascend-docker-runtime
|
||||
service: Ascend-docker-runtime
|
||||
MindXSDK: b050
|
||||
packageInfo:
|
||||
- name: "Ascend-docker-runtime_{{ version }}_linux-{{ systemEnv.processor }}.run"
|
||||
input:
|
||||
files:
|
||||
include:
|
||||
- remove: ["{{ systemEnv.workspace }}/ascend-docker-plugin/output/*"]
|
||||
- copy:
|
||||
src:
|
||||
- "{{ systemEnv.workspace }}/ascend-docker-plugin/runtime/build/ascend-docker-runtime"
|
||||
- "{{ systemEnv.workspace }}/ascend-docker-plugin/hook/build/ascend-docker-hook"
|
||||
- "{{ systemEnv.workspace }}/ascend-docker-plugin/build/helper/build/ascend-docker*"
|
||||
- "{{ systemEnv.workspace }}/ascend-docker-plugin/build/cli/build/ascend-docker*"
|
||||
- "{{ systemEnv.workspace }}/ascend-docker-plugin/build/destroy/build/ascend-docker*"
|
||||
- "{{ systemEnv.workspace }}/ascend-docker-plugin/build/scripts/uninstall.sh"
|
||||
- "{{ systemEnv.workspace }}/ascend-docker-plugin/build/scripts/base.list"
|
||||
- "{{ systemEnv.workspace }}/ascend-docker-plugin/build/scripts/base.list_A500"
|
||||
- "{{ systemEnv.workspace }}/ascend-docker-plugin/build/scripts/base.list_A200"
|
||||
- "{{ systemEnv.workspace }}/ascend-docker-plugin/build/scripts/base.list_A200ISoC"
|
||||
- "{{ systemEnv.workspace }}/ascend-docker-plugin/assets"
|
||||
- "{{ systemEnv.workspace }}/ascend-docker-plugin/README.md"
|
||||
- "{{ systemEnv.workspace }}/ascend-docker-plugin/build/scripts/run_main.sh"
|
||||
des: "{{ systemEnv.workspace }}/ascend-docker-plugin/build/run_pkg/"
|
||||
- copy:
|
||||
src:
|
||||
- "{{ systemEnv.workspace }}/ascend-docker-plugin/opensource/makeself-release-2.4.2/makeself.sh"
|
||||
- "{{ systemEnv.workspace }}/ascend-docker-plugin/opensource/makeself-release-2.4.2/makeself-header.sh"
|
||||
des: "{{ systemEnv.workspace }}/ascend-docker-plugin/build/conf/scripts/"
|
||||
- sed:
|
||||
option: "-i"
|
||||
srcstr: 's/%{PACKAGE_VERSION}%/{{ version }}/g'
|
||||
curfile: '{{ systemEnv.workspace }}/ascend-docker-plugin/build/run_pkg/run_main.sh'
|
||||
- commands:
|
||||
- command: "chmod 550 {{ systemEnv.workspace }}/ascend-docker-plugin/build/run_pkg/run_main.sh"
|
||||
|
||||
process:
|
||||
type: run
|
||||
srcRoot: "{{ systemEnv.workspace }}/ascend-docker-plugin/build/"
|
||||
parameters: [ makeself, help.info, "{{systemEnv.DATE }}"]
|
||||
output:
|
||||
files:
|
||||
include:
|
||||
- move:
|
||||
src: ["{{ systemEnv.workspace }}/ascend-docker-plugin/build/*.run"]
|
||||
des: "{{ systemEnv.workspace }}/ascend-docker-plugin/output"
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
component: cli
|
||||
product: ToolBox
|
||||
systemEnv:
|
||||
- workspace
|
||||
- processor
|
||||
compile:
|
||||
name: cli
|
||||
version:
|
||||
input:
|
||||
files: ""
|
||||
process:
|
||||
language: c
|
||||
compilerTool: cmake
|
||||
parameters: []
|
||||
sourcePath: "{{ systemEnv.workspace }}/ascend-docker-plugin/cli/src"
|
||||
buildPath: "{{ systemEnv.workspace }}/ascend-docker-plugin/build/cli/build"
|
||||
output:
|
||||
@@ -1,5 +0,0 @@
|
||||
version:
|
||||
pkgversion:
|
||||
AtlasEdge:
|
||||
projects:
|
||||
compilers:
|
||||
@@ -1,17 +0,0 @@
|
||||
component: destroy
|
||||
product: ToolBox
|
||||
systemEnv:
|
||||
- workspace
|
||||
- processor
|
||||
compile:
|
||||
name: destroy
|
||||
version:
|
||||
input:
|
||||
files: ""
|
||||
process:
|
||||
language: c
|
||||
compilerTool: cmake
|
||||
parameters: []
|
||||
sourcePath: "{{ systemEnv.workspace }}/ascend-docker-plugin/destroy/src"
|
||||
buildPath: "{{ systemEnv.workspace }}/ascend-docker-plugin//build/destroy/build"
|
||||
output:
|
||||
@@ -1,27 +0,0 @@
|
||||
component: hook
|
||||
product: ToolBox
|
||||
systemEnv:
|
||||
- workspace
|
||||
- processor
|
||||
compile:
|
||||
name: hook
|
||||
version:
|
||||
input:
|
||||
files:
|
||||
exclude:
|
||||
- remove: [ "{{ systemEnv.workspace }}/ascend-docker-plugin/hook/build" ]
|
||||
include:
|
||||
- commands:
|
||||
- command: "mkdir {{ systemEnv.workspace }}/ascend-docker-plugin/hook/build"
|
||||
- command: "cd {{ systemEnv.workspace }}/ascend-docker-plugin/hook"
|
||||
- command: "export GOPATH={{ systemEnv.workspace }}/ascend-docker-plugin/opensource && env"
|
||||
process:
|
||||
language: go
|
||||
compilePath: "{{ systemEnv.workspace }}/ascend-docker-plugin/hook/"
|
||||
parameters: [
|
||||
[ "buildmode","pie" ],
|
||||
[ "ldflags",'-linkmode=external -buildid=IdNetCheck -extldflags "-Wl,-z,now" -w -s '],
|
||||
[ "o", "{{ systemEnv.workspace }}/ascend-docker-plugin/hook/build/ascend-docker-hook"],
|
||||
[ "trimpath","{{ systemEnv.workspace }}/ascend-docker-plugin/hook/main.go"],
|
||||
]
|
||||
output:
|
||||
@@ -1,27 +0,0 @@
|
||||
component: installhelper
|
||||
product: ToolBox
|
||||
systemEnv:
|
||||
- workspace
|
||||
- processor
|
||||
compile:
|
||||
name: installhelper
|
||||
version:
|
||||
input:
|
||||
files:
|
||||
exclude:
|
||||
- remove: [ "{{ systemEnv.workspace }}/ascend-docker-plugin/build/helper/build" ]
|
||||
include:
|
||||
- commands:
|
||||
- command: "mkdir -p {{ systemEnv.workspace }}/ascend-docker-plugin/build/helper/build"
|
||||
- command: "cd {{ systemEnv.workspace }}/ascend-docker-plugin/install/deb/src"
|
||||
- command: "export GOPATH={{ systemEnv.workspace }}/ascend-docker-plugin/opensource && env"
|
||||
process:
|
||||
language: go
|
||||
compilePath: "{{ systemEnv.workspace }}/ascend-docker-plugin/install/deb/src"
|
||||
parameters: [
|
||||
[ "buildmode", "pie" ],
|
||||
[ "ldflags", '-linkmode=external -buildid=IdNetCheck -extldflags "-Wl,-z,now" -w -s'],
|
||||
[ "o", "{{ systemEnv.workspace }}/ascend-docker-plugin/build/helper/build/ascend-docker-plugin-install-helper"],
|
||||
[ "trimpath", "{{ systemEnv.workspace }}/ascend-docker-plugin/install/deb/src/main.go"],
|
||||
]
|
||||
output:
|
||||
@@ -1,27 +0,0 @@
|
||||
component: runtime
|
||||
product: ToolBox
|
||||
systemEnv:
|
||||
- workspace
|
||||
- processor
|
||||
compile:
|
||||
name: runtime
|
||||
version:
|
||||
input:
|
||||
files:
|
||||
exclude:
|
||||
- remove: [ "{{ systemEnv.workspace }}/ascend-docker-plugin/runtime/build" ]
|
||||
include:
|
||||
- commands:
|
||||
- command: "mkdir -p {{ systemEnv.workspace }}/ascend-docker-plugin/runtime/build"
|
||||
- command: "cd {{ systemEnv.workspace }}/ascend-docker-plugin/runtime"
|
||||
- command: "export GOPATH={{ systemEnv.workspace }}/ascend-docker-plugin/opensource && env"
|
||||
process:
|
||||
language: go
|
||||
compilePath: "{{ systemEnv.workspace }}/ascend-docker-plugin/runtime"
|
||||
parameters: [
|
||||
[ "buildmode", "pie" ],
|
||||
[ "ldflags", '-linkmode=external -buildid=IdNetCheck -extldflags "-Wl,-z,now" -w -s'],
|
||||
[ "o", "{{ systemEnv.workspace }}/ascend-docker-plugin/runtime/build/ascend-docker-runtime"],
|
||||
[ "trimpath", "{{ systemEnv.workspace }}/ascend-docker-plugin/runtime/main.go" ],
|
||||
]
|
||||
output:
|
||||
@@ -1,7 +1,7 @@
|
||||
# 查找当前目录下的所有源文件
|
||||
# 并将名称保存到 LIB_SRC 变量
|
||||
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/../../platform/HuaweiSecureC/src LIB_SRC)
|
||||
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/../../platform/libboundscheck/src LIB_SRC)
|
||||
|
||||
#生成链接库
|
||||
add_library(HuaweiSecureC ${LIB_SRC})
|
||||
target_compile_options(HuaweiSecureC PRIVATE -fstack-protector-all -fpie)
|
||||
add_library(libboundscheck ${LIB_SRC})
|
||||
target_compile_options(libboundscheck PRIVATE -fstack-protector-all -fpie)
|
||||
@@ -20,7 +20,7 @@ set -e
|
||||
ASCEND_RUNTIME_CONFIG_DIR=/etc/ascend-docker-runtime.d
|
||||
DOCKER_CONFIG_DIR=/etc/docker
|
||||
INSTALL_PATH=/usr/local/Ascend/Ascend-Docker-Runtime
|
||||
readonly PACKAGE_VERSION=%{PACKAGE_VERSION}%
|
||||
readonly PACKAGE_VERSION=3.0.0
|
||||
|
||||
|
||||
function save_install_args() {
|
||||
|
||||
@@ -6,9 +6,9 @@ set(CMAKE_C_STANDARD 11)
|
||||
message(STATUS "CMAKE_SHARED_LIBRARY_LINK_C_FLAGS = " ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS})
|
||||
set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
|
||||
|
||||
include_directories("${PROJECT_SOURCE_DIR}/../../platform/HuaweiSecureC/include")
|
||||
include_directories("${PROJECT_SOURCE_DIR}/../../platform/libboundscheck/include")
|
||||
aux_source_directory(. SRC)
|
||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../build/HuaweiSecureC ${CMAKE_CURRENT_SOURCE_DIR}/../../build/HuaweiSecureC)
|
||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../build/libboundscheck ${CMAKE_CURRENT_SOURCE_DIR}/../../build/libboundscheck)
|
||||
add_executable(ascend-docker-cli ${SRC})
|
||||
target_compile_options(ascend-docker-cli PRIVATE -fstack-protector-all -fpie -D_FORTIFY_SOURCE=2 -O2)
|
||||
target_link_libraries(ascend-docker-cli -pie -Wl,-s,-z,now HuaweiSecureC)
|
||||
target_link_libraries(ascend-docker-cli -pie -Wl,-s,-z,now libboundscheck)
|
||||
|
||||
@@ -81,6 +81,7 @@ target_link_libraries(ut_demo
|
||||
)
|
||||
target_link_libraries(ut_demo -fprofile-arcs -pthread)
|
||||
target_include_directories(ut_demo PUBLIC ${PROJECT_SOURCE_DIR}/Depend/googletest/googletest/include)
|
||||
target_include_directories(ut_demo PUBLIC ${PROJECT_SOURCE_DIR}/Depend/mockcpp/3rdparty)
|
||||
target_include_directories(ut_demo PUBLIC ${PROJECT_SOURCE_DIR}/Depend/mockcpp/include)
|
||||
target_include_directories(ut_demo PUBLIC ${PROJECT_SOURCE_DIR}/Depend/HuaweiSecureC/include)
|
||||
target_link_libraries(ut_demo demolib)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
# 查找当前目录下的所有源文件
|
||||
# 并将名称保存到 LIB_SRC 变量
|
||||
aux_source_directory(src LIB_SRC)
|
||||
include_directories(include)
|
||||
|
||||
#生成链接库
|
||||
add_library(HuaweiSecureC STATIC ${LIB_SRC})
|
||||
target_compile_options(HuaweiSecureC PRIVATE -fstack-protector-all -fpie)
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
# 查找当前目录下的所有源文件
|
||||
# 并将名称保存到 LIB_SRC 变量
|
||||
aux_source_directory(src LIB_SRC)
|
||||
include_directories(include)
|
||||
|
||||
#生成链接库
|
||||
add_library(libboundscheck STATIC ${LIB_SRC})
|
||||
target_compile_options(libboundscheck PRIVATE -fstack-protector-all -fpie)
|
||||
31
cli/test/dt/README.md
Normal file
@@ -0,0 +1,31 @@
|
||||
# 使用测试用例
|
||||
|
||||
进入Ascend Docker Runtime的根目录
|
||||
```shell
|
||||
cd <path-to-root-path-of-ascend-docker-runtime>
|
||||
```
|
||||
下载相关的开源库,注意对应的tag
|
||||
```shell
|
||||
git clone -b v2.7 https://github.com/sinojelly/mockcpp.git
|
||||
git clone -b release-1.10.0 https://github.com/google/googletest.git
|
||||
git clone -b v1.1.10 https://gitee.com/openeuler/libboundscheck.git
|
||||
```
|
||||
进入dt目录
|
||||
```shell
|
||||
cd cli/test/dt
|
||||
```
|
||||
编译
|
||||
```shell
|
||||
sh build.sh
|
||||
```
|
||||
结果会显示相关的测试用例覆盖率
|
||||
```shell
|
||||
...
|
||||
Writing directory view page.
|
||||
Overall coverage rate:
|
||||
lines......: 63.3% (746 of 1179 lines)
|
||||
functions..: 91.4% (74 of 81 functions)
|
||||
branches...: 54.0% (409 of 758 branches)
|
||||
-------------run_ut cli end-------------------
|
||||
run_lcov_cli succeed.
|
||||
```
|
||||
@@ -27,7 +27,7 @@ usage()
|
||||
exit 1
|
||||
}
|
||||
|
||||
makepre()
|
||||
makepre()
|
||||
{
|
||||
if [ -f ${CUR_DIR}/../../../googletest.tar.gz ]; then
|
||||
cd ${CUR_DIR}/../../../
|
||||
@@ -36,7 +36,7 @@ makepre()
|
||||
cd ${CUR_DIR}
|
||||
fi
|
||||
if [ -d ${CUR_DIR}/../../../googletest ]; then
|
||||
cp -rf ${CUR_DIR}/../../../googletest ${CUR_DIR}/Depend/googletest/
|
||||
cp -rf ${CUR_DIR}/../../../googletest/* ${CUR_DIR}/Depend/googletest/
|
||||
fi
|
||||
|
||||
if [ -f ${CUR_DIR}/../../../mockcpp.tar.gz ]; then
|
||||
@@ -47,17 +47,13 @@ makepre()
|
||||
if [ -d ${CUR_DIR}/../../../mockcpp ]; then
|
||||
cp -rf ${CUR_DIR}/../../../mockcpp/* ${CUR_DIR}/Depend/mockcpp/
|
||||
cd ${CUR_DIR}/Depend/mockcpp
|
||||
sed -i 's/${PYTHON_EXECUTABLE}/python2/g' src/CMakeLists.txt
|
||||
sed -i '57i #if 0' ./include/mockcpp/mockcpp.h
|
||||
sed -i '64i #endif' ./include/mockcpp/mockcpp.h
|
||||
sed -i '5s/SET(PYTHON ${PYTHON_EXECUTABLE})/SET(PYTHON python2)/' ./src/CMakeLists.txt
|
||||
sed -i '14s/SET(MOCKCPP_SRC_ROOT ${CMAKE_SOURCE_DIR})/SET(MOCKCPP_SRC_ROOT ${CMAKE_SOURCE_DIR}\/mockcpp)/' ./src/CMakeLists.txt
|
||||
sed -i '16s/SET(MOCKCPP_SRC_ROOT ${CMAKE_SOURCE_DIR})/SET(MOCKCPP_SRC_ROOT ${CMAKE_SOURCE_DIR}\/mockcpp)/' ./src/CMakeLists.txt
|
||||
cmake .
|
||||
make
|
||||
cd ${CUR_DIR}
|
||||
fi
|
||||
|
||||
# 如果没有生成过,则需要生成
|
||||
# need to compile lib if it is not present
|
||||
if [ ! -d Depend/lib ]
|
||||
then
|
||||
echo "-------------make pre begin-------------------"
|
||||
@@ -76,20 +72,20 @@ makepre()
|
||||
fi
|
||||
}
|
||||
|
||||
build_huaweisecurec()
|
||||
build_boundscheck()
|
||||
{
|
||||
echo "-------------build_ut huaweisecurec begin-------------------"
|
||||
if [ -f ${CUR_DIR}/../../../HuaweiSecureC.tar.gz ]; then
|
||||
echo "-------------build_ut boundscheck begin-------------------"
|
||||
if [ -f ${CUR_DIR}/../../../libboundscheck.tar.gz ]; then
|
||||
cd ${CUR_DIR}/../../../
|
||||
tar xf ${CUR_DIR}/../../../HuaweiSecureC.tar.gz
|
||||
mv huawei_secure_c-tag_Huawei_Secure_C_V100R001C01SPC011B003_00001/ HuaweiSecureC
|
||||
tar xf ${CUR_DIR}/../../../libboundscheck.tar.gz
|
||||
mv libboundscheck-v1.1.10/ libboundscheck
|
||||
cd ${CUR_DIR}
|
||||
fi
|
||||
if [ -d ${CUR_DIR}/../../../HuaweiSecureC/ ]; then
|
||||
cp -rf ${CUR_DIR}/../../../HuaweiSecureC/* ${CUR_DIR}/Depend/HuaweiSecureC/
|
||||
cp -rf ${CUR_DIR}/../../../HuaweiSecureC/* ${SRC_ROOT}/HuaweiSecureC/
|
||||
if [ -d ${CUR_DIR}/../../../libboundscheck ]; then
|
||||
cp -rf ${CUR_DIR}/../../../libboundscheck/* ${CUR_DIR}/Depend/libboundscheck/
|
||||
cp -rf ${CUR_DIR}/../../../libboundscheck/* ${SRC_ROOT}/libboundscheck/
|
||||
fi
|
||||
cd ${CUR_DIR}/Depend/HuaweiSecureC
|
||||
cd ${CUR_DIR}/Depend/libboundscheck
|
||||
if [ -d ./build ]; then
|
||||
rm -rf ./build
|
||||
fi
|
||||
@@ -97,8 +93,8 @@ build_huaweisecurec()
|
||||
cd ./build
|
||||
cmake ..
|
||||
make
|
||||
cp libHuaweiSecureC.a ${CUR_DIR}/srclib
|
||||
echo "-------------build_ut huaweisecurec end-------------------"
|
||||
cp liblibboundscheck.a ${CUR_DIR}/srclib
|
||||
echo "-------------build_ut boundscheck end-------------------"
|
||||
}
|
||||
|
||||
build_cli()
|
||||
@@ -160,7 +156,7 @@ main()
|
||||
echo SRC_ROOT is "$SRC_ROOT"
|
||||
|
||||
# step_3 编译对应模块
|
||||
build_huaweisecurec
|
||||
build_boundscheck
|
||||
build_cli
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
|
||||
@@ -15,7 +15,7 @@ ENDIF()
|
||||
add_definitions(-Dgtest)
|
||||
#set(UT_DEMO_SRCS ../../../src/main.c)
|
||||
aux_source_directory(../../../src UT_DEMO_SRCS)
|
||||
include_directories("../Depend/HuaweiSecureC/include")
|
||||
include_directories("../Depend/libboundscheck/include")
|
||||
|
||||
add_library(${PROJECT_NAME} ${UT_DEMO_SRCS})
|
||||
target_link_libraries(${PROJECT_NAME} ${PROJECT_SOURCE_DIR}/libHuaweiSecureC.a)
|
||||
target_link_libraries(${PROJECT_NAME} ${PROJECT_SOURCE_DIR}/liblibboundscheck.a)
|
||||
|
||||
@@ -7,10 +7,10 @@ add_compile_options(-fstack-protector-all -D _GNU_SOURCE -Wl,--no-undefined)
|
||||
|
||||
message(STATUS "CMAKE_SHARED_LIBRARY_LINK_C_FLAGS = " ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS})
|
||||
set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
|
||||
include_directories("${PROJECT_SOURCE_DIR}/../../platform/HuaweiSecureC/include")
|
||||
include_directories("${PROJECT_SOURCE_DIR}/../../platform/libboundscheck/include")
|
||||
include_directories("${PROJECT_SOURCE_DIR}/../../cli/src")
|
||||
aux_source_directory(. SRC)
|
||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../build/HuaweiSecureC ${CMAKE_CURRENT_SOURCE_DIR}/../../build/HuaweiSecureC)
|
||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../build/libboundscheck ${CMAKE_CURRENT_SOURCE_DIR}/../../build/libboundscheck)
|
||||
add_executable(ascend-docker-destroy ../../cli/src/logger.c ../../cli/src/utils.c ../../cli/src/basic.c ${SRC} )
|
||||
target_compile_options(ascend-docker-destroy PRIVATE -fstack-protector-all -fpie -ldl -D_FORTIFY_SOURCE=2 -O2)
|
||||
target_link_libraries(ascend-docker-destroy -ldl -pie -Wl,-s,-z,now HuaweiSecureC)
|
||||
target_link_libraries(ascend-docker-destroy -ldl -pie -Wl,-s,-z,now libboundscheck)
|
||||
|
||||
16
hook/go.mod
@@ -1,17 +1,23 @@
|
||||
module main
|
||||
|
||||
go 1.16
|
||||
go 1.17
|
||||
|
||||
require (
|
||||
github.com/opencontainers/runtime-spec v1.0.3-0.20220718201635-a8106e99982b
|
||||
github.com/prashantv/gostub v1.1.0
|
||||
huawei.com/mindx/common/hwlog v0.0.0
|
||||
huawei.com/npu-exporter/v3 v3.0.0
|
||||
mindxcheckutils v1.0.0
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/fsnotify/fsnotify v1.6.0 // indirect
|
||||
github.com/gopherjs/gopherjs v1.17.2 // indirect
|
||||
github.com/jtolds/gls v4.20.0+incompatible // indirect
|
||||
github.com/smartystreets/assertions v1.13.0 // indirect
|
||||
golang.org/x/sys v0.0.0-20220908164124-27713097b956 // indirect
|
||||
)
|
||||
|
||||
replace (
|
||||
huawei.com/mindx/common/cache => codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/common-utils.git/cache v0.0.2
|
||||
huawei.com/mindx/common/hwlog => codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/common-utils.git/hwlog v0.0.10
|
||||
huawei.com/mindx/common/utils => codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/common-utils.git/utils v0.0.6
|
||||
huawei.com/npu-exporter/v3 => gitee.com/ascend/ascend-npu-exporter/v3 v3.0.0
|
||||
mindxcheckutils => ../mindxcheckutils
|
||||
)
|
||||
|
||||
43
hook/go.sum
@@ -1,39 +1,22 @@
|
||||
codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/common-utils.git/hwlog v0.0.3 h1:Dq2tZTuClykBv1tS6C2XU6hY/waVK0K5lyr/8tJcT/I=
|
||||
codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/common-utils.git/hwlog v0.0.3/go.mod h1:tuvVYh4aDcHqpiyNKZNiBgt1XBehJ130VubLidKWNjY=
|
||||
codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/common-utils.git/utils v0.0.6 h1:nGlHkoj7L6DdSYFFLjceD6t5XrNAKrM+Gk3wT0iOfWE=
|
||||
codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/common-utils.git/utils v0.0.6/go.mod h1:gzaoiHwloaNTtm46GVe93KtXMcXVHJ8LBVqWEAjmh+0=
|
||||
gitee.com/ascend/ascend-npu-exporter/v3 v3.0.0 h1:JfB5Kmce3mWEzbtAhybJozGp6+yJH+jU7D6WytEcOzs=
|
||||
gitee.com/ascend/ascend-npu-exporter/v3 v3.0.0/go.mod h1:78lAYBVM18u8mobeoKqhJP7POvbayTYBk32hnm9IkfQ=
|
||||
github.com/agiledragon/gomonkey/v2 v2.8.0 h1:u2K2nNGyk0ippzklz1CWalllEB9ptD+DtSXeCX5O000=
|
||||
github.com/agiledragon/gomonkey/v2 v2.8.0/go.mod h1:ap1AmDzcVOAz1YpeJ3TCzIgstoaWLA6jbbgxfB4w2iY=
|
||||
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI=
|
||||
github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU=
|
||||
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=
|
||||
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
|
||||
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
|
||||
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
|
||||
github.com/gopherjs/gopherjs v1.17.2 h1:fQnZVsXk8uxXIStYb0N4bGk7jeyTalG/wsZjQ25dO0g=
|
||||
github.com/gopherjs/gopherjs v1.17.2/go.mod h1:pRRIvn/QzFLrKfvEz3qUuEhtE/zLCWfreZ6J5gM2i+k=
|
||||
github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
|
||||
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
|
||||
github.com/opencontainers/runtime-spec v1.0.2 h1:UfAcuLBJB9Coz72x1hgl8O5RVzTdNiaglX6v2DM6FI0=
|
||||
github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
|
||||
github.com/opencontainers/runtime-spec v1.0.3-0.20220718201635-a8106e99982b h1:udwtfS44rxYE/ViMLchHQBjfE60GZSB1arY7BFbyxLs=
|
||||
github.com/opencontainers/runtime-spec v1.0.3-0.20220718201635-a8106e99982b/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g=
|
||||
github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U=
|
||||
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
|
||||
github.com/smartystreets/assertions v1.2.0 h1:42S6lae5dvLc7BrLu/0ugRtcFVjoJNMC/N3yZFZkDFs=
|
||||
github.com/smartystreets/assertions v1.2.0/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo=
|
||||
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
|
||||
github.com/smartystreets/goconvey v1.7.2 h1:9RBaZCeXEQ3UselpuwUQHltGVXvdwm6cv1hgR6gDIPg=
|
||||
github.com/smartystreets/goconvey v1.7.2/go.mod h1:Vw0tHAZW6lzCRk3xgdin6fKYcG+G3Pg9vgXWeJpQFMM=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/smartystreets/assertions v1.13.0 h1:Dx1kYM01xsSqKPno3aqLnrwac2LetPvN23diwyr69Qs=
|
||||
github.com/smartystreets/assertions v1.13.0/go.mod h1:wDmR7qL282YbGsPy6H/yAsesrxfxaaSlJazyFLYVFx8=
|
||||
github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s=
|
||||
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c h1:F1jZWGFhYfh0Ci55sIpILtKKK8p3i2/krTr0H1rg74I=
|
||||
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
golang.org/x/sys v0.0.0-20220908164124-27713097b956 h1:XeJjHH1KiLpKGb6lvMiksZ9l0fVUh+AmGcm0nOMEBOY=
|
||||
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
|
||||
@@ -33,7 +33,7 @@ import (
|
||||
|
||||
"mindxcheckutils"
|
||||
|
||||
"huawei.com/mindx/common/hwlog"
|
||||
"huawei.com/npu-exporter/v3/common-utils/hwlog"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -1,15 +1,21 @@
|
||||
module main
|
||||
|
||||
go 1.16
|
||||
go 1.17
|
||||
|
||||
require (
|
||||
huawei.com/mindx/common/hwlog v0.0.0
|
||||
huawei.com/npu-exporter/v3 v3.0.0
|
||||
mindxcheckutils v1.0.0
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/fsnotify/fsnotify v1.6.0 // indirect
|
||||
github.com/gopherjs/gopherjs v1.17.2 // indirect
|
||||
github.com/jtolds/gls v4.20.0+incompatible // indirect
|
||||
github.com/smartystreets/assertions v1.13.0 // indirect
|
||||
golang.org/x/sys v0.0.0-20220908164124-27713097b956 // indirect
|
||||
)
|
||||
|
||||
replace (
|
||||
huawei.com/mindx/common/cache => codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/common-utils.git/cache v0.0.2
|
||||
huawei.com/mindx/common/hwlog => codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/common-utils.git/hwlog v0.0.10
|
||||
huawei.com/mindx/common/utils => codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/common-utils.git/utils v0.0.6
|
||||
huawei.com/npu-exporter/v3 => gitee.com/ascend/ascend-npu-exporter/v3 v3.0.0
|
||||
mindxcheckutils => ../../../mindxcheckutils
|
||||
)
|
||||
|
||||
@@ -26,7 +26,7 @@ import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"huawei.com/mindx/common/hwlog"
|
||||
"huawei.com/npu-exporter/v3/common-utils/hwlog"
|
||||
|
||||
"mindxcheckutils"
|
||||
)
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
module mindxcheckutils
|
||||
|
||||
go 1.16
|
||||
go 1.17
|
||||
|
||||
@@ -251,7 +251,7 @@ func ChangeRuntimeLogMode(runLog, operLog string) error {
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
return fmt.Errorf("traversal runLogDir failed")
|
||||
return fmt.Errorf("traversal runLogDir failed: %s", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -1,19 +1,25 @@
|
||||
module main
|
||||
|
||||
go 1.16
|
||||
go 1.17
|
||||
|
||||
require (
|
||||
github.com/opencontainers/runtime-spec v1.0.3-0.20220718201635-a8106e99982b
|
||||
github.com/prashantv/gostub v1.1.0
|
||||
github.com/stretchr/testify v1.8.0 // indirect
|
||||
huawei.com/mindx/common/hwlog v0.0.0
|
||||
huawei.com/npu-exporter/v3 v3.0.0
|
||||
mindxcheckutils v1.0.0
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/fsnotify/fsnotify v1.6.0 // indirect
|
||||
github.com/gopherjs/gopherjs v1.17.2 // indirect
|
||||
github.com/jtolds/gls v4.20.0+incompatible // indirect
|
||||
github.com/smartystreets/assertions v1.13.0 // indirect
|
||||
github.com/stretchr/testify v1.8.0 // indirect
|
||||
golang.org/x/sys v0.0.0-20220908164124-27713097b956 // indirect
|
||||
)
|
||||
|
||||
replace (
|
||||
huawei.com/mindx/common/cache => codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/common-utils.git/cache v0.0.2
|
||||
github.com/prashantv/gostub => github.com/prashantv/gostub v1.0.1-0.20191007164320-bbe3712b9c4a
|
||||
huawei.com/mindx/common/hwlog => codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/common-utils.git/hwlog v0.0.10
|
||||
huawei.com/mindx/common/utils => codehub-dg-y.huawei.com/MindX_DL/AtlasEnableWarehouse/common-utils.git/utils v0.0.6
|
||||
huawei.com/npu-exporter/v3 => gitee.com/ascend/ascend-npu-exporter/v3 v3.0.0
|
||||
mindxcheckutils => ../mindxcheckutils
|
||||
)
|
||||
|
||||
@@ -29,7 +29,7 @@ import (
|
||||
"syscall"
|
||||
|
||||
"github.com/opencontainers/runtime-spec/specs-go"
|
||||
"huawei.com/mindx/common/hwlog"
|
||||
"huawei.com/npu-exporter/v3/common-utils/hwlog"
|
||||
|
||||
"main/dcmi"
|
||||
"mindxcheckutils"
|
||||
|
||||