chore(ci): post-review changes
* Dockerfile argument is now a generic BUILD_OPTION for any build_oai available option * docker-compose files are only modified at deployment time. Not needed for undeployment * fixes for oai-nr-cuup * cleaner section for the private registry push Signed-off-by: Raphael Defosseux <raphael.defosseux@eurecom.fr>
This commit is contained in:
committed by
Robert Schmidt
parent
4db8dfaf5d
commit
8e35d8fe5b
@@ -26,7 +26,7 @@
|
||||
#---------------------------------------------------------------------
|
||||
|
||||
FROM ran-base:latest as ran-build
|
||||
ARG SANITIZE_OPTION
|
||||
ARG BUILD_OPTION
|
||||
|
||||
RUN rm -Rf /oai-ran
|
||||
WORKDIR /oai-ran
|
||||
@@ -36,6 +36,6 @@ COPY . .
|
||||
RUN /bin/sh oaienv && \
|
||||
cd cmake_targets && \
|
||||
mkdir -p log && \
|
||||
./build_oai --eNB --gNB --RU --UE --nrUE --ninja --build-lib "telnetsrv enbscope uescope nrscope nrqtscope" -w USRP -t Ethernet --noavx512 -c --cmake-opt -DCMAKE_C_FLAGS=-Werror --cmake-opt -DCMAKE_CXX_FLAGS=-Werror $SANITIZE_OPTION && \
|
||||
./build_oai --eNB --gNB --RU --UE --nrUE --ninja --build-lib "telnetsrv enbscope uescope nrscope nrqtscope" -w USRP -t Ethernet --noavx512 -c --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
|
||||
|
||||
@@ -32,7 +32,7 @@ FROM ran-build:latest AS enb-build
|
||||
|
||||
#start from scratch for target executable
|
||||
FROM ubuntu:focal as oai-enb
|
||||
ARG SANITIZE_OPTION
|
||||
ARG BUILD_OPTION
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
ENV TZ=Europe/Paris
|
||||
|
||||
@@ -59,7 +59,7 @@ RUN apt-get update && \
|
||||
python3-requests \
|
||||
libusb-1.0-0 && \
|
||||
# if the --sanitize option was used to build, additional packages are required
|
||||
/bin/bash -c 'if [[ "$SANITIZE_OPTION" = "--sanitize" ]]; then DEBIAN_FRONTEND=noninteractive apt-get install --yes \
|
||||
/bin/bash -c 'if [[ "$BUILD_OPTION" = "--sanitize" ]]; then DEBIAN_FRONTEND=noninteractive apt-get install --yes \
|
||||
libasan5 \
|
||||
libubsan1 \
|
||||
liblapacke; fi' && \
|
||||
|
||||
@@ -32,7 +32,7 @@ FROM ran-build:latest AS gnb-build
|
||||
|
||||
#start from scratch for target executable
|
||||
FROM ubuntu:focal as oai-gnb
|
||||
ARG SANITIZE_OPTION
|
||||
ARG BUILD_OPTION
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
ENV TZ=Europe
|
||||
|
||||
@@ -58,7 +58,7 @@ RUN apt-get update && \
|
||||
python3-requests \
|
||||
libusb-1.0-0 && \
|
||||
# if the --sanitize option was used to build, additional packages are required
|
||||
/bin/bash -c 'if [[ "$SANITIZE_OPTION" = "--sanitize" ]]; then DEBIAN_FRONTEND=noninteractive apt-get install --yes \
|
||||
/bin/bash -c 'if [[ "$BUILD_OPTION" = "--sanitize" ]]; then DEBIAN_FRONTEND=noninteractive apt-get install --yes \
|
||||
libasan5 \
|
||||
libubsan1 \
|
||||
liblapacke; fi' && \
|
||||
|
||||
@@ -32,7 +32,7 @@ FROM ran-build:latest AS lte-ue-build
|
||||
|
||||
#start from scratch for target executable
|
||||
FROM ubuntu:focal as oai-lte-ue
|
||||
ARG SANITIZE_OPTION
|
||||
ARG BUILD_OPTION
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
ENV TZ=Europe/Paris
|
||||
|
||||
@@ -58,7 +58,7 @@ RUN apt-get update && \
|
||||
iproute2 \
|
||||
iperf && \
|
||||
# if the --sanitize option was used to build, additional packages are required
|
||||
/bin/bash -c 'if [[ "$SANITIZE_OPTION" = "--sanitize" ]]; then DEBIAN_FRONTEND=noninteractive apt-get install --yes \
|
||||
/bin/bash -c 'if [[ "$BUILD_OPTION" = "--sanitize" ]]; then DEBIAN_FRONTEND=noninteractive apt-get install --yes \
|
||||
libasan5 \
|
||||
libubsan1 \
|
||||
liblapacke; fi' && \
|
||||
|
||||
@@ -31,7 +31,7 @@ FROM ran-build:latest AS gnb-build
|
||||
|
||||
|
||||
FROM ubuntu:focal as oai-nr-cuup
|
||||
ARG SANITIZE_OPTION
|
||||
ARG BUILD_OPTION
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
ENV TZ=Europe
|
||||
|
||||
@@ -42,7 +42,7 @@ RUN apt-get update && \
|
||||
libconfig9 \
|
||||
openssl && \
|
||||
# if the --sanitize option was used to build, additional packages are required
|
||||
/bin/bash -c 'if [[ "$SANITIZE_OPTION" = "--sanitize" ]]; then DEBIAN_FRONTEND=noninteractive apt-get install --yes \
|
||||
/bin/bash -c 'if [[ "$BUILD_OPTION" = "--sanitize" ]]; then DEBIAN_FRONTEND=noninteractive apt-get install --yes \
|
||||
libasan5 \
|
||||
libubsan1 \
|
||||
liblapacke; fi' && \
|
||||
|
||||
@@ -32,7 +32,7 @@ FROM ran-build:latest AS nr-ue-build
|
||||
|
||||
#start from scratch for target executable
|
||||
FROM ubuntu:focal as oai-nr-ue
|
||||
ARG SANITIZE_OPTION
|
||||
ARG BUILD_OPTION
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
ENV TZ=Europe/Paris
|
||||
|
||||
@@ -58,7 +58,7 @@ RUN apt-get update && \
|
||||
iproute2 \
|
||||
iperf && \
|
||||
# if the --sanitize option was used to build, additional packages are required
|
||||
/bin/bash -c 'if [[ "$SANITIZE_OPTION" = "--sanitize" ]]; then DEBIAN_FRONTEND=noninteractive apt-get install --yes \
|
||||
/bin/bash -c 'if [[ "$BUILD_OPTION" = "--sanitize" ]]; then DEBIAN_FRONTEND=noninteractive apt-get install --yes \
|
||||
libasan5 \
|
||||
libubsan1; fi' && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
+17
-7
@@ -46,16 +46,15 @@ For all platforms, the strategy for building docker/podman images is the same:
|
||||
- Some tools (such as `ping`, `ifconfig`)
|
||||
|
||||
Note that on every push to develop (i.e., typically after integrating merge
|
||||
requests), we build all images and push them to [Docker
|
||||
Hub](https://hub.docker.com/u/oaisoftwarealliance). To pull them, do
|
||||
requests), we build all images and push them to [Docker Hub](https://hub.docker.com/u/oaisoftwarealliance). To pull them, do
|
||||
|
||||
```
|
||||
docker pull oaisoftwarealliance/oai-gnb:develop
|
||||
docker pull oaisoftwarealliance/oai-nr-ue:develop
|
||||
docker pull oaisoftwarealliance/oai-enb:develop
|
||||
docker pull oaisoftwarealliance/oai-lte-ue:develop
|
||||
```
|
||||
Have a look at [this
|
||||
README](../ci-scripts/yaml_files/5g_rfsimulator/README.md) to get some
|
||||
Have a look at [this README](../ci-scripts/yaml_files/5g_rfsimulator/README.md) to get some
|
||||
information on how to use the images.
|
||||
|
||||
# 2. File organization #
|
||||
@@ -114,12 +113,21 @@ ran-base latest 5c9c02a5b4a8 1 minute ago
|
||||
|
||||
Note that the steps are identical for `rocky-linux`.
|
||||
|
||||
You can also create `address-sanitizer` version of the ran-build image. This is only available for the Ubuntu-20 version.
|
||||
### 3.2.1. Additional build otions
|
||||
|
||||
This is only available for the Ubuntu-20 version.
|
||||
|
||||
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 "SANITIZE_OPTION=--sanitize" .
|
||||
docker build --target ran-build --tag ran-build:latest --file docker/Dockerfile.build.ubuntu20 --build-arg "BUILD_OPTION=--sanitize" .
|
||||
```
|
||||
|
||||
Currently the `--sanitize` option for `build_oai` enables:
|
||||
|
||||
* [Address Sanitizer](https://github.com/google/sanitizers/wiki/AddressSanitizer)
|
||||
* [Undefined Behavior Sanitizer](https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html)
|
||||
|
||||
After building:
|
||||
|
||||
```bash
|
||||
@@ -131,6 +139,8 @@ ran-build latest f2633a7f5102 1 minute ago
|
||||
|
||||
Note that the image is much bigger.
|
||||
|
||||
You can also use this docker build arguments to pass any available option(s) on the `build-oai` script.
|
||||
|
||||
## 3.3. Building any target image ##
|
||||
|
||||
For example, the eNB:
|
||||
@@ -161,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 "SANITIZE_OPTION=--sanitize" .
|
||||
docker build --target oai-gnb --tag oai-gnb:latest --file docker/Dockerfile.gNB.ubuntu20 --build-arg "BUILD_OPTION=--sanitize" .
|
||||
```
|
||||
|
||||
Normally the target image will be around 200 Mbytes bigger.
|
||||
|
||||
Reference in New Issue
Block a user