Commit 65036309 authored by sagar arora's avatar sagar arora

Adding 7.2 containerfiles and docker-compose

Signed-off-by: sagar arora's avatararora <sagar.arora@eurecom.fr>
parent 297ef9d1
<table style="border-collapse: collapse; border: none;">
<tr style="border-collapse: collapse; border: none;">
<td style="border-collapse: collapse; border: none;">
<a href="http://www.openairinterface.org/">
<img src="../../../doc/images/oai_final_logo.png" alt="" border=3 height=50 width=150>
</img>
</a>
</td>
<td style="border-collapse: collapse; border: none; vertical-align: center;">
<b><font size = "5">OAI O-RAN 7.2 Front-haul Docker Compose</font></b>
</td>
</tr>
</table>
![Docker deploy 7.2](docker-deploy-oai-7-2.png)
This docker-compose is designed to use `OAI-gNB` with a 7.2 compatible Radio Unit. Before using this docker compose you have to configure the host machine as per the [ORAN_FHI7.2_Tutorial](../../../doc/ORAN_FHI7.2_Tutorial.md). The container image used by the docker compose file is tested only on `Ubuntu 22.04` docker host. The image is present in our official docker hub account `docker.io/oaisoftwarealliance/oai-gnb-7.2:develop`.
## Build Image (Optional)
If you wish to make your own image after modification or from a specific branch then you can build it manually,
```bash
cd ../../../
docker build -f docker/Dockerfile.base.ubuntu22 -t ran:base:latest .
docker build -f docker/Dockerfile.fhi72.build.ubuntu22 -t ran:build:latest .
docker build -f docker/Dockerfile.fhi72.gNB.ubuntu22 -t oai-gnb-7.2:<your-image-tag> .
```
The new image will be `oai-gnb-7.2:<your-image-tag>`. You will have to replace this new image with `docker.io/oaisoftwarealliance/oai-gnb-7.2:develop`.
## Configure Networking
### SR-IOV Virtual Functions (VFs)
In docker-compose environment there is no automated method to configure the VFs on the fly. The user will have to manually configure C/U plane VFs before starting the container `OAI-gNB`. You can follow the step [configure-network-interfaces-and-dpdk-vfs](../../../doc/ORAN_FHI7.2_Tutorial.md#configure-network-interfaces-and-dpdk-vfs).
### Interface towards AMF (N2)
For N2 interface we are using `macvlan` driver of docker.
You can use the `bridge` driver, in situation
- When the core network is running on the same machine
- or different machine but you have configured needed `ip route` and forwarding to access the core network from RAN host.
To configure docker `macvlan` network you need to choose `ipam.config` and `driver_opts.parent` are per your environment
```
oai-net:
driver: macvlan
name: oai-net
ipam:
config:
- subnet: "172.21.16.0/22"
ip_range: "172.21.18.20/32"
gateway: "172.21.19.254"
driver_opts:
com.docker.network.bridge.name: "oai-net"
parent: enp193s0f0
```
To configure `bridge` network you need to choose `ipam.config.subnet` as per your environment.
```
oai-net:
driver: bridge
name: oai-net
ipam:
config:
- subnet: 192.168.72.128/26
driver_opts:
com.docker.network.bridge.name: "oai-net"
```
## Deploy OAI-gNB Container
The [configuration file](../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.273prb.fhi72.4x4-vvdn.conf) used in by this docker compose is configured for VVDN GEN 3 RU (firmware version 03-v3.0.5).
```bash
docker-compose up -d
```
services:
oai-gnb:
image: docker.io/oaisoftwarealliance/oai-gnb-7.2:develop
privileged: true
container_name: oai-gnb
environment:
TZ: Europe/Paris
USE_ADDITIONAL_OPTIONS: --sa --thread-pool 13,14,15,16,17,18
devices:
- /dev/vfio:/dev/vfio/
volumes:
- ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.273prb.fhi72.4x4-vvdn.conf:/tmp/gnb.conf
- /dev/hugepages:/dev/hugepages
cpuset: "0,1,2,8,9,10,13,14,15,16,17,18"
networks:
oai-net:
ipv4_address: 172.21.18.20
healthcheck:
test: /bin/bash -c "pgrep nr-softmodem"
interval: 10s
timeout: 5s
retries: 5
networks:
oai-net:
driver: macvlan
name: oai-net
ipam:
config:
- subnet: "172.21.16.0/22"
ip_range: "172.21.18.20/32"
gateway: "172.21.19.254"
driver_opts:
com.docker.network.bridge.name: "oai-net"
parent: enp193s0f0
This diff is collapsed.
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
#---------------------------------------------------------------------
#
# Dockerfile for the Open-Air-Interface BUILD service
# Valid for Ubuntu 22.04
#
#---------------------------------------------------------------------
FROM ubuntu:jammy AS ran-base
ARG NEEDED_GIT_PROXY
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Paris
ENV BUILD_UHD_FROM_SOURCE=True
ENV UHD_VERSION=4.4.0.0
#install developers pkg/repo
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && \
DEBIAN_FRONTEND=noninteractive apt-get install --yes \
#gcc needed for build_oai
build-essential \
psmisc \
git \
gcc-12 \
g++-12 \
xxd \
# python3-pip for conf template generation
python3-pip && \
pip3 install --ignore-installed pyyaml && \
## setting to gcc 12 and g++ 12 as default
ln -s -f /usr/bin/gcc-12 /usr/bin/gcc && \
ln -s -f /usr/bin/g++-12 /usr/bin/g++
# Add "Tini - A tiny but valid init for containers", https://github.com/krallin/tini
# it will be copied into target containers, to print exit numbers and handle signals properly
ENV TINI_VERSION v0.19.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini
# In some network environments, GIT proxy is required
RUN /bin/bash -c "if [[ -v NEEDED_GIT_PROXY ]]; then git config --global http.proxy $NEEDED_GIT_PROXY; fi"
# Copying only the needed files to create ran-base
WORKDIR /oai-ran/cmake_targets/tools
COPY cmake_targets/tools/build_helper \
cmake_targets/tools/uhd-4.x-tdd-patch.diff \
./
WORKDIR /oai-ran/cmake_targets
COPY cmake_targets/build_oai .
WORKDIR /oai-ran
COPY oaienv .
#run build_oai -I to get the builder image
RUN /bin/sh oaienv && \
cd cmake_targets && \
mkdir -p log && \
./build_oai -I -w USRP --install-optional-packages
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
#---------------------------------------------------------------------
#
# Dockerfile for the Open-Air-Interface RAN Build for FHI 7.2
# Valid for UBUNTU 22.04
#
#---------------------------------------------------------------------
FROM ran-base:latest as ran-base
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && \
DEBIAN_FRONTEND=noninteractive apt-get install --yes \
meson \
wget \
xz-utils \
pkg-config \
libnuma-dev && \
rm -rf /var/lib/apt/lists/*
RUN rm -Rf /oai-ran
WORKDIR /oai-ran
COPY . .
## Download and build DPDK
RUN wget http://fast.dpdk.org/rel/dpdk-20.11.9.tar.xz && \
tar -xvf dpdk-20.11.9.tar.xz && \
cd dpdk-stable-20.11.9 && \
meson build && \
ninja -C build && \
ninja install -C build
## Build Fronthaul library
RUN git clone https://gerrit.o-ran-sc.org/r/o-du/phy.git /opt/phy && \
cd /opt/phy && \
git checkout oran_e_maintenance_release_v1.0 &&\
git apply /oai-ran/cmake_targets/tools/oran_fhi_integration_patches/E/oaioran_E.patch && \
cd /opt/phy/fhi_lib/lib && \
RTE_SDK=/oai-ran/dpdk-stable-20.11.9/ XRAN_DIR=/opt/phy/fhi_lib make XRAN_LIB_SO=1
## Build and install OAI
#run build_oai to build the target image
RUN /bin/sh oaienv && \
cd cmake_targets && \
mkdir -p log && \
./build_oai \
--gNB \
--build-lib "telnetsrv enbscope uescope nrscope nrqtscope" \
-t oran_fhlib_5g --cmake-opt -Dxran_LOCATION=/opt/phy/fhi_lib/lib -P \
--build-e2 --cmake-opt -DXAPP_MULTILANGUAGE=OFF \
$BUILD_OPTION && \
# Mainly to see if the sanitize option was perfectly executed
ldd ran_build/build/nr-softmodem && \
ldd ran_build/build/liboran_fhlib_5g.so && \
ldd /opt/phy/fhi_lib/lib/build/libxran.so
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
#---------------------------------------------------------------------
#
# Dockerfile for the Open-Air-Interface BUILD service
# Valid for Ubuntu22.04
#
#---------------------------------------------------------------------
FROM ran-base:latest as gnb-base
FROM ran-build:latest AS gnb-build
#start from scratch for target executable
FROM ubuntu:jammy as oai-gnb
ARG BUILD_OPTION
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && \
DEBIAN_FRONTEND=noninteractive apt-get install --yes \
software-properties-common \
procps \
pkg-config \
libsctp1 \
tzdata \
libblas3 \
libatlas3-base \
libconfig9 \
openssl \
net-tools \
iperf \
iproute2 \
iputils-ping \
gdb \
pciutils \
libpcap-dev \
xz-utils \
libnuma-dev \
python3 \
python3-six \
python3-requests &&\
# 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 \
libubsan1 \
liblapacke; fi' && \
rm -rf /var/lib/apt/lists/*
WORKDIR /opt/oai-gnb/bin
COPY --from=gnb-build \
/oai-ran/cmake_targets/ran_build/build/nr-softmodem ./
COPY ./docker/scripts/gnb_entrypoint.sh ./entrypoint.sh
COPY --from=gnb-build \
/oai-ran/cmake_targets/ran_build/build/librfsimulator.so \
/oai-ran/cmake_targets/ran_build/build/liboai_transpro.so \
/oai-ran/cmake_targets/ran_build/build/libcoding.so \
/oai-ran/cmake_targets/ran_build/build/libparams_libconfig.so \
/oai-ran/cmake_targets/ran_build/build/libdfts.so \
/oai-ran/cmake_targets/ran_build/build/libldpc*.so \
/oai-ran/cmake_targets/ran_build/build/libtelnetsrv.so \
/oai-ran/cmake_targets/ran_build/build/libtelnetsrv_ci.so \
/usr/local/lib/
## Libxran library
COPY --from=gnb-build \
/opt/phy/fhi_lib/lib/build/libxran.so \
/opt/phy/fhi_lib/lib/build/
## DPDK libraries
COPY --from=gnb-build /usr/local/lib/x86_64-linux-gnu /usr/local/lib/x86_64-linux-gnu/
# Copying liboost files
COPY --from=gnb-base \
/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/libboost_program_options.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" && \
ldconfig && \
ldd /opt/oai-gnb/bin/nr-softmodem
WORKDIR /opt/oai-gnb
COPY --from=gnb-base /tini /tini
ENTRYPOINT ["/tini", "-v", "--", "/opt/oai-gnb/bin/entrypoint.sh"]
CMD ["/opt/oai-gnb/bin/nr-softmodem", "-O", "/opt/oai-gnb/etc/gnb.conf"]
......@@ -177,8 +177,8 @@ gNBs =
NETWORK_INTERFACES :
{
GNB_IPV4_ADDRESS_FOR_NG_AMF = "172.21.16.108/22";
GNB_IPV4_ADDRESS_FOR_NGU = "172.21.16.108/22";
GNB_IPV4_ADDRESS_FOR_NG_AMF = "172.21.18.20/22";
GNB_IPV4_ADDRESS_FOR_NGU = "172.21.18.20/22";
GNB_PORT_FOR_S1U = 2152; # Spec 2152
};
}
......@@ -226,7 +226,7 @@ RUs = (
max_rxgain = 75;
sf_extension = 0;
eNB_instances = [0];
ru_thread_core = 6;
ru_thread_core = 9;
sl_ahead = 5;
##beamforming 1x2 matrix: 1 layer x 2 antennas
bf_weights = [0x00007fff, 0x0000,0x00007fff, 0x0000];
......@@ -277,7 +277,7 @@ log_config : {
fhi_72 = {
dpdk_devices = ("0000:31:06.0", "0000:31:06.1");
system_core = 0;
io_core = 4;
io_core = 1;
worker_cores = (2);
du_addr = ("76:76:64:6e:00:01", "76:76:64:6e:00:01");
ru_addr = ("98:ae:71:01:c5:eb", "98:ae:71:01:c5:eb");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment