Commit e82ee89d authored by Raphael Defosseux's avatar Raphael Defosseux

Merge remote-tracking branch 'origin/develop' into dreibh/tx-checksum-ip-generic-off

parents fa782bbf 2117bcf0
# Any CI/CD artifact
openair-spgwu.tar.bz2
archives
*-cfg.sh
*-env.list
src/oai_rules_result*txt
# RELEASE NOTES: #
## v1.0.0 -- May 2019 ##
* First release, Able to serve a MME with basic attach, detach, release, paging procedures, default bearer only.
# Contributing to OpenAir-CN #
We want to make contributing to this project as easy and transparent as possible.
Please refer to the steps described on our website: [How to contribute to OAI](https://www.openairinterface.org/?page_id=112)
1. Sign and return a Contributor License Agreement to OAI team.
2. Create an account on [GitHub](https://github.com).
3. Provide the identifiant of this account to the OAI team (mailto:contact@openairinterface.org) so you have developer rights on this repository.
4. The policies are described in these wiki pages: [OAI Policies](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/oai-policies-home)
- You can fork onto another hosting system. But we will **NOT** accept a pull request from a forked repository.
* This decision was made for the license reasons.
* The Continuous Integration will reject your pull request.
- All pull requests SHALL have **`develop`** branch as target branch.
## Coding Styles ##
We are using `clang-format` as formatting tool on the C/C++ code.
At the time of writing (March 30th, 2020), we are using `clang-format` version 8.0.0 or above. By default, on a Ubuntu bionic Desktop edition, you would install version 6.0.0.
So it is very likely you will have to install it manually. Again, at the time of writing, the working version we found was 9.0.0.
```bash
$ wget https://releases.llvm.org/9.0.0/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz
$ mkdir clang_tmp
$ tar xvfJ clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz -C ./clang_tmp
$ sudo cp clang_tmp/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/clang-format /usr/bin/clang-format
$ rm -Rf clang*
$ clang-format --version
clang-format version 9.0.0 (tags/RELEASE_900/final)
```
How to format:
```bash
$ cd myClonedWorkspace/src
$ clang-format -i theFilesYouWantToFormat
```
## License ##
By contributing to OpenAirInterface, you agree that your contributions will be licensed under the [LICENSE](LICENSE) file in the root directory of this source tree.
## Continuous Integration process ##
1. You push your modified code with the new branch onto our [official GitHub repository](https://github.com/OPENAIRINTERFACE/openair-spgwu-tiny).
- Please make the name of the branch explicit and short.
2. You create a pull request from the [dedicated web page](https://github.com/OPENAIRINTERFACE/openair-spgwu-tiny/pulls).
- The `target` (`base` in the web-page) branch **SHALL be `develop`**.
- The `source` (`compare` in the web-page) branch is your branch.
3. Our Continuous Integration (CI) process will be triggered automatically on your proposed modified code and check the validity.
- Check build
- Check some formatting rules
- Run a bunch of tests
4. If at least one of these steps fails, you will have to push corrections onto your source branch.
- The step 3. will be again automatically triggered on this new commit.
- Please wait that your run is finished before committing and pushing new modifications on your source branch.
- That will allow fairness on the CI usage to other contributors.
4. When this automated process passes, one of our CI administrators will review your changes or assign a senior contributor
to do a peer-review.
5. Once the peer reviewer accepts your modification, one of our CI administrators will accept and merge your pull request
- The CI will run again on the new `develop` branch commit.
- The source branch WILL be deleted by one of our CI administrators.
# openair-cn-cups
Control User Plane Separation of SPGW-C and SPGW-U
├── http://www.openairinterface.org/?page_id=698
------------------------------------------------------------------------------
It is distributed under OAI Public License V1.0.
The license information is distributed under LICENSE file in the same directory.
OPENAIR-CN
An implementation of the Evolved Packet Core network.
------------------------------------------------------------------------------
Openair-cn is an implementation of the 3GPP specifications concerning the
Evolved Packet Core Networks, that means it contains the implementation of the
following network elements:
The OpenAirInterface CN CUPS software is composed of the following parts:
* MME,
* HSS,
* S-GW+P-GW.
Each element implementation has its own repository: this repository (`openair-spgwu-tiny`) is meant for SPGW-U.
openair-cn-cups
# openair-spgwc
In the Control User Plane Separation of SPGW, only the SPGW-U (User Plane) implementation is available in this repo.
It is distributed under `OAI Public License V1.1`. See [OAI Website for more details](https://www.openairinterface.org/?page_id=698).
The text for `OAI Public License V1.1` is also available under [LICENSE](LICENSE) file in the same directory.
# Where to start
The Openair-cn SPGW-U code is written, executed, and tested on UBUNTU server bionic version.
More details on the deployment options and the supported feature set is available on this [page](docs/FEATURE_SET.md).
# Collaborative work
This source code is managed through a GITHUB, a collaborative development platform
Process is explained in [CONTRIBUTING](CONTRIBUTING.md) file.
# Directory structure
<pre>
openair-spgwu-tiny
├── build : Build directory, contains targets and object files generated by compilation of network functions.
├── log : Directory containing build log files.
├── scripts : Directory containing scripts for building network functions
├── spgw_c : Directory containing CMakefile.txt and object files generated by compilation of SPGW-C network function.
├── spgw_u : Directory containing CMakefile.txt and object files generated by compilation of SPGW-U network function.
└── ci-scripts : Directory containing scripts for the CI process
│ ├── log : Directory containing build log files.
│ ├── scripts : Directory containing scripts for building network functions
│ └── spgw_u : Directory containing CMakefile.txt and object files generated by compilation of SPGW-U network function.
├── ci-scripts : Directory containing scripts for the CI process
├── etc : Directory containing the configuration files to be deployed for each network function.
└── src : Source files of network functions.
├── common : Common header files
......@@ -22,15 +52,9 @@ openair-cn-cups
├── gtpv1u : Generic GTPV1-U stack implementation
├── gtpv2c : Generic GTPV2-C stack implementation
├── itti : Inter task interface
├── oai_spgwc : SPGW-C main directory, contains the "main" CMakeLists.txt file.
├── oai_spgwu : SPGW-U main directory, contains the "main" CMakeLists.txt file.
├── pfcp : Generic PFCP stack implementation.
├── pgwc : PGW-C network fonctions procedures and contexts.
├── sgwc : SGW-C network fonctions procedures and contexts.
├── spgwu : SPGW-U network fonctions procedures and contexts.
│   └── simpleswitch : Very Basic Switch implementation.
├── pfcp : Generic PFCP stack implementation.
└── udp : UDP server implementation.
</pre>
RELEASE NOTES:
v1.0.0 -> First release, Able to serve a MME with basic attach, detach, release, paging procedures, default bearer only.
......@@ -38,7 +38,7 @@ case "$OS_DISTRO" in
ubuntu) OS_BASEDISTRO="debian"; INSTALLER="apt-get"; CMAKE="cmake" ;;
esac
IS_CONTAINER=`egrep -c "docker|kubepods" /proc/self/cgroup`
IS_CONTAINER=`egrep -c "docker|podman|kubepods" /proc/self/cgroup || true`
if [ $IS_CONTAINER -eq 0 ]
then
......@@ -128,6 +128,7 @@ check_supported_distribution() {
case "$distribution" in
"ubuntu18.04") return 0 ;;
"rhel8") return 0 ;;
"rhel8.2") return 0 ;;
"centos8") return 0 ;;
esac
return 1
......
......@@ -31,6 +31,7 @@ source $THIS_SCRIPT_PATH/build_helper
#arg1 is force (0 or 1) (no interactive script)
#arg2 is debug (0 or 1) (install debug libraries)
install_fb_folly_from_source(){
echo_info "Starting to install folly from source"
if [ $1 -eq 0 ]; then
OPTION=""
read -p "Do you want to install FaceBook folly (github)? <y/N> " prompt
......@@ -143,6 +144,7 @@ install_fb_folly_from_source(){
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
popd
fi
echo_success "End of folly installation"
return 0
}
......@@ -69,6 +69,7 @@ install_fmt() {
#arg1 is force (0 or 1) (no interactive script)
#arg2 is debug (0 or 1) (install debug libraries)
install_spdlog_from_git() {
echo_info "Starting to install spdlog from source"
if [ $1 -eq 0 ]; then
read -p "Do you want to install spdlog ? <y/N> " prompt
OPTION=""
......@@ -101,6 +102,7 @@ install_spdlog_from_git() {
sed -i '/#define SPDLOG_ENABLE_SYSLOG/s/^\/\///g' include/spdlog/tweakme.h
popd
fi
echo_success "End of spdlog installation"
return 0
}
......@@ -382,6 +384,7 @@ check_install_spgwu_deps() {
bison \
$CMAKE \
cppcheck \
procps-ng \
flex \
gdb \
git"
......@@ -420,12 +423,20 @@ check_install_spgwu_deps() {
python \
pkg-config"
elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then
case "$(get_distribution_release)" in
"centos8")
specific_packages="libidn2-devel"
;;
"rhel8.2")
specific_packages=""
;;
esac
PACKAGE_LIST="\
$specific_packages \
guile-devel \
libconfig-devel \
libgcrypt-devel \
gmp-devel \
libidn2-devel \
libidn-devel \
lksctp-tools \
lksctp-tools-devel \
......@@ -444,6 +455,7 @@ check_install_spgwu_deps() {
$SUDO $INSTALLER install $OPTION $PACKAGE_LIST
ret=$?;[[ $ret -ne 0 ]] && return $ret
echo_info "Packages and Libraries installation finished!"
# Use fmt lib included in spdlog
#install_fmt $1
......
......@@ -144,24 +144,26 @@ function main()
mkdir -m 777 -p $dext
if [ $var_check_install_min_deps -gt 0 ];then
disable_ipv6
check_install_spgwu_min_deps $force $debug
if [[ $? -ne 0 ]]; then
echo_error "Error: SPGW-U minimal deps installation failed"
return 1
else
# Done now after
disable_ipv6
echo_success "SPGW-U minimal deps installation successful"
echo_warning "SPGW-U not compiled, to compile it, re-run build_spgwu without -i option"
return 0
fi
fi
if [ $var_check_install_deps -gt 0 ];then
disable_ipv6
check_install_spgwu_deps $force $debug
if [[ $? -ne 0 ]]; then
echo_error "Error: SPGW-U deps installation failed"
return 1
else
# Done now after
disable_ipv6
echo_success "SPGW-U deps installation successful"
echo_warning "SPGW-U not compiled, to compile it, re-run build_spgwu without -I option"
return 0
......
......@@ -122,17 +122,13 @@ pipeline {
stage ('Build SPGW-U Image') {
steps {
script {
if (env.ghprbPullId != null) {
// Building a temporary image
myShCmd('docker image prune --force', new_host_flag, new_host_user, new_host)
myShCmd('docker build --target oai-spgwu-tiny --tag oai-spgwu-tiny:ci-temp --file ci-scripts/Dockerfile.ubuntu18.04 --build-arg EURECOM_PROXY="http://proxy.eurecom.fr:8080" --build-arg BUILD_FOR_CI="True" --build-arg CI_SRC_BRANCH="' + env.ghprbSourceBranch + '" --build-arg CI_SRC_COMMIT="' + env.ghprbActualCommit + '" --build-arg CI_DEST_BRANCH="develop" . > archives/spgwu_docker_image_build.log 2>&1', new_host_flag, new_host_user, new_host)
} else {
if (env.ghprbPullId == null) {
// Currently this pipeline only runs for pushes to `develop` branch
// First clean image registry
myShCmd('docker image rm oai-spgwu-tiny:develop', new_host_flag, new_host_user, new_host)
myShCmd('docker image prune --force', new_host_flag, new_host_user, new_host)
myShCmd('docker build --target oai-spgwu-tiny --tag oai-spgwu-tiny:develop --file ci-scripts/Dockerfile.ubuntu18.04 --build-arg EURECOM_PROXY="http://proxy.eurecom.fr:8080" --build-arg CI_SRC_BRANCH="develop" . > archives/spgwu_docker_image_build.log 2>&1', new_host_flag, new_host_user, new_host)
}
myShCmd('docker image prune --force', new_host_flag, new_host_user, new_host)
myShCmd('docker build --target oai-spgwu-tiny --tag oai-spgwu-tiny:' + spgwu_tag + ' --file docker/Dockerfile.ubuntu18.04 --build-arg EURECOM_PROXY="http://proxy.eurecom.fr:8080" . > archives/spgwu_docker_image_build.log 2>&1', new_host_flag, new_host_user, new_host)
myShCmd('docker image ls >> archives/spgwu_docker_image_build.log', new_host_flag, new_host_user, new_host)
}
}
......
......@@ -7,7 +7,7 @@
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# * 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,
......@@ -16,7 +16,7 @@
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# * contact@openairinterface.org
# */
#---------------------------------------------------------------------
......@@ -31,6 +31,8 @@ class spgwuConfigGen():
self.sxu_name = ''
self.spgwc0_ip_addr = ''
self.fromDockerFile = False
self.envForEntrypoint = False
self.network_ue_ip = '12.1.1.0/24'
def GenerateSpgwuConfigurer(self):
spgwuFile = open('./spgwu-cfg.sh', 'w')
......@@ -60,7 +62,7 @@ class spgwuConfigGen():
spgwuFile.write('SPGWU_CONF[@SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP@]=\'' + self.s1u_name + '\'\n')
spgwuFile.write('SPGWU_CONF[@SGW_INTERFACE_NAME_FOR_SX@]=\'' + self.sxu_name + '\'\n')
# SGI is fixed on SGI
spgwuFile.write('SPGWU_CONF[@SGW_INTERFACE_NAME_FOR_SGI@]=\'eth0\'\n')
spgwuFile.write('SPGWU_CONF[@PGW_INTERFACE_NAME_FOR_SGI@]=\'eth0\'\n')
spgwuFile.write('SPGWU_CONF[@SPGWC0_IP_ADDRESS@]=\'' + self.spgwc0_ip_addr + '\'\n')
spgwuFile.write('\n')
spgwuFile.write('for K in "${!SPGWU_CONF[@]}"; do \n')
......@@ -70,6 +72,18 @@ class spgwuConfigGen():
spgwuFile.write('exit 0\n')
spgwuFile.close()
def GenerateSpgwuEnvList(self):
spgwuFile = open('./spgwu-env.list', 'w')
spgwuFile.write('# Environment Variables used by the OAI-SPGW-U-TINY Entrypoint Script\n')
spgwuFile.write('INSTANCE=1\n')
spgwuFile.write('PID_DIRECTORY=/var/run\n')
spgwuFile.write('SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP=' + self.s1u_name + '\n')
spgwuFile.write('SGW_INTERFACE_NAME_FOR_SX=' + self.sxu_name + '\n')
spgwuFile.write('PGW_INTERFACE_NAME_FOR_SGI=eth0\n')
spgwuFile.write('SPGWC0_IP_ADDRESS=' + self.spgwc0_ip_addr + '\n')
spgwuFile.write('NETWORK_UE_IP=' + self.network_ue_ip + '\n')
spgwuFile.close()
#-----------------------------------------------------------
# Usage()
#-----------------------------------------------------------
......@@ -87,6 +101,8 @@ def Usage():
print(' --sxu=[SPGW-U SX Interface Name]')
print(' --s1u=[SPGW-U S1-U Interface Name]')
print(' --from_docker_file')
print('------------------------------------------------------------------------------------------- SPGW-U Not Mandatory -----')
print(' --envForEntrypoint [generates a spgwc-env.list interpreted by the entrypoint]')
argvs = sys.argv
argc = len(argvs)
......@@ -113,6 +129,8 @@ while len(argvs) > 1:
mySpgwuCfg.s1u_name = matchReg.group(1)
elif re.match('^\-\-from_docker_file', myArgv, re.IGNORECASE):
mySpgwuCfg.fromDockerFile = True
elif re.match('^\-\-env_for_entrypoint', myArgv, re.IGNORECASE):
mySpgwuCfg.envForEntrypoint = True
else:
Usage()
sys.exit('Invalid Parameter: ' + myArgv)
......@@ -132,7 +150,10 @@ if mySpgwuCfg.kind == 'SPGW-U':
Usage()
sys.exit('missing SPGW-C #0 IP address on SX interface')
else:
mySpgwuCfg.GenerateSpgwuConfigurer()
if mySpgwuCfg.envForEntrypoint:
mySpgwuCfg.GenerateSpgwuEnvList()
else:
mySpgwuCfg.GenerateSpgwuConfigurer()
sys.exit(0)
else:
Usage()
......
......@@ -445,7 +445,7 @@ class HtmlReport():
if os.path.isfile(cwd + '/archives/' + logFileName):
status = False
section_start_pattern = 'build_spgwu --install-deps --force'
section_end_pattern = 'build_spgwu --clean --build-type Release --jobs'
section_end_pattern = 'build_spgwu --clean --build-type Release --jobs --Verbose'
section_status = False
package_install = False
folly_build_start = False
......@@ -464,22 +464,22 @@ class HtmlReport():
result = re.search('SPGW-U deps installation successful', line)
if result is not None:
status = True
result = re.search('/tmp /openair-spgwu-tiny/build/scripts', line)
result = re.search('Packages and Libraries installation finished', line)
if result is not None:
package_install = True
result = re.search('Cloning into \'folly\'', line)
result = re.search('Starting to install folly from source', line)
if result is not None:
folly_build_start = True
if folly_build_start:
result = re.search('Installing: /usr/local/lib/libfollybenchmark', line)
result = re.search('End of folly installation', line)
if result is not None:
folly_build_start = False
folly_build = True
result = re.search('Install spdlog from ', line)
result = re.search('Starting to install spdlog from source', line)
if result is not None:
spdlog_build_start = True
if spdlog_build_start:
result = re.search('/openair-spgwu-tiny/build/scripts', line)
result = re.search('End of spdlog installation', line)
if result is not None:
spdlog_build_start = False
spdlog_build = True
......@@ -531,8 +531,8 @@ class HtmlReport():
cwd = os.getcwd()
if os.path.isfile(cwd + '/archives/' + logFileName):
status = False
section_start_pattern = 'build_spgwu --clean --build-type Release --jobs'
section_end_pattern = 'cat /openair-spgwu-tiny/build/log/spgwu.txt'
section_start_pattern = 'build_spgwu --clean --build-type Release --jobs --Verbose'
section_end_pattern = 'git log -n1 > version.txt'
section_status = False
with open(cwd + '/archives/' + logFileName, 'r') as logfile:
for line in logfile:
......@@ -574,8 +574,8 @@ class HtmlReport():
nb_warnings = 0
if os.path.isfile(cwd + '/archives/' + logFileName):
section_start_pattern = 'cat /openair-spgwu-tiny/build/log/spgwu.txt'
section_end_pattern = 'FROM ubuntu:bionic as oai-spgwu-tiny$'
section_start_pattern = 'build_spgwu --clean --build-type Release --jobs --Verbose'
section_end_pattern = 'git log -n1 > version.txt'
section_status = False
with open(cwd + '/archives/' + logFileName, 'r') as logfile:
for line in logfile:
......
......@@ -96,6 +96,9 @@ class deploySanityCheckTest():
subprocess_run_w_echo('python3 ci-scripts/generateSpgwcConfigFiles.py --kind=SPGW-C --s11c=eth0 --sxc=eth1 --from_docker_file')
subprocess_run_w_echo('docker cp ./spgwc-cfg.sh ci-oai-spgwc:/openair-spgwc')
subprocess_run_w_echo('docker exec -it ci-oai-spgwc /bin/bash -c "cd /openair-spgwc && chmod 777 spgwc-cfg.sh && ./spgwc-cfg.sh" >> archives/spgwc_config.log')
# If we deploy a SPGW-U w/ entrypoint, SPGW-C SHALL be started
# This will be removed later on.
subprocess_run_w_echo('docker exec -d ci-oai-spgwc /bin/bash -c "nohup ./bin/oai_spgwc -o -c ./etc/spgw_c.conf > spgwc_check_run.log 2>&1"')
def deploySPGWU(self):
res = ''
......@@ -144,7 +147,8 @@ class deploySanityCheckTest():
if entrypoint is not None:
print('there is an entrypoint -- no need')
else:
subprocess_run_w_echo('docker exec -d ci-oai-spgwc /bin/bash -c "nohup ./bin/oai_spgwc -o -c ./etc/spgw_c.conf > spgwc_check_run.log 2>&1"')
print('Already started')
#subprocess_run_w_echo('docker exec -d ci-oai-spgwc /bin/bash -c "nohup ./bin/oai_spgwc -o -c ./etc/spgw_c.conf > spgwc_check_run.log 2>&1"')
def startSPGWU(self):
res = ''
......
......@@ -77,6 +77,8 @@ RUN yum update -y \
psmisc \
net-tools \
tcpdump \
iptables \
ethtool \
glog \
double-conversion \
libconfig \
......
#/*
# * 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 Open-Air-Interface SPGW-U-TINY service
# Valid for CentOS 8
#
#---------------------------------------------------------------------
#---------------------------------------------------------------------
# BUILDER IMAGE
#---------------------------------------------------------------------
FROM centos:8 as oai-spgwu-tiny-builder
ARG EURECOM_PROXY
ARG BUILD_FOR_CI
ARG CI_SRC_BRANCH
ARG CI_SRC_COMMIT
ARG CI_DEST_BRANCH
RUN yum update -y \
&& yum install epel-release -y \
&& yum install dnf-plugins-core -y \
&& yum config-manager --set-enabled PowerTools \
&& yum install -y \
psmisc \
git \
&& yum clean all -y \
&& rm -rf /var/cache/yum
# Some GIT configuration command quite useful
RUN /bin/bash -c "if [[ -v EURECOM_PROXY ]]; then git config --global http.proxy $EURECOM_PROXY; fi"
RUN git config --global https.postBuffer 123289600
RUN git config --global http.sslverify false
# In normal case, we build out of the develop branch
RUN /bin/bash -c "if [[ -v CI_SRC_BRANCH ]]; then git clone https://github.com/OPENAIRINTERFACE/openair-spgwu-tiny.git -b $CI_SRC_BRANCH /openair-spgwu-tiny; else git clone https://github.com/OPENAIRINTERFACE/openair-spgwu-tiny.git -b helm3.1-onap-sync-with-cn-split-repos /openair-spgwu-tiny; fi"
# For CI, especially for Pull/Merge Requests, we build out of temp merge
WORKDIR /openair-spgwu-tiny
RUN /bin/bash -c "if [[ -v BUILD_FOR_CI ]]; then git config --global user.name \"OAI CI\"; fi"
RUN /bin/bash -c "if [[ -v BUILD_FOR_CI ]]; then git config --global user.email ci@openairinterface.org; fi"
RUN /bin/bash -c "if [[ -v BUILD_FOR_CI ]]; then git checkout -f $CI_SRC_COMMIT; fi"
RUN /bin/bash -c "if [[ -v BUILD_FOR_CI ]]; then git merge --ff origin/$CI_DEST_BRANCH -m \"Temporary merge for CI\"; fi"
# Installing and Building SPGW-C
WORKDIR /openair-spgwu-tiny/build/scripts
RUN ./build_spgwu --install-deps --force
RUN ./build_spgwu --clean --build-type Debug --jobs --Verbose
#---------------------------------------------------------------------
# TARGET IMAGE
#---------------------------------------------------------------------
FROM centos:8 as oai-spgwu-tiny
# We install some debug tools for the moment in addition of mandatory libraries
RUN yum update -y \
&& yum install epel-release -y \
&& yum install dnf-plugins-core -y \
&& yum config-manager --set-enabled PowerTools \
&& yum install -y \
psmisc \
net-tools \
tcpdump \
iptables \
ethtool \
glog \
double-conversion \
libconfig \
libevent \
boost-system \
gdb \
valgrind \
&& yum clean all -y \
&& rm -rf /var/cache/yum
# Copying executable and generated libraries
WORKDIR /openair-spgwu-tiny/bin
COPY --from=oai-spgwu-tiny-builder /openair-spgwu-tiny/build/spgw_u/build/spgwu oai_spgwu
# Copying template configuration files
# The configuration folder will be flat
WORKDIR /openair-spgwu-tiny/etc
COPY --from=oai-spgwu-tiny-builder /openair-spgwu-tiny/etc/spgw_u.conf .
WORKDIR /openair-spgwu-tiny
#/*
# * 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 Open-Air-Interface SPGW-U-TINY service
# Valid for RHEL8.2 in the OpenShift context (v4.4)
#
#---------------------------------------------------------------------
#---------------------------------------------------------------------
# BUILDER IMAGE
#---------------------------------------------------------------------
FROM registry.access.redhat.com/ubi8/ubi:latest as oai-spgwu-tiny-builder
# Entitlements and RHSM configurations are Open-Shift Secret and ConfigMaps
# It is pre-requisite
RUN rm -Rf /etc/rhsm/ca /etc/pki/entitlement
# Copy the entitlements
COPY ./etc-pki-entitlement /etc/pki/entitlement
# Copy the subscription manager configurations
COPY ./rhsm-conf /etc/rhsm
COPY ./rhsm-ca /etc/rhsm/ca
RUN rm /etc/rhsm-host && \
# Initialize /etc/yum.repos.d/redhat.repo
# See https://access.redhat.com/solutions/1443553
yum repolist --disablerepo=* && \
subscription-manager repos --enable codeready-builder-for-rhel-8-x86_64-rpms && \
yum update -y && \
yum -y install --enablerepo="codeready-builder-for-rhel-8-x86_64-rpms" \
# diff, cmp and file are not in the ubi???
diffutils \
file \
psmisc \
git
# Copy the workspace as is
WORKDIR /openair-spgwu-tiny
COPY . /openair-spgwu-tiny
# Installing and Building SPGW-U-TINY
WORKDIR /openair-spgwu-tiny/build/scripts
RUN ./build_spgwu --install-deps --force
RUN ./build_spgwu --clean --build-type Release --jobs --Verbose
#---------------------------------------------------------------------
# TARGET IMAGE
#---------------------------------------------------------------------
FROM registry.access.redhat.com/ubi8/ubi:latest as oai-spgwu-tiny
# We install some debug tools for the moment in addition of mandatory libraries
RUN yum update -y && \
yum -y install --enablerepo="ubi-8-codeready-builder" \
psmisc \
net-tools \
ethtool \
iproute \
iptables \
initscripts \
libevent && \
yum clean all -y && \
rm -rf /var/cache/yum
# Copying executable and generated libraries
WORKDIR /openair-spgwu-tiny/bin
COPY --from=oai-spgwu-tiny-builder /openair-spgwu-tiny/build/spgw_u/build/spgwu oai_spgwu
COPY --from=oai-spgwu-tiny-builder /openair-spgwu-tiny/scripts/entrypoint.sh .
# Copying installed libraries from builder
COPY --from=oai-spgwu-tiny-builder /lib64/libgflags.so.2.1 /lib64/
COPY --from=oai-spgwu-tiny-builder /lib64/libglog.so.0 /lib64/
COPY --from=oai-spgwu-tiny-builder /lib64/libdouble-conversion.so.1 /lib64/
COPY --from=oai-spgwu-tiny-builder /lib64/libconfig++.so.9 /lib64/
COPY --from=oai-spgwu-tiny-builder /lib64/libboost_system.so.1.66.0 /lib64/
RUN ldconfig
# Copying template configuration files
# The configuration folder will be flat
WORKDIR /openair-spgwu-tiny/etc
COPY --from=oai-spgwu-tiny-builder /openair-spgwu-tiny/etc/spgw_u.conf .
WORKDIR /openair-spgwu-tiny
# expose ports
EXPOSE 2152/udp 8805/udp
CMD ["/openair-spgwu-tiny/bin/oai_spgwu", "-c", "/openair-spgwu-tiny/etc/spgw_u.conf", "-o"]
ENTRYPOINT ["/openair-spgwu-tiny/bin/entrypoint.sh"]
......@@ -31,37 +31,31 @@
FROM ubuntu:bionic as oai-spgwu-tiny-builder
ARG EURECOM_PROXY
ARG BUILD_FOR_CI
ARG CI_SRC_BRANCH
ARG CI_SRC_COMMIT
ARG CI_DEST_BRANCH
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && DEBIAN_FRONTEND=noninteractive apt-get install --yes \
psmisc \
git \
&& rm -rf /var/lib/apt/lists/*
git
# Some GIT configuration command quite useful
RUN /bin/bash -c "if [[ -v EURECOM_PROXY ]]; then git config --global http.proxy $EURECOM_PROXY; fi"
RUN git config --global https.postBuffer 123289600
RUN git config --global http.sslverify false
# In normal case, we build out of the develop branch
RUN /bin/bash -c "if [[ -v CI_SRC_BRANCH ]]; then git clone https://github.com/OPENAIRINTERFACE/openair-spgwu-tiny.git -b $CI_SRC_BRANCH /openair-spgwu-tiny; else git clone https://github.com/OPENAIRINTERFACE/openair-spgwu-tiny.git -b develop /openair-spgwu-tiny; fi"
# For CI, especially for Pull/Merge Requests, we build out of temp merge
# Copy the workspace as is
WORKDIR /openair-spgwu-tiny
RUN /bin/bash -c "if [[ -v BUILD_FOR_CI ]]; then git config --global user.name \"OAI CI\"; fi"
RUN /bin/bash -c "if [[ -v BUILD_FOR_CI ]]; then git config --global user.email ci@openairinterface.org; fi"
RUN /bin/bash -c "if [[ -v BUILD_FOR_CI ]]; then git checkout -f $CI_SRC_COMMIT; fi"
RUN /bin/bash -c "if [[ -v BUILD_FOR_CI ]]; then git merge --ff origin/$CI_DEST_BRANCH -m \"Temporary merge for CI\"; fi"
COPY . /openair-spgwu-tiny
# Installing and Building SPGW-U-TINY
WORKDIR /openair-spgwu-tiny/build/scripts
RUN ./build_spgwu --install-deps --force
RUN ./build_spgwu --clean --build-type Release --jobs
RUN cat /openair-spgwu-tiny/build/log/spgwu.txt
RUN ./build_spgwu --clean --build-type Release --jobs --Verbose
# Getting SHA-ONE for support
WORKDIR /openair-spgwu-tiny
RUN git log -n1 > version.txt
#---------------------------------------------------------------------
# TARGET IMAGE
......@@ -76,6 +70,7 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && DE
net-tools \
iproute2 \
ethtool \
iptables \
tshark \
libgoogle-glog0v5 \
libdouble-conversion1 \
......@@ -87,6 +82,7 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && DE
# Copying executable and generated libraries
WORKDIR /openair-spgwu-tiny/bin
COPY --from=oai-spgwu-tiny-builder /openair-spgwu-tiny/build/spgw_u/build/spgwu oai_spgwu
COPY --from=oai-spgwu-tiny-builder /openair-spgwu-tiny/scripts/entrypoint.sh .
# Copying template configuration files
# The configuration folder will be flat
......@@ -94,3 +90,10 @@ WORKDIR /openair-spgwu-tiny/etc
COPY --from=oai-spgwu-tiny-builder /openair-spgwu-tiny/etc/spgw_u.conf .
WORKDIR /openair-spgwu-tiny
COPY --from=oai-spgwu-tiny-builder /openair-spgwu-tiny/version.txt .
# expose ports
EXPOSE 2152/udp 8805/udp
CMD ["/openair-spgwu-tiny/bin/oai_spgwu", "-c", "/openair-spgwu-tiny/etc/spgw_u.conf", "-o"]
ENTRYPOINT ["/openair-spgwu-tiny/bin/entrypoint.sh"]
<table style="border-collapse: collapse; border: none;">
<tr style="border-collapse: collapse; border: none;">
<td style="border-collapse: collapse; border: none;">
<a href="http://www.openairinterface.org/">
<img src="./images/oai_final_logo.png" alt="" border=3 height=50 width=150>
</img>
</a>
</td>
<td style="border-collapse: collapse; border: none; vertical-align: center;">
<b><font size = "5">OpenAirInterface Core Network Feature Set</font></b>
</td>
</tr>
</table>
**Table of Contents**
1. [OpenAirInterface Core Network Block Diagram](#1-openairinterface-core-network-block-diagram)
2. [OpenAirInterface Core Network Fundamentals](#2-oai-core-network-fundamentals)
3. [OpenAirInterface Core Network Deployment](#3-oai-core-network-deployment)
4. [OpenAirInterface SPGW-CUPS Fundamentals](#4-oai-spgw-cups-fundamentals)
5. [OpenAirInterface SGW Feature List](./FEATURE_SET_SGW.md)
6. [OpenAirInterface PGW Feature List](./FEATURE_SET_PGW.md)
# 1. OpenAirInterface Core Network Block Diagram #
![Block Diagram](./images/oai_cn_block_diagram.png)
# 2. OAI Core Network Fundamentals #
* Network Access Control Functions
- Authentication and authorization
- Admission control
- Policy and charging enforcement
* Packet Routing and Transfer Functions
- IP header compression function
- Packet screening.
* Mobility Management Functions
- Reachability management for UE in ECM IDLE state
* Security Functions
* Radio Resource Management Functions
* Network Management Functions (O&M)
- GTP C signaling based Load and Overload Control
- Load balancing between MME instances
- MME control of overload
- PDN GW control of overload
# 3. OAI Core Network Deployment #
* Target OS
- Ubuntu 18.04 (bionic) server edition
- Red Hat Entreprise Linux 8
* Hardware Requirements
- x86-64 Intel/AMD CPU
- At least one 1 network device
* Linux Kernel
- Generic kernel is enough
* Deployment feasible on:
- PC
- Server
- Container
- Virtual Machine
# 4. OAI SPGW-CUPS Fundamentals #
CUPS = Control-User Planes Separation
So SPGW is composed of almost 2 network functions:
* 1 SPGW-C
* 1 SPGW-U
Fully written in C++ (-std=c++17)
* Internal design still asynchronous (ITTI based API)
* Usage of submodules: spdlog, libfolly (nolock collections)
Main differences with previous SPGW (tag `v0.7.0`)
* Handles GTP fragmentation
* Enables Network Address Translation (NAT), based on iptables
* Easier to install (no kernel dependencies)
* Switch-talking natively PFCP
* Data is copied/handled in user space
<table style="border-collapse: collapse; border: none;">
<tr style="border-collapse: collapse; border: none;">
<td style="border-collapse: collapse; border: none;">
<a href="http://www.openairinterface.org/">
<img src="./images/oai_final_logo.png" alt="" border=3 height=50 width=150>
</img>
</a>
</td>
<td style="border-collapse: collapse; border: none; vertical-align: center;">
<b><font size = "5">OpenAirInterface Core PDN Gateway Feature Set</font></b>
</td>
</tr>
</table>
**Table of Contents**
1. [PGW Fundamentals](#1-pgw-fundamentals)
2. [OAI PGW Available Interfaces](#2-oai-pgw-available-interfaces)
3. [OAI PGW Conformance Functions](#3-oai-pgw-conformance-functions)
# 1. PGW Fundamentals #
(from [Wikipedia.org](https://en.wikipedia.org/wiki/System_Architecture_Evolution))
The Packet Data Network Gateway provides connectivity from the UE to external packet data networks by being the point of exit and entry of traffic for the UE.
A UE may have simultaneous connectivity with more than one PGW for accessing multiple PDNs.
The PGW performs:
- Policy enforcement,
- Packet filtering for each user,
- Charging support,
- Lawful interception and
- Packet screening.
Another key role of the PGW is to act as the anchor for mobility between 3GPP and non-3GPP technologies such as WiMAX and 3GPP2 (CDMA 1X and EvDO)
# 2. OAI PGW Available Interfaces #
| **ID** | **Interface** | **Status** | **Comments** | **Protocols** |
| ------ | ------------- | ------------------ | ---------------------------------------------- | ------------- |
| 1 | S5 / S8 | :heavy_check_mark: | Available on control plane only. | GTP-based |
| 2 | Gx | :x: | Policy | |
| 3 | Gy | :x: | Charging | |
| 4 | SGi | :heavy_check_mark: | | |
# 3. OAI SGW Conformance Functions #
Based on document **3GPP TS 23.401 V15.5.0 §4.4.3.3**.
| **ID** | **Classification** | **Status** | **Comments** |
| ------ | ------------------------------------------------------------ | ------------------ | ---------------------------------------------- |
| 1 | Per-user based packet filtering (ie deep packet inspection) | :heavy_check_mark: | |
| 2 | Lawful Interception | :x: | |
| 3 | UE IP address allocation | :heavy_check_mark: | Pools of IP addresses |
| 4 | Transport level packet marking in the uplink and downlink | :x: | |
| 5 | Accounting for inter-operator charging | :x: | |
| 6 | UL and DL service level charging as defined in TS 23.203 | :x: | |
| 7 | Interfacing OFCS through | :x: | |
| 8 | UL and DL service level gating control | :x: | |
| 9 | UL and DL service level rate enforcement | :x: | |
| 10 | UL and DL rate enforcement based on APN-AMBR | :x: | |
| 11 | DL rate enforcement based on the accumulated MBRs of the | :x: | |
| | aggregate of SDFs with the same GBR QCI | | |
| 12 | DHCPv4 (server and client) and DHCPv6 (client and server) | :x: | |
| 13 | The network does not support PPP bearer type | :x: | |
| 14 | The PDN GW may support Non-IP data transfer | :x: | |
| 15 | Packet screening | :x: | |
| 16 | Sending of one or more "end marker(s)" to the source SGW | :x: | |
| | immediately after switching the path during SGW change | | |
| 17 | PCC related features (e.g. involving PCRF and OCS) | :x: | |
| 18 | UL and DL bearer binding as defined in TS 23.203 | :x: | |
| 19 | UL bearer binding verification as defined in TS 23.203 | :x: | |
| 20 | Functionality as defined in RFC 4861 | :x: | |
| 21 | Accounting per UE and bearer | :x: | |
<table style="border-collapse: collapse; border: none;">
<tr style="border-collapse: collapse; border: none;">
<td style="border-collapse: collapse; border: none;">
<a href="http://www.openairinterface.org/">
<img src="./images/oai_final_logo.png" alt="" border=3 height=50 width=150>
</img>
</a>
</td>
<td style="border-collapse: collapse; border: none; vertical-align: center;">
<b><font size = "5">OpenAirInterface Core Serving Gateway Feature Set</font></b>
</td>
</tr>
</table>
**Table of Contents**
1. [SGW Fundamentals](#1-sgw-fundamentals)
2. [OAI SGW Available Interfaces](#2-oai-sgw-available-interfaces)
3. [OAI SGW Conformance Functions](#3-oai-sgw-conformance-functions)
# 1. SGW Fundamentals #
(from [Wikipedia.org](https://en.wikipedia.org/wiki/System_Architecture_Evolution))
The Serving Gateway routes and forwards user data packets, while also acting as the mobility anchor for the user plane during inter-eNodeB handovers and as the anchor for mobility between LTE and other 3GPP technologies (terminating S4 interface and relaying the traffic between 2G/3G systems and PGW).
For idle state UEs, the SGW terminates the downlink data path and triggers paging when downlink data arrives for the UE.
* It manages and stores UE contexts, e.g. parameters of the IP bearer service, network internal routing information.
* It also performs replication of the user traffic in case of lawful interception.
# 2. OAI SGW Available Interfaces #
| **ID** | **Interface** | **Status** | **Comments** | **Protocols** |
| ------ | ------------- | ------------------ | ---------------------------------------------- | ------------- |
| 1 | S5 / S8 | :heavy_check_mark: | Split in control plane only | GTP-C/U |
| | | :x: | Missing split in User plane | |
| 2 | S1-U | :heavy_check_mark: | Split in control plane only | GTP-U/UDP |
| 3 | S11 | :heavy_check_mark: | S11-C only actually | GTP-C/UDP |
| 4 | S4 | :x: | No interconnection with SGSN | GTP-C/UDP |
| 5 | S12 | :x: | No interconnection with UTRAN | GTP-U/UDP |
# 3. OAI SGW Conformance Functions #
Based on document **3GPP TS 23.401 V15.5.0 §4.4.3.2**.
| **ID** | **Classification** | **Status** | **Comments** |
| ------ | ------------------------------------------------------------ | ------------------ | ---------------------------------------------- |
| 1 | Local Mobility Anchor point for inter eNodeB handover | :question: | Should be, X2HO have to be tested. |
| | (except when user data is transported using the Control | | |
| | Plane CIoT EPS optimization) | | |
| 2 | Sending sending of one or more "end marker" to | :x: | Could be requested |
| | -- the source eNodeB, | | |
| | -- the source SGSN or | | |
| | -- the source RNC | | |
| | immediately after the Serving GW switches the path during | | |
| | inter-eNodeB and inter-RAT handover(s), | | |
| | especially to assist the reordering function in eNodeB | | |
| 3 | Mobility anchoring for inter-3GPP mobility | :x: | No Support of 2G and 3G systems |
| | (terminating S4 and relaying the traffic between 2G/3G system and PDN GW) | | |
| 4 | ECM-IDLE mode downlink packet buffering and | :x: | Buffering is not supported in idle-mode |
| | initiation of network triggered service request procedure | | |
| | and optionally Paging Policy Differentiation | | |
| 5 | Lawful Interception | :x: | |
| 6 | Packet routing and forwarding | :heavy_check_mark: | |
| 7 | Transport level packet marking in the uplink & the downlink | :x: | Could be supported |
| | e.g. setting the DiffServ Code Point, based on the QCI, and | | |
| | optionally the ARP priority level, of the associated EPS bearer | | |
| 8 | Accounting for inter-operator charging. | :x: | |
| | -- For GTP based S5/S8, the SGW generates accounting data per UE and bearer | | |
| 9 | Interfacing OFCS according to charging principles and | :x: | |
| | through reference points specified in TS 32.240 | | |
| 10 | Forwarding of "end marker" to the | :x: | |
| | -- the source eNodeB, | | |
| | -- the source SGSN or | | |
| | -- the source RNC | | |
| | when the "end marker" is received from PGW and SGW has downlink user plane established. | | |
| | Upon reception of "end marker", the Serving GW shall not send Downlink Data Notification. | | |
......@@ -20,7 +20,7 @@
################################################################################
SPGW-U =
{
INSTANCE = @INSTANCE@; # 0 is the default
INSTANCE = 0; # 0 is the default
PID_DIRECTORY = "@PID_DIRECTORY@"; # /var/run is the default
#ITTI_TASKS :
......@@ -82,7 +82,7 @@ SPGW-U =
SGI :
{
# No config to set, the software will set the SGi interface to the interface used for the default route.
INTERFACE_NAME = "@SGW_INTERFACE_NAME_FOR_SGI@"; # STRING, interface name or "default_gateway"
INTERFACE_NAME = "@PGW_INTERFACE_NAME_FOR_SGI@"; # STRING, interface name or "default_gateway"
IPV4_ADDRESS = "read"; # STRING, CIDR or "read" to let app read interface configured IP address
#SCHED_PARAMS :
#{
......@@ -94,11 +94,7 @@ SPGW-U =
};
PDN_NETWORK_LIST = (
{NETWORK_IPV4 = "12.1.1.0/24"; NETWORK_IPV6 = "2001:1:2::0/64"; SNAT = "yes";},
{NETWORK_IPV4 = "12.1.2.0/24"; SNAT = "no";},
{NETWORK_IPV4 = "192.169.0.0/24"; SNAT = "no";},
{NETWORK_IPV4 = "192.170.0.0/24"; SNAT = "no";},
{NETWORK_IPV4 = "192.171.0.0/24"; SNAT = "no";}
{NETWORK_IPV4 = "@NETWORK_UE_IP@"; SNAT = "no";}
);
SPGW-C_LIST = (
......
# Build and deploying OAI-SPGW-C in OpenShift cluster #
## Pre-requisite ##
To build our images, we SHALL use the `codeready-builder-for-rhel-8-x86_64-rpms` repository with all the proper development libraries.
This repository is not directly accessible from the UBI RHEL8 image (`registry.access.redhat.com/ubi8/ubi:latest`).
So we need to copy, from a registered RHEL8 machine, certificates and subsccription manager configuration files.
On a `RHEL8` physical machine (or a virtual machine) connected to the OpenShift Cluster, recover the entitlement and the RH subscription manager configs:
```bash
oc create configmap rhsm-conf --from-file /etc/rhsm/rhsm.conf
oc create configmap rhsm-ca --from-file /etc/rhsm/ca/redhat-uep.pem
oc create secret generic etc-pki-entitlement --from-file /etc/pki/entitlement/{NUMBER_ON_YOUR_COMPUTER}.pem --from-file /etc/pki/entitlement/{NUMBER_ON_YOUR_COMPUTER}-key.pem
```
These configmaps and secret will be shared by all the build configs in your OC project. No need to do it each time.
## Launching the Build ##
On a machine connected to the OpenShift Cluster, create the target image stream and the build configuration.
Note that the project name is currently hard-coded to `oai`.
**TODO: pass as env variables: branch name, image tag and project name**
```bash
git clone https://github.com/OPENAIRINTERFACE/openair-spgwu-tiny.git
cd openair-spgwu-tiny
git checkout develop
oc apply -f openshift/oai-spgwu-tiny-image-stream.yml
oc apply -f openshift/oai-spgwu-tiny-build-config.yml
```
Note that this step has to be done once before the first build and if you modify the yaml files.
Then anytime you want to build:
```bash
oc start-build oai-spgwu-tiny-build-config --follow
```
The `--follow` might break.
```bash
oc logs build/oai-spgwu-tiny-build-config-XYZ --follow
```
where `XYZ` is the build number.
You should see a successful buid when :
```bash
...
Pushing image image-registry.openshift-image-registry.svc:5000/oai/oai-spgwu-tiny:onap-0.1.0 ...
Getting image source signatures
Copying blob sha256:087e0da17c56af1aaf0a1eba37169b46f6c46936b554b7e13f11165dac4ba8ef
...
Copying blob sha256:0adcf0e0c86fbba84ed7a22a57a2cd4d7695c1ce858dd03f03dc3002880b8061
Copying config sha256:73330dfa1a733335355324848a02ba1899f9d125559979f9911f3dedcd4450ca
Writing manifest to image destination
Storing signatures
Successfully pushed image-registry.openshift-image-registry.svc:5000/oai/oai-spgwu-tiny@sha256:c1de087af5515d22e40486fb181f6ff65a7f34788d8174aa122d686667042cf9
Push successful
```
#/*
# * 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
# */
#---------------------------------------------------------------------
#
kind: BuildConfig
apiVersion: build.openshift.io/v1
metadata:
name: "oai-spgwu-tiny-build-config"
spec:
runPolicy: "Serial"
source:
git:
uri: "https://github.com/OPENAIRINTERFACE/openair-spgwu-tiny.git"
ref: "develop"
httpProxy: http://proxy.eurecom.fr:8080
httpsProxy: https://proxy.eurecom.fr:8080
secrets:
- secret:
name: etc-pki-entitlement
destinationDir: etc-pki-entitlement
configMaps:
- configMap:
name: rhsm-conf
destinationDir: rhsm-conf
- configMap:
name: rhsm-ca
destinationDir: rhsm-ca
strategy:
dockerStrategy:
dockerfilePath: "docker/Dockerfile.rhel8-2.oc4-4"
output:
to:
kind: "ImageStreamTag"
name: "oai-spgwu-tiny:onap-0.1.0"
#/*
# * 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
# */
#
apiVersion: v1
kind: ImageStream
metadata:
name: oai-spgwu-tiny
namespace: oai
status:
tag: onap-0.1.0
#!/bin/bash
set -euo pipefail
CONFIG_DIR="/openair-spgwu-tiny/etc"
for c in ${CONFIG_DIR}/*.conf; do
# grep variable names (format: ${VAR}) from template to be rendered
VARS=$(grep -oP '@[a-zA-Z0-9_]+@' ${c} | sort | uniq | xargs)
# create sed expressions for substituting each occurrence of ${VAR}
# with the value of the environment variable "VAR"
EXPRESSIONS=""
for v in ${VARS}; do
NEW_VAR=`echo $v | sed -e "s#@##g"`
if [[ "${!NEW_VAR}x" == "x" ]]; then
echo "Error: Environment variable '${NEW_VAR}' is not set." \
"Config file '$(basename $c)' requires all of $VARS."
exit 1
fi
EXPRESSIONS="${EXPRESSIONS};s|${v}|${!NEW_VAR}|g"
done
EXPRESSIONS="${EXPRESSIONS#';'}"
# render template and inline replace config file
sed -i "${EXPRESSIONS}" ${c}
done
exec "$@"
......@@ -127,7 +127,8 @@ if (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
endif()
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
add_boolean_option(LOG_OAI True "Thread safe logging API")
SET(ASAN asan)
# Set it manually if needed: SET(ASAN asan)
SET(ASAN)
endif()
if (CMAKE_BUILD_TYPE STREQUAL "")
set(CMAKE_BUILD_TYPE "MinSizeRel")
......@@ -155,21 +156,14 @@ set(CMAKE_C_FLAGS
add_definitions(-DCMAKER)
add_definitions(-DBSTRLIB_CAN_USE_STL=1 -DBSTRLIB_CAN_USE_IOSTREAM=1 -DBSTRLIB_THROWS_EXCEPTIONS=1)
if(STATIC_LINKING)
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -g -fstack-protector-all -DMALLOC_CHECK_=3 -DINFO_IS_ON=1 -DDEBUG_IS_ON=1 -DTRACE_IS_ON=1 -O0 -fno-omit-frame-pointer")
else (STATIC_LINKING)
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -g -fstack-protector-all -DMALLOC_CHECK_=3 -DINFO_IS_ON=1 -DDEBUG_IS_ON=1 -DTRACE_IS_ON=1 -O0 -fsanitize=address -fno-omit-frame-pointer")
endif(STATIC_LINKING)
# CMAKE_C_FLAGS_DEBUG: -fsanitize=address not compatible with valgrind
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -g -fstack-protector-all -DMALLOC_CHECK_=3 -DINFO_IS_ON=1 -DDEBUG_IS_ON=1 -DTRACE_IS_ON=1 -O0 -fno-omit-frame-pointer")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} -O2 -fno-omit-frame-pointer -s -DINFO_IS_ON=1")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS} -g -O1 -DINFO_IS_ON=1 ")
set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS} -Os -s")
if(STATIC_LINKING)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -std=c++17 -g -fstack-protector-all -DMALLOC_CHECK_=3 -DINFO_IS_ON=1 -DDEBUG_IS_ON=1 -DTRACE_IS_ON=1 -O0 -fno-omit-frame-pointer")
else(STATIC_LINKING)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -std=c++17 -g -fstack-protector-all -DMALLOC_CHECK_=3 -DINFO_IS_ON=1 -DDEBUG_IS_ON=1 -DTRACE_IS_ON=1 -O0 -fsanitize=address -fno-omit-frame-pointer")
endif(STATIC_LINKING)
# CMAKE_CXX_FLAGS_DEBUG: -fsanitize=address not compatible with valgrind
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -std=c++17 -g -fstack-protector-all -DMALLOC_CHECK_=3 -DINFO_IS_ON=1 -DDEBUG_IS_ON=1 -DTRACE_IS_ON=1 -O0 -fno-omit-frame-pointer")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -std=c++17 -O2 -fno-omit-frame-pointer -s -DINFO_IS_ON=1")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS} -std=c++17 -g -O1 -DINFO_IS_ON=1")
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS} -std=c++17 -Os -s")
......
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