From 07217614924c11740f4facae31b25cea24a09949 Mon Sep 17 00:00:00 2001 From: Rafal Blaczkowski Date: Tue, 11 Aug 2020 09:28:55 +0200 Subject: [PATCH] Enable Model Zoo in OpenVINO-ONNX CI (#1660) --- .ci/openvino-onnx/Dockerfile | 2 +- .ci/openvino-onnx/Jenkinsfile | 20 ++++++++++++++++--- .../python/tests/test_onnx/test_zoo_models.py | 4 ---- ngraph/python/tox.ini | 3 ++- 4 files changed, 20 insertions(+), 9 deletions(-) diff --git a/.ci/openvino-onnx/Dockerfile b/.ci/openvino-onnx/Dockerfile index d84afab1953..a0c30ce5cc5 100644 --- a/.ci/openvino-onnx/Dockerfile +++ b/.ci/openvino-onnx/Dockerfile @@ -81,4 +81,4 @@ ENV LD_LIBRARY_PATH=/openvino/dist/lib ENV NGRAPH_ONNX_IMPORT_ENABLE=TRUE ENV PYTHONPATH=/openvino/bin/intel64/Release/lib/python_api/python3.8:${PYTHONPATH} RUN git clone --recursive https://github.com/pybind/pybind11.git -RUN tox +CMD tox diff --git a/.ci/openvino-onnx/Jenkinsfile b/.ci/openvino-onnx/Jenkinsfile index 1a900a3074d..3b6f136fd5f 100644 --- a/.ci/openvino-onnx/Jenkinsfile +++ b/.ci/openvino-onnx/Jenkinsfile @@ -1,7 +1,9 @@ - // Copyright (C) 2018-2020 Intel Corporation // SPDX-License-Identifier: Apache-2.0 +DOCKER_CONTAINER_NAME= "openvino-onnx-ci-container" +DOCKER_IMAGE_TAG = "openvino-onnx-ci-image" + def getGitPrInfo(String project) { def gitPrInfo = [ prAuthorEmail : "", @@ -58,12 +60,19 @@ def gitSubmoduleUpdate(String repository_name) { def buildDockerImage() { sh """ - docker build --tag=openvino-onnx-ci --file=.ci/openvino-onnx/Dockerfile \ + docker build --tag=${DOCKER_IMAGE_TAG} --file=.ci/openvino-onnx/Dockerfile \ --build-arg http_proxy=http://proxy-chain.intel.com:911/ \ --build-arg https_proxy=http://proxy-chain.intel.com:912/ . """ } +def runTests() { + sh """ + docker run --rm --name ${DOCKER_CONTAINER_NAME} \ + --volume ${HOME}/ONNX_CI/onnx_models/.onnx:/root/.onnx ${DOCKER_IMAGE_TAG} + """ +} + pipeline { agent { label "OpenVino" @@ -84,13 +93,18 @@ pipeline { gitSubmoduleUpdate(PROJECT_NAME) } } - stage("Run tests") { + stage("Prepare Docker environment") { steps{ dir("${WORKDIR}") { buildDockerImage() } } } + stage("Run tests") { + steps{ + runTests() + } + } } post { failure { diff --git a/ngraph/python/tests/test_onnx/test_zoo_models.py b/ngraph/python/tests/test_onnx/test_zoo_models.py index bc035a3b359..a9adba6adcb 100644 --- a/ngraph/python/tests/test_onnx/test_zoo_models.py +++ b/ngraph/python/tests/test_onnx/test_zoo_models.py @@ -592,16 +592,12 @@ test_cases_list = [ test_cases.test_rain_princess_opset9_cpu, test_cases.test_ssd_opset10_cpu, test_cases.test_resnet152_v2_opset7_cpu, - test_cases.test_resnet50_v2_opset7_cpu, test_cases.test_resnet18_v1_opset7_cpu, test_cases.test_resnet18_v2_opset7_cpu, - test_cases.test_resnet34_v1_opset7_cpu, test_cases.test_resnet34_v2_opset7_cpu, test_cases.test_resnet101_v2_opset7_cpu, test_cases.test_resnet101_v1_opset7_cpu, test_cases.test_ResNet101_DUC_opset7_cpu, - test_cases.test_arcfaceresnet100_opset8_cpu, - test_cases.test_mobilenetv2_opset7_cpu, test_cases.test_candy_opset8_cpu, test_cases.test_resnet152_v1_opset7_cpu ] diff --git a/ngraph/python/tox.ini b/ngraph/python/tox.ini index 23944ce7277..8b1de635ab6 100644 --- a/ngraph/python/tox.ini +++ b/ngraph/python/tox.ini @@ -9,6 +9,7 @@ deps = -rrequirements_test.txt mypy flake8-bugbear + pytest-xdist setenv = NGRAPH_CPP_BUILD_PATH = {env:NGRAPH_CPP_BUILD_PATH:{homedir}/ngraph_dist} NGRAPH_ONNX_IMPORT_ENABLE = {env:NGRAPH_ONNX_IMPORT_ENABLE:"FALSE"} @@ -26,7 +27,7 @@ commands= flake8 {posargs:src/ setup.py} flake8 --ignore=D100,D101,D102,D103,D104,D105,D107,W503 tests/ # ignore lack of docs in tests mypy --config-file=tox.ini {posargs:src/} - pytest --backend={env:NGRAPH_BACKEND} tests/test_ngraph tests/test_onnx -v -k 'not test_zoo_models.py' + pytest --backend={env:NGRAPH_BACKEND} tests -v -n 20 [testenv:devenv] envdir = devenv