From 94497435e7386629b82e2fb1e03b37365fdad89a Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 22 May 2024 20:11:51 +0200 Subject: [PATCH] Upgrade CI images to Ubuntu 22 This updates all images in the CI to Ubuntu 22. It also updates corresponding documentation. Remove python(2) from the image, as it is not needed. Update documentation. It seems that the gcc coming in Ubuntu 22 does not like stack-protector-strong, so remove it as well. Since we compile Flexric, which does not support Ubuntu 22's default gcc-11 (it hits a compile bug), switch to gcc-12 manually. Since we update the compiler, we also need to be careful to use the right address sanitizer version (which is bundled with the compiler version). To avoid a reinstallation of the wrong asan version in target images, we modify Ubuntu 22 targets to copy libasan from the base image. This is necessary since we use update-alternative in the base image, but we don't want to install compilers in the target images to use update-alternatives to install the right asan version... This should be undone when switching to Ubuntu 24 in the future, as it will have a newer default gcc version, such that we don't need to update the compile in the first place. Upgrade libpython in lteUE for U22 upgrade to make it compatible with UHD. --- ci-scripts/cls_containerize.py | 4 +-- ....ubuntu20 => Dockerfile.unittest.ubuntu22} | 2 +- .../4g_rfsimulator_fdd_05MHz/README.md | 2 +- ci-scripts/yaml_files/5g_l2sim_tdd/README.md | 4 +-- .../yaml_files/5g_rfsimulator/README.md | 2 +- doc/Aerial_FAPI_Split_Tutorial.md | 4 +-- doc/TESTBenches.md | 20 ++++++------- ...base.ubuntu20 => Dockerfile.base.ubuntu22} | 8 +++-- ...ild.ubuntu20 => Dockerfile.build.ubuntu22} | 4 +-- ...e.eNB.ubuntu20 => Dockerfile.eNB.ubuntu22} | 29 +++++++++++-------- ...buntu20 => Dockerfile.gNB.aerial.ubuntu22} | 2 +- ...file.gNB.aerial.ubuntu22.sanitize-address} | 2 +- ....ubuntu20 => Dockerfile.gNB.aw2s.ubuntu22} | 2 +- ...e.gNB.ubuntu20 => Dockerfile.gNB.ubuntu22} | 27 ++++++++++------- ...eRU.ubuntu20 => Dockerfile.lteRU.ubuntu22} | 19 ++++++------ ...eUE.ubuntu20 => Dockerfile.lteUE.ubuntu22} | 29 +++++++++++-------- ...p.ubuntu20 => Dockerfile.nr-cuup.ubuntu22} | 10 +++++-- ...nrUE.ubuntu20 => Dockerfile.nrUE.ubuntu22} | 29 +++++++++++-------- docker/README.md | 18 ++++++------ 19 files changed, 122 insertions(+), 95 deletions(-) rename ci-scripts/docker/{Dockerfile.unittest.ubuntu20 => Dockerfile.unittest.ubuntu22} (98%) rename docker/{Dockerfile.base.ubuntu20 => Dockerfile.base.ubuntu22} (91%) rename docker/{Dockerfile.build.ubuntu20 => Dockerfile.build.ubuntu22} (91%) rename docker/{Dockerfile.eNB.ubuntu20 => Dockerfile.eNB.ubuntu22} (84%) rename docker/{Dockerfile.gNB.aerial.ubuntu20 => Dockerfile.gNB.aerial.ubuntu22} (98%) rename docker/{Dockerfile.gNB.aerial.ubuntu20.sanitize-address => Dockerfile.gNB.aerial.ubuntu22.sanitize-address} (99%) rename docker/{Dockerfile.gNB.aw2s.ubuntu20 => Dockerfile.gNB.aw2s.ubuntu22} (99%) rename docker/{Dockerfile.gNB.ubuntu20 => Dockerfile.gNB.ubuntu22} (84%) rename docker/{Dockerfile.lteRU.ubuntu20 => Dockerfile.lteRU.ubuntu22} (86%) rename docker/{Dockerfile.lteUE.ubuntu20 => Dockerfile.lteUE.ubuntu22} (83%) rename docker/{Dockerfile.nr-cuup.ubuntu20 => Dockerfile.nr-cuup.ubuntu22} (86%) rename docker/{Dockerfile.nrUE.ubuntu20 => Dockerfile.nrUE.ubuntu22} (83%) diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index 5d353f2b77..82edcbb973 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -286,7 +286,7 @@ class Containerize(): self.host = result.group(0) if self.host == 'Ubuntu': self.cli = 'docker' - self.dockerfileprefix = '.ubuntu20' + self.dockerfileprefix = '.ubuntu22' self.cliBuildOptions = '' elif self.host == 'Red Hat': self.cli = 'sudo podman' @@ -677,7 +677,7 @@ class Containerize(): return False # build ran-unittests image - dockerfile = "ci-scripts/docker/Dockerfile.unittest.ubuntu20" + dockerfile = "ci-scripts/docker/Dockerfile.unittest.ubuntu22" ret = cmd.run(f'docker build --progress=plain --tag ran-unittests:{baseTag} --file {dockerfile} . &> {lSourcePath}/cmake_targets/log/unittest-build.log') if ret.returncode != 0: build_log_name = f'build_log_{self.testCase_id}' diff --git a/ci-scripts/docker/Dockerfile.unittest.ubuntu20 b/ci-scripts/docker/Dockerfile.unittest.ubuntu22 similarity index 98% rename from ci-scripts/docker/Dockerfile.unittest.ubuntu20 rename to ci-scripts/docker/Dockerfile.unittest.ubuntu22 index 57bc7f3bef..6098a1d1f6 100644 --- a/ci-scripts/docker/Dockerfile.unittest.ubuntu20 +++ b/ci-scripts/docker/Dockerfile.unittest.ubuntu22 @@ -21,7 +21,7 @@ #--------------------------------------------------------------------- # # Dockerfile for the Open-Air-Interface BUILD service -# Valid for Ubuntu 20.04 +# Valid for Ubuntu 22.04 # #--------------------------------------------------------------------- diff --git a/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/README.md b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/README.md index 3ac4962321..e761886855 100644 --- a/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/README.md +++ b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/README.md @@ -12,7 +12,7 @@ -This page is only valid for an `Ubuntu18` host. +This page is only valid for an `Ubuntu 22` host. **Table of Contents** diff --git a/ci-scripts/yaml_files/5g_l2sim_tdd/README.md b/ci-scripts/yaml_files/5g_l2sim_tdd/README.md index 7fdb1bb8be..6579fcac5f 100644 --- a/ci-scripts/yaml_files/5g_l2sim_tdd/README.md +++ b/ci-scripts/yaml_files/5g_l2sim_tdd/README.md @@ -12,10 +12,8 @@ -This page is valid for an `Ubuntu18` host. -It is also valid for `Ubuntu 20.04`. +It is also valid for `Ubuntu 22.04`. -This tutorial is only valid once this file is merged into the `develop` branch. # 1. Adapt the `docker-compose` to your environment # The yaml file is in the following directory: `ci-scripts/yaml_files/5g_l2sim_tdd` diff --git a/ci-scripts/yaml_files/5g_rfsimulator/README.md b/ci-scripts/yaml_files/5g_rfsimulator/README.md index eec4eb17d2..87e98633f3 100644 --- a/ci-scripts/yaml_files/5g_rfsimulator/README.md +++ b/ci-scripts/yaml_files/5g_rfsimulator/README.md @@ -12,7 +12,7 @@ -This page is only valid for an `Ubuntu18` host. +This page is only valid for an `Ubuntu 22` host. **NOTE: this version (2023-01-27) has been updated for the `v1.5.0` version of the `OAI 5G CN`.** diff --git a/doc/Aerial_FAPI_Split_Tutorial.md b/doc/Aerial_FAPI_Split_Tutorial.md index d04c723ca2..46541fff95 100644 --- a/doc/Aerial_FAPI_Split_Tutorial.md +++ b/doc/Aerial_FAPI_Split_Tutorial.md @@ -202,8 +202,8 @@ With the nvIPC sources in the project directory, the docker image can be built. In order to build the final image, there is an intermediary image to be built (ran-base) ```bash ~$ cd ~/openairinterface5g/ -~/openairinterface5g$ docker build . -f docker/Dockerfile.base.ubuntu20 --tag ran-base:latest -~/openairinterface5g$ docker build . -f docker/Dockerfile.gNB.aerial.ubuntu20 --tag oai-gnb-aerial:latest +~/openairinterface5g$ docker build . -f docker/Dockerfile.base.ubuntu22 --tag ran-base:latest +~/openairinterface5g$ docker build . -f docker/Dockerfile.gNB.aerial.ubuntu22 --tag oai-gnb-aerial:latest ``` diff --git a/doc/TESTBenches.md b/doc/TESTBenches.md index c9453b10e0..58b7eeb862 100644 --- a/doc/TESTBenches.md +++ b/doc/TESTBenches.md @@ -112,16 +112,16 @@ information on how the images are built. - [RAN-Ubuntu18-Image-Builder](https://jenkins-oai.eurecom.fr/job/RAN-Ubuntu18-Image-Builder/) ~BUILD-ONLY ~4G-LTE ~5G-NR - run formatting check from `ci-scripts/docker/Dockerfile.formatting.bionic` - - obelix: Ubuntu 20 image build using docker (Note: builds U20 images while pipeline is named U18!) - - base image from `Dockerfile.base.ubuntu20` - - build image from `Dockerfile.build.ubuntu20`, followed by - - target image from `Dockerfile.eNB.ubuntu20` - - target image from `Dockerfile.gNB.ubuntu20` - - target image from `Dockerfile.nr-cuup.ubuntu20` - - target image from `Dockerfile.nrUE.ubuntu20` - - target image from `Dockerfile.lteUE.ubuntu20` - - target image from `Dockerfile.lteRU.ubuntu20` - - build unit tests from `ci-scripts/docker/Dockerfile.unittest.ubuntu20`, and run them + - obelix: Ubuntu 22 image build using docker (Note: builds U22 images while pipeline is named U18!) + - base image from `Dockerfile.base.ubuntu22` + - build image from `Dockerfile.build.ubuntu22`, followed by + - target image from `Dockerfile.eNB.ubuntu22` + - target image from `Dockerfile.gNB.ubuntu22` + - target image from `Dockerfile.nr-cuup.ubuntu22` + - target image from `Dockerfile.nrUE.ubuntu22` + - target image from `Dockerfile.lteUE.ubuntu22` + - target image from `Dockerfile.lteRU.ubuntu22` + - build unit tests from `ci-scripts/docker/Dockerfile.unittest.ubuntu22`, and run them #### Image Test pipelines diff --git a/docker/Dockerfile.base.ubuntu20 b/docker/Dockerfile.base.ubuntu22 similarity index 91% rename from docker/Dockerfile.base.ubuntu20 rename to docker/Dockerfile.base.ubuntu22 index 5687e21ac2..9ed0cd6beb 100644 --- a/docker/Dockerfile.base.ubuntu20 +++ b/docker/Dockerfile.base.ubuntu22 @@ -21,12 +21,12 @@ #--------------------------------------------------------------------- # # Dockerfile for the Open-Air-Interface BUILD service -# Valid for Ubuntu 20.04 +# Valid for Ubuntu 22.04 # #--------------------------------------------------------------------- -FROM ubuntu:focal AS ran-base +FROM ubuntu:jammy AS ran-base ARG NEEDED_GIT_PROXY ENV DEBIAN_FRONTEND=noninteractive ENV TZ=Europe/Paris @@ -34,6 +34,7 @@ ENV BUILD_UHD_FROM_SOURCE=True ENV UHD_VERSION=4.4.0.0 #install developers pkg/repo +#use gcc-12 to avoid problems of default gcc-11 in FlexRIC RUN apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && \ DEBIAN_FRONTEND=noninteractive apt-get install --yes \ @@ -41,9 +42,12 @@ RUN apt-get update && \ build-essential \ psmisc \ git \ + gcc-12 \ + g++-12 \ xxd \ # python3-pip for conf template generation python3-pip && \ + update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 100 --slave /usr/bin/g++ g++ /usr/bin/g++-12 && \ pip3 install --ignore-installed pyyaml # Add "Tini - A tiny but valid init for containers", https://github.com/krallin/tini diff --git a/docker/Dockerfile.build.ubuntu20 b/docker/Dockerfile.build.ubuntu22 similarity index 91% rename from docker/Dockerfile.build.ubuntu20 rename to docker/Dockerfile.build.ubuntu22 index 3459e0b265..e92aecceda 100644 --- a/docker/Dockerfile.build.ubuntu20 +++ b/docker/Dockerfile.build.ubuntu22 @@ -21,7 +21,7 @@ #--------------------------------------------------------------------- # # Dockerfile for the Open-Air-Interface BUILD service -# Valid for Ubuntu 20.04 +# Valid for Ubuntu 22.04 # #--------------------------------------------------------------------- @@ -42,6 +42,6 @@ RUN /bin/sh oaienv && \ -w USRP -t Ethernet \ --build-e2 --cmake-opt -DXAPP_MULTILANGUAGE=OFF \ --noavx512 \ - --cmake-opt -DCMAKE_C_FLAGS="-Werror -fstack-protector-strong" --cmake-opt -DCMAKE_CXX_FLAGS="-Werror -fstack-protector-strong" $BUILD_OPTION && \ + --cmake-opt -DCMAKE_C_FLAGS="-Werror" --cmake-opt -DCMAKE_CXX_FLAGS="-Werror" $BUILD_OPTION && \ # Mainly to see if the sanitize option was perfectly executed ldd ran_build/build/nr-softmodem diff --git a/docker/Dockerfile.eNB.ubuntu20 b/docker/Dockerfile.eNB.ubuntu22 similarity index 84% rename from docker/Dockerfile.eNB.ubuntu20 rename to docker/Dockerfile.eNB.ubuntu22 index 8822349c0b..f71abefbc1 100644 --- a/docker/Dockerfile.eNB.ubuntu20 +++ b/docker/Dockerfile.eNB.ubuntu22 @@ -21,7 +21,7 @@ #--------------------------------------------------------------------- # # Dockerfile for the Open-Air-Interface BUILD service -# Valid for Ubuntu 20.04 +# Valid for Ubuntu 22.04 # #--------------------------------------------------------------------- @@ -31,7 +31,7 @@ FROM ran-build:latest AS enb-build #start from scratch for target executable -FROM ubuntu:focal as oai-enb +FROM ubuntu:jammy as oai-enb ARG BUILD_OPTION ENV DEBIAN_FRONTEND=noninteractive ENV TZ=Europe/Paris @@ -42,14 +42,14 @@ RUN apt-get update && \ software-properties-common \ procps \ libsctp1 \ - libboost-chrono1.71.0 \ - libboost-date-time1.71.0 \ - libboost-filesystem1.71.0 \ - libboost-regex1.71.0 \ - libboost-serialization1.71.0 \ - libboost-thread1.71.0 \ - libboost-system1.71.0 \ - libboost-program-options1.71.0 \ + libboost-chrono1.74.0 \ + libboost-date-time1.74.0 \ + libboost-filesystem1.74.0 \ + libboost-regex1.74.0 \ + libboost-serialization1.74.0 \ + libboost-thread1.74.0 \ + libboost-system1.74.0 \ + libboost-program-options1.74.0 \ tzdata \ libblas3 \ libatlas3-base \ @@ -61,19 +61,24 @@ RUN apt-get update && \ iputils-ping \ iproute2 \ gdb \ - python \ python3 \ python3-six \ python3-requests \ libusb-1.0-0 && \ # if the --sanitize option was used to build, additional packages are required /bin/bash -c 'if [[ "$BUILD_OPTION" = "--sanitize" ]]; then DEBIAN_FRONTEND=noninteractive apt-get install --yes \ - libasan5 \ + #libasan5 \ # see below libubsan1 \ liblapacke; fi' && \ apt-get clean -y && \ rm -rf /var/lib/apt/lists/* +# we select another compile (gcc-12) for compilation, requiring another libasan +# library version. Installing it above would install the wrong version. Hence, +# copy the right version from ran-build. When upgrading to Ubuntu24, install +# the correct one above! +COPY --from=enb-build /usr/lib/x86_64-linux-gnu/libasan.so.8.0.0 /usr/lib/x86_64-linux-gnu/ + WORKDIR /opt/oai-enb/bin COPY --from=enb-build \ /oai-ran/cmake_targets/ran_build/build/lte-softmodem ./ diff --git a/docker/Dockerfile.gNB.aerial.ubuntu20 b/docker/Dockerfile.gNB.aerial.ubuntu22 similarity index 98% rename from docker/Dockerfile.gNB.aerial.ubuntu20 rename to docker/Dockerfile.gNB.aerial.ubuntu22 index 3984e236cb..f3cfe7a4be 100644 --- a/docker/Dockerfile.gNB.aerial.ubuntu20 +++ b/docker/Dockerfile.gNB.aerial.ubuntu22 @@ -58,7 +58,7 @@ RUN /bin/sh oaienv && \ #start from scratch for target executable -FROM ubuntu:focal as oai-gnb-aerial +FROM ubuntu:jammy as oai-gnb-aerial ENV DEBIAN_FRONTEND=noninteractive ENV TZ=Europe diff --git a/docker/Dockerfile.gNB.aerial.ubuntu20.sanitize-address b/docker/Dockerfile.gNB.aerial.ubuntu22.sanitize-address similarity index 99% rename from docker/Dockerfile.gNB.aerial.ubuntu20.sanitize-address rename to docker/Dockerfile.gNB.aerial.ubuntu22.sanitize-address index 147d7231a4..0713d65a2c 100644 --- a/docker/Dockerfile.gNB.aerial.ubuntu20.sanitize-address +++ b/docker/Dockerfile.gNB.aerial.ubuntu22.sanitize-address @@ -58,7 +58,7 @@ RUN /bin/sh oaienv && \ #start from scratch for target executable -FROM ubuntu:focal as oai-gnb-aerial +FROM ubuntu:jammy as oai-gnb-aerial ENV DEBIAN_FRONTEND=noninteractive ENV TZ=Europe diff --git a/docker/Dockerfile.gNB.aw2s.ubuntu20 b/docker/Dockerfile.gNB.aw2s.ubuntu22 similarity index 99% rename from docker/Dockerfile.gNB.aw2s.ubuntu20 rename to docker/Dockerfile.gNB.aw2s.ubuntu22 index c0bd7f7401..a000d9a643 100644 --- a/docker/Dockerfile.gNB.aw2s.ubuntu20 +++ b/docker/Dockerfile.gNB.aw2s.ubuntu22 @@ -21,7 +21,7 @@ #--------------------------------------------------------------------- # # Dockerfile for the Open-Air-Interface BUILD service -# Valid for Ubuntu18.04 +# Valid for Ubuntu 22.04 # #--------------------------------------------------------------------- diff --git a/docker/Dockerfile.gNB.ubuntu20 b/docker/Dockerfile.gNB.ubuntu22 similarity index 84% rename from docker/Dockerfile.gNB.ubuntu20 rename to docker/Dockerfile.gNB.ubuntu22 index dc24bb7636..f039d9dce0 100644 --- a/docker/Dockerfile.gNB.ubuntu20 +++ b/docker/Dockerfile.gNB.ubuntu22 @@ -31,7 +31,7 @@ FROM ran-build:latest AS gnb-build #start from scratch for target executable -FROM ubuntu:focal as oai-gnb +FROM ubuntu:jammy as oai-gnb ARG BUILD_OPTION ENV DEBIAN_FRONTEND=noninteractive ENV TZ=Europe/Paris @@ -42,14 +42,14 @@ RUN apt-get update && \ software-properties-common \ procps \ libsctp1 \ - libboost-chrono1.71.0 \ - libboost-date-time1.71.0 \ - libboost-filesystem1.71.0 \ - libboost-regex1.71.0 \ - libboost-serialization1.71.0 \ - libboost-thread1.71.0 \ - libboost-system1.71.0 \ - libboost-program-options1.71.0 \ + libboost-chrono1.74.0 \ + libboost-date-time1.74.0 \ + libboost-filesystem1.74.0 \ + libboost-regex1.74.0 \ + libboost-serialization1.74.0 \ + libboost-thread1.74.0 \ + libboost-system1.74.0 \ + libboost-program-options1.74.0 \ tzdata \ libblas3 \ libatlas3-base \ @@ -61,19 +61,24 @@ RUN apt-get update && \ iproute2 \ iputils-ping \ gdb \ - python \ python3 \ python3-six \ python3-requests \ libusb-1.0-0 && \ # if the --sanitize option was used to build, additional packages are required /bin/bash -c 'if [[ "$BUILD_OPTION" = "--sanitize" ]]; then DEBIAN_FRONTEND=noninteractive apt-get install --yes \ - libasan5 \ + #libasan5 \ # see below libubsan1 \ liblapacke; fi' && \ apt-get clean -y && \ rm -rf /var/lib/apt/lists/* +# we select another compile (gcc-12) for compilation, requiring another libasan +# library version. Installing it above would install the wrong version. Hence, +# copy the right version from ran-build. When upgrading to Ubuntu24, install +# the correct one above! +COPY --from=gnb-build /usr/lib/x86_64-linux-gnu/libasan.so.8.0.0 /usr/lib/x86_64-linux-gnu/ + WORKDIR /opt/oai-gnb/bin COPY --from=gnb-build \ /oai-ran/cmake_targets/ran_build/build/nr-softmodem ./ diff --git a/docker/Dockerfile.lteRU.ubuntu20 b/docker/Dockerfile.lteRU.ubuntu22 similarity index 86% rename from docker/Dockerfile.lteRU.ubuntu20 rename to docker/Dockerfile.lteRU.ubuntu22 index 6fa2a167b7..44a7337e40 100644 --- a/docker/Dockerfile.lteRU.ubuntu20 +++ b/docker/Dockerfile.lteRU.ubuntu22 @@ -21,7 +21,7 @@ #--------------------------------------------------------------------- # # Dockerfile for the Open-Air-Interface BUILD service -# Valid for Ubuntu 20.04 +# Valid for Ubuntu 22.04 # #--------------------------------------------------------------------- @@ -31,7 +31,7 @@ FROM ran-build:latest AS ru-build #start from scratch for target executable -FROM ubuntu:focal as oai-lte-ru +FROM ubuntu:jammy as oai-lte-ru ENV DEBIAN_FRONTEND=noninteractive ENV TZ=Europe/Paris @@ -46,7 +46,6 @@ RUN apt-get update && \ libconfig9 \ net-tools \ gdb \ - python \ python3 \ python3-six \ python3-requests \ @@ -74,13 +73,13 @@ COPY --from=ru-base /usr/local/lib/libuhd.so.4.4.0 /usr/local/lib COPY --from=ru-base /usr/local/lib/uhd/utils/uhd_images_downloader.py /opt/oai-lte-ru/bin COPY --from=ru-base \ - /usr/lib/x86_64-linux-gnu/libboost_chrono.so.1.71.0 \ - /usr/lib/x86_64-linux-gnu/libboost_date_time.so.1.71.0 \ - /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.71.0 \ - /usr/lib/x86_64-linux-gnu/libboost_regex.so.1.71.0 \ - /usr/lib/x86_64-linux-gnu/libboost_serialization.so.1.71.0 \ - /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.71.0 \ - /usr/lib/x86_64-linux-gnu/libboost_system.so.1.71.0 \ + /usr/lib/x86_64-linux-gnu/libboost_chrono.so.1.74.0 \ + /usr/lib/x86_64-linux-gnu/libboost_date_time.so.1.74.0 \ + /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.74.0 \ + /usr/lib/x86_64-linux-gnu/libboost_regex.so.1.74.0 \ + /usr/lib/x86_64-linux-gnu/libboost_serialization.so.1.74.0 \ + /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.74.0 \ + /usr/lib/x86_64-linux-gnu/libboost_system.so.1.74.0 \ /usr/lib/x86_64-linux-gnu/ RUN /bin/bash -c "ln -s /usr/local/lib/liboai_usrpdevif.so /usr/local/lib/liboai_device.so" && \ diff --git a/docker/Dockerfile.lteUE.ubuntu20 b/docker/Dockerfile.lteUE.ubuntu22 similarity index 83% rename from docker/Dockerfile.lteUE.ubuntu20 rename to docker/Dockerfile.lteUE.ubuntu22 index 12652c3141..1a0b8c1841 100644 --- a/docker/Dockerfile.lteUE.ubuntu20 +++ b/docker/Dockerfile.lteUE.ubuntu22 @@ -31,7 +31,7 @@ FROM ran-build:latest AS lte-ue-build #start from scratch for target executable -FROM ubuntu:focal as oai-lte-ue +FROM ubuntu:jammy as oai-lte-ue ARG BUILD_OPTION ENV DEBIAN_FRONTEND=noninteractive ENV TZ=Europe/Paris @@ -42,25 +42,24 @@ RUN apt-get update && \ software-properties-common \ procps \ libsctp1 \ - libboost-chrono1.71.0 \ - libboost-date-time1.71.0 \ - libboost-filesystem1.71.0 \ - libboost-regex1.71.0 \ - libboost-serialization1.71.0 \ - libboost-thread1.71.0 \ - libboost-system1.71.0 \ - libboost-program-options1.71.0 \ + libboost-chrono1.74.0 \ + libboost-date-time1.74.0 \ + libboost-filesystem1.74.0 \ + libboost-regex1.74.0 \ + libboost-serialization1.74.0 \ + libboost-thread1.74.0 \ + libboost-system1.74.0 \ + libboost-program-options1.74.0 \ tzdata \ liblapacke \ libatlas3-base \ libconfig9 \ openssl \ net-tools \ - python \ python3 \ python3-six \ python3-requests \ - libpython3.8 \ + libpython3.10 \ libusb-1.0-0 \ iputils-ping \ iproute2 \ @@ -68,12 +67,18 @@ RUN apt-get update && \ iperf && \ # if the --sanitize option was used to build, additional packages are required /bin/bash -c 'if [[ "$BUILD_OPTION" = "--sanitize" ]]; then DEBIAN_FRONTEND=noninteractive apt-get install --yes \ - libasan5 \ + #libasan5 \ # see below libubsan1 \ liblapacke; fi' && \ apt-get clean -y && \ rm -rf /var/lib/apt/lists/* +# we select another compile (gcc-12) for compilation, requiring another libasan +# library version. Installing it above would install the wrong version. Hence, +# copy the right version from ran-build. When upgrading to Ubuntu24, install +# the correct one above! +COPY --from=lte-ue-build /usr/lib/x86_64-linux-gnu/libasan.so.8.0.0 /usr/lib/x86_64-linux-gnu/ + WORKDIR /opt/oai-lte-ue/bin COPY --from=lte-ue-build \ /oai-ran/cmake_targets/ran_build/build/lte-uesoftmodem \ diff --git a/docker/Dockerfile.nr-cuup.ubuntu20 b/docker/Dockerfile.nr-cuup.ubuntu22 similarity index 86% rename from docker/Dockerfile.nr-cuup.ubuntu20 rename to docker/Dockerfile.nr-cuup.ubuntu22 index 0a371e669c..b618a578be 100644 --- a/docker/Dockerfile.nr-cuup.ubuntu20 +++ b/docker/Dockerfile.nr-cuup.ubuntu22 @@ -30,7 +30,7 @@ FROM ran-base:latest as gnb-base FROM ran-build:latest AS gnb-build -FROM ubuntu:focal as oai-nr-cuup +FROM ubuntu:jammy as oai-nr-cuup ARG BUILD_OPTION ENV DEBIAN_FRONTEND=noninteractive ENV TZ=Europe @@ -45,11 +45,17 @@ RUN apt-get update && \ openssl && \ # if the --sanitize option was used to build, additional packages are required /bin/bash -c 'if [[ "$BUILD_OPTION" = "--sanitize" ]]; then DEBIAN_FRONTEND=noninteractive apt-get install --yes \ - libasan5 \ + #libasan5 \ see below libubsan1 \ liblapacke; fi' && \ rm -rf /var/lib/apt/lists/* +# we select another compile (gcc-12) for compilation, requiring another libasan +# library version. Installing it above would install the wrong version. Hence, +# copy the right version from ran-build. When upgrading to Ubuntu24, install +# the correct one above! +COPY --from=gnb-build /usr/lib/x86_64-linux-gnu/libasan.so.8.0.0 /usr/lib/x86_64-linux-gnu/ + WORKDIR /opt/oai-gnb/bin COPY --from=gnb-build \ /oai-ran/cmake_targets/ran_build/build/nr-cuup \ diff --git a/docker/Dockerfile.nrUE.ubuntu20 b/docker/Dockerfile.nrUE.ubuntu22 similarity index 83% rename from docker/Dockerfile.nrUE.ubuntu20 rename to docker/Dockerfile.nrUE.ubuntu22 index dfbd5f93e6..13387d2523 100644 --- a/docker/Dockerfile.nrUE.ubuntu20 +++ b/docker/Dockerfile.nrUE.ubuntu22 @@ -21,7 +21,7 @@ #--------------------------------------------------------------------- # # Dockerfile for the Open-Air-Interface BUILD service -# Valid for Ubuntu 20.04 +# Valid for Ubuntu 22.04 # #--------------------------------------------------------------------- @@ -31,7 +31,7 @@ FROM ran-build:latest AS nr-ue-build #start from scratch for target executable -FROM ubuntu:focal as oai-nr-ue +FROM ubuntu:jammy as oai-nr-ue ARG BUILD_OPTION ENV DEBIAN_FRONTEND=noninteractive ENV TZ=Europe/Paris @@ -42,14 +42,14 @@ RUN apt-get update && \ software-properties-common \ procps \ libsctp1 \ - libboost-chrono1.71.0 \ - libboost-date-time1.71.0 \ - libboost-filesystem1.71.0 \ - libboost-regex1.71.0 \ - libboost-serialization1.71.0 \ - libboost-thread1.71.0 \ - libboost-system1.71.0 \ - libboost-program-options1.71.0 \ + libboost-chrono1.74.0 \ + libboost-date-time1.74.0 \ + libboost-filesystem1.74.0 \ + libboost-regex1.74.0 \ + libboost-serialization1.74.0 \ + libboost-thread1.74.0 \ + libboost-system1.74.0 \ + libboost-program-options1.74.0 \ tzdata \ liblapacke \ libatlas3-base \ @@ -57,7 +57,6 @@ RUN apt-get update && \ openssl \ net-tools \ gdb \ - python \ python3 \ python3-six \ python3-requests \ @@ -68,11 +67,17 @@ RUN apt-get update && \ iperf && \ # if the --sanitize option was used to build, additional packages are required /bin/bash -c 'if [[ "$BUILD_OPTION" = "--sanitize" ]]; then DEBIAN_FRONTEND=noninteractive apt-get install --yes \ - libasan5 \ + #libasan5 \ # see below libubsan1; fi' && \ apt-get clean -y && \ rm -rf /var/lib/apt/lists/* +# we select another compile (gcc-12) for compilation, requiring another libasan +# library version. Installing it above would install the wrong version. Hence, +# copy the right version from ran-build. When upgrading to Ubuntu24, install +# the correct one above! +COPY --from=nr-ue-build /usr/lib/x86_64-linux-gnu/libasan.so.8.0.0 /usr/lib/x86_64-linux-gnu/ + WORKDIR /opt/oai-nr-ue/bin COPY --from=nr-ue-build \ /oai-ran/cmake_targets/ran_build/build/nr-uesoftmodem \ diff --git a/docker/README.md b/docker/README.md index 578cd47274..483a049f9d 100644 --- a/docker/README.md +++ b/docker/README.md @@ -75,18 +75,18 @@ Targets can be: The currently-supported OS are: - `rhel9` for Red Hat Entreprise Linux (including images for an OpenShift cluster) -- `ubuntu20` for Ubuntu 20.04 LTS +- `ubuntu22` for Ubuntu 22.04 LTS - `rocky` for Rocky-Linux 8.7 For more details regarding the build on an Openshift Cluster, see [OpenShift README](../openshift/README.md). -# 3. Building using `docker` under Ubuntu 20.04 # +# 3. Building using `docker` under Ubuntu 22.04 # ## 3.1. Pre-requisites ## * `git` installed * `docker-ce` installed -* Pulling `ubuntu:focal` from DockerHub +* Pulling `ubuntu:jammy` from DockerHub ## 3.2. Building the shared images ## @@ -96,8 +96,8 @@ There are two shared images: one that has all dependencies, and a second that co git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git cd openairinterface5g git checkout develop -docker build --target ran-base --tag ran-base:latest --file docker/Dockerfile.base.ubuntu20 . -docker build --target ran-build --tag ran-build:latest --file docker/Dockerfile.build.ubuntu20 . +docker build --target ran-base --tag ran-base:latest --file docker/Dockerfile.base.ubuntu22 . +docker build --target ran-build --tag ran-build:latest --file docker/Dockerfile.build.ubuntu22 . ``` After building both: @@ -115,12 +115,12 @@ Note that the steps are identical for `rocky-linux`. ### 3.2.1. Additional build otions -This is only available for the Ubuntu-20 version. +This is only available for the Ubuntu version of Dockerfiles. You can, for example, create a `sanitizer` version of the ran-build image. ```bash -docker build --target ran-build --tag ran-build:latest --file docker/Dockerfile.build.ubuntu20 --build-arg "BUILD_OPTION=--sanitize" . +docker build --target ran-build --tag ran-build:latest --file docker/Dockerfile.build.ubuntu22 --build-arg "BUILD_OPTION=--sanitize" . ``` Currently the `--sanitize` option for `build_oai` enables: @@ -146,7 +146,7 @@ You can also use this docker build arguments to pass any available option(s) on For example, the eNB: ```bash -docker build --target oai-enb --tag oai-enb:latest --file docker/Dockerfile.eNB.ubuntu20 . +docker build --target oai-enb --tag oai-enb:latest --file docker/Dockerfile.eNB.ubuntu22 . ``` After a while: @@ -171,7 +171,7 @@ Note that the steps are identical for `rocky-linux`. If you have used the sanitizer option, then you should also pass it when building the target image: ```bash -docker build --target oai-gnb --tag oai-gnb:latest --file docker/Dockerfile.gNB.ubuntu20 --build-arg "BUILD_OPTION=--sanitize" . +docker build --target oai-gnb --tag oai-gnb:latest --file docker/Dockerfile.gNB.ubuntu22 --build-arg "BUILD_OPTION=--sanitize" . ``` Normally the target image will be around 200 Mbytes bigger.