O-RU: Add Dockerfile and image build step
This commit is contained in:
@@ -325,6 +325,7 @@ class Containerize():
|
|||||||
imageNames.append(('oai-nr-cuup', 'nr-cuup', 'oai-nr-cuup-asan', '--build-arg "BUILD_OPTION=--sanitize"'))
|
imageNames.append(('oai-nr-cuup', 'nr-cuup', 'oai-nr-cuup-asan', '--build-arg "BUILD_OPTION=--sanitize"'))
|
||||||
imageNames.append(('ran-build-fhi72', 'build.fhi72', 'ran-build-fhi72', ''))
|
imageNames.append(('ran-build-fhi72', 'build.fhi72', 'ran-build-fhi72', ''))
|
||||||
imageNames.append(('oai-gnb', 'gNB.fhi72', 'oai-gnb-fhi72', ''))
|
imageNames.append(('oai-gnb', 'gNB.fhi72', 'oai-gnb-fhi72', ''))
|
||||||
|
imageNames.append(('oai-nr-oru', 'nrORU.fhi72', 'oai-nr-oru', ''))
|
||||||
result = re.search('build_cross_arm64', self.imageKind)
|
result = re.search('build_cross_arm64', self.imageKind)
|
||||||
if result is not None:
|
if result is not None:
|
||||||
self.dockerfileprefix = '.ubuntu.cross-arm64'
|
self.dockerfileprefix = '.ubuntu.cross-arm64'
|
||||||
@@ -413,7 +414,7 @@ class Containerize():
|
|||||||
# target images should use the proper ran-build image
|
# target images should use the proper ran-build image
|
||||||
if image != 'ran-build' and "-asan" in name:
|
if image != 'ran-build' and "-asan" in name:
|
||||||
cmd.run(f'sed -i -e "s#ran-build:latest#ran-build-asan:{imageTag}#" docker/Dockerfile.{pattern}{self.dockerfileprefix}')
|
cmd.run(f'sed -i -e "s#ran-build:latest#ran-build-asan:{imageTag}#" docker/Dockerfile.{pattern}{self.dockerfileprefix}')
|
||||||
elif "fhi72" in name:
|
elif "fhi72" in name or name == "oai-nr-oru":
|
||||||
cmd.run(f'sed -i -e "s#ran-build-fhi72:latest#ran-build-fhi72:{imageTag}#" docker/Dockerfile.{pattern}{self.dockerfileprefix}')
|
cmd.run(f'sed -i -e "s#ran-build-fhi72:latest#ran-build-fhi72:{imageTag}#" docker/Dockerfile.{pattern}{self.dockerfileprefix}')
|
||||||
elif image != 'ran-build':
|
elif image != 'ran-build':
|
||||||
cmd.run(f'sed -i -e "s#ran-build:latest#ran-build:{imageTag}#" docker/Dockerfile.{pattern}{self.dockerfileprefix}')
|
cmd.run(f'sed -i -e "s#ran-build:latest#ran-build:{imageTag}#" docker/Dockerfile.{pattern}{self.dockerfileprefix}')
|
||||||
|
|||||||
@@ -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"]
|
||||||
Executable
+65
@@ -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