From 8d06e5a9df3024dbaadf4e221812d2fd46faabcd Mon Sep 17 00:00:00 2001 From: leqiao-1 <61653207+leqiao-1@users.noreply.github.com> Date: Thu, 17 Feb 2022 17:10:01 +0800 Subject: [PATCH] Add openvino base image option (#10581) * add selectable python package build pipeline * update tensorrt version * update tensorrt version * Update Dockerfile.ubuntu_openvino * Update install_ubuntu.sh * add parameters for openvino base image * fix syntax error --- .../github/azure-pipelines/py-package-build-pipeline.yml | 6 ++++++ .../templates/py-packaging-selectable-stage.yml | 9 ++++++++- .../github/linux/docker/Dockerfile.ubuntu_openvino | 3 ++- .../github/linux/docker/scripts/install_ubuntu.sh | 8 +++++++- 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/py-package-build-pipeline.yml b/tools/ci_build/github/azure-pipelines/py-package-build-pipeline.yml index 82b89315e9..1ed02e39dd 100644 --- a/tools/ci_build/github/azure-pipelines/py-package-build-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/py-package-build-pipeline.yml @@ -34,6 +34,11 @@ parameters: type: string default: ' ' +- name: ubuntu_version_linux_cpu + displayName: 'Ubuntu Version for Linux CPU package.' + type: string + default: '20.04' + trigger: none stages: @@ -46,3 +51,4 @@ stages: python_version: ${{ parameters.python_version }} cpu_build_py_parameters: ${{ parameters.cpu_build_py_parameters }} gpu_build_py_parameters: ${{ parameters.gpu_build_py_parameters }} + ubuntu_version_linux_cpu: ${{ parameters.ubuntu_version_linux_cpu }} diff --git a/tools/ci_build/github/azure-pipelines/templates/py-packaging-selectable-stage.yml b/tools/ci_build/github/azure-pipelines/templates/py-packaging-selectable-stage.yml index 632755eb1e..609bf0f72d 100644 --- a/tools/ci_build/github/azure-pipelines/templates/py-packaging-selectable-stage.yml +++ b/tools/ci_build/github/azure-pipelines/templates/py-packaging-selectable-stage.yml @@ -34,6 +34,11 @@ parameters: type: string default: ' ' +- name: ubuntu_version_linux_cpu + displayName: 'Ubuntu Version for Linux CPU package.' + type: string + default: '20.04' + stages: - stage: Python_Packaging @@ -49,6 +54,8 @@ stages: ${{ each PythonVersion in parameters.python_version }}: 'Python${{ PythonVersion }}': PythonVersion: ${{ PythonVersion }} + variables: + UbuntuVersion: ${{ parameters.ubuntu_version_linux_cpu }} steps: - checkout: self clean: true @@ -58,7 +65,7 @@ stages: parameters: Dockerfile: tools/ci_build/github/linux/docker/Dockerfile.ubuntu_openvino Context: tools/ci_build/github/linux/docker - DockerBuildArgs: "--build-arg PYTHON_VERSION=$(PythonVersion)" + DockerBuildArgs: "--build-arg PYTHON_VERSION=$(PythonVersion) --build-arg UBUNTU_VERSION=$(UbuntuVersion)" Repository: onnxruntimecpubuild - task: CmdLine@2 diff --git a/tools/ci_build/github/linux/docker/Dockerfile.ubuntu_openvino b/tools/ci_build/github/linux/docker/Dockerfile.ubuntu_openvino index 5e3ffe85b2..d93d7e9a4a 100644 --- a/tools/ci_build/github/linux/docker/Dockerfile.ubuntu_openvino +++ b/tools/ci_build/github/linux/docker/Dockerfile.ubuntu_openvino @@ -1,4 +1,5 @@ -FROM ubuntu:20.04 +ARG UBUNTU_VERSION=20.04 +FROM ubuntu:${UBUNTU_VERSION} ARG OPENVINO_VERSION=2021.4 ARG PYTHON_VERSION=3.8 diff --git a/tools/ci_build/github/linux/docker/scripts/install_ubuntu.sh b/tools/ci_build/github/linux/docker/scripts/install_ubuntu.sh index 058cee0d91..45472d90a6 100755 --- a/tools/ci_build/github/linux/docker/scripts/install_ubuntu.sh +++ b/tools/ci_build/github/linux/docker/scripts/install_ubuntu.sh @@ -41,7 +41,6 @@ PACKAGE_LIST="autotools-dev \ libcurl4 \ libssl1.1 \ libkrb5-3 \ - libicu66 \ libtinfo-dev \ libtool \ openssh-server \ @@ -58,6 +57,13 @@ PACKAGE_LIST="autotools-dev \ if [ $DEVICE_TYPE = "Normal" ]; then PACKAGE_LIST="$PACKAGE_LIST libedit-dev libxml2-dev python3-packaging" fi + +if [ "$OS_VERSION" = "18.04" ]; then + PACKAGE_LIST="$PACKAGE_LIST libicu60" +else + PACKAGE_LIST="$PACKAGE_LIST libicu66" +fi + apt-get install -y --no-install-recommends $PACKAGE_LIST locale-gen en_US.UTF-8