Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Ubuntu24 base image #2892

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 27 additions & 17 deletions Dockerfile.ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,15 @@ RUN ./install_opencv.sh
################### BASE BUILD ##########################
FROM base_build as build
ARG BASE_IMAGE
ARG BASE_OS
ENV DEBIAN_FRONTEND=noninteractive
SHELL ["/bin/bash", "-xo", "pipefail", "-c"]

ARG debug_bazel_flags="--strip=always --config=mp_on_py_on --//:distro=ubuntu"

RUN if [ "$BASE_OS" == "ubuntu24" ] ; then apt-get update && \
apt-get install -y software-properties-common --no-install-recommends; add-apt-repository 'ppa:deadsnakes/ppa' -y && \
apt-get clean && rm -rf /var/lib/apt/lists/* ; fi
ENV PIP_BREAK_SYSTEM_PACKAGES=1
RUN apt-get update && apt-get install --no-install-recommends -y \
libgflags-dev \
bc \
Expand All @@ -106,26 +110,25 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
lcov \
less \
libpugixml1v5 \
libusb-dev \
libusb-1.0-0-dev \
libtool \
libnuma-dev \
libtbb-dev \
libssl-dev \
python2 \
python2-dev \
python3-dev \
python3-venv \
libxml2 \
python3.10-dev \
python3.10-venv \
python3-pip \
unzip \
gdb \
vim && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
python3 -m pip install "numpy<2.0.0" --no-cache-dir && \
python3 -m pip install "Jinja2==3.1.4" "MarkupSafe==3.0.2" --no-cache-dir

RUN apt-get update; apt-get install -y --no-install-recommends libxml2 && rm -rf /var/lib/apt/lists/* && rm -rf /tmp/*
rm -rf /var/lib/apt/lists/*
RUN python3.10 -m pip install "numpy<2.0.0" --no-cache-dir
RUN if [ "$BASE_OS" == "ubuntu24" ] ; then apt-get update ; apt-get install python3.12-dev -y --no-install-recommends ; apt-get clean && \
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1 && \
apt-get clean && rm -rf /var/lib/apt/lists/* && \
python3.12 -m pip install "Jinja2==3.1.4" "MarkupSafe==3.0.2" "numpy<2.0.0" --no-cache-dir ; fi
RUN if [ "$BASE_OS" == "ubuntu22" ] ; then python3 -m pip install "Jinja2==3.1.4" "MarkupSafe==3.0.2" --no-cache-dir ; fi

ARG JOBS=8
ARG ov_use_binary=0
Expand Down Expand Up @@ -433,10 +436,17 @@ RUN apt-get update ; \
if [ "$NPU" == "1" ] ; then \
mkdir /tmp/npu_deps && cd /tmp/npu_deps ; \
apt-get update && apt-get install -y --no-install-recommends libtbb12 && \
curl -L -O https://github.com/intel/linux-npu-driver/releases/download/v1.10.0/intel-driver-compiler-npu_1.10.0.20241107-11729849322_ubuntu22.04_amd64.deb ; \
curl -L -O https://github.com/intel/linux-npu-driver/releases/download/v1.10.0/intel-fw-npu_1.10.0.20241107-11729849322_ubuntu22.04_amd64.deb ; \
curl -L -O https://github.com/intel/linux-npu-driver/releases/download/v1.10.0/intel-level-zero-npu_1.10.0.20241107-11729849322_ubuntu22.04_amd64.deb ; \
curl -L -O https://github.com/oneapi-src/level-zero/releases/download/v1.17.44/level-zero_1.17.44+u22.04_amd64.deb ; \
if [[ "$BASE_IMAGE" == *"22.04"* ]] ; then \
curl -L -O https://github.com/intel/linux-npu-driver/releases/download/v1.10.0/intel-driver-compiler-npu_1.10.0.20241107-11729849322_ubuntu22.04_amd64.deb ; \
curl -L -O https://github.com/intel/linux-npu-driver/releases/download/v1.10.0/intel-fw-npu_1.10.0.20241107-11729849322_ubuntu22.04_amd64.deb ; \
curl -L -O https://github.com/intel/linux-npu-driver/releases/download/v1.10.0/intel-level-zero-npu_1.10.0.20241107-11729849322_ubuntu22.04_amd64.deb ; \
curl -L -O https://github.com/oneapi-src/level-zero/releases/download/v1.17.44/level-zero_1.17.44+u22.04_amd64.deb ; \
else \
curl -L -O https://github.com/intel/linux-npu-driver/releases/download/v1.10.0/intel-driver-compiler-npu_1.10.0.20241107-11729849322_ubuntu24.04_amd64.deb ; \
curl -L -O https://github.com/intel/linux-npu-driver/releases/download/v1.10.0/intel-fw-npu_1.10.0.20241107-11729849322_ubuntu24.04_amd64.deb ; \
curl -L -O https://github.com/intel/linux-npu-driver/releases/download/v1.10.0/intel-level-zero-npu_1.10.0.20241107-11729849322_ubuntu24.04_amd64.deb ; \
curl -L -O https://github.com/oneapi-src/level-zero/releases/download/v1.17.44/level-zero_1.17.44+u24.04_amd64.deb ; \
fi ; \
dpkg -i ./*.deb && rm -Rf /tmp/npu_deps ; \
fi ; \
apt-get clean ; \
Expand All @@ -461,7 +471,7 @@ COPY --from=build /usr/local/lib/python3.*/dist-packages/markupsafe /ovms/python
# For image with Python enabled install Python library
RUN if ! [[ $debug_bazel_flags == *"py_off"* ]]; then true ; else exit 0 ; fi ; \
apt-get update -y ; \
if [[ "$BASE_IMAGE" == *"22.04"* ]] ; then python_version=3.10; else python_version=3.8; fi; \
if [[ "$BASE_IMAGE" == *"22.04"* ]] ; then python_version=3.10; else python_version=3.12; fi; \
apt-get install libpython$python_version --no-install-recommends -y && \
apt-get clean && rm -rf /var/lib/apt/lists/* && rm -rf /tmp/*

Expand Down
25 changes: 11 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ JOBS ?= $(CORES_TOTAL)


# Image on which OVMS is compiled. If DIST_OS is not set, it's also used for a release image.
# Currently supported BASE_OS values are: ubuntu20 ubuntu22 redhat
# Currently supported BASE_OS values are: ubuntu24 ubuntu22 redhat
BASE_OS ?= ubuntu22

# do not change this; change versions per OS a few lines below (BASE_OS_TAG_*)!
Expand Down Expand Up @@ -140,7 +140,10 @@ else
$(error BASE_OS must be either ubuntu or redhat)
endif
CAPI_FLAGS = "--strip=$(STRIP)"$(BAZEL_DEBUG_BUILD_FLAGS)" --config=mp_off_py_off"$(OV_TRACING_PARAMS)$(TARGET_DISTRO_PARAMS)
BAZEL_DEBUG_FLAGS="--strip=$(STRIP)"$(BAZEL_DEBUG_BUILD_FLAGS)$(DISABLE_PARAMS)$(FUZZER_BUILD_PARAMS)$(OV_TRACING_PARAMS)$(TARGET_DISTRO_PARAMS)
ifeq ($(BASE_OS),ubuntu24)
REPO_ENV=" --repo_env PYTHON_BIN_PATH=/usr/bin/python3.12"
endif
BAZEL_DEBUG_FLAGS="--strip=$(STRIP)"$(BAZEL_DEBUG_BUILD_FLAGS)$(DISABLE_PARAMS)$(FUZZER_BUILD_PARAMS)$(OV_TRACING_PARAMS)$(TARGET_DISTRO_PARAMS)$(REPO_ENV)

# Option to Override release image.
# Release image OS *must have* glibc version >= glibc version on BASE_OS:
Expand All @@ -153,8 +156,8 @@ ifeq ($(findstring ubuntu,$(BASE_OS)),ubuntu)
ifeq ($(BASE_OS),ubuntu22)
BASE_OS_TAG=22.04
endif
ifeq ($(BASE_OS),ubuntu20)
BASE_OS_TAG=20.04
ifeq ($(BASE_OS),ubuntu24)
BASE_OS_TAG=24.04
endif
ifeq ($(NVIDIA),1)
BASE_IMAGE=docker.io/nvidia/cuda:11.8.0-runtime-ubuntu$(BASE_OS_TAG)
Expand All @@ -163,10 +166,10 @@ ifeq ($(findstring ubuntu,$(BASE_OS)),ubuntu)
BASE_IMAGE ?= ubuntu:$(BASE_OS_TAG)
BASE_IMAGE_RELEASE=$(BASE_IMAGE)
endif
ifeq ($(BASE_OS_TAG),20.04)
OS=ubuntu20
INSTALL_DRIVER_VERSION ?= "22.43.24595"
DLDT_PACKAGE_URL ?= https://storage.openvinotoolkit.org/repositories/openvino/packages/nightly/2025.0.0-17449-2b7f48e8a8e/l_openvino_toolkit_ubuntu20_2025.0.0.dev20241126_x86_64.tgz
ifeq ($(BASE_OS_TAG),24.04)
OS=ubuntu24
INSTALL_DRIVER_VERSION ?= "24.39.31294"
DLDT_PACKAGE_URL ?= https://storage.openvinotoolkit.org/repositories/openvino/packages/nightly/2025.0.0-17449-2b7f48e8a8e/l_openvino_toolkit_ubuntu24_2025.0.0.dev20241126_x86_64.tgz
else ifeq ($(BASE_OS_TAG),22.04)
OS=ubuntu22
INSTALL_DRIVER_VERSION ?= "24.39.31294"
Expand Down Expand Up @@ -354,11 +357,6 @@ ifeq ($(FUZZER_BUILD),1)
@echo "Cannot run fuzzer with redhat"; exit 1 ;
endif
endif
ifeq ($(BASE_OS_TAG),20.04)
ifeq ($(RUN_TESTS),1)
@echo "On ubuntu20 run tests via make run_unit_tests"; exit 1 ;
endif
endif
ifeq ($(NVIDIA),1)
ifeq ($(OV_USE_BINARY),1)
@echo "Building NVIDIA plugin requires OV built from source. To build NVIDIA plugin and OV from source make command should look like this 'NVIDIA=1 OV_USE_BINARY=0 make docker_build'"; exit 1 ;
Expand Down Expand Up @@ -706,6 +704,5 @@ else
exit $$exit_status
endif


run_lib_files_test:
docker run --entrypoint bash -v $(realpath tests/file_lists):/test $(OVMS_CPP_DOCKER_IMAGE):$(OVMS_CPP_IMAGE_TAG)$(IMAGE_TAG_SUFFIX) ./test/test_release_files.sh ${BAZEL_DEBUG_FLAGS} > file_test.log 2>&1 ; exit_status=$$? ; tail -200 file_test.log ; exit $$exit_status
12 changes: 6 additions & 6 deletions docs/build_from_source.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This document gives information how to build docker images and the binary packag
## Prerequisites

1. [Docker Engine](https://docs.docker.com/engine/)
1. Ubuntu 20.04, Ubuntu 22.04 or RedHat 8.8 host
1. Ubuntu 22.04, Ubuntu 24.04 or RedHat 8.10 host
1. make
1. bash

Expand All @@ -27,8 +27,8 @@ To build the image with non default configuration, add parameters described belo

Select base OS:
- `ubuntu22` for Ubuntu 22.04 (default)
- `ubuntu20` for Ubuntu 20.04
- `redhat` for Red Hat UBI 8.8
- `ubuntu24` for Ubuntu 22.04
- `redhat` for Red Hat UBI 8.10

```bash
make release_image BASE_OS=redhat
Expand All @@ -43,9 +43,9 @@ Example:
Parameter used to control which GPU driver version will be installed. Supported versions:
| OS | Versions |
|---|---|
| Ubuntu22 | 23.13.26032 (default), <br />22.35.24055, <br />22.10.22597, <br />21.48.21782 |
| Ubuntu20 | 22.43.24595 (default), <br />22.35.24055, <br />22.10.22597, <br />21.48.21782 |
| RedHat | 22.43.24595 (default), <br />22.28.23726, <br />22.10.22597, <br />21.38.21026 |
| Ubuntu22 | 24.39.31294 (default), <br >24.26.30049 (default), <br />23.22.26516, <br />23.13.2603|
| Ubuntu24 | 24.39.31294 (default) |
| RedHat | 23.22.26516 (default), <br /> 24.26.30049, <br />23.22.26516, <br />22.10.22597 |

Additionally it is possible to specify custom (pre-production) drivers by providing location to NEO Runtime packages on local disk. Contact Intel representative to get the access to the pre-production drivers.
Warning: _Maintained only for Ubuntu base OS._
Expand Down
37 changes: 5 additions & 32 deletions docs/deploying_server.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,36 +82,9 @@ If everything is set up correctly, you will see 'zebra' prediction in the output

## Deploying Model Server on Baremetal (without container)
It is possible to deploy Model Server outside of container.
To deploy Model Server on baremetal, use pre-compiled binaries for Ubuntu20, Ubuntu22 or RHEL8.
To deploy Model Server on baremetal, use compiled binaries for Ubuntu22, Ubuntu24 or RHEL8.

::::{tab-set}
:::{tab-item} Ubuntu 20.04
:sync: ubuntu-20-04
Build the binary:

```{code} sh
# Clone the model server repository
git clone https://github.com/openvinotoolkit/model_server
cd model_server
# Build docker images (the binary is one of the artifacts)
make docker_build BASE_OS=ubuntu20 PYTHON_DISABLE=1 RUN_TESTS=0
# Unpack the package
tar -xzvf dist/ubuntu20/ovms.tar.gz
```
Install required libraries:
```{code} sh
sudo apt update -y && apt install -y liblibxml2 curl
```
Set path to the libraries
```{code} sh
export LD_LIBRARY_PATH=${pwd}/ovms/lib
```
In case of the build with Python calculators for MediaPipe graphs (PYTHON_DISABLE=0), run also:
```{code} sh
export PYTHONPATH=${pwd}/ovms/lib/python
sudo apt -y install libpython3.8
```
:::
:::{tab-item} Ubuntu 22.04
:sync: ubuntu-22-04
Download precompiled package:
Expand All @@ -125,7 +98,7 @@ or build it yourself:
git clone https://github.com/openvinotoolkit/model_server
cd model_server
# Build docker images (the binary is one of the artifacts)
make docker_build PYTHON_DISABLE=1 RUN_TESTS=0
make docker_build PYTHON_DISABLE=1
# Unpack the package
tar -xzvf dist/ubuntu22/ovms.tar.gz
```
Expand Down Expand Up @@ -156,9 +129,9 @@ or build it yourself:
git clone https://github.com/openvinotoolkit/model_server
cd model_server
# Build docker images (the binary is one of the artifacts)
make docker_build PYTHON_DISABLE=1 RUN_TESTS=0
make docker_build PYTHON_DISABLE=1 BASE_OS=ubuntu24
# Unpack the package
tar -xzvf dist/ubuntu22/ovms.tar.gz
tar -xzvf dist/ubuntu24/ovms.tar.gz
```
Install required libraries:
```{code} sh
Expand All @@ -171,7 +144,7 @@ export LD_LIBRARY_PATH=${pwd}/ovms/lib
In case of the build with Python calculators for MediaPipe graphs (PYTHON_DISABLE=0), run also:
```{code} sh
export PYTHONPATH=${pwd}/ovms/lib/python
sudo apt -y install libpython3.10
sudo apt -y install libpython3.12
```
:::
:::{tab-item} RHEL 8.10
Expand Down
10 changes: 0 additions & 10 deletions install_redhat_gpu_drivers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,6 @@ if [ -z "$DNF_TOOL" ]; then
fi

case $INSTALL_DRIVER_VERSION in \
"21.38.21026") \
mkdir /tmp/gpu_deps ; \
curl -L --output /tmp/gpu_deps/intel-igc-core-1.0.8708-1.el8.x86_64.rpm https://download.copr.fedorainfracloud.org/results/jdanecki/intel-opencl/centos-stream-8-x86_64/02870435-intel-igc/intel-igc-core-1.0.8708-1.el8.x86_64.rpm ; \
curl -L --output /tmp/gpu_deps/intel-opencl-21.38.21026-1.el8.x86_64.rpm https://download.copr.fedorainfracloud.org/results/jdanecki/intel-opencl/centos-stream-8-x86_64/02871549-intel-opencl/intel-opencl-21.38.21026-1.el8.x86_64.rpm ; \
curl -L --output /tmp/gpu_deps/intel-igc-opencl-devel-1.0.8708-1.el8.x86_64.rpm https://download.copr.fedorainfracloud.org/results/jdanecki/intel-opencl/centos-stream-8-x86_64/02870435-intel-igc/intel-igc-opencl-devel-1.0.8708-1.el8.x86_64.rpm ; \
curl -L --output /tmp/gpu_deps/intel-igc-opencl-1.0.8708-1.el8.x86_64.rpm https://download.copr.fedorainfracloud.org/results/jdanecki/intel-opencl/centos-stream-8-x86_64/02870435-intel-igc/intel-igc-opencl-1.0.8708-1.el8.x86_64.rpm ; \
curl -L --output /tmp/gpu_deps/intel-gmmlib-21.2.1-1.el7.x86_64.rpm https://download.copr.fedorainfracloud.org/results/jdanecki/intel-opencl/centos-stream-8-x86_64/02320646-intel-gmmlib/intel-gmmlib-21.2.1-1.el8.x86_64.rpm ; \
curl -L --output /tmp/gpu_deps/intel-gmmlib-devel-21.2.1-1.el8.x86_64.rpm https://download.copr.fedorainfracloud.org/results/jdanecki/intel-opencl/centos-stream-8-x86_64/02320646-intel-gmmlib/intel-gmmlib-devel-21.2.1-1.el8.x86_64.rpm ; \
cd /tmp/gpu_deps && rpm -iv *.rpm && rm -Rf /tmp/gpu_deps ; \
;; \
"22.10.22597") \
$DNF_TOOL install --nodocs -y libedit ; \
rpm -ivh https://repositories.intel.com/graphics/rhel/8.5/intel-gmmlib-22.0.3-i699.3.el8.x86_64.rpm ; \
Expand Down
44 changes: 0 additions & 44 deletions install_ubuntu_gpu_drivers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,50 +25,6 @@ fi

apt-get update && apt-get install -y libnuma1 ocl-icd-libopencl1 --no-install-recommends && rm -rf /var/lib/apt/lists/* && \
case $INSTALL_DRIVER_VERSION in \
"21.48.21782") \
mkdir /tmp/gpu_deps && cd /tmp/gpu_deps ; \
curl -L -O https://github.com/intel/compute-runtime/releases/download/21.48.21782/intel-gmmlib_21.3.3_amd64.deb ; \
curl -L -O https://github.com/intel/intel-graphics-compiler/releases/download/igc-1.0.9441/intel-igc-core_1.0.9441_amd64.deb ; \
curl -L -O https://github.com/intel/intel-graphics-compiler/releases/download/igc-1.0.9441/intel-igc-opencl_1.0.9441_amd64.deb ; \
curl -L -O https://github.com/intel/compute-runtime/releases/download/21.48.21782/intel-opencl-icd_21.48.21782_amd64.deb ; \
curl -L -O https://github.com/intel/compute-runtime/releases/download/21.48.21782/intel-level-zero-gpu_1.2.21782_amd64.deb ; \
dpkg -i intel*.deb && rm -Rf /tmp/gpu_deps ; \
;; \
"22.10.22597") \
mkdir /tmp/gpu_deps && cd /tmp/gpu_deps ; \
curl -L -O https://github.com/intel/compute-runtime/releases/download/22.10.22597/intel-gmmlib_22.0.2_amd64.deb ; \
curl -L -O https://github.com/intel/intel-graphics-compiler/releases/download/igc-1.0.10409/intel-igc-core_1.0.10409_amd64.deb ; \
curl -L -O https://github.com/intel/intel-graphics-compiler/releases/download/igc-1.0.10409/intel-igc-opencl_1.0.10409_amd64.deb ; \
curl -L -O https://github.com/intel/compute-runtime/releases/download/22.10.22597/intel-opencl-icd_22.10.22597_amd64.deb ; \
curl -L -O https://github.com/intel/compute-runtime/releases/download/22.10.22597/intel-level-zero-gpu_1.3.22597_amd64.deb ; \
dpkg -i intel*.deb && rm -Rf /tmp/gpu_deps ; \
;; \
"22.35.24055") \
apt-get update && apt-get install -y --no-install-recommends gpg gpg-agent && \
curl https://repositories.intel.com/graphics/intel-graphics.key | gpg --dearmor --output /usr/share/keyrings/intel-graphics.gpg && \
echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/intel-graphics.gpg] https://repositories.intel.com/graphics/ubuntu focal-legacy main' | tee /etc/apt/sources.list.d/intel.gpu.focal.list && \
apt-get update && \
apt-get install -y --no-install-recommends \
intel-opencl-icd=22.35.24055+i815~u20.04 \
intel-level-zero-gpu=1.3.24055+i815~u20.04 \
level-zero=1.8.5+i815~u20.04 && \
apt-get purge gpg gpg-agent --yes && apt-get --yes autoremove && \
apt-get clean ; \
rm -rf /var/lib/apt/lists/* && rm -rf /tmp/* ; \
;; \
"22.43.24595") \
apt-get update && apt-get install -y --no-install-recommends gpg gpg-agent && \
curl https://repositories.intel.com/graphics/intel-graphics.key | gpg --dearmor --output /usr/share/keyrings/intel-graphics.gpg && \
echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/intel-graphics.gpg] https://repositories.intel.com/graphics/ubuntu focal-legacy main' | tee /etc/apt/sources.list.d/intel.gpu.focal.list && \
apt-get update && \
apt-get install -y --no-install-recommends \
intel-opencl-icd=22.43.24595.35+i538~20.04 \
intel-level-zero-gpu=1.3.24595.35+i538~20.04 \
level-zero=1.8.8+i524~u20.04 && \
apt-get purge gpg gpg-agent --yes && apt-get --yes autoremove && \
apt-get clean ; \
rm -rf /var/lib/apt/lists/* && rm -rf /tmp/* ; \
;; \
"23.13.26032") \
mkdir /tmp/gpu_deps && cd /tmp/gpu_deps ; \
curl -L -O https://github.com/intel/compute-runtime/releases/download/23.05.25593.11/libigdgmm12_22.3.0_amd64.deb ; \
Expand Down
3 changes: 2 additions & 1 deletion third_party/aws-sdk-cpp/aws-sdk-cpp.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ def _impl(repository_ctx):
result = repository_ctx.execute(["cat","/etc/os-release"],quiet=False)
ubuntu20_count = result.stdout.count("PRETTY_NAME=\"Ubuntu 20")
ubuntu22_count = result.stdout.count("PRETTY_NAME=\"Ubuntu 22")
ubuntu24_count = result.stdout.count("PRETTY_NAME=\"Ubuntu 24")

if ubuntu20_count == 1 or ubuntu22_count == 1:
if ubuntu24_count == 1 or ubuntu22_count == 1:
lib_path = "lib"
else: # for redhat
lib_path = "lib64"
Expand Down
4 changes: 2 additions & 2 deletions third_party/opencv/install_opencv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ if [ "$os" == "auto" ] ; then
os="rhel8"
fi
case $os in
rhel8|ubuntu18.04|ubuntu20.04|ubuntu21.10|ubuntu22.04) [ -z "$print" ] && echo "Detected OS: ${os}" ;;
rhel8|ubuntu18.04|ubuntu20.04|ubuntu22.04|ubuntu24.04) [ -z "$print" ] && echo "Detected OS: ${os}" ;;
*) echo "Unsupported OS: ${os:-detection failed}" >&2 ; exit 1 ;;
esac
fi

#===================================================================================================
# OpenCV installation

if [ "$os" == "ubuntu20.04" ] || [ "$os" == "ubuntu22.04" ] ; then
if [ "$os" == "ubuntu24.04" ] || [ "$os" == "ubuntu22.04" ] ; then
export DEBIAN_FRONTEND=noninteractive
apt update && apt install -y build-essential git cmake \
&& rm -rf /var/lib/apt/lists/*
Expand Down
9 changes: 5 additions & 4 deletions third_party/python/python_repo.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@ def _python_repository_impl(repository_ctx):
result = repository_ctx.execute(["cat","/etc/os-release"],quiet=False)
ubuntu20_count = result.stdout.count("PRETTY_NAME=\"Ubuntu 20")
ubuntu22_count = result.stdout.count("PRETTY_NAME=\"Ubuntu 22")
ubuntu24_count = result.stdout.count("PRETTY_NAME=\"Ubuntu 24")

if ubuntu20_count == 1 or ubuntu22_count == 1:
if ubuntu22_count == 1 or ubuntu24_count == 1:
lib_path = "lib/x86_64-linux-gnu"
if ubuntu20_count == 1:
version = "3.8"
else:
if ubuntu22_count == 1:
version = "3.10"
else:
version = 3.12
else: # for redhat
lib_path = "lib64"
version = "3.9"
Expand Down