mirror of
https://gitlab.eurecom.fr/oai/openairinterface5g.git
synced 2026-07-13 04:30:28 +00:00
O-RU: Add Dockerfile and image build step
This commit is contained in:
98
docker/Dockerfile.nrORU.fhi72.ubuntu
Normal file
98
docker/Dockerfile.nrORU.fhi72.ubuntu
Normal file
@@ -0,0 +1,98 @@
|
||||
#/*
|
||||
# * 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
|
||||
# */
|
||||
|
||||
FROM ran-base:latest AS ran-base
|
||||
|
||||
FROM ran-build-fhi72:latest AS ran-build
|
||||
|
||||
#start from scratch for target executable
|
||||
FROM ubuntu:noble AS oai-nr-oru
|
||||
ARG BUILD_OPTION
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
ENV TZ=Europe
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get upgrade --yes && \
|
||||
apt-get install --yes \
|
||||
software-properties-common \
|
||||
procps \
|
||||
pkg-config \
|
||||
libsctp1 \
|
||||
tzdata \
|
||||
libblas3 \
|
||||
libconfig9 \
|
||||
openssl \
|
||||
net-tools \
|
||||
iperf \
|
||||
iproute2 \
|
||||
iputils-ping \
|
||||
gdb \
|
||||
pciutils \
|
||||
libpcap-dev \
|
||||
xz-utils \
|
||||
libnuma-dev \
|
||||
libyaml-cpp-dev && \
|
||||
# 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 \
|
||||
libasan8 \
|
||||
libubsan1 \
|
||||
liblapacke; fi' && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /opt/nr-oru/bin
|
||||
COPY --from=ran-build \
|
||||
/oai-ran/cmake_targets/ran_build/build/nr-oru ./
|
||||
COPY ./docker/scripts/nr_oru_entrypoint.sh ./entrypoint.sh
|
||||
|
||||
COPY --from=ran-build \
|
||||
/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/libparams_yaml.so \
|
||||
/usr/local/lib/
|
||||
|
||||
## Libxran library
|
||||
COPY --from=ran-build \
|
||||
/opt/phy/fhi_lib/lib/build/libxran.so \
|
||||
/opt/phy/fhi_lib/lib/build/
|
||||
|
||||
## Copy all DPDK libraries as liboran_fhlib_5g.so require most of them
|
||||
COPY --from=ran-build /usr/local/lib/x86_64-linux-gnu /usr/local/lib/x86_64-linux-gnu/
|
||||
|
||||
RUN ldconfig && \
|
||||
echo "---- ldd on nr-oru ----" && \
|
||||
ldd /opt/nr-oru/bin/nr-oru && \
|
||||
echo "---- ldd on shared libraries ----" && \
|
||||
ldd /usr/local/lib/liboai_transpro.so \
|
||||
/usr/local/lib/libcoding.so \
|
||||
/usr/local/lib/libparams_libconfig.so \
|
||||
/usr/local/lib/libdfts.so \
|
||||
/usr/local/lib/libldpc*.so \
|
||||
/opt/phy/fhi_lib/lib/build/libxran.so
|
||||
|
||||
WORKDIR /opt/nr-oru
|
||||
|
||||
COPY --from=ran-base /usr/local/bin/yq /usr/local/bin/yq
|
||||
COPY --from=ran-base /tini /tini
|
||||
ENTRYPOINT ["/tini", "-v", "--", "/opt/nr-oru/bin/entrypoint.sh"]
|
||||
CMD ["/opt/nr-oru/bin/nr-oru"]
|
||||
65
docker/scripts/nr_oru_entrypoint.sh
Executable file
65
docker/scripts/nr_oru_entrypoint.sh
Executable file
@@ -0,0 +1,65 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -uo pipefail
|
||||
|
||||
PREFIX=/opt/nr-oru
|
||||
CONFIGFILE=$PREFIX/etc/nr-oru.conf
|
||||
|
||||
echo "=================================="
|
||||
echo "/proc/sys/kernel/core_pattern=$(cat /proc/sys/kernel/core_pattern)"
|
||||
|
||||
if [ ! -f $CONFIGFILE ]; then
|
||||
echo "No configuration file $CONFIGFILE found: attempting to find YAML config"
|
||||
YAML_CONFIGFILE=$PREFIX/etc/nr-oru.yaml
|
||||
if [ ! -f $YAML_CONFIGFILE ]; then
|
||||
echo "No configuration file $YAML_CONFIGFILE found. Please mount either at $CONFIGFILE or $YAML_CONFIGFILE"
|
||||
exit 255
|
||||
fi
|
||||
CONFIGFILE=$YAML_CONFIGFILE
|
||||
fi
|
||||
|
||||
echo "=================================="
|
||||
echo "== Configuration file:"
|
||||
cat $CONFIGFILE
|
||||
|
||||
new_args=()
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
new_args+=("$1")
|
||||
shift
|
||||
done
|
||||
|
||||
new_args+=("-O")
|
||||
new_args+=("$CONFIGFILE")
|
||||
|
||||
# Load the USRP binaries
|
||||
echo "=================================="
|
||||
echo "== Load USRP binaries"
|
||||
if [[ -v USE_B2XX ]]; then
|
||||
$PREFIX/bin/uhd_images_downloader.py -t b2xx
|
||||
elif [[ -v USE_X3XX ]]; then
|
||||
$PREFIX/bin/uhd_images_downloader.py -t x3xx
|
||||
elif [[ -v USE_N3XX ]]; then
|
||||
$PREFIX/bin/uhd_images_downloader.py -t n3xx
|
||||
fi
|
||||
|
||||
# enable printing of stack traces on assert
|
||||
export OAI_GDBSTACKS=1
|
||||
|
||||
echo "=================================="
|
||||
echo "== Starting O-RU "
|
||||
if [[ -v USE_ADDITIONAL_OPTIONS ]]; then
|
||||
echo "Additional option(s): ${USE_ADDITIONAL_OPTIONS}"
|
||||
while [[ $# -gt 0 ]]; do
|
||||
new_args+=("$1")
|
||||
shift
|
||||
done
|
||||
for word in ${USE_ADDITIONAL_OPTIONS}; do
|
||||
new_args+=("$word")
|
||||
done
|
||||
echo "${new_args[@]}"
|
||||
exec "${new_args[@]}"
|
||||
else
|
||||
echo "${new_args[@]}"
|
||||
exec "${new_args[@]}"
|
||||
fi
|
||||
Reference in New Issue
Block a user