Commit 758a6924 authored by Javier Morgade's avatar Javier Morgade

CENTOS 7.6.1810 images consolidated for LTE targets

	-TOCHECK: Image size are rather high (at lest compared to the ones generated from other develop branch)
	-cmake3, boost 1.58 and uhd v15.0.0 libraries compiled from source (check new scripts folder)
	-container tested from both ubuntu 16.04 and 18.04 (with both RFSIM and USRP setups)
parent 74e47587
......@@ -13,51 +13,99 @@
# See the License for the specific language governing permissions and
# limitations under the License.
##FROM ubuntu:16.04 AS oai-base
##RUN apt-get update && apt-get install -y \
## sudo \
## vim-common \
## git \
## build-essential \
## cmake \
## && rm -rf /var/lib/apt/lists/*
#
FROM centos:7.6.1810 AS oai-base
ARG EURECOM_PROXY
RUN yum update -y && yum install -y \
vim-common \
git \
make \
cmake3 \
autoconf \
automake \
bc \
bison \
flex \
libtool \
patch \
devtoolset-7 \
sudo \
openssl \
gcc-c++
RUN yum update -y \
&& yum install centos-release-scl -y \
&& yum-config-manager --enable rhel-server-rhscl-7-rpms -y \
&& yum install -y \
wget \
vim-common \
git \
make \
autoconf \
automake \
bc \
bison \
flex \
libtool \
patch \
#sudo \
openssl \
gcc-c++ \
devtoolset-7 \
atlas-devel \
blas \
blas-devel \
bzip2-devel \
check \
check-devel \
elfutils-libelf-devel \
gflags-devel \
glog-devel \
gmp-devel \
gnutls-devel \
guile-devel \
kernel-devel \
kernel-headers \
lapack \
lapack-devel \
libasan \
libconfig-devel \
libevent-devel \
libffi-devel \
libgcrypt-devel \
libidn-devel \
libidn2-devel \
libtool \
libusb-devel \
libusbx-devel \
libxml2-devel \
libXpm-devel \
libxslt-devel \
libyaml-devel \
lksctp-tools \
lksctp-tools-devel \
lz4-devel \
mariadb-devel \
nettle-devel \
openssh-clients \
openssh-server \
openssl \
openssl-devel \
pkgconfig \
psmisc \
python3-pip.noarch \
python-devel \
python-mako \
unzip \
vim-common \
xforms-devel \
xz-devel \
zlib-devel \
scl-utils \
bzip2 \
#boost-devel \
&& yum clean all -y \
&& rm -rf /var/cache/yum \
&& pip3 install --user mako pexpect \
&& pip3 install six \
&& pip3 install requests
#ENV GIT_SSL_NO_VERIFY=true
ENV USER=root
COPY scripts scripts/
RUN scl enable devtoolset-7 scripts/build_missing_packages
RUN rm -rf /tmp/*
# In Eurecom env we need a git proxy
RUN /bin/bash -c "if [[ -v EURECOM_PROXY ]]; then git config --global http.proxy http://proxy.eurecom.fr:8080; fi"
RUN GIT_SSL_NO_VERIFY=true git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git /openairinterface5g -b develop
RUN git clone https://gitlab.eurecom.fr/oai/openairinterface5g/ /openairinterface5g -b develop
WORKDIR /openairinterface5g
COPY nasmesh.patch nasmesh.patch
RUN git apply nasmesh.patch
RUN /bin/bash -c "source oaienv" && cd cmake_targets && ./build_oai -I
COPY scripts scripts/
RUN scl enable devtoolset-7 scripts/build_missing_packages
#RUN /bin/bash -c "source oaienv" && cd cmake_targets && ./build_oai -I
ARG org_label_schema_version=unknown
ARG org_label_schema_vcs_url=unknown
......
......@@ -18,43 +18,68 @@ ARG build_base
FROM $build_base AS enb-builder
WORKDIR /openairinterface5g
ENV USER=root
RUN /bin/bash -c "source oaienv" && cd cmake_targets && ./build_oai --eNB -w USRP --verbose-compile
RUN ln -sf /usr/local/bin/cmake /usr/local/bin/cmake3
#FROM ubuntu:16.04 AS lte-softmodem
FROM centos:7.6.1810 AS lte-softmodem
RUN yum install nettle.x86_64 -y
RUN yum install lksctp-tools.x86_64 -y
RUN yum install libyaml.x86_64 -y
RUN yum install linux-headers-4.15.0-74-generic -y
RUN yum install iperf3.x86_64 -y
RUN yum install blas.x86_64 -y
RUN yum install atlas.x86_64 -y
RUN yum install atlas-devel.x86_64 -y
RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm \
&& REPOLIST="rhel-7-server-optional-rpms" \
&& PKGLIST="boost libconfig lksctp-tools protobuf-c iproute iputils procps-ng bind-utils xforms nettle libyaml libusb" \
# && yum -y upgrade-minimal --setopt=tsflags=nodocs --security --sec-severity=Critical --sec-severity=Important && \
&& yum -y install --enablerepo ${REPOLIST} --setopt=tsflag=nodocs ${PKGLIST} \
&& yum -y clean all \
&& rm -rf /var/cache/yum
RUN cd /openairinterface5g/cmake_targets \
&& ln -sf /usr/local/bin/asn1c_oai /usr/local/bin/asn1c \
&& ln -sf /usr/local/share/asn1c_oai /usr/local/share/asn1c \
&& ./build_oai -c --eNB -w USRP --verbose-compile
#RUN apt-get update && apt-get install -y \
#libssl1.0.0 \
#libnettle6 \
#libsctp1 \
#libforms2 \
#libprotobuf-c1 \
#libyaml-0-2 \
#libconfig9 \
#dnsutils \
#iproute2 \
#iputils-ping \
#&& rm -rf /var/lib/apt/lists/*
FROM centos:7.6.1810 AS lte-softmodem
RUN yum update -y && yum install -y nettle.x86_64 \
lksctp-tools.x86_64 \
libyaml.x86_64 \
iperf3.x86_64 \
blas.x86_64 \
atlas.x86_64 \
atlas-devel.x86_64 \
libconfig-devel.x86_64 \
iptables.x86_64 \
lapack-devel.x86_64 \
&& yum clean all -y \
&& rm -rf /var/cache/yum
WORKDIR /openairinterface5g/ci-scripts
COPY --from=enb-builder /openairinterface5g/ci-scripts/ .
WORKDIR /openairinterface5g/cmake_targets
COPY --from=enb-builder /openairinterface5g/cmake_targets/ .
COPY --from=enb-builder /usr/local/bin/uhd_* /usr/local/bin/
COPY --from=enb-builder /usr/local/share/uhd/ /usr/local/share/uhd/
COPY --from=enb-builder /usr/local/lib64/libuhd* /usr/local/lib64/
COPY --from=enb-builder /usr/lib64/libboost_* /usr/lib64/
COPY --from=enb-builder /usr/lib64/libusb* /usr/lib64/
COPY --from=enb-builder /usr/lib/libboost_* /usr/lib/
COPY --from=enb-builder /usr/local/lib/libproto* /usr/local/lib/
RUN find . -name "*.h" -type f -delete
RUN find . -name "*.c" -type f -delete
RUN find / -name "*.a" -type f -delete
RUN find / -name "*.tar.gz" -type f -delete
RUN rm -rf ./ran_build/build/CMakeFiles/
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib64/:/usr/local/lib:/usr/lib
# S1U, GTP/UDP
EXPOSE 2152/udp
# ?
EXPOSE 22100/tcp
# S1C, SCTP/UDP
EXPOSE 36412/udp
# X2C, SCTP/UDP
EXPOSE 36422/udp
# M2C, SCTP/UDP
EXPOSE 36443/udp
# M3C, SCTP/UDP
EXPOSE 36444/udp
# IF5 / ORI (control)
EXPOSE 50000/udp
# IF5 / ECPRI (data)
EXPOSE 50001/udp
# Label image
ARG org_label_schema_version=unknown
ARG org_label_schema_vcs_url=unknown
......
......@@ -16,37 +16,49 @@
ARG build_base
FROM $build_base AS ue-builder
#RUN apt-get update && apt-get install -y \
#linux-headers-`uname -r` \
#&& rm -rf /var/lib/apt/lists/*
WORKDIR /openairinterface5g
ENV USER=root
RUN /bin/bash -c "source oaienv" && cd cmake_targets && ./build_oai --UE -w USRP
RUN ln -sf /usr/local/bin/cmake /usr/local/bin/cmake3
RUN cd /openairinterface5g/cmake_targets \
&& ln -sf /usr/local/bin/asn1c_oai /usr/local/bin/asn1c \
&& ln -sf /usr/local/share/asn1c_oai /usr/local/share/asn1c \
&& ./build_oai -c --UE -w USRP --verbose-compile
#FROM ubuntu:16.04 AS lte-uesoftmodem
FROM centos:7.6.1810 AS lte-uesoftmodem
#yum install linux-headers-4.15.0-74-generic -y
##RUN apt-get update && apt-get install -y \
## libssl1.0.0 \
## libnettle6 \
## libsctp1 \
## libforms2 \
## libconfig9 \
## libblas3 \
## liblapacke \
## sudo \
## dnsutils \
## iproute2 \
## iputils-ping \
## net-tools \
## && rm -rf /var/lib/apt/lists/*
RUN yum update -y && yum install -y nettle.x86_64 \
lksctp-tools.x86_64 \
libyaml.x86_64 \
iperf3.x86_64 \
blas.x86_64 \
atlas.x86_64 \
atlas-devel.x86_64 \
libconfig-devel.x86_64 \
iptables.x86_64 \
lapack-devel.x86_64 \
&& yum clean all -y \
&& rm -rf /var/cache/yum
WORKDIR /openairinterface5g/ci-scripts
COPY --from=ue-builder /openairinterface5g/ci-scripts/ .
WORKDIR /openairinterface5g/cmake_targets
COPY --from=ue-builder /openairinterface5g/cmake_targets .
COPY --from=ue-builder /openairinterface5g/targets/bin/nvram .
COPY --from=ue-builder /openairinterface5g/targets/bin/usim .
COPY --from=ue-builder /openairinterface5g/targets ../targets
COPY --from=ue-builder /openairinterface5g/cmake_targets/ .
COPY --from=ue-builder /usr/local/bin/uhd_* /usr/local/bin/
COPY --from=ue-builder /usr/local/share/uhd/ /usr/local/share/uhd/
COPY --from=ue-builder /usr/local/lib64/libuhd* /usr/local/lib64/
COPY --from=ue-builder /usr/lib64/libboost_* /usr/lib64/
COPY --from=ue-builder /usr/lib64/libusb* /usr/lib64/
COPY --from=ue-builder /usr/lib/libboost_* /usr/lib/
COPY --from=ue-builder /usr/local/lib/libproto* /usr/local/lib/
RUN find . -name "*.h" -type f -delete
RUN find . -name "*.c" -type f -delete
RUN find / -name "*.a" -type f -delete
RUN find / -name "*.tar.gz" -type f -delete
RUN rm -rf ./ran_build/build/CMakeFiles/
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib64/:/usr/local/lib:/usr/lib
# Label image
ARG org_label_schema_version=unknown
......
......@@ -52,7 +52,7 @@ docker-build-centos.7.6.1810:
.
docker build $(DOCKER_BUILD_ARGS) \
--target ${ENB_NAME} \
--tag ${ENB_IMAGENAME} \
--tag ${ENB_IMAGENAME}_centos.7.6.1810 \
--file Dockerfile.enb.centos.7.6.1810 \
--build-arg build_base=${BASE_IMAGENAME}_centos.7.6.1810 \
--build-arg org_label_schema_version="${VERSION}" \
......@@ -63,7 +63,7 @@ docker-build-centos.7.6.1810:
.
docker build $(DOCKER_BUILD_ARGS) \
--target ${UE_NAME} \
--tag ${UE_IMAGENAME} \
--tag ${UE_IMAGENAME}_centos.7.6.1810 \
--file Dockerfile.ue.centos.7.6.1810 \
--build-arg build_base=${BASE_IMAGENAME}_centos.7.6.1810 \
--build-arg org_label_schema_version="${VERSION}" \
......
diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai
index 6f4d560..68c75e7 100755
index ef01e85..aad97fb 100755
--- a/cmake_targets/build_oai
+++ b/cmake_targets/build_oai
@@ -633,13 +633,13 @@ function main() {
@@ -641,13 +641,13 @@ function main() {
$build_dir coding \
libcoding.so $dbin/libcoding.so
......@@ -10,15 +10,28 @@ index 6f4d560..68c75e7 100755
- $build_dir nasmesh \
- CMakeFiles/nasmesh/nasmesh.ko $dbin/nasmesh.ko
+ #compilations \
+ # $build_dir nasmesh \
+ # CMakeFiles/nasmesh/nasmesh.ko $dbin/nasmesh.ko
+ #$build_dir nasmesh \
+ #CMakeFiles/nasmesh/nasmesh.ko $dbin/nasmesh.ko
- compilations \
- $build_dir rb_tool \
- rb_tool $dbin/rb_tool
+ #compilations \
+ # $build_dir rb_tool \
+ # rb_tool $dbin/rb_tool
+ #$build_dir rb_tool \
+ #rb_tool $dbin/rb_tool
cp $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 $dbin
fi
@@ -656,9 +656,9 @@ function main() {
if [ "$UE" = 1 ] ; then
echo_info "Compiling UE specific part"
- compilations \
- $build_dir ue_ip \
- CMakeFiles/ue_ip/ue_ip.ko $dbin/ue_ip.ko
+ #compilations \
+ #$build_dir ue_ip \
+ #CMakeFiles/ue_ip/ue_ip.ko $dbin/ue_ip.ko
# mkdir -p $DIR/at_commands/build
# cd $DIR/at_commands/build
#!/bin/bash
set -x
set -euo pipefail
SCRIPT_DIR=$(dirname $(readlink -f $0))
source /etc/os-release
PLATFORM=${ID#rh*}${VERSION_ID%.*}
function build_install_boost {
rm -rf /tmp/boost
mkdir -p /tmp/boost
cd /tmp/boost
wget http://downloads.sourceforge.net/boost/boost_1_58_0.tar.bz2
bzip2 -d boost_1_58_0.tar.bz2
tar -xvf boost_1_58_0.tar
cd boost_1_58_0
sed -e '1 i#ifndef Q_MOC_RUN' \
-e '$ a#endif' \
-i boost/type_traits/detail/has_binary_operator.hpp &&
./bootstrap.sh --prefix=/usr &&
./b2 stage threading=multi link=shared
./b2 install threading=multi link=shared
}
function build_install_cmake3 {
rm -rf /tmp/cmake3
mkdir -p /tmp/cmake3
cd /tmp/cmake3
wget https://cmake.org/files/v3.13/cmake-3.13.4.tar.gz
tar zxvf cmake-3.13.4.tar.gz
cd cmake-3.13.4
./bootstrap --prefix=/usr/local
make -j$(nproc)
make install
}
function build_install_asn1c_oai {
rm -rf /tmp/asn1c_oai
git clone https://gitlab.eurecom.fr/oai/asn1c.git /tmp/asn1c_oai
cd /tmp/asn1c_oai
git checkout 0a7524184f16e7093990a31d8d4db487a16e5782
autoreconf -iv
./configure --program-suffix=_oai
make -j`nproc`
make install
mv /usr/local/share/asn1c /usr/local/share/asn1c_oai
}
function build_install_asn1c_cn {
rm -rf /tmp/asn1c_cn
git clone https://gitlab.eurecom.fr/oai/asn1c.git /tmp/asn1c_cn
cd /tmp/asn1c_cn
./configure --program-suffix=_cn
make -j`nproc`
make install
mv /usr/local/share/asn1c /usr/local/share/asn1c_cn
}
function build_install_uhd {
rm -rf /tmp/uhd
git clone https://github.com/EttusResearch/uhd.git /tmp/uhd
cd /tmp/uhd
#git checkout tags/v3.14.1.1
git checkout tags/$1
mkdir -p host/build
cd host/build
cmake ../
make -j`nproc`
make test
make install
ldconfig
}
function build_install_freediameter {
rm -rf /tmp/freediameter
GIT_SSL_NO_VERIFY=true git clone --branch=eurecom-1.2.0 https://gitlab.eurecom.fr/oai/freediameter.git /tmp/freediameter
cd /tmp/freediameter
patch -p1 < ${SCRIPT_DIR}/../patches/freediameter_eurecom-1.2.0_0001-S6a-dictionary-add-CLR-Flags.patch
patch -p1 < ${SCRIPT_DIR}/../patches/freediameter_compatibility-1.2.0_patch_0001-S6a-dictionary-avp493.patch
patch -p1 < ${SCRIPT_DIR}/../patches/freediameter-1.x_api-fix.patch
mkdir -p build
cd build
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr/local ../
make -j`nproc`
make install
}
function build_install_liblfds {
rm -rf /tmp/liblfds*
git clone https://github.com/liblfds/liblfds.git /tmp/liblfds
cd /tmp/liblfds/liblfds/liblfds7.1.0/liblfds710/build/gcc_gnumake
make so_dbg
make so_install
}
function build_install_double-conversion {
rm -rf /tmp/double-conversion
git clone --depth=1 --branch=v3.1.5 https://github.com/google/double-conversion.git /tmp/double-conversion
cd /tmp/double-conversion
cmake .
make -j`nproc`
make install
}
function build_install_folly {
rm -rf /tmp/folly
git clone --depth=1 --branch=v2019.06.17.00 https://github.com/facebook/folly.git /tmp/folly
git clone --depth=1 --branch=release-1.8.0 https://github.com/google/googletest.git /tmp/folly/folly/test/gtest
cd /tmp/folly
patch -p1 < ${SCRIPT_DIR}/../patches/folly-gflagslib-fix.patch
mkdir -p _build
cd _build
cmake ..
make -j`nproc`
make install
}
function build_install_libuv {
rm -rf /tmp/libuv
git clone --depth=1 --branch=v1.23.1 https://github.com/libuv/libuv.git /tmp/libuv
cd /tmp/libuv
mkdir -p build
cd build
cmake ..
make -j`nproc`
make install
}
function build_install_protobuf {
rm -rf /tmp/protobuf
git clone --depth=1 --branch=v3.3.0 https://github.com/protocolbuffers/protobuf.git /tmp/protobuf
cd /tmp/protobuf
git submodule update --init --recursive
./autogen.sh
./configure
make -j`nproc`
make install
}
function build_install_protobuf_c {
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
rm -rf /tmp/protobuf-c
git clone --depth=1 --branch=v1.3.0 https://github.com/protobuf-c/protobuf-c.git /tmp/protobuf-c
cd /tmp/protobuf-c
./autogen.sh
./configure
make -j`nproc`
make install
}
build_install_cmake3
case "${PLATFORM}" in
el8)
(cd /usr/bin && ln -sf python2 python)
;;
el7)
(cd /usr/bin && ln -sf cmake3 cmake)
build_install_protobuf
build_install_protobuf_c
;;
centos7)
(cd /usr/bin && ln -sf cmake3 cmake)
build_install_boost
build_install_protobuf
build_install_protobuf_c
build_install_uhd v3.15.0.0
sed -i 's/python2/python3/g' /usr/local/bin/uhd_images_downloader
uhd_images_downloader
;;
centos8)
(cd /usr/bin && ln -sf cmake3 cmake)
build_install_uhd v3.15.0.0
sed -i 's/python2/python3/g' /usr/local/bin/uhd_images_downloader
uhd_images_downloader
build_install_protobuf
build_install_protobuf_c
;;
fedora31)
(cd /usr/bin && ln -sf cmake3 cmake)
build_install_uhd v3.15.0.0
sed -i 's/python2/python3/g' /usr/local/bin/uhd_images_downloader
uhd_images_downloader
build_install_protobuf
build_install_protobuf_c
;;
esac
build_install_asn1c_oai
build_install_asn1c_cn
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