Add Debug build to OpenVINO-ONNX CI (#5034)

This commit is contained in:
Michał Karzyński 2021-04-01 13:04:51 +02:00 committed by GitHub
parent 8c50c3d155
commit 0f8cdfa293
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 42 additions and 21 deletions

View File

@ -1,6 +1,10 @@
FROM ubuntu:20.04
LABEL version=2020.07.09.1
LABEL version=2021.03.30.1
# Build configuration arguments
ARG BUILD_TYPE=Release
ARG PROTOBUF_LITE=OFF
ARG http_proxy
ARG https_proxy
@ -10,7 +14,6 @@ ENV https_proxy ${https_proxy}
ENV CI=true
ENV DEBIAN_FRONTEND=noninteractive
ENV PYTHONUNBUFFERED 1
ARG PROTOBUF_LITE=OFF
# Install base dependencies
RUN apt-get update && apt-get install -y locales && apt-get clean autoclean && apt-get autoremove -y
@ -52,7 +55,7 @@ RUN apt-get update && apt-get -y --no-install-recommends install \
COPY . /openvino/
WORKDIR /openvino/build
RUN cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DENABLE_VPU=OFF \
-DENABLE_GNA=OFF \
-DENABLE_OPENCV=OFF \
@ -75,7 +78,7 @@ RUN make -j $(nproc) install
# Run tests via tox
WORKDIR /openvino/ngraph/python
ENV NGRAPH_CPP_BUILD_PATH=/openvino/dist/deployment_tools/ngraph
ENV ngraph_DIR=/openvino/dist/deployment_tools/ngraph
ENV LD_LIBRARY_PATH=/openvino/dist/deployment_tools/ngraph/lib
ENV PYTHONPATH=/openvino/bin/intel64/Release/lib/python_api/python3.8:${PYTHONPATH}
ENV PYTHONPATH=/openvino/bin/intel64/${BUILD_TYPE}/lib/python_api/python3.8:${PYTHONPATH}
CMD tox

View File

@ -5,8 +5,9 @@ DOCKER_CONTAINER_NAME= "openvino-onnx-ci-container"
DOCKER_IMAGE_TAG = "openvino-onnx-ci-image"
BACKEND_CONFIGURATIONS = [
[ protobuf_lite : "ON" ],
[ protobuf_lite : "OFF" ]
[ name: "Release", build_type: "Release", protobuf_lite : "OFF" ],
[ name: "Debug", build_type: "Debug", protobuf_lite : "OFF" ],
[ name: "Rel+Lite", build_type: "Release", protobuf_lite : "ON" ],
]
// workaround for aborting previous builds on PR update
@ -95,29 +96,41 @@ def updateModels() {
"""
}
def buildDockerImage(String protobuf_lite="OFF") {
def buildDockerImage(Map configuration) {
updateModels()
sh """
docker build --tag=${DOCKER_IMAGE_TAG} --build-arg PROTOBUF_LITE=${protobuf_lite} \
docker build --tag=${DOCKER_IMAGE_TAG} \
--build-arg BUILD_TYPE=${configuration.build_type} \
--build-arg PROTOBUF_LITE=${configuration.protobuf_lite} \
--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 --name ${DOCKER_CONTAINER_NAME} \
--volume ${HOME}/ONNX_CI/data/model_zoo:/root/.onnx/model_zoo \
${DOCKER_IMAGE_TAG}
"""
def runTests(Map configuration) {
// Run only basic unit tests in Debug configuration
if (configuration.build_type == "Debug") {
sh """
docker run --name ${DOCKER_CONTAINER_NAME} ${DOCKER_IMAGE_TAG}
"""
}
// Run unit-tests AND large model tests by default
else {
sh """
docker run --name ${DOCKER_CONTAINER_NAME} \
--volume ${HOME}/ONNX_CI/data/model_zoo:/root/.onnx/model_zoo \
${DOCKER_IMAGE_TAG} /bin/bash -c "tox && tox -e zoo_models"
"""
}
}
def getConfigurationsMap() {
def configurationsMap = [:]
for (backend in BACKEND_CONFIGURATIONS) {
def configuration = backend.clone()
configuration.name = "protobuf-lite ${configuration.protobuf_lite}"
configuration.name = "${configuration.name}"
configurationsMap[configuration.name] = {
stage(configuration.name) { CONFIGURATION_WORKFLOW(configuration) }
}
@ -143,12 +156,12 @@ CONFIGURATION_WORKFLOW = { configuration ->
}
stage("Prepare Docker environment") {
dir("${WORKDIR}") {
buildDockerImage(configuration.protobuf_lite)
buildDockerImage(configuration)
}
}
stage("Run tests") {
timeout(time: 20, unit: 'MINUTES') {
runTests()
runTests(configuration)
}
}
}
@ -166,8 +179,8 @@ CONFIGURATION_WORKFLOW = { configuration ->
stage("Cleanup") {
deleteDir()
sh """
docker image prune -f
docker rm -f ${DOCKER_CONTAINER_NAME}
docker image prune -f
"""
}
}

View File

@ -7,4 +7,4 @@ pydocstyle==5.1.1
pytest==6.1.2
retrying==1.3.3
tox==3.23.0
wheel==0.35.1
wheel==0.36.2

View File

@ -13,7 +13,7 @@ deps =
setenv =
NGRAPH_BACKEND = {env:NGRAPH_BACKEND:"CPU"}
PYTHONPATH = {env:PYTHONPATH}
ngraph_DIR = {env:NGRAPH_CPP_BUILD_PATH}
ngraph_DIR = {env:ngraph_DIR}
passenv =
http_proxy
https_proxy
@ -24,6 +24,11 @@ commands=
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 -v -k 'not _cuda' --ignore=tests/test_onnx/test_zoo_models.py
[testenv:zoo_models]
commands=
{envbindir}/python setup.py bdist_wheel
{envbindir}/pip install --no-index --pre --find-links=dist/ ngraph-core
pytest --backend={env:NGRAPH_BACKEND} tests/test_onnx/test_zoo_models.py -v -n 4 -k 'not _cuda' --model_zoo_xfail
[testenv:devenv]