Skip to content

Commit d1c19e7

Browse files
authored
Update OpenVino CI Ubuntu to 22.04 (microsoft#21127)
### Description [Update OpenVino CI Ubuntu to 22.04](microsoft@312fab5) ### Motivation and Context Ubuntu 22.04 is needed for linux C++20
1 parent eeb8fc0 commit d1c19e7

File tree

4 files changed

+47
-22
lines changed

4 files changed

+47
-22
lines changed

tools/ci_build/github/azure-pipelines/linux-openvino-ci-pipeline.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ jobs:
3232
parameters:
3333
AgentPool : 'Linux-CPU-2019'
3434
JobName: 'Linux_CI_Dev'
35-
RunDockerBuildArgs: '-o ubuntu20.04 -d openvino -v 2024.0.0 -x "--use_openvino CPU --build_wheel"'
35+
RunDockerBuildArgs: '-o ubuntu22.04 -p 3.10 -d openvino -v 2024.0.0 -x "--use_openvino CPU --build_wheel"'
3636
TimeoutInMinutes: 120

tools/ci_build/github/linux/docker/Dockerfile.ubuntu_openvino

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
ARG UBUNTU_VERSION=20.04
1+
ARG UBUNTU_VERSION=22.04
22
FROM ubuntu:${UBUNTU_VERSION}
33

44
ARG OPENVINO_VERSION=2024.0.0
5-
ARG PYTHON_VERSION=3.9
5+
ARG PYTHON_VERSION=3.10
66

77
ADD scripts /tmp/scripts
8-
RUN /tmp/scripts/install_ubuntu.sh -p ${PYTHON_VERSION} -d EdgeDevice && \
9-
/tmp/scripts/install_os_deps.sh -d EdgeDevice && \
10-
/tmp/scripts/install_python_deps.sh -p ${PYTHON_VERSION} -d EdgeDevice
8+
RUN /tmp/scripts/install_ubuntu.sh -p $PYTHON_VERSION -d EdgeDevice
9+
RUN /tmp/scripts/install_os_deps.sh -d EdgeDevice
10+
RUN /tmp/scripts/install_python_deps.sh -p $PYTHON_VERSION -d EdgeDevice
1111

1212
RUN apt update && apt install -y libnuma1 ocl-icd-libopencl1 && \
1313
rm -rf /var/lib/apt/lists/* /tmp/scripts
@@ -19,9 +19,9 @@ ENV IE_PLUGINS_PATH $INTEL_OPENVINO_DIR/runtime/lib/intel64
1919
ENV DEBIAN_FRONTEND=noninteractive
2020

2121
RUN cd /opt && mkdir -p intel && cd intel && \
22-
wget https://storage.openvinotoolkit.org/repositories/openvino/packages/2024.0/linux/l_openvino_toolkit_ubuntu20_2024.0.0.14509.34caeefd078_x86_64.tgz && \
23-
tar xzf l_openvino_toolkit_ubuntu20_2024.0.0.14509.34caeefd078_x86_64.tgz && rm -rf l_openvino_toolkit_ubuntu20_2024.0.0.14509.34caeefd078_x86_64.tgz && \
24-
mv l_openvino_toolkit_ubuntu20_2024.0.0.14509.34caeefd078_x86_64 openvino_2024.0.0 && \
22+
wget https://storage.openvinotoolkit.org/repositories/openvino/packages/2024.0/linux/l_openvino_toolkit_ubuntu22_2024.0.0.14509.34caeefd078_x86_64.tgz && \
23+
tar xzf l_openvino_toolkit_ubuntu22_2024.0.0.14509.34caeefd078_x86_64.tgz && rm -rf l_openvino_toolkit_ubuntu22_2024.0.0.14509.34caeefd078_x86_64.tgz && \
24+
mv l_openvino_toolkit_ubuntu22_2024.0.0.14509.34caeefd078_x86_64 openvino_2024.0.0 && \
2525
cd $INTEL_OPENVINO_DIR/install_dependencies && ./install_openvino_dependencies.sh -y
2626

2727
WORKDIR /root

tools/ci_build/github/linux/docker/scripts/install_ubuntu.sh

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,14 @@ PYTHON_VER=${PYTHON_VER:=3.8}
1212
# Some Edge devices only have limited disk space, use this option to exclude some package
1313
DEVICE_TYPE=${DEVICE_TYPE:=Normal}
1414

15+
# shellcheck disable=SC2034
1516
DEBIAN_FRONTEND=noninteractive
1617
echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
1718

1819
apt-get update && apt-get install -y software-properties-common lsb-release
1920

2021
OS_VERSION=$(lsb_release -r -s)
2122

22-
SYS_LONG_BIT=$(getconf LONG_BIT)
23-
2423
PACKAGE_LIST="autotools-dev \
2524
automake \
2625
build-essential \
@@ -37,9 +36,8 @@ PACKAGE_LIST="autotools-dev \
3736
gfortran \
3837
python3-dev \
3938
language-pack-en \
40-
liblttng-ust0 \
39+
liblttng-ust-dev \
4140
libcurl4 \
42-
libssl1.1 \
4341
libkrb5-3 \
4442
libtinfo-dev \
4543
libtinfo5 \
@@ -50,7 +48,7 @@ PACKAGE_LIST="autotools-dev \
5048
unzip \
5149
zip \
5250
rsync libunwind8 libpng-dev libexpat1-dev \
53-
python3-setuptools python3-numpy python3-wheel python python3-pip python3-pytest \
51+
python3-setuptools python3-numpy python3-wheel python3-pip python3-pytest python3-distutils \
5452
openjdk-11-jdk \
5553
graphviz"
5654

@@ -59,16 +57,22 @@ if [ $DEVICE_TYPE = "Normal" ]; then
5957
PACKAGE_LIST="$PACKAGE_LIST libedit-dev libxml2-dev python3-packaging"
6058
fi
6159

62-
PACKAGE_LIST="$PACKAGE_LIST libicu66"
60+
PACKAGE_LIST="$PACKAGE_LIST libicu-dev"
6361

6462
apt-get install -y --no-install-recommends $PACKAGE_LIST
6563

6664
locale-gen en_US.UTF-8
6765
update-locale LANG=en_US.UTF-8
6866

6967
if [ "$OS_VERSION" = "20.04" ]; then
68+
# The defaul version of python is 3.8
69+
major=$(echo $PYTHON_VER | cut -d. -f1)
70+
minor=$(echo $PYTHON_VER | cut -d. -f2)
71+
if [ "$major" -lt 3 ] || [ "$major" -eq 3 ] && [ "$minor" -lt 8 ]; then
72+
PYTHON_VER="3.8"
73+
fi
7074
if [ "$PYTHON_VER" != "3.8" ]; then
71-
add-apt-repository -y ppa:deadsnakes/ppa
75+
add-apt-repository -y ppa:deadsnakes/ppa
7276
apt-get update
7377
apt-get install -y --no-install-recommends \
7478
python${PYTHON_VER} \
@@ -80,6 +84,23 @@ if [ "$OS_VERSION" = "20.04" ]; then
8084
#put at /usr/local/. Then there will be two pips.
8185
/usr/bin/python${PYTHON_VER} -m pip install --upgrade --force-reinstall pip==19.0.3
8286
fi
87+
elif [ "$OS_VERSION" = "22.04" ] ; then
88+
# The defaul version of python is 3.10
89+
major=$(echo $PYTHON_VER | cut -d. -f1)
90+
minor=$(echo $PYTHON_VER | cut -d. -f2)
91+
if [ "$major" -lt 3 ] || [ "$major" -eq 3 ] && [ "$minor" -lt 10 ]; then
92+
PYTHON_VER="3.10"
93+
fi
94+
if [ "$PYTHON_VER" != "3.10" ]; then
95+
add-apt-repository -y ppa:deadsnakes/ppa
96+
apt-get update
97+
apt-get install -y --no-install-recommends \
98+
python${PYTHON_VER} \
99+
python${PYTHON_VER}-dev
100+
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python${PYTHON_VER} 1
101+
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 2
102+
update-alternatives --set python3 /usr/bin/python${PYTHON_VER}
103+
fi
83104
else
84105
exit 1
85106
fi

tools/ci_build/github/linux/run_dockerbuild.sh

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ ORTMODULE_BUILD=false
2020
#Training only
2121
USE_CONDA=false
2222
ALLOW_RELEASED_ONNX_OPSET_ONLY_ENV="ALLOW_RELEASED_ONNX_OPSET_ONLY="$ALLOW_RELEASED_ONNX_OPSET_ONLY
23-
echo "ALLOW_RELEASED_ONNX_OPSET_ONLY environment variable is set as "$ALLOW_RELEASED_ONNX_OPSET_ONLY_ENV
23+
echo "ALLOW_RELEASED_ONNX_OPSET_ONLY environment variable is set as $ALLOW_RELEASED_ONNX_OPSET_ONLY_ENV"
2424

2525
while getopts o:d:p:x:v:y:t:i:mue parameter_Option
2626
do case "${parameter_Option}"
2727
in
28-
#yocto, ubuntu20.04
28+
#yocto, ubuntu22.04
2929
o) BUILD_OS=${OPTARG};;
3030
#gpu, tensorrt or openvino. It is ignored when BUILD_OS is yocto.
3131
d) BUILD_DEVICE=${OPTARG};;
32-
#python version: 3.6 3.7 (absence means default 3.6)
32+
#python version: 3.8 3.9 3.10 3.11 3.12 (absence means default 3.8)
3333
p) PYTHON_VER=${OPTARG};;
3434
# "--build_wheel --use_openblas"
3535
x) BUILD_EXTR_PAR=${OPTARG};;
@@ -48,9 +48,11 @@ m) INSTALL_DEPS_DISTRIBUTED_SETUP=true;;
4848
u) ORTMODULE_BUILD=true;;
4949
# install and use conda
5050
e) USE_CONDA=true;;
51+
*) echo "Invalid option";;
5152
esac
5253
done
5354

55+
# shellcheck disable=SC2034
5456
EXIT_CODE=1
5557
DEFAULT_PYTHON_VER="3.8"
5658

@@ -62,7 +64,10 @@ if [[ -n "${IMAGE_CACHE_CONTAINER_REGISTRY_NAME}" ]]; then
6264
GET_DOCKER_IMAGE_CMD="${GET_DOCKER_IMAGE_CMD} --container-registry ${IMAGE_CACHE_CONTAINER_REGISTRY_NAME}"
6365
fi
6466
DOCKER_CMD="docker"
65-
67+
# If BUILD_OS is ubuntu, then UBUNTU_VERSION is set to the version string after ubuntu
68+
if [[ $BUILD_OS == ubuntu* ]]; then
69+
UBUNTU_VERSION=${BUILD_OS#ubuntu}
70+
fi
6671

6772
NEED_BUILD_SHARED_LIB=true
6873
cd $SCRIPT_DIR/docker
@@ -96,10 +101,9 @@ elif [ $BUILD_DEVICE = "gpu" ]; then
96101
--docker-build-args="--build-arg BASEIMAGE=nvcr.io/nvidia/cuda:11.8.0-cudnn8-devel-${BUILD_OS} --build-arg BUILD_USER=onnxruntimedev --build-arg BUILD_UID=$(id -u) --build-arg PYTHON_VERSION=${PYTHON_VER} --build-arg INSTALL_DEPS_EXTRA_ARGS=\"${INSTALL_DEPS_EXTRA_ARGS}\" --build-arg USE_CONDA=${USE_CONDA} --network=host" \
97102
--dockerfile Dockerfile.ubuntu_gpu_training --context .
98103
elif [[ $BUILD_DEVICE = "openvino"* ]]; then
99-
BUILD_ARGS="--build-arg BUILD_USER=onnxruntimedev --build-arg BUILD_UID=$(id -u) --build-arg PYTHON_VERSION=3.8"
104+
BUILD_ARGS="--build-arg BUILD_USER=onnxruntimedev --build-arg BUILD_UID=$(id -u) --build-arg PYTHON_VERSION=${PYTHON_VER} --build-arg OPENVINO_VERSION=${OPENVINO_VERSION} --build-arg UBUNTU_VERSION=${UBUNTU_VERSION}"
100105
IMAGE="$BUILD_OS-openvino"
101106
DOCKER_FILE=Dockerfile.ubuntu_openvino
102-
BUILD_ARGS+=" --build-arg OPENVINO_VERSION=${OPENVINO_VERSION}"
103107
$GET_DOCKER_IMAGE_CMD --repository "onnxruntime-$IMAGE" \
104108
--docker-build-args="${BUILD_ARGS}" \
105109
--dockerfile $DOCKER_FILE --context .

0 commit comments

Comments
 (0)