1 ################################################################################
2 # Copyright (c) 2019 AT&T Intellectual Property. #
4 # Licensed under the Apache License, Version 2.0 (the "License"); #
5 # you may not use this file except in compliance with the License. #
6 # You may obtain a copy of the License at #
8 # http://www.apache.org/licenses/LICENSE-2.0 #
10 # Unless required by applicable law or agreed to in writing, software #
11 # distributed under the License is distributed on an "AS IS" BASIS, #
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
13 # See the License for the specific language governing permissions and #
14 # limitations under the License. #
15 ################################################################################
16 FROM centos:centos7.7.1908 AS builder
18 ENV https_proxy $https_proxy
19 ENV http_proxy $http_proxy
20 ENV no_proxy $no_proxy
25 ENV BUILD_DIR /opt/o-du/phy
26 ENV XRAN_DIR $BUILD_DIR/fhi_lib
28 ###Install required libs
29 RUN yum install -y libhugetlbfs-utils libhugetlbfs-devel libhugetlbfs numactl-devel ethtool gcc make module-init-tools kmod patch xz iproute pciutils python vim cmake unzip nano mc iputils-ping libaio libaio-devel net-tools wget zip
31 ###Install some libs to compile DPDK
32 RUN yum groupinstall -y "Development Tools"
33 RUN yum install -y ncurses-devel hmaccalc zlib-devel binutils-devel elfutils-libelf-devel bc libstdc++-4.8.5-28.el7_5.1.x86_64 gcc-c++ libstdc++-devel-4.8.5-28.el7_5.1.x86_64 autoconf-2.69-11.el7.noarch
35 ###googletest is required for XRAN unittests build and run
36 RUN wget https://github.com/google/googletest/archive/release-1.7.0.tar.gz && \
37 cd /opt && tar -zxvf $BUILD_DIR/release-1.7.0.tar.gz
38 ENV GTEST_ROOT /opt/googletest-release-1.7.0
39 ENV GTEST_DIR /opt/googletest-release-1.7.0
40 RUN cd $GTEST_DIR && \
41 g++ -isystem ${GTEST_DIR}/include -I${GTEST_DIR} -pthread -c ${GTEST_DIR}/src/gtest-all.cc && \
42 ar -rv libgtest.a gtest-all.o && cd build-aux/ && cmake $GTEST_DIR && make && cd .. && ln -s build-aux/libgtest_main.a libgtest_main.a
44 ###Before install ISS, please go to Intel site to get a free license: https://software.intel.com/en-us/system-studio/choose-download
45 COPY $icc_license_file $BUILD_DIR/license.lic
47 ####Download Intel System Studio from Intel website and install ICC
48 RUN wget https://registrationcenter-download.intel.com/akdlm/IRC_NAS/16789/system_studio_2020_u2_ultimate_edition_offline.tar.gz && \
49 cd /opt && mkdir intel && cp $BUILD_DIR/license.lic intel/license.lic && \
50 tar -zxvf $BUILD_DIR/system_studio_2020_u2_ultimate_edition_offline.tar.gz && \
51 cd system_studio_2020_u2_ultimate_edition_offline/ && \
52 sed -i "s/ACCEPT_EULA.*/ACCEPT_EULA=accept/" silent.cfg && \
53 sed -i "s/PSET_INSTALL_DIR.*/PSET_INSTALL_DIR=\/opt\/intel/" silent.cfg && \
54 sed -i "s/.*ACTIVATION_LICENSE_FILE.*/ACTIVATION_LICENSE_FILE=\/opt\/intel\/license.lic/" silent.cfg && \
55 sed -i "s/ACTIVATION_TYPE.*/ACTIVATION_TYPE=license_file/" silent.cfg && \
56 ./install.sh -s silent.cfg
59 RUN source /opt/intel/system_studio_2020/bin/iccvars.sh intel64
60 ENV PATH /opt/intel/system_studio_2020/bin/:$PATH
62 ####Download and build DPDK
63 ENV RTE_TARGET x86_64-native-linuxapp-icc
64 ENV RTE_SDK /opt/o-du/dpdk-19.11
65 RUN wget http://fast.dpdk.org/rel/dpdk-19.11.tar.xz && \
66 tar -xf dpdk-19.11.tar.xz && \
67 mv dpdk-19.11 $RTE_SDK && \
69 make config T=$RTE_TARGET O=$RTE_TARGET && \
70 cd $RTE_SDK/$RTE_TARGET && \
71 sed -i "s/CONFIG_RTE_EAL_IGB_UIO=y/CONFIG_RTE_EAL_IGB_UIO=n/" .config && \
72 sed -i "s/CONFIG_RTE_KNI_KMOD=y/CONFIG_RTE_KNI_KMOD=n/" .config && \
75 ####Install octave. Issue when downloading octave. And the octave will take 500MB space.
76 RUN yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm -y && \
79 RUN yum install -y expect
81 ###Copy XRAN source code into docker image
82 COPY fhi_lib $BUILD_DIR/fhi_lib
83 COPY misc $BUILD_DIR/misc
85 ENV WIRELESS_SDK_TARGET_ISA avx512
87 ####Download and Build FlexRAN FEC SDK, not needed for run L1
88 #RUN cd $BUILD_DIR/ && wget https://software.intel.com/sites/default/files/managed/23/b8/FlexRAN-FEC-SDK-19-04.tar.gz && tar -zxvf #FlexRAN-FEC-SDK-19-04.tar.gz && misc/extract-flexran-fec-sdk.ex && cd FlexRAN-FEC-SDK-19-04/sdk && source #/opt/intel/system_studio_2019/bin/iccvars.sh intel64 && ./create-makefiles-linux.sh && cd build-avx512-icc && #make && make install
90 ####Build XRAN lib, unittests, sample app
91 RUN cd $BUILD_DIR/fhi_lib/ && export XRAN_LIB_SO=1 && ./build.sh xclean && ./build.sh && cd app && octave gen_test.m
94 COPY wls_lib $BUILD_DIR/wls_lib
95 RUN cd $BUILD_DIR/wls_lib && ./build.sh xclean && ./build.sh
96 ENV DIR_WIRELESS_WLS $BUILD_DIR/wls_lib
98 ####Clone FlexRAN repo from Github
99 RUN cd /opt/o-du && git clone https://github.com/intel/FlexRAN.git
100 ENV DIR_WIRELESS=/opt/o-du/FlexRAN/l1/
103 COPY fapi_5g $BUILD_DIR/fapi_5g
104 ENV DIR_WIRELESS_ORAN_5G_FAPI $BUILD_DIR/fapi_5g
106 RUN cd $BUILD_DIR/fapi_5g/build && ./build.sh xclean && ./build.sh
108 ####Copy other folders/files
109 COPY setupenv.sh $BUILD_DIR
111 ####Unset network proxy
112 RUN unset http_proxy https_prox ftp_proxy no_proxy
114 ####Copy built binaries/libraries into docker images
115 FROM centos:centos7.7.1908
116 ENV TARGET_DIR /opt/o-du/
117 COPY --from=builder $TARGET_DIR/phy $TARGET_DIR/phy
118 COPY --from=builder $TARGET_DIR/FlexRAN $TARGET_DIR/FlexRAN
120 ###Install required libs
121 RUN yum install -y libhugetlbfs-utils libhugetlbfs-devel libhugetlbfs numactl-devel ethtool gcc make module-init-tools kmod patch xz iproute pciutils python vim cmake unzip nano mc iputils-ping libaio libaio-devel net-tools wget zip
123 ###Install some libs to compile DPDK
124 RUN yum groupinstall -y "Development Tools"
125 RUN yum install -y ncurses-devel hmaccalc zlib-devel binutils-devel elfutils-libelf-devel bc libstdc++-4.8.5-28.el7_5.1.x86_64 gcc-c++ libstdc++-devel-4.8.5-28.el7_5.1.x86_64 autoconf-2.69-11.el7.noarch
127 ###googletest is required for XRAN unittests build and run
128 RUN wget https://github.com/google/googletest/archive/release-1.7.0.tar.gz && \
129 cd /opt && tar -zxvf $BUILD_DIR/release-1.7.0.tar.gz
130 ENV GTEST_ROOT /opt/googletest-release-1.7.0
131 ENV GTEST_DIR /opt/googletest-release-1.7.0
132 RUN cd $GTEST_DIR && \
133 g++ -isystem ${GTEST_DIR}/include -I${GTEST_DIR} -pthread -c ${GTEST_DIR}/src/gtest-all.cc && \
134 ar -rv libgtest.a gtest-all.o && cd build-aux/ && cmake $GTEST_DIR && make && cd .. && ln -s build-aux/libgtest_main.a libgtest_main.a
136 RUN yum install -y expect
140 LABEL description="ORAN O-DU PHY Applications"