-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix for handling S-NSSAI * Add support for multiple slices via config file * Allowed reusing GTPv1-U socket * Fix GTPU offset sequence number * Fix configurable number of DL threads for data path * Official images produced by CI are pushed to `oaisoftwarealliance` Docker-Hub Team account * Reduce image size * Skipping release tag v1.3.0 to be in sync with OAI CN 5G network functions
Showing
36 changed files
with
527 additions
and
579 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
""" | ||
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: | ||
[email protected] | ||
""" | ||
|
||
import argparse | ||
import re | ||
import subprocess | ||
import sys | ||
|
||
def main() -> None: | ||
args = _parse_args() | ||
status = perform_flattening(args.tag) | ||
sys.exit(status) | ||
|
||
def _parse_args() -> argparse.Namespace: | ||
parser = argparse.ArgumentParser(description='Flattening Image') | ||
|
||
parser.add_argument( | ||
'--tag', '-t', | ||
action='store', | ||
required=True, | ||
help='Image Tag in image-name:image tag format', | ||
) | ||
return parser.parse_args() | ||
|
||
def perform_flattening(tag): | ||
# First detect which docker/podman command to use | ||
cli = '' | ||
image_prefix = '' | ||
cmd = 'which podman || true' | ||
podman_check = subprocess.check_output(cmd, shell=True, universal_newlines=True) | ||
if re.search('podman', podman_check.strip()): | ||
cli = 'sudo podman' | ||
image_prefix = 'localhost/' | ||
if cli == '': | ||
cmd = 'which docker || true' | ||
docker_check = subprocess.check_output(cmd, shell=True, universal_newlines=True) | ||
if re.search('docker', docker_check.strip()): | ||
cli = 'docker' | ||
image_prefix = '' | ||
if cli == '': | ||
print ('No docker / podman installed: quitting') | ||
return -1 | ||
print (f'Flattening {tag}') | ||
# Creating a container | ||
cmd = cli + ' run --name test-flatten --entrypoint /bin/true -d ' + tag | ||
print (cmd) | ||
subprocess.check_output(cmd, shell=True, universal_newlines=True) | ||
|
||
# Export / Import trick | ||
cmd = cli + ' export test-flatten | ' + cli + ' import ' | ||
# Bizarro syntax issue with podman | ||
if cli == 'docker': | ||
cmd += ' --change "ENV PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" ' | ||
else: | ||
cmd += ' --change "ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" ' | ||
cmd += ' --change "WORKDIR /openair-spgwu-tiny" ' | ||
cmd += ' --change "EXPOSE 2152/udp" ' | ||
cmd += ' --change "EXPOSE 8805/udp" ' | ||
cmd += ' --change "LABEL support-multi-sgwu-instances=\\"true\\"" ' | ||
cmd += ' --change "LABEL support-nrf-fdqn=\\"true\\"" ' | ||
cmd += ' --change "CMD [\\"/openair-spgwu-tiny/bin/oai_spgwu\\", \\"-c\\", \\"/openair-spgwu-tiny/etc/spgw_u.conf\\", \\"-o\\"]" ' | ||
cmd += ' --change "ENTRYPOINT [\\"/bin/bash\\", \\"/openair-spgwu-tiny/bin/entrypoint.sh\\"]" ' | ||
cmd += ' - ' + image_prefix + tag | ||
print (cmd) | ||
subprocess.check_output(cmd, shell=True, universal_newlines=True) | ||
|
||
# Remove container | ||
cmd = cli + ' rm -f test-flatten' | ||
print (cmd) | ||
subprocess.check_output(cmd, shell=True, universal_newlines=True) | ||
|
||
# At this point the original image is a dangling image. | ||
# CI pipeline will clean up (`image prune --force`) | ||
return 0 | ||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
--- | ||
apiVersion: build.openshift.io/v1 | ||
kind: BuildConfig | ||
metadata: | ||
name: oai-spgwu-tiny-base-builder | ||
spec: | ||
output: | ||
to: | ||
kind: ImageStreamTag | ||
name: "oai-spgwu-tiny-base-builder:oai-oc" | ||
runPolicy: Serial | ||
strategy: | ||
type: Docker | ||
source: | ||
secrets: | ||
- destinationDir: etc-pki-entitlement | ||
secret: | ||
name: etc-pki-entitlement | ||
configMaps: | ||
- configMap: | ||
name: rhsm-conf | ||
destinationDir: rhsm-conf | ||
- configMap: | ||
name: rhsm-ca | ||
destinationDir: rhsm-ca | ||
dockerfile: | | ||
################################################################ | ||
# Builder Image (can also be used as developer's image) | ||
################################################################ | ||
FROM registry.access.redhat.com/ubi8/ubi:latest as oai-spgwu-tiny-builder | ||
ARG FEATURES=mme_oai | ||
ENV MAGMA_ROOT=/magma | ||
ENV BUILD_TYPE=Debug | ||
ENV C_BUILD=/build/c | ||
ENV TZ=Europe/Paris | ||
# Entitlements and RHSM configurations are Open-Shift Secret and ConfigMaps | ||
# It is pre-requisite | ||
# 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 && \ | ||
yum repolist --disablerepo=* && \ | ||
subscription-manager repos --enable codeready-builder-for-rhel-8-x86_64-rpms \ | ||
&& yum update -y \ | ||
&& yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm \ | ||
&& yum install dnf-plugins-core -y \ | ||
&& yum install -y --enablerepo="codeready-builder-for-rhel-8-x86_64-rpms" \ | ||
# diff, cmp and file are not in the ubi??? | ||
autoconf \ | ||
automake \ | ||
binutils-devel \ | ||
bison \ | ||
boost-devel \ | ||
check \ | ||
cmake \ | ||
cppcheck \ | ||
diffutils \ | ||
double-conversion-devel \ | ||
ethtool \ | ||
file \ | ||
flex \ | ||
gcc-c++ \ | ||
gdb \ | ||
gflags-devel \ | ||
git \ | ||
glog-devel \ | ||
gmp-devel \ | ||
guile-devel \ | ||
initscripts \ | ||
iproute \ | ||
iptables \ | ||
libconfig-devel \ | ||
libcurl-devel \ | ||
libevent \ | ||
libevent-devel \ | ||
libgcrypt-devel \ | ||
libidn-devel \ | ||
libtool \ | ||
libxml2 \ | ||
libxml2-devel \ | ||
lksctp-tools \ | ||
lksctp-tools-devel \ | ||
lz4-devel \ | ||
make \ | ||
net-tools \ | ||
openssl \ | ||
openssl-devel \ | ||
pkgconfig \ | ||
procps-ng \ | ||
psmisc \ | ||
python2 \ | ||
tzdata \ | ||
wget \ | ||
zlib-devel | ||
WORKDIR / | ||
RUN wget --quiet --tries=3 --retry-connrefused https://github.com/google/googletest/archive/release-1.8.0.tar.gz \ | ||
&& tar zxf release-1.8.0.tar.gz \ | ||
&& rm -f release-1.8.0.tar.gz \ | ||
&& cd googletest-release-1.8.0 \ | ||
&& cmake . \ | ||
&& make \ | ||
&& make install | ||
RUN git clone https://github.com/facebook/folly.git \ | ||
&& cd folly \ | ||
&& git checkout -f v2019.06.17.00 \ | ||
&& echo 'diff --git a/build/fbcode_builder/CMake/FindGflags.cmake b/build/fbcode_builder/CMake/FindGflags.cmake' > patch.diff \ | ||
&& echo 'index 246ceac..3b96716 100644' >> patch.diff \ | ||
&& echo '--- a/build/fbcode_builder/CMake/FindGflags.cmake' >> patch.diff \ | ||
&& echo '+++ b/build/fbcode_builder/CMake/FindGflags.cmake' >> patch.diff \ | ||
&& echo '@@ -34,6 +34,9 @@ IF (LIBGFLAGS_INCLUDE_DIR)' >> patch.diff \ | ||
&& echo ' ENDIF ()' >> patch.diff \ | ||
&& echo '' >> patch.diff \ | ||
&& echo ' find_package(gflags CONFIG QUIET)' >> patch.diff \ | ||
&& echo '+get_filename_component (_LIB_PATH "${gflags_CONFIG}/../../../" ABSOLUTE)' >> patch.diff \ | ||
&& echo '+unset(gflags_LIBRARIES)' >> patch.diff \ | ||
&& echo '+find_library(gflags_LIBRARIES gflags PATHS ${_LIB_PATH})' >> patch.diff \ | ||
&& echo ' if (gflags_FOUND)' >> patch.diff \ | ||
&& echo ' if (NOT Gflags_FIND_QUIETLY)' >> patch.diff \ | ||
&& echo ' message(STATUS "Found gflags from package config ${gflags_CONFIG}")' >> patch.diff \ | ||
&& git apply patch.diff \ | ||
&& mkdir _build && cd _build \ | ||
&& cmake3 .. \ | ||
&& make -j $(nproc) \ | ||
&& make install | ||
RUN git clone https://github.com/gabime/spdlog.git \ | ||
&& cd spdlog && git checkout master \ | ||
&& sed -i "/#define SPDLOG_ENABLE_SYSLOG/s/^\/\///g" include/spdlog/tweakme.h | ||
RUN git clone https://github.com/nlohmann/json.git \ | ||
&& cd json && git checkout -f v3.10.3 \ | ||
&& mkdir _build && cd _build \ | ||
&& cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DJSON_BuildTests=OFF .. \ | ||
&& make \ | ||
&& make install | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
--- | ||
apiVersion: build.openshift.io/v1 | ||
kind: BuildConfig | ||
metadata: | ||
name: oai-spgwu-tiny-dev | ||
spec: | ||
output: | ||
to: | ||
kind: ImageStreamTag | ||
name: "oai-spgwu-tiny-dev:oai-oc" | ||
runPolicy: Serial | ||
strategy: | ||
type: Docker | ||
source: | ||
secrets: | ||
- destinationDir: etc-pki-entitlement | ||
secret: | ||
name: etc-pki-entitlement | ||
configMaps: | ||
- configMap: | ||
name: rhsm-conf | ||
destinationDir: rhsm-conf | ||
- configMap: | ||
name: rhsm-ca | ||
destinationDir: rhsm-ca | ||
dockerfile: | | ||
################################################################ | ||
# Builder Image (can also be used as developer's image) | ||
################################################################ | ||
FROM image-registry.openshift-image-registry.svc:5000/oai4g/oai-spgwu-tiny-base-builder:oai-oc as oai-spgwu-tiny-builder | ||
ENV TZ=Europe/Paris | ||
WORKDIR / | ||
RUN git clone -b develop https://github.com/lionelgo/openair-spgwu-tiny.git | ||
WORKDIR /openair-spgwu-tiny/build/ext | ||
RUN ln -s /spdlog /openair-spgwu-tiny/build/ext/spdlog \ | ||
&& ln -s /json /openair-spgwu-tiny/build/ext/json | ||
WORKDIR /openair-spgwu-tiny/build/scripts | ||
RUN ./build_spgwu --clean --build-type Release --jobs --Verbose \ | ||
&& ldd /openair-spgwu-tiny/build/spgw_u/build/spgwu \ | ||
&& mv /openair-spgwu-tiny/build/spgw_u/build/spgwu \ | ||
/openair-spgwu-tiny/build/spgw_u/build/oai_spgwu \ | ||
&& mkdir /openair-spgwu-tiny/bin \ | ||
&& cp /openair-spgwu-tiny/build/spgw_u/build/oai_spgwu \ | ||
/openair-spgwu-tiny/scripts/entrypoint.sh \ | ||
/openair-spgwu-tiny/bin | ||
RUN ldconfig && \ | ||
ldd /openair-spgwu-tiny/bin/oai_spgwu | ||
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"] | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
--- | ||
apiVersion: build.openshift.io/v1 | ||
kind: BuildConfig | ||
metadata: | ||
name: oai-spgwu-tiny | ||
spec: | ||
output: | ||
to: | ||
kind: ImageStreamTag | ||
name: "oai-spgwu-tiny:oai-oc" | ||
runPolicy: Serial | ||
strategy: | ||
type: Docker | ||
source: | ||
secrets: | ||
- destinationDir: etc-pki-entitlement | ||
secret: | ||
name: etc-pki-entitlement | ||
configMaps: | ||
- configMap: | ||
name: rhsm-conf | ||
destinationDir: rhsm-conf | ||
- configMap: | ||
name: rhsm-ca | ||
destinationDir: rhsm-ca | ||
dockerfile: | | ||
################################################################ | ||
# Target Image | ||
################################################################ | ||
FROM image-registry.openshift-image-registry.svc:5000/oai4g/oai-spgwu-tiny-dev:oai-oc as oai-spgwu-tiny-dev | ||
FROM registry.access.redhat.com/ubi8/ubi:latest as spgwu | ||
ENV TZ=Europe/Paris | ||
# 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" \ | ||
tzdata \ | ||
procps-ng \ | ||
psmisc \ | ||
net-tools \ | ||
ethtool \ | ||
iproute \ | ||
iptables \ | ||
initscripts \ | ||
libevent && \ | ||
yum clean all -y && \ | ||
rm -rf /var/cache/yum /var/cache/dnf | ||
# Copying executable and generated libraries | ||
WORKDIR /openair-spgwu-tiny/bin | ||
COPY --from=oai-spgwu-tiny-dev \ | ||
/openair-spgwu-tiny/build/spgw_u/build/oai_spgwu \ | ||
/openair-spgwu-tiny/scripts/entrypoint.sh \ | ||
./ | ||
# Copying installed libraries from builder | ||
COPY --from=oai-spgwu-tiny-dev \ | ||
/lib64/libgflags.so.2.1 \ | ||
/lib64/libglog.so.0 \ | ||
/lib64/libdouble-conversion.so.1 \ | ||
/lib64/libconfig++.so.9 \ | ||
/lib64/libboost_system.so.1.66.0 \ | ||
/lib64/ | ||
RUN ldconfig && \ | ||
ldd /openair-spgwu-tiny/bin/oai_spgwu | ||
# Copying template configuration files | ||
# The configuration folder will be flat | ||
WORKDIR /openair-spgwu-tiny/etc | ||
COPY --from=oai-spgwu-tiny-dev /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"] |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,7 @@ | |
|
||
#include "logger.hpp" | ||
#include "3gpp_29.510.h" | ||
#include "3gpp_23.003.h" | ||
|
||
namespace spgwu { | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters