mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-14 20:48:00 +00:00
Update OpenVino CI Ubuntu to 22.04 (#21127)
### Description
[Update OpenVino CI Ubuntu to
22.04](312fab5b3f)
### Motivation and Context
Ubuntu 22.04 is needed for linux C++20
This commit is contained in:
parent
eeb8fc0931
commit
d1c19e79ea
4 changed files with 47 additions and 22 deletions
|
|
@ -32,5 +32,5 @@ jobs:
|
|||
parameters:
|
||||
AgentPool : 'Linux-CPU-2019'
|
||||
JobName: 'Linux_CI_Dev'
|
||||
RunDockerBuildArgs: '-o ubuntu20.04 -d openvino -v 2024.0.0 -x "--use_openvino CPU --build_wheel"'
|
||||
RunDockerBuildArgs: '-o ubuntu22.04 -p 3.10 -d openvino -v 2024.0.0 -x "--use_openvino CPU --build_wheel"'
|
||||
TimeoutInMinutes: 120
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
ARG UBUNTU_VERSION=20.04
|
||||
ARG UBUNTU_VERSION=22.04
|
||||
FROM ubuntu:${UBUNTU_VERSION}
|
||||
|
||||
ARG OPENVINO_VERSION=2024.0.0
|
||||
ARG PYTHON_VERSION=3.9
|
||||
ARG PYTHON_VERSION=3.10
|
||||
|
||||
ADD scripts /tmp/scripts
|
||||
RUN /tmp/scripts/install_ubuntu.sh -p ${PYTHON_VERSION} -d EdgeDevice && \
|
||||
/tmp/scripts/install_os_deps.sh -d EdgeDevice && \
|
||||
/tmp/scripts/install_python_deps.sh -p ${PYTHON_VERSION} -d EdgeDevice
|
||||
RUN /tmp/scripts/install_ubuntu.sh -p $PYTHON_VERSION -d EdgeDevice
|
||||
RUN /tmp/scripts/install_os_deps.sh -d EdgeDevice
|
||||
RUN /tmp/scripts/install_python_deps.sh -p $PYTHON_VERSION -d EdgeDevice
|
||||
|
||||
RUN apt update && apt install -y libnuma1 ocl-icd-libopencl1 && \
|
||||
rm -rf /var/lib/apt/lists/* /tmp/scripts
|
||||
|
|
@ -19,9 +19,9 @@ ENV IE_PLUGINS_PATH $INTEL_OPENVINO_DIR/runtime/lib/intel64
|
|||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN cd /opt && mkdir -p intel && cd intel && \
|
||||
wget https://storage.openvinotoolkit.org/repositories/openvino/packages/2024.0/linux/l_openvino_toolkit_ubuntu20_2024.0.0.14509.34caeefd078_x86_64.tgz && \
|
||||
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 && \
|
||||
mv l_openvino_toolkit_ubuntu20_2024.0.0.14509.34caeefd078_x86_64 openvino_2024.0.0 && \
|
||||
wget https://storage.openvinotoolkit.org/repositories/openvino/packages/2024.0/linux/l_openvino_toolkit_ubuntu22_2024.0.0.14509.34caeefd078_x86_64.tgz && \
|
||||
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 && \
|
||||
mv l_openvino_toolkit_ubuntu22_2024.0.0.14509.34caeefd078_x86_64 openvino_2024.0.0 && \
|
||||
cd $INTEL_OPENVINO_DIR/install_dependencies && ./install_openvino_dependencies.sh -y
|
||||
|
||||
WORKDIR /root
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ PYTHON_VER=${PYTHON_VER:=3.8}
|
|||
# Some Edge devices only have limited disk space, use this option to exclude some package
|
||||
DEVICE_TYPE=${DEVICE_TYPE:=Normal}
|
||||
|
||||
# shellcheck disable=SC2034
|
||||
DEBIAN_FRONTEND=noninteractive
|
||||
echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
|
||||
|
||||
|
|
@ -19,8 +20,6 @@ apt-get update && apt-get install -y software-properties-common lsb-release
|
|||
|
||||
OS_VERSION=$(lsb_release -r -s)
|
||||
|
||||
SYS_LONG_BIT=$(getconf LONG_BIT)
|
||||
|
||||
PACKAGE_LIST="autotools-dev \
|
||||
automake \
|
||||
build-essential \
|
||||
|
|
@ -37,9 +36,8 @@ PACKAGE_LIST="autotools-dev \
|
|||
gfortran \
|
||||
python3-dev \
|
||||
language-pack-en \
|
||||
liblttng-ust0 \
|
||||
liblttng-ust-dev \
|
||||
libcurl4 \
|
||||
libssl1.1 \
|
||||
libkrb5-3 \
|
||||
libtinfo-dev \
|
||||
libtinfo5 \
|
||||
|
|
@ -50,7 +48,7 @@ PACKAGE_LIST="autotools-dev \
|
|||
unzip \
|
||||
zip \
|
||||
rsync libunwind8 libpng-dev libexpat1-dev \
|
||||
python3-setuptools python3-numpy python3-wheel python python3-pip python3-pytest \
|
||||
python3-setuptools python3-numpy python3-wheel python3-pip python3-pytest python3-distutils \
|
||||
openjdk-11-jdk \
|
||||
graphviz"
|
||||
|
||||
|
|
@ -59,7 +57,7 @@ if [ $DEVICE_TYPE = "Normal" ]; then
|
|||
PACKAGE_LIST="$PACKAGE_LIST libedit-dev libxml2-dev python3-packaging"
|
||||
fi
|
||||
|
||||
PACKAGE_LIST="$PACKAGE_LIST libicu66"
|
||||
PACKAGE_LIST="$PACKAGE_LIST libicu-dev"
|
||||
|
||||
apt-get install -y --no-install-recommends $PACKAGE_LIST
|
||||
|
||||
|
|
@ -67,8 +65,14 @@ locale-gen en_US.UTF-8
|
|||
update-locale LANG=en_US.UTF-8
|
||||
|
||||
if [ "$OS_VERSION" = "20.04" ]; then
|
||||
# The defaul version of python is 3.8
|
||||
major=$(echo $PYTHON_VER | cut -d. -f1)
|
||||
minor=$(echo $PYTHON_VER | cut -d. -f2)
|
||||
if [ "$major" -lt 3 ] || [ "$major" -eq 3 ] && [ "$minor" -lt 8 ]; then
|
||||
PYTHON_VER="3.8"
|
||||
fi
|
||||
if [ "$PYTHON_VER" != "3.8" ]; then
|
||||
add-apt-repository -y ppa:deadsnakes/ppa
|
||||
add-apt-repository -y ppa:deadsnakes/ppa
|
||||
apt-get update
|
||||
apt-get install -y --no-install-recommends \
|
||||
python${PYTHON_VER} \
|
||||
|
|
@ -80,6 +84,23 @@ if [ "$OS_VERSION" = "20.04" ]; then
|
|||
#put at /usr/local/. Then there will be two pips.
|
||||
/usr/bin/python${PYTHON_VER} -m pip install --upgrade --force-reinstall pip==19.0.3
|
||||
fi
|
||||
elif [ "$OS_VERSION" = "22.04" ] ; then
|
||||
# The defaul version of python is 3.10
|
||||
major=$(echo $PYTHON_VER | cut -d. -f1)
|
||||
minor=$(echo $PYTHON_VER | cut -d. -f2)
|
||||
if [ "$major" -lt 3 ] || [ "$major" -eq 3 ] && [ "$minor" -lt 10 ]; then
|
||||
PYTHON_VER="3.10"
|
||||
fi
|
||||
if [ "$PYTHON_VER" != "3.10" ]; then
|
||||
add-apt-repository -y ppa:deadsnakes/ppa
|
||||
apt-get update
|
||||
apt-get install -y --no-install-recommends \
|
||||
python${PYTHON_VER} \
|
||||
python${PYTHON_VER}-dev
|
||||
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python${PYTHON_VER} 1
|
||||
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 2
|
||||
update-alternatives --set python3 /usr/bin/python${PYTHON_VER}
|
||||
fi
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -20,16 +20,16 @@ ORTMODULE_BUILD=false
|
|||
#Training only
|
||||
USE_CONDA=false
|
||||
ALLOW_RELEASED_ONNX_OPSET_ONLY_ENV="ALLOW_RELEASED_ONNX_OPSET_ONLY="$ALLOW_RELEASED_ONNX_OPSET_ONLY
|
||||
echo "ALLOW_RELEASED_ONNX_OPSET_ONLY environment variable is set as "$ALLOW_RELEASED_ONNX_OPSET_ONLY_ENV
|
||||
echo "ALLOW_RELEASED_ONNX_OPSET_ONLY environment variable is set as $ALLOW_RELEASED_ONNX_OPSET_ONLY_ENV"
|
||||
|
||||
while getopts o:d:p:x:v:y:t:i:mue parameter_Option
|
||||
do case "${parameter_Option}"
|
||||
in
|
||||
#yocto, ubuntu20.04
|
||||
#yocto, ubuntu22.04
|
||||
o) BUILD_OS=${OPTARG};;
|
||||
#gpu, tensorrt or openvino. It is ignored when BUILD_OS is yocto.
|
||||
d) BUILD_DEVICE=${OPTARG};;
|
||||
#python version: 3.6 3.7 (absence means default 3.6)
|
||||
#python version: 3.8 3.9 3.10 3.11 3.12 (absence means default 3.8)
|
||||
p) PYTHON_VER=${OPTARG};;
|
||||
# "--build_wheel --use_openblas"
|
||||
x) BUILD_EXTR_PAR=${OPTARG};;
|
||||
|
|
@ -48,9 +48,11 @@ m) INSTALL_DEPS_DISTRIBUTED_SETUP=true;;
|
|||
u) ORTMODULE_BUILD=true;;
|
||||
# install and use conda
|
||||
e) USE_CONDA=true;;
|
||||
*) echo "Invalid option";;
|
||||
esac
|
||||
done
|
||||
|
||||
# shellcheck disable=SC2034
|
||||
EXIT_CODE=1
|
||||
DEFAULT_PYTHON_VER="3.8"
|
||||
|
||||
|
|
@ -62,7 +64,10 @@ if [[ -n "${IMAGE_CACHE_CONTAINER_REGISTRY_NAME}" ]]; then
|
|||
GET_DOCKER_IMAGE_CMD="${GET_DOCKER_IMAGE_CMD} --container-registry ${IMAGE_CACHE_CONTAINER_REGISTRY_NAME}"
|
||||
fi
|
||||
DOCKER_CMD="docker"
|
||||
|
||||
# If BUILD_OS is ubuntu, then UBUNTU_VERSION is set to the version string after ubuntu
|
||||
if [[ $BUILD_OS == ubuntu* ]]; then
|
||||
UBUNTU_VERSION=${BUILD_OS#ubuntu}
|
||||
fi
|
||||
|
||||
NEED_BUILD_SHARED_LIB=true
|
||||
cd $SCRIPT_DIR/docker
|
||||
|
|
@ -96,10 +101,9 @@ elif [ $BUILD_DEVICE = "gpu" ]; then
|
|||
--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" \
|
||||
--dockerfile Dockerfile.ubuntu_gpu_training --context .
|
||||
elif [[ $BUILD_DEVICE = "openvino"* ]]; then
|
||||
BUILD_ARGS="--build-arg BUILD_USER=onnxruntimedev --build-arg BUILD_UID=$(id -u) --build-arg PYTHON_VERSION=3.8"
|
||||
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}"
|
||||
IMAGE="$BUILD_OS-openvino"
|
||||
DOCKER_FILE=Dockerfile.ubuntu_openvino
|
||||
BUILD_ARGS+=" --build-arg OPENVINO_VERSION=${OPENVINO_VERSION}"
|
||||
$GET_DOCKER_IMAGE_CMD --repository "onnxruntime-$IMAGE" \
|
||||
--docker-build-args="${BUILD_ARGS}" \
|
||||
--dockerfile $DOCKER_FILE --context .
|
||||
|
|
|
|||
Loading…
Reference in a new issue