Commit 231e3e7b authored by Raphael Defosseux's avatar Raphael Defosseux

Merge branch 'build_time_optimise' into 'develop'

Dockerfile updated for base image preperation

See merge request oai/cn5g/oai-cn5g-upf-vpp!10
parents 377a0362 2d038da6
......@@ -151,7 +151,9 @@ vpp_upf_init(){
$SUDO cp -rf $OPENAIRCN_DIR/vpp/build-root/install-vpp-native/vpp/bin/vppctl /bin/
echo_info "Copied binaries to /bin"
# Copying necessary libraries
$SUDO cp -rf $OPENAIRCN_DIR/vpp/build-root/install-vpp-native/vpp/lib/vpp_plugins /usr/lib/x86_64-linux-gnu/vpp_plugins/
# $SUDO cp -rf $OPENAIRCN_DIR/vpp/build-root/install-vpp-native/vpp/lib/vpp_plugins /usr/lib/x86_64-linux-gnu/vpp_plugins/
$SUDO cp -rf $OPENAIRCN_DIR/vpp/build-root/install-vpp-native/vpp/lib/vpp_plugins/upf_plugin.so /usr/lib/x86_64-linux-gnu/vpp_plugins/
$SUDO cp -rf $OPENAIRCN_DIR/vpp/build-root/install-vpp-native/vpp/lib/vpp_plugins/dpdk_plugin.so /usr/lib/x86_64-linux-gnu/vpp_plugins/
$SUDO cp -rf $OPENAIRCN_DIR/vpp/build-root/install-vpp-native/vpp/lib/libvppinfra.so.21.01.1 /usr/lib/x86_64-linux-gnu/
$SUDO cp -rf $OPENAIRCN_DIR/vpp/build-root/install-vpp-native/vpp/lib/libvnet.so.21.01.1 /usr/lib/x86_64-linux-gnu/
$SUDO cp -rf $OPENAIRCN_DIR/vpp/build-root/install-vpp-native/vpp/lib/libvlibmemory.so.21.01.1 /usr/lib/x86_64-linux-gnu/
......
......@@ -165,7 +165,7 @@ pipeline {
// First clean image registry
myShCmd('docker image rm oai-upf-vpp:' + upf_tag + ' || true', rem_u18_host_flag, rem_u18_host_user, rem_u18_host)
myShCmd('mkdir -p archives', rem_u18_host_flag, rem_u18_host_user, rem_u18_host)
myShCmd('docker build --no-cache --target oai-upf-vpp --tag oai-upf-vpp:' + upf_tag + ' --file docker/Dockerfile.upf-vpp.ubuntu18 --build-arg NEEDED_GIT_PROXY="http://proxy.eurecom.fr:8080" . > archives/upf_docker_image_build.log 2>&1', rem_u18_host_flag, rem_u18_host_user, rem_u18_host)
myShCmd('docker build --no-cache --target oai-upf-vpp --tag oai-upf-vpp:' + upf_tag + ' --file docker/Dockerfile.upf-vpp.ubuntu --build-arg NEEDED_GIT_PROXY="http://proxy.eurecom.fr:8080" . > archives/upf_docker_image_build.log 2>&1', rem_u18_host_flag, rem_u18_host_user, rem_u18_host)
myShCmd('docker image ls >> archives/upf_docker_image_build.log', rem_u18_host_flag, rem_u18_host_user, rem_u18_host)
// We will keep also the TMP image in U18 case.
if ("MERGE".equals(env.gitlabActionType)) {
......
......@@ -76,8 +76,8 @@ RUN git clone -b stable/2101 https://github.com/fdio/vpp.git && \
mv upg-vpp/vpp.spec / && \
./scripts/apply_vpp_patches.sh
RUN make install-dep build-release -C vpp/
RUN make install-dep -C vpp/
RUN make build-release -C vpp/
#---------------------------------------------------------------------
# TARGET IMAGE
#---------------------------------------------------------------------
......@@ -127,7 +127,7 @@ COPY --from=vpp-upf-builder \
/vpp-upf/vpp/build-root/install-vpp-native/vpp/lib/libvlibmemory.so.21.01.1 \
/vpp-upf/vpp/build-root/install-vpp-native/vpp/lib/libvlib.so.21.01.1 \
/vpp-upf/vpp/build-root/install-vpp-native/vpp/lib/libsvm.so.21.01.1 \
/vpp-upf/vpp/build-root/install-vpp-native/vpp/lib/libnat.so.21.01.1 \
# /vpp-upf/vpp/build-root/install-vpp-native/vpp/lib/libnat.so.21.01.1 \
/usr/lib64/
RUN ldconfig
......
#/*
# * 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 VPP-UPF service
# Valid for Ubuntu-18.04 (bionic) and Ubuntu-20.04 (focal)
#
#---------------------------------------------------------------------
#---------------------------------------------------------------------
# BUILDER IMAGE
#---------------------------------------------------------------------
ARG BASE_IMAGE=ubuntu:18.04
FROM $BASE_IMAGE AS vpp-upf-builder
ARG NEEDED_GIT_PROXY
ENV DEBIAN_FRONTEND=noninteractive
# Installing hyperscan library for upf plugin
RUN apt update && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && \
DEBIAN_FRONTEND=noninteractive apt-get install --yes \
git \
sudo \
python3 \
wget \
make \
build-essential \
libhyperscan-dev \
&& rm -rf /var/lib/apt/lists/*
# Some GIT configuration commands quite useful
RUN /bin/bash -c "if [[ -v NEEDED_GIT_PROXY ]]; then git config --global http.proxy $NEEDED_GIT_PROXY; fi"
RUN git config --global https.postBuffer 123289600 && \
git config --global http.sslverify false
WORKDIR /vpp-upf
COPY . .
# Applying vpp patches
RUN git clone -b stable/2101 https://github.com/fdio/vpp.git && \
git clone -b stable/1.2 https://github.com/travelping/upg-vpp.git && \
cd upg-vpp && \
cd .. && \
mv upg-vpp/upf/ vpp/src/plugins/ && \
mv upg-vpp/vpp-patches/* scripts/patches/ && \
mv upg-vpp/vpp.spec / && \
./scripts/apply_vpp_patches.sh && \
touch /etc/apt/apt.conf.d/90forceyes && \
echo "APT::Get::Assume-Yes "true";" >> /etc/apt/apt.conf.d/90forceyes && \
echo "APT::Get::force-yes "true";" >> /etc/apt/apt.conf.d/90forceyes
# To Do - remove unnecessary pulgin build to optimise build time e.g. ipsec, dpdk etc.
# Build vpp with Travelping upf plugin
RUN make install-dep -C vpp
RUN make build-release -C vpp
#---------------------------------------------------------------------
# TARGET IMAGE
#---------------------------------------------------------------------
FROM $BASE_IMAGE as oai-upf-vpp
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Paris
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && \
DEBIAN_FRONTEND=noninteractive apt-get install --yes \
net-tools \
tshark \
tzdata\
libhyperscan-dev \
iproute2 \
iputils-ping \
curl \
libnuma1 \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /openair-upf/bin
COPY --from=vpp-upf-builder \
/vpp-upf/scripts/entrypoint.sh \
/vpp-upf/vpp/build-root/install-vpp-native/vpp/bin/vpp \
/vpp-upf/vpp/build-root/install-vpp-native/vpp/bin/vppctl \
/vpp-upf/src/nrf_client.sh \
./
COPY --from=vpp-upf-builder \
/vpp-upf/scripts/upf_conf/init.conf \
/vpp-upf/scripts/upf_conf/startup_debug.conf \
/vpp-upf/scripts/upf_conf/upf_profile.json \
/openair-upf/etc/
COPY --from=vpp-upf-builder \
/vpp-upf/vpp/build-root/install-vpp-native/vpp/lib/vpp_plugins/upf_plugin.so \
/vpp-upf/vpp/build-root/install-vpp-native/vpp/lib/vpp_plugins/dpdk_plugin.so \
/usr/lib/x86_64-linux-gnu/vpp_plugins/
COPY --from=vpp-upf-builder \
/vpp-upf/vpp/build-root/install-vpp-native/vpp/lib/libvppinfra.so.21.01.1 \
/vpp-upf/vpp/build-root/install-vpp-native/vpp/lib/libvnet.so.21.01.1 \
/vpp-upf/vpp/build-root/install-vpp-native/vpp/lib/libvlibmemory.so.21.01.1 \
/vpp-upf/vpp/build-root/install-vpp-native/vpp/lib/libvlib.so.21.01.1 \
/vpp-upf/vpp/build-root/install-vpp-native/vpp/lib/libsvm.so.21.01.1 \
# /vpp-upf/vpp/build-root/install-vpp-native/vpp/lib/libnat.so.21.01.1 \
/usr/lib/x86_64-linux-gnu/
RUN ldconfig
RUN groupadd vpp
WORKDIR /openair-upf
COPY --from=vpp-upf-builder /vpp-upf/scripts/run.sh .
#expose
EXPOSE 8085/udp 2152/udp
ENTRYPOINT ["/openair-upf/bin/entrypoint.sh"]
CMD ["/openair-upf/run.sh"]
#/*
# * 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 VPP-UPF service
# Valid for Ubuntu-18.04 (bionic)
#
#---------------------------------------------------------------------
#---------------------------------------------------------------------
# BUILDER IMAGE
#---------------------------------------------------------------------
FROM ubuntu:18.04 AS vpp-upf-builder
ARG NEEDED_GIT_PROXY
ENV DEBIAN_FRONTEND=noninteractive
# Installing hyperscan library for upf plugin
RUN apt update && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && \
DEBIAN_FRONTEND=noninteractive apt-get install --yes \
git \
sudo \
python3 \
wget \
make \
build-essential \
libhyperscan-dev \
&& rm -rf /var/lib/apt/lists/*
# Some GIT configuration commands quite useful
RUN /bin/bash -c "if [[ -v NEEDED_GIT_PROXY ]]; then git config --global http.proxy $NEEDED_GIT_PROXY; fi"
RUN git config --global https.postBuffer 123289600 && \
git config --global http.sslverify false
WORKDIR /vpp-upf
COPY . .
# Applying vpp patches
RUN git clone -b stable/2101 https://github.com/fdio/vpp.git && \
git clone -b stable/1.2 https://github.com/travelping/upg-vpp.git && \
cd upg-vpp && \
cd .. && \
mv upg-vpp/upf/ vpp/src/plugins/ && \
mv upg-vpp/vpp-patches/* scripts/patches/ && \
mv upg-vpp/vpp.spec / && \
./scripts/apply_vpp_patches.sh && \
touch /etc/apt/apt.conf.d/90forceyes && \
echo "APT::Get::Assume-Yes "true";" >> /etc/apt/apt.conf.d/90forceyes && \
echo "APT::Get::force-yes "true";" >> /etc/apt/apt.conf.d/90forceyes
# To Do - remove unnecessary pulgin build to optimise build time e.g. ipsec, dpdk etc.
# Build vpp with travelping upf plugin
RUN make install-dep build-release -C vpp
#---------------------------------------------------------------------
# TARGET IMAGE
#---------------------------------------------------------------------
FROM ubuntu:bionic as oai-upf-vpp
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Paris
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && \
DEBIAN_FRONTEND=noninteractive apt-get install --yes \
net-tools \
tshark \
tzdata\
libhyperscan-dev \
iproute2 \
iputils-ping \
curl \
libnuma1 \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /openair-upf/bin
COPY --from=vpp-upf-builder \
/vpp-upf/scripts/entrypoint.sh \
/vpp-upf/vpp/build-root/install-vpp-native/vpp/bin/vpp \
/vpp-upf/vpp/build-root/install-vpp-native/vpp/bin/vppctl \
/vpp-upf/src/nrf_client.sh \
./
COPY --from=vpp-upf-builder \
/vpp-upf/scripts/upf_conf/init.conf \
/vpp-upf/scripts/upf_conf/startup_debug.conf \
/vpp-upf/scripts/upf_conf/upf_profile.json \
/openair-upf/etc/
COPY --from=vpp-upf-builder \
/vpp-upf/vpp/build-root/install-vpp-native/vpp/lib/vpp_plugins/upf_plugin.so \
/vpp-upf/vpp/build-root/install-vpp-native/vpp/lib/vpp_plugins/dpdk_plugin.so \
/usr/lib/x86_64-linux-gnu/vpp_plugins/
COPY --from=vpp-upf-builder \
/vpp-upf/vpp/build-root/install-vpp-native/vpp/lib/libvppinfra.so.21.01.1 \
/vpp-upf/vpp/build-root/install-vpp-native/vpp/lib/libvnet.so.21.01.1 \
/vpp-upf/vpp/build-root/install-vpp-native/vpp/lib/libvlibmemory.so.21.01.1 \
/vpp-upf/vpp/build-root/install-vpp-native/vpp/lib/libvlib.so.21.01.1 \
/vpp-upf/vpp/build-root/install-vpp-native/vpp/lib/libsvm.so.21.01.1 \
/vpp-upf/vpp/build-root/install-vpp-native/vpp/lib/libnat.so.21.01.1 \
/usr/lib/x86_64-linux-gnu/
RUN ldconfig
RUN groupadd vpp
WORKDIR /openair-upf
COPY --from=vpp-upf-builder /vpp-upf/scripts/run.sh .
#expose
EXPOSE 8085/udp 2152/udp
ENTRYPOINT ["/openair-upf/bin/entrypoint.sh"]
CMD ["/openair-upf/run.sh"]
Dockerfile.upf-vpp.ubuntu
\ No newline at end of file
......@@ -20,11 +20,20 @@ Here in our network configuration, we need to pass the "GIT PROXY" configuration
```bash
$ docker build --target oai-upf-vpp --tag oai-upf-vpp:latest \
--file docker/Dockerfile.upf-vpp.ubuntu18 \
--file docker/Dockerfile.upf-vpp.ubuntu \
--build-arg NEEDED_GIT_PROXY="http://proxy.eurecom.fr:8080" .
```
## 3.2 On a RHEL 7 Host ##
## 3.2 On a Ubuntu 20.04 Host ##
```bash
$ docker build --target oai-upf-vpp --tag oai-upf-vpp:latest \
--file docker/Dockerfile.upf-vpp.ubuntu \
--build-arg NEEDED_GIT_PROXY="http://proxy.eurecom.fr:8080" \
--build-arg BASE_IMAGE=ubuntu:20.04 .
```
## 3.3 On a RHEL 7 Host ##
```bash
$ docker build --target oai-upf-vpp --tag oai-upf-vpp:latest \
......
--- a/src/plugins/CMakeLists.txt 2022-02-24 15:09:32.984235101 +0100
+++ b/src/plugins/CMakeLists.txt 2022-02-24 15:08:41.663698835 +0100
@@ -19,11 +19,18 @@
##############################################################################
# find and add all plugin subdirs
##############################################################################
+set(ALLOWED_PLUGINS "dpdk" "upf")
+
FILE(GLOB files RELATIVE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/*/CMakeLists.txt
)
foreach (f ${files})
get_filename_component(dir ${f} DIRECTORY)
- add_subdirectory(${dir})
+ IF(${dir} IN_LIST ALLOWED_PLUGINS)
+ message("Adding sudirectory -> " ${dir})
+ add_subdirectory(${dir})
+ ENDIF()
+ #add_subdirectory(${dir})
endforeach()
+
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