From ea6493bfe1c30c944d8006ff040f95a5a376b1e0 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Thu, 24 Feb 2022 12:00:54 +0100 Subject: [PATCH 01/25] fix(ci): more flexible report name from child test pipelines in order to trigger the new U18 RF sim sanity check sub-pipeline Signed-off-by: Raphael Defosseux --- ci-scripts/Jenkinsfile-GitHub-Docker | 5 ++--- ci-scripts/generateHtmlReport.py | 33 ++++++++++++++-------------- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/ci-scripts/Jenkinsfile-GitHub-Docker b/ci-scripts/Jenkinsfile-GitHub-Docker index 2483766..d23d040 100644 --- a/ci-scripts/Jenkinsfile-GitHub-Docker +++ b/ci-scripts/Jenkinsfile-GitHub-Docker @@ -408,7 +408,7 @@ pipeline { always { script { copyArtifacts(projectName: params.CN_EPC_FED_PipelineName, - filter: 'test_results_oai_epc.html', + filter: 'test_results*.html', selector: lastCompleted()) } } @@ -437,7 +437,7 @@ pipeline { always { script { copyArtifacts(projectName: params.RHEL8_SanityCheck_PipelineName, - filter: 'test_results_magma_epc_rhel8.html', + filter: 'test_results*.html', selector: lastCompleted()) } } @@ -641,7 +641,6 @@ pipeline { sh "sed -i -e 's#TEMPLATE_TIME#${JOB_TIMESTAMP}#' ${htmlFile}" archiveArtifacts artifacts: htmlFile } - // Sending an email to the last committer. Maybe not the Pull Request's author. if (params.sendToCommitterEmail != null) { if (params.sendToCommitterEmail) { diff --git a/ci-scripts/generateHtmlReport.py b/ci-scripts/generateHtmlReport.py index 5c9bcdc..d055331 100644 --- a/ci-scripts/generateHtmlReport.py +++ b/ci-scripts/generateHtmlReport.py @@ -20,6 +20,7 @@ # */ #--------------------------------------------------------------------- +import glob import os import re import sys @@ -163,23 +164,21 @@ def generateHeader(self): self.file.write(buildSummary) cwd = os.getcwd() - test_reports = ['test_results_oai_epc', 'test_results_magma_epc_rhel8', \ - 'test_results_oai_cn5g_basic', 'test_results_oai_cn5g_mini', \ - 'test_results_oai_cn5g_oc', 'test_results_oai_cn5g_tutorials'] - for test in test_reports: - if os.path.isfile(cwd + '/' + test + '.html'): - newEpcReport = open(cwd + '/' + test + '_new.html', 'w') - buildSummaryDone = True - with open(cwd + '/' + test + '.html', 'r') as originalEpcReport: - for line in originalEpcReport: - result = re.search('Deployment Summary', line) - if (result is not None) and buildSummaryDone: - newEpcReport.write(buildSummary) - buildSummaryDone = False - newEpcReport.write(line) - originalEpcReport.close() - newEpcReport.close() - os.rename(cwd + '/' + test + '_new.html', cwd + '/' + test + '.html') + for reportFile in glob.glob('./*results_*.html'): + if reportFile == './test_results_oai_spgwu.html': + continue + newEpcReport = open(cwd + '/' + str(reportFile) + '.new', 'w') + buildSummaryDone = True + with open(cwd + '/' + str(reportFile), 'r') as originalEpcReport: + for line in originalEpcReport: + result = re.search('Deployment Summary', line) + if (result is not None) and buildSummaryDone: + newEpcReport.write(buildSummary) + buildSummaryDone = False + newEpcReport.write(line) + originalEpcReport.close() + newEpcReport.close() + os.rename(cwd + '/' + str(reportFile) + '.new', cwd + '/' + str(reportFile)) def generateFooter(self): self.file.write('
End of Build Report -- Copyright 2020 OpenAirInterface. All Rights Reserved.
\n') From d547576bc9d553a4cf419e8cb9c12aebc38a1963 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Thu, 24 Feb 2022 13:40:51 +0100 Subject: [PATCH 02/25] fix(ci): only on test_results HTML files Signed-off-by: Raphael Defosseux --- ci-scripts/generateHtmlReport.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-scripts/generateHtmlReport.py b/ci-scripts/generateHtmlReport.py index d055331..dd37c8a 100644 --- a/ci-scripts/generateHtmlReport.py +++ b/ci-scripts/generateHtmlReport.py @@ -164,7 +164,7 @@ def generateHeader(self): self.file.write(buildSummary) cwd = os.getcwd() - for reportFile in glob.glob('./*results_*.html'): + for reportFile in glob.glob('./test_results_*.html'): if reportFile == './test_results_oai_spgwu.html': continue newEpcReport = open(cwd + '/' + str(reportFile) + '.new', 'w') From 6439e36135f3dce9997f4dcc0b8b9a162429a839 Mon Sep 17 00:00:00 2001 From: lionelgo <29477918+lionelgo@users.noreply.github.com> Date: Wed, 9 Mar 2022 12:09:39 +0100 Subject: [PATCH 03/25] Fix configurable number of DL threads for data path Signed-off-by: lionelgo <29477918+lionelgo@users.noreply.github.com> --- src/spgwu/simpleswitch/pfcp_switch.cpp | 10 ++++++---- src/spgwu/simpleswitch/pfcp_switch.hpp | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/spgwu/simpleswitch/pfcp_switch.cpp b/src/spgwu/simpleswitch/pfcp_switch.cpp index 58ecfc2..ba632ad 100644 --- a/src/spgwu/simpleswitch/pfcp_switch.cpp +++ b/src/spgwu/simpleswitch/pfcp_switch.cpp @@ -74,7 +74,7 @@ void pfcp_switch::pdn_worker( if (iov->msg_iov.iov_base) { pfcp_session_look_up_pack_in_core( (const char*) iov->msg_iov.iov_base, iov->msg_iov.iov_len); - free_pool_->write(iov); + free_pool_->blockingWrite(iov); } else { free(iov); std::cout << "exit DL w" << id << " " << count << std::endl; @@ -89,12 +89,14 @@ void pfcp_switch::pdn_worker( } //------------------------------------------------------------------------------ void pfcp_switch::pdn_read_loop( - int sock_r, const util::thread_sched_params& sched_params) { + int sock_r, util::thread_sched_params sched_params) { uint64_t count = 0; uint64_t errors = 0; iovec_q_item_t* iov = nullptr; // struct sockaddr_in sin = {}; + // Producer should not interfere with consumer for not de-sequence IP packets + sched_params.sched_priority -=1; sched_params.apply(TASK_NONE, Logger::pfcp_switch()); while (1) { @@ -123,7 +125,7 @@ void pfcp_switch::pdn_read_loop( ++count; // std::cout << "pdn" << count << " " << nread << " bytes" << std::endl; iov->msg_iov.iov_len = nread; - work_pool_->write(iov); + work_pool_->blockingWrite(iov); iov = nullptr; } else { ++errors; @@ -386,7 +388,7 @@ pfcp_switch::pfcp_switch() threads_(16), socks_r(16), sock_w(0) { - num_threads_ = 8; + num_threads_ = spgwu_cfg.sgi.thread_rd_sched_params.thread_pool_size; int num_blocks = num_threads_ * 16; free_pool_ = new folly::MPMCQueue(num_blocks); work_pool_ = new folly::MPMCQueue(num_blocks); diff --git a/src/spgwu/simpleswitch/pfcp_switch.hpp b/src/spgwu/simpleswitch/pfcp_switch.hpp index 8557489..d77b5c6 100644 --- a/src/spgwu/simpleswitch/pfcp_switch.hpp +++ b/src/spgwu/simpleswitch/pfcp_switch.hpp @@ -97,7 +97,7 @@ class pfcp_switch { // moodycamel::ConcurrentQueue create_session_q; void pdn_worker(const int id, const util::thread_sched_params& sched_params); - void pdn_read_loop(int sock_r, const util::thread_sched_params& sched_params); + void pdn_read_loop(int sock_r, util::thread_sched_params sched_params); int create_pdn_socket( const char* const ifname, const bool promisc, int& if_index); int create_pdn_socket(const char* const ifname); From 6a1f7bcc157fb18f69687c3539f96e4abaf1f3be Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Thu, 24 Feb 2022 13:40:51 +0100 Subject: [PATCH 04/25] fix(ci): only on test_results HTML files Signed-off-by: Raphael Defosseux --- ci-scripts/generateHtmlReport.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-scripts/generateHtmlReport.py b/ci-scripts/generateHtmlReport.py index d055331..dd37c8a 100644 --- a/ci-scripts/generateHtmlReport.py +++ b/ci-scripts/generateHtmlReport.py @@ -164,7 +164,7 @@ def generateHeader(self): self.file.write(buildSummary) cwd = os.getcwd() - for reportFile in glob.glob('./*results_*.html'): + for reportFile in glob.glob('./test_results_*.html'): if reportFile == './test_results_oai_spgwu.html': continue newEpcReport = open(cwd + '/' + str(reportFile) + '.new', 'w') From 963853cec655b7f0e45127703e86c8475206fb33 Mon Sep 17 00:00:00 2001 From: kharade Date: Thu, 7 Apr 2022 12:19:22 +0200 Subject: [PATCH 05/25] gtpu offset fix seq number --- src/spgwu/simpleswitch/spgwu_s1u.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/spgwu/simpleswitch/spgwu_s1u.cpp b/src/spgwu/simpleswitch/spgwu_s1u.cpp index f78798c..58955ea 100644 --- a/src/spgwu/simpleswitch/spgwu_s1u.cpp +++ b/src/spgwu/simpleswitch/spgwu_s1u.cpp @@ -124,7 +124,7 @@ void spgwu_s1u::handle_receive( if (gtpuh->message_type == GTPU_G_PDU) { uint8_t gtp_flags = recv_buffer[GTPU_MESSAGE_FLAGS_POS_IN_UDP_PAYLOAD]; std::size_t gtp_payload_offset = GTPV1U_MSG_HEADER_MIN_SIZE; - if (gtp_flags == 0x34) gtp_payload_offset += 4; + if (gtp_flags == 0x34 || gtp_flags == 0x36) gtp_payload_offset += 4; std::size_t gtp_payload_length = be16toh(gtpuh->message_length); if (gtp_flags & 0x07) { gtp_payload_offset += 4; From cf66d92cb8eadc0ec38daedce4c45cdbf0da6e91 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Tue, 12 Apr 2022 10:06:57 +0200 Subject: [PATCH 06/25] feat(ci): adding a script to test flattening image Signed-off-by: Raphael Defosseux --- ci-scripts/Jenkinsfile-GitHub-Docker | 6 ++++ ci-scripts/flatten_image.py | 42 ++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 ci-scripts/flatten_image.py diff --git a/ci-scripts/Jenkinsfile-GitHub-Docker b/ci-scripts/Jenkinsfile-GitHub-Docker index d23d040..0750437 100644 --- a/ci-scripts/Jenkinsfile-GitHub-Docker +++ b/ci-scripts/Jenkinsfile-GitHub-Docker @@ -153,6 +153,9 @@ pipeline { } myShCmd('docker image prune --force', rem_u18_host_flag, rem_u18_host_user, rem_u18_host) myShCmd('docker build --no-cache --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', rem_u18_host_flag, rem_u18_host_user, rem_u18_host) + // Putting a place holder to try out on the flattening of image. + // If not satisfactory, we can remove it. + myShCmd('python3 ./ci-scripts/flatten_image.py --tag oai-spgwu-tiny:' + spgwu_tag, rem_u18_host_flag, rem_u18_host_user, rem_u18_host) myShCmd('docker image ls >> archives/spgwu_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 (env.ghprbPullId != null) { @@ -194,6 +197,9 @@ pipeline { myShCmd('sudo cp /etc/rhsm/rhsm.conf ./rhsm-conf', rem_rhel_host_flag, rem_rhel_host_user, rem_rhel_host) myShCmd('sudo cp /etc/rhsm/ca/*pem ./rhsm-ca', rem_rhel_host_flag, rem_rhel_host_user, rem_rhel_host) myShCmd('sudo podman build --no-cache --target oai-spgwu-tiny --tag oai-spgwu-tiny:' + spgwu_tag + ' --file docker/Dockerfile.rhel8 --build-arg EURECOM_PROXY="http://proxy.eurecom.fr:8080" . > archives/spgwu_podman_image_build.log 2>&1', rem_rhel_host_flag, rem_rhel_host_user, rem_rhel_host) + // Putting a place holder to try out on the flattening of image. + // If not satisfactory, we can remove it. + myShCmd('python3 ./ci-scripts/flatten_image.py --tag oai-spgwu-tiny:' + spgwu_tag, rem_rhel_host_flag, rem_rhel_host_user, rem_rhel_host) myShCmd('sudo podman image ls >> archives/spgwu_podman_image_build.log', rem_rhel_host_flag, rem_rhel_host_user, rem_rhel_host) if (env.ghprbPullId != null) { myShCmd('sudo podman image tag oai-spgwu-tiny:' + spgwu_tag + ' oai-spgwu-tiny:' + rhel_spgwu_tag, rem_rhel_host_flag, rem_rhel_host_user, rem_rhel_host) diff --git a/ci-scripts/flatten_image.py b/ci-scripts/flatten_image.py new file mode 100644 index 0000000..a83155b --- /dev/null +++ b/ci-scripts/flatten_image.py @@ -0,0 +1,42 @@ +""" + 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 +""" + +import argparse +import sys + +def main() -> None: + args = _parse_args() + print (f'Does nothing for the moment on {args.tag}') + sys.exit(0) + +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() + +if __name__ == '__main__': + main() From 1de1cccb09270e9d73c646e781dc064d74663d99 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Tue, 19 Apr 2022 16:29:50 +0200 Subject: [PATCH 07/25] fix(ci): no more proxy required in the new Eurecom infra Signed-off-by: Raphael Defosseux --- ci-scripts/Jenkinsfile-GitHub-Docker | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ci-scripts/Jenkinsfile-GitHub-Docker b/ci-scripts/Jenkinsfile-GitHub-Docker index 0750437..0298235 100644 --- a/ci-scripts/Jenkinsfile-GitHub-Docker +++ b/ci-scripts/Jenkinsfile-GitHub-Docker @@ -107,7 +107,6 @@ pipeline { echo "PR ID is ${env.ghprbPullId}" echo "PR LINK is ${env.ghprbPullLink}" echo "PR TITLE is ${env.ghprbPullTitle}" - sh "git fetch --prune --unshallow" shortenShaOne = sh returnStdout: true, script: 'git log -1 --pretty=format:"%h" ' + env.ghprbActualCommit shortenShaOne = shortenShaOne.trim() sh "./ci-scripts/doGitHubPullRequestTempMerge.sh --src-branch ${env.ghprbSourceBranch} --src-commit ${env.ghprbActualCommit} --target-branch ${env.ghprbTargetBranch} --target-commit ${GIT_COMMIT}" @@ -152,7 +151,7 @@ pipeline { myShCmd('docker image rm oai-spgwu-tiny:' + spgwu_tag + ' || true', rem_u18_host_flag, rem_u18_host_user, rem_u18_host) } myShCmd('docker image prune --force', rem_u18_host_flag, rem_u18_host_user, rem_u18_host) - myShCmd('docker build --no-cache --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', rem_u18_host_flag, rem_u18_host_user, rem_u18_host) + myShCmd('docker build --no-cache --target oai-spgwu-tiny --tag oai-spgwu-tiny:' + spgwu_tag + ' --file docker/Dockerfile.ubuntu18.04 . > archives/spgwu_docker_image_build.log 2>&1', rem_u18_host_flag, rem_u18_host_user, rem_u18_host) // Putting a place holder to try out on the flattening of image. // If not satisfactory, we can remove it. myShCmd('python3 ./ci-scripts/flatten_image.py --tag oai-spgwu-tiny:' + spgwu_tag, rem_u18_host_flag, rem_u18_host_user, rem_u18_host) @@ -196,7 +195,7 @@ pipeline { myShCmd('cp /etc/pki/entitlement/*pem ./etc-pki-entitlement', rem_rhel_host_flag, rem_rhel_host_user, rem_rhel_host) myShCmd('sudo cp /etc/rhsm/rhsm.conf ./rhsm-conf', rem_rhel_host_flag, rem_rhel_host_user, rem_rhel_host) myShCmd('sudo cp /etc/rhsm/ca/*pem ./rhsm-ca', rem_rhel_host_flag, rem_rhel_host_user, rem_rhel_host) - myShCmd('sudo podman build --no-cache --target oai-spgwu-tiny --tag oai-spgwu-tiny:' + spgwu_tag + ' --file docker/Dockerfile.rhel8 --build-arg EURECOM_PROXY="http://proxy.eurecom.fr:8080" . > archives/spgwu_podman_image_build.log 2>&1', rem_rhel_host_flag, rem_rhel_host_user, rem_rhel_host) + myShCmd('sudo podman build --no-cache --target oai-spgwu-tiny --tag oai-spgwu-tiny:' + spgwu_tag + ' --file docker/Dockerfile.rhel8 . > archives/spgwu_podman_image_build.log 2>&1', rem_rhel_host_flag, rem_rhel_host_user, rem_rhel_host) // Putting a place holder to try out on the flattening of image. // If not satisfactory, we can remove it. myShCmd('python3 ./ci-scripts/flatten_image.py --tag oai-spgwu-tiny:' + spgwu_tag, rem_rhel_host_flag, rem_rhel_host_user, rem_rhel_host) From 6e4becd892b90815685ddefac992a1844e737de0 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Wed, 20 Apr 2022 09:49:33 +0200 Subject: [PATCH 08/25] fix(clang-format): git setup to be done in CI case Signed-off-by: Raphael Defosseux --- ci-scripts/checkCodingFormattingRules.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ci-scripts/checkCodingFormattingRules.sh b/ci-scripts/checkCodingFormattingRules.sh index 01b3671..d0ffff3 100755 --- a/ci-scripts/checkCodingFormattingRules.sh +++ b/ci-scripts/checkCodingFormattingRules.sh @@ -139,6 +139,16 @@ then exit 1 fi +# When running in a container, in /home folder +IS_CONTAINER=`egrep -c "docker|kubepods|podman|buildah|libpod" /proc/self/cgroup || true` +if [ $IS_CONTAINER -ne 0 ] +then + if [ $PWD = "/home/src" ] + then + git config --global --add safe.directory /home + fi +fi + # Merge request scenario MERGE_COMMMIT=`git log -n1 --pretty=format:%H` From 9bb6ac9bf6960735a298b3cdf1c515eea54a394b Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Wed, 13 Apr 2022 14:48:09 +0200 Subject: [PATCH 09/25] feat(ci): flatten image to one layer to reduce image to the max Signed-off-by: Raphael Defosseux --- ci-scripts/flatten_image.py | 57 ++++++++++++++++++++++++++++++-- ci-scripts/generateHtmlReport.py | 2 +- docker/Dockerfile.rhel8 | 2 +- docker/Dockerfile.ubuntu18.04 | 3 +- 4 files changed, 59 insertions(+), 5 deletions(-) diff --git a/ci-scripts/flatten_image.py b/ci-scripts/flatten_image.py index a83155b..f43c270 100644 --- a/ci-scripts/flatten_image.py +++ b/ci-scripts/flatten_image.py @@ -20,12 +20,14 @@ """ import argparse +import re +import subprocess import sys def main() -> None: args = _parse_args() - print (f'Does nothing for the moment on {args.tag}') - sys.exit(0) + status = perform_flattening(args.tag) + sys.exit(status) def _parse_args() -> argparse.Namespace: parser = argparse.ArgumentParser(description='Flattening Image') @@ -38,5 +40,56 @@ def _parse_args() -> argparse.Namespace: ) 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() diff --git a/ci-scripts/generateHtmlReport.py b/ci-scripts/generateHtmlReport.py index dd37c8a..9e91552 100644 --- a/ci-scripts/generateHtmlReport.py +++ b/ci-scripts/generateHtmlReport.py @@ -747,7 +747,7 @@ def analyze_image_size_log(self, nfType): result = re.search('oai-spgwu-tiny *ci-temp', line) else: result = re.search('oai-spgwu-tiny *develop', line) - if result is not None: + if result is not None and not status: result = re.search('ago *([0-9 A-Z]+)', line) if result is not None: size = result.group(1) diff --git a/docker/Dockerfile.rhel8 b/docker/Dockerfile.rhel8 index fd4b3b0..f93ce25 100644 --- a/docker/Dockerfile.rhel8 +++ b/docker/Dockerfile.rhel8 @@ -81,7 +81,7 @@ RUN yum update -y && \ initscripts \ libevent && \ yum clean all -y && \ - rm -rf /var/cache/yum + rm -rf /var/cache/yum /var/cache/dnf # Copying executable and generated libraries WORKDIR /openair-spgwu-tiny/bin diff --git a/docker/Dockerfile.ubuntu18.04 b/docker/Dockerfile.ubuntu18.04 index 93c5796..5736e3b 100644 --- a/docker/Dockerfile.ubuntu18.04 +++ b/docker/Dockerfile.ubuntu18.04 @@ -75,8 +75,8 @@ RUN apt-get update && \ iproute2 \ ethtool \ iptables \ - tshark \ perl \ + libgssapi-krb5-2 \ libldap-2.4-2 \ libgoogle-glog0v5 \ libdouble-conversion1 \ @@ -93,6 +93,7 @@ COPY --from=oai-spgwu-tiny-builder \ WORKDIR /usr/local/lib COPY --from=oai-spgwu-tiny-builder \ /usr/lib/libboost_system.so.1.67.0 \ + /usr/lib/x86_64-linux-gnu/libnghttp2.so.14 \ /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4 \ /usr/lib/x86_64-linux-gnu/librtmp.so.1 \ /usr/lib/x86_64-linux-gnu/libpsl.so.5 \ From 85d4d91c50828e93225e33a0e0a5192003c574af Mon Sep 17 00:00:00 2001 From: kharade Date: Wed, 27 Apr 2022 09:41:54 +0200 Subject: [PATCH 10/25] defined constants for flags --- src/spgwu/simpleswitch/spgwu_s1u.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/spgwu/simpleswitch/spgwu_s1u.cpp b/src/spgwu/simpleswitch/spgwu_s1u.cpp index 58955ea..25fb2ba 100644 --- a/src/spgwu/simpleswitch/spgwu_s1u.cpp +++ b/src/spgwu/simpleswitch/spgwu_s1u.cpp @@ -116,6 +116,9 @@ void spgwu_s1u::handle_receive( char* recv_buffer, const std::size_t bytes_transferred, const endpoint& r_endpoint) { #define GTPU_MESSAGE_FLAGS_POS_IN_UDP_PAYLOAD 0 +#define GTPU_MESSAGE_EXT_HEADER_FLAG 0x34 +#define GTPU_MESSAGE_SEQN_FLAG 0x36 +#define GTPU_MESSAGE_PRIME_FLAG 0x07 // auto start = std::chrono::high_resolution_clock::now(); struct gtpuhdr* gtpuh = (struct gtpuhdr*) &recv_buffer[0]; @@ -124,9 +127,11 @@ void spgwu_s1u::handle_receive( if (gtpuh->message_type == GTPU_G_PDU) { uint8_t gtp_flags = recv_buffer[GTPU_MESSAGE_FLAGS_POS_IN_UDP_PAYLOAD]; std::size_t gtp_payload_offset = GTPV1U_MSG_HEADER_MIN_SIZE; - if (gtp_flags == 0x34 || gtp_flags == 0x36) gtp_payload_offset += 4; + if (gtp_flags == GTPU_MESSAGE_EXT_HEADER_FLAG || + gtp_flags == GTPU_MESSAGE_SEQN_FLAG) + gtp_payload_offset += 4; std::size_t gtp_payload_length = be16toh(gtpuh->message_length); - if (gtp_flags & 0x07) { + if (gtp_flags & GTPU_MESSAGE_PRIME_FLAG) { gtp_payload_offset += 4; gtp_payload_length -= 4; } From e67041868b74521066e17ce0e25ec748c138a537 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Thu, 28 Apr 2022 15:48:36 +0200 Subject: [PATCH 11/25] fix(ci): changing the Docker Hub account to push to Signed-off-by: Raphael Defosseux --- ci-scripts/Jenkinsfile-GitHub-Docker | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ci-scripts/Jenkinsfile-GitHub-Docker b/ci-scripts/Jenkinsfile-GitHub-Docker index 0298235..be3139d 100644 --- a/ci-scripts/Jenkinsfile-GitHub-Docker +++ b/ci-scripts/Jenkinsfile-GitHub-Docker @@ -52,6 +52,9 @@ def rem_rhel8_resource = params.PodmanContainers def spgwu_tag = 'develop' def spgwu_branch = 'develop' +// Docker Hub account to push to +def DH_Account = "oaisoftwarealliance" + //------------------------------------------------------------------------------- // Pipeline start pipeline { @@ -546,9 +549,9 @@ pipeline { [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.DockerHubCredentials}", usernameVariable: 'DH_Username', passwordVariable: 'DH_Password'] ]) { myShCmd("echo ${DH_Password} | docker login --username ${DH_Username} --password-stdin", rem_u18_host_flag, rem_u18_host_user, rem_u18_host) - myShCmd("docker image tag oai-spgwu-tiny:develop ${DH_Username}/oai-spgwu-tiny:develop", rem_u18_host_flag, rem_u18_host_user, rem_u18_host) - myShCmd("docker push ${DH_Username}/oai-spgwu-tiny:develop", rem_u18_host_flag, rem_u18_host_user, rem_u18_host) - myShCmd("docker rmi ${DH_Username}/oai-spgwu-tiny:develop", rem_u18_host_flag, rem_u18_host_user, rem_u18_host) + myShCmd("docker image tag oai-spgwu-tiny:develop ${DH_Account}/oai-spgwu-tiny:develop", rem_u18_host_flag, rem_u18_host_user, rem_u18_host) + myShCmd("docker push ${DH_Account}/oai-spgwu-tiny:develop", rem_u18_host_flag, rem_u18_host_user, rem_u18_host) + myShCmd("docker rmi ${DH_Account}/oai-spgwu-tiny:develop", rem_u18_host_flag, rem_u18_host_user, rem_u18_host) myShCmd("docker logout", rem_u18_host_flag, rem_u18_host_user, rem_u18_host) } } From ab33f409e082910078a88a19e060b385d7e9561d Mon Sep 17 00:00:00 2001 From: kharade Date: Tue, 3 May 2022 13:32:43 +0200 Subject: [PATCH 12/25] code rearrange --- src/gtpv1u/gtpu.h | 8 +++++++- src/spgwu/simpleswitch/spgwu_s1u.cpp | 12 ++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/gtpv1u/gtpu.h b/src/gtpv1u/gtpu.h index 88352ba..254600c 100644 --- a/src/gtpv1u/gtpu.h +++ b/src/gtpv1u/gtpu.h @@ -31,6 +31,12 @@ #include #include +#define GTPU_MESSAGE_PN_MASK 0x1 +#define GTPU_MESSAGE_SN_MASK 0x2 +#define GTPU_MESSAGE_EXT_HEADER_MASK 0x4 +#define GTPU_MESSAGE_PT_MASK 0x10 +#define GTPU_MESSAGE_VERSION_MASK 0xE + struct gtpuhdr { #if __BYTE_ORDER == __LITTLE_ENDIAN unsigned int pn : 1; @@ -90,4 +96,4 @@ struct gtpu_extn_pdu_session_container { // Next Extension Header Type - This field defines the type of Extension // Header that follows this field in the GTP-PDU uint8_t next_ext_type; -}; \ No newline at end of file +}; diff --git a/src/spgwu/simpleswitch/spgwu_s1u.cpp b/src/spgwu/simpleswitch/spgwu_s1u.cpp index 25fb2ba..d7307d3 100644 --- a/src/spgwu/simpleswitch/spgwu_s1u.cpp +++ b/src/spgwu/simpleswitch/spgwu_s1u.cpp @@ -116,9 +116,6 @@ void spgwu_s1u::handle_receive( char* recv_buffer, const std::size_t bytes_transferred, const endpoint& r_endpoint) { #define GTPU_MESSAGE_FLAGS_POS_IN_UDP_PAYLOAD 0 -#define GTPU_MESSAGE_EXT_HEADER_FLAG 0x34 -#define GTPU_MESSAGE_SEQN_FLAG 0x36 -#define GTPU_MESSAGE_PRIME_FLAG 0x07 // auto start = std::chrono::high_resolution_clock::now(); struct gtpuhdr* gtpuh = (struct gtpuhdr*) &recv_buffer[0]; @@ -127,11 +124,14 @@ void spgwu_s1u::handle_receive( if (gtpuh->message_type == GTPU_G_PDU) { uint8_t gtp_flags = recv_buffer[GTPU_MESSAGE_FLAGS_POS_IN_UDP_PAYLOAD]; std::size_t gtp_payload_offset = GTPV1U_MSG_HEADER_MIN_SIZE; - if (gtp_flags == GTPU_MESSAGE_EXT_HEADER_FLAG || - gtp_flags == GTPU_MESSAGE_SEQN_FLAG) + if ((((gtp_flags & GTPU_MESSAGE_VERSION_MASK)) && + (gtp_flags & GTPU_MESSAGE_PT_MASK)) && + ((gtp_flags & GTPU_MESSAGE_EXT_HEADER_MASK) || + (gtp_flags & GTPU_MESSAGE_SN_MASK) || + (gtp_flags & GTPU_MESSAGE_PN_MASK))) gtp_payload_offset += 4; std::size_t gtp_payload_length = be16toh(gtpuh->message_length); - if (gtp_flags & GTPU_MESSAGE_PRIME_FLAG) { + if (gtp_flags & 0x07) { gtp_payload_offset += 4; gtp_payload_length -= 4; } From fdea280bd454506c9258712d1d4f4c32d7c7b1d1 Mon Sep 17 00:00:00 2001 From: lionelgo <29477918+lionelgo@users.noreply.github.com> Date: Thu, 5 May 2022 13:48:07 +0200 Subject: [PATCH 13/25] set GTPV1U socket option to REUSE_PORT Signed-off-by: lionelgo <29477918+lionelgo@users.noreply.github.com> --- src/udp/udp.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/udp/udp.cpp b/src/udp/udp.cpp index 89df6e5..e1b5d34 100644 --- a/src/udp/udp.cpp +++ b/src/udp/udp.cpp @@ -135,6 +135,15 @@ int udp_server::create_socket( return errno; } + int on = 1; + if (setsockopt(sd, SOL_SOCKET, SO_REUSEPORT, &on, sizeof(on)) < 0) { + /* + * Reuse port has failed... + */ + Logger::udp().error("Socket option reuse port failed (%s)\n", strerror(errno)); + return errno; + } + addr.sin_family = AF_INET; addr.sin_port = htons(port); addr.sin_addr.s_addr = address.s_addr; From d10e019b8ec5205d562d727edb649853ab8cd126 Mon Sep 17 00:00:00 2001 From: sagar arora Date: Tue, 10 May 2022 16:35:13 +0200 Subject: [PATCH 14/25] [CI] Cmake3 package issue - Earlier cmake3 command was there in the container but now we have to install it. - We are doing the same thing for other 5GCN NF --- docker/Dockerfile.rhel8 | 1 + 1 file changed, 1 insertion(+) diff --git a/docker/Dockerfile.rhel8 b/docker/Dockerfile.rhel8 index f93ce25..732e073 100644 --- a/docker/Dockerfile.rhel8 +++ b/docker/Dockerfile.rhel8 @@ -49,6 +49,7 @@ RUN rm /etc/rhsm-host && \ # diff, cmp and file are not in the ubi??? diffutils \ file \ + cmake3 \ psmisc \ git From fe242896fddb6f91d2b1c007cbac126b1b61f360 Mon Sep 17 00:00:00 2001 From: sagar arora Date: Wed, 11 May 2022 10:05:01 +0200 Subject: [PATCH 15/25] [CI] Bump up the version of UBI8 to 8.6 - Deprecate centos - cleaning of dockerfiles and openshift files - Include bc and is from lionel --- build/scripts/build_helper | 6 +- build/scripts/build_helper.spgw | 8 +- docker/Dockerfile.centos8 | 101 ------------ docker/Dockerfile.debug.centos8 | 67 -------- docker/Dockerfile.debug.centos8.3dparty | 73 --------- docker/Dockerfile.rhel8 | 2 - openshift/bc-base-builder.yaml | 146 ++++++++++++++++++ openshift/bc-dev.yaml | 60 +++++++ openshift/bc-target.yaml | 79 ++++++++++ .../build-config.debug.centos8.3dparty.yml | 52 ------- openshift/build-config.debug.centos8.yml | 55 ------- openshift/build_image.debug.centos8 | 50 ------ openshift/build_image.debug.centos8.3dparty | 50 ------ ...pgwu-tiny-image-stream.yml => is-base.yml} | 11 +- ...m.debug.centos8.3dparty.yml => is-dev.yml} | 11 +- ...stream.debug.centos8.yml => is-target.yml} | 8 +- openshift/oai-spgwu-tiny-build-config.yml | 52 ------- 17 files changed, 308 insertions(+), 523 deletions(-) delete mode 100644 docker/Dockerfile.centos8 delete mode 100644 docker/Dockerfile.debug.centos8 delete mode 100644 docker/Dockerfile.debug.centos8.3dparty create mode 100644 openshift/bc-base-builder.yaml create mode 100644 openshift/bc-dev.yaml create mode 100644 openshift/bc-target.yaml delete mode 100644 openshift/build-config.debug.centos8.3dparty.yml delete mode 100644 openshift/build-config.debug.centos8.yml delete mode 100755 openshift/build_image.debug.centos8 delete mode 100755 openshift/build_image.debug.centos8.3dparty rename openshift/{oai-spgwu-tiny-image-stream.yml => is-base.yml} (87%) rename openshift/{image-stream.debug.centos8.3dparty.yml => is-dev.yml} (90%) rename openshift/{image-stream.debug.centos8.yml => is-target.yml} (92%) delete mode 100644 openshift/oai-spgwu-tiny-build-config.yml diff --git a/build/scripts/build_helper b/build/scripts/build_helper index 437acd8..6365ecf 100644 --- a/build/scripts/build_helper +++ b/build/scripts/build_helper @@ -33,7 +33,6 @@ OS_RELEASE=$(grep "^VERSION_ID=" /etc/os-release | sed "s/VERSION_ID=//" | sed " case "$OS_DISTRO" in fedora) OS_BASEDISTRO="fedora"; INSTALLER="dnf"; CMAKE="cmake" ;; rhel) OS_BASEDISTRO="fedora"; INSTALLER="yum"; CMAKE="cmake3" ;; - centos) OS_BASEDISTRO="fedora"; INSTALLER="yum"; CMAKE="cmake3" ;; debian) OS_BASEDISTRO="debian"; INSTALLER="apt-get"; CMAKE="cmake" ;; ubuntu) OS_BASEDISTRO="debian"; INSTALLER="apt-get"; CMAKE="cmake" ;; esac @@ -132,7 +131,8 @@ check_supported_distribution() { "rhel8.3") return 0 ;; "rhel8.4") return 0 ;; "rhel8.5") return 0 ;; - "centos8") return 0 ;; + "rhel8.6") return 0 ;; + esac return 1 } @@ -284,7 +284,7 @@ update_package_db() { check_enable_epel_repos() { # on Enterprise Linuxes, ensure EPEL repos are installed # (provides: libidn2-devel, vconfig, iperf, phpMyAdmin, dkms, ...) - if [[ "$OS_DISTRO" == "rhel" ]] || [[ "$OS_DISTRO" == "centos" ]]; then + if [[ "$OS_DISTRO" == "rhel" ]] ; then if rpm -q epel-release > /dev/null; then echo "EPEL repos already present. Good." else diff --git a/build/scripts/build_helper.spgw b/build/scripts/build_helper.spgw index a9034b6..66691b0 100644 --- a/build/scripts/build_helper.spgw +++ b/build/scripts/build_helper.spgw @@ -55,7 +55,7 @@ install_fmt() { git clone https://github.com/fmtlib/fmt.git ret=$?;[[ $ret -ne 0 ]] && return $ret cd fmt - cmake . + $CMAKE . ret=$?;[[ $ret -ne 0 ]] && return $ret make -j `nproc` ret=$?;[[ $ret -ne 0 ]] && return $ret @@ -140,9 +140,9 @@ install_nlohmann_from_git() { ret=$?;[[ $ret -ne 0 ]] && popd && return $ret mkdir _build && cd _build if [[ "$OS_BASEDISTRO" == "fedora" ]]; then - cmake3 -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DJSON_BuildTests=OFF .. + $CMAKE -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DJSON_BuildTests=OFF .. else - cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DJSON_BuildTests=OFF .. + $CMAKE -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DJSON_BuildTests=OFF .. fi ret=$?;[[ $ret -ne 0 ]] && popd && return $ret make @@ -195,7 +195,7 @@ check_install_spgwu_deps() { automake \ bison \ build-essential \ - cmake \ + $CMAKE \ doxygen \ flex \ gdb \ diff --git a/docker/Dockerfile.centos8 b/docker/Dockerfile.centos8 deleted file mode 100644 index 3c80768..0000000 --- a/docker/Dockerfile.centos8 +++ /dev/null @@ -1,101 +0,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 -# */ -#--------------------------------------------------------------------- -# -# 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 develop /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 Release --jobs --Verbose - -#--------------------------------------------------------------------- -# TARGET IMAGE -#--------------------------------------------------------------------- -FROM centos:8 as oai-spgwu-tiny -ENV TZ=Europe/Paris -# 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 \ - tzdata \ - psmisc \ - net-tools \ - tcpdump \ - iptables \ - ethtool \ - glog \ - double-conversion \ - libconfig \ - libevent \ - boost-system \ - && 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 diff --git a/docker/Dockerfile.debug.centos8 b/docker/Dockerfile.debug.centos8 deleted file mode 100644 index e343f50..0000000 --- a/docker/Dockerfile.debug.centos8 +++ /dev/null @@ -1,67 +0,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 -# */ -#--------------------------------------------------------------------- -# -# Dockerfile for the Open-Air-Interface SPGW-U-TINY service -# Valid for CentOS 8 -# -#--------------------------------------------------------------------- - -#--------------------------------------------------------------------- -# BUILDER IMAGE -#--------------------------------------------------------------------- -FROM oai-spgwu-tiny:centos8-spgwu-debug-3rd-party as centos8-spgwu-debug - - -# Some GIT configuration command quite useful -RUN /bin/bash -c "if [[ -v HTTP_PROXY ]]; then git config --global http.proxy $HTTP_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 - -COPY ./ /openair-spgwu-tiny - -# Installing and Building SPGW-U -WORKDIR /openair-spgwu-tiny/build/scripts -RUN ./build_spgwu --clean --build-type Debug --jobs --Verbose - -# Copying executable and generated libraries -WORKDIR /openair-spgwu-tiny/bin -RUN cp /openair-spgwu-tiny/build/spgw_u/build/spgwu oai_spgwu \ - && cp /openair-spgwu-tiny/scripts/entrypoint.sh . \ - && cp /openair-spgwu-tiny/build/spgw_u/build/spgwu /openair-spgwu-tiny/bin/oai_spgwu.deb - -# WORKDIR /openair-spgwu-tiny/build/scripts -# RUN ./build_spgwu --clean --build-type Release --jobs --Verbose && \ -# cp /openair-spgwu-tiny/build/spgw_u/build/spgwu /openair-spgwu-tiny/bin/oai_spgwu.rel && \ -# ./build_spgwu --clean --build-type RelWithDebInfo --jobs --Verbose && \ -# cp /openair-spgwu-tiny/build/spgw_u/build/spgwu /openair-spgwu-tiny/bin/oai_spgwu.red && \ -# ./build_spgwu --clean --build-type MinSizeRel --jobs --Verbose && \ -# cp /openair-spgwu-tiny/build/spgw_u/build/spgwu /openair-spgwu-tiny/bin/oai_spgwu.min - -WORKDIR /openair-spgwu-tiny - -# expose ports -EXPOSE 2152/udp 8805/udp 22/tcp - - -CMD ["/openair-spgwu-tiny/bin/oai_spgwu", "-c", "/openair-spgwu-tiny/etc/spgw_u.conf", "-o"] -ENTRYPOINT ["/openair-spgwu-tiny/bin/entrypoint.sh"] diff --git a/docker/Dockerfile.debug.centos8.3dparty b/docker/Dockerfile.debug.centos8.3dparty deleted file mode 100644 index 21f33ca..0000000 --- a/docker/Dockerfile.debug.centos8.3dparty +++ /dev/null @@ -1,73 +0,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 -# */ -#--------------------------------------------------------------------- -# -# Dockerfile for the Open-Air-Interface SPGW-U-TINY service -# Valid for CentOS 8 -# -#--------------------------------------------------------------------- - -#--------------------------------------------------------------------- -# BUILDER IMAGE -#--------------------------------------------------------------------- -FROM centos:8 as centos8-spgwu-debug-3rd-party - -ARG HTTP_PROXY - -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 \ - iptables \ - ethtool \ - glog \ - double-conversion \ - libconfig \ - libevent \ - boost-system \ - # debugging - gdb \ - valgrind \ - diffutils \ - iputils \ - tree \ - tcpdump \ - wireshark-cli \ - net-tools \ - openssh-server \ - procps-ng \ - && yum clean all -y \ - && rm -rf /var/cache/yum - -# Some GIT configuration command quite useful -RUN /bin/bash -c "if [[ -v HTTP_PROXY ]]; then git config --global http.proxy $HTTP_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 - -COPY ./ /openair-spgwu-tiny - -# Installing and Building SPGW-U -WORKDIR /openair-spgwu-tiny/build/scripts -RUN ./build_spgwu --install-deps --force diff --git a/docker/Dockerfile.rhel8 b/docker/Dockerfile.rhel8 index 732e073..b30e028 100644 --- a/docker/Dockerfile.rhel8 +++ b/docker/Dockerfile.rhel8 @@ -46,10 +46,8 @@ RUN rm /etc/rhsm-host && \ 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 \ - cmake3 \ psmisc \ git diff --git a/openshift/bc-base-builder.yaml b/openshift/bc-base-builder.yaml new file mode 100644 index 0000000..452a205 --- /dev/null +++ b/openshift/bc-base-builder.yaml @@ -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 + + diff --git a/openshift/bc-dev.yaml b/openshift/bc-dev.yaml new file mode 100644 index 0000000..7a37640 --- /dev/null +++ b/openshift/bc-dev.yaml @@ -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"] + \ No newline at end of file diff --git a/openshift/bc-target.yaml b/openshift/bc-target.yaml new file mode 100644 index 0000000..6541d65 --- /dev/null +++ b/openshift/bc-target.yaml @@ -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"] diff --git a/openshift/build-config.debug.centos8.3dparty.yml b/openshift/build-config.debug.centos8.3dparty.yml deleted file mode 100644 index 3181909..0000000 --- a/openshift/build-config.debug.centos8.3dparty.yml +++ /dev/null @@ -1,52 +0,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 -# */ -#--------------------------------------------------------------------- -# -kind: BuildConfig -apiVersion: build.openshift.io/v1 -metadata: - name: "spgwu-tiny-debug-centos8-3dparty" -spec: - runPolicy: "Serial" - source: - git: - uri: "https://github.com/OPENAIRINTERFACE/openair-spgwu-tiny.git" - ref: "Dockerfile-centos8" - 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.debug.centos8.3dparty" - output: - to: - kind: "ImageStreamTag" - name: "oai-spgwu-tiny:debug-centos8-3rd-party" diff --git a/openshift/build-config.debug.centos8.yml b/openshift/build-config.debug.centos8.yml deleted file mode 100644 index 0bd2a11..0000000 --- a/openshift/build-config.debug.centos8.yml +++ /dev/null @@ -1,55 +0,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 -# */ -#--------------------------------------------------------------------- -# -kind: BuildConfig -apiVersion: build.openshift.io/v1 -metadata: - name: "spgwu-tiny-debug-centos8" -spec: - runPolicy: "Serial" - source: - git: - uri: "https://github.com/lionelgo/openair-spgwu-tiny.git" - ref: "multi-spgwu" - 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.debug.centos8" - from: - kind: "ImageStreamTag" - name: "oai-spgwu-tiny:debug-centos8-3rd-party" - output: - to: - kind: "ImageStreamTag" - name: "oai-spgwu-tiny:multi-spgwu" diff --git a/openshift/build_image.debug.centos8 b/openshift/build_image.debug.centos8 deleted file mode 100755 index 0615c9c..0000000 --- a/openshift/build_image.debug.centos8 +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash -################################################################################ -# 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 Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 -# -# 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 -################################################################################ -# file build_image.debug.centos8 -# brief -# author Lionel Gauthier -# company Eurecom -# email: lionel.gauthier@eurecom.fr -# - -set -o pipefail - -THIS_SCRIPT_PATH=$(dirname $(readlink -f $0)) - -function main() -{ - oc apply -f $THIS_SCRIPT_PATH/build-config.debug.centos8.yml - if [[ $? -ne 0 ]]; then - echo "Error: oc apply -f $THIS_SCRIPT_PATH/build-config.debug.centos8.yml failed" - return 1 - fi - oc apply -f $THIS_SCRIPT_PATH/image-stream.debug.centos8.yml - if [[ $? -ne 0 ]]; then - echo "Error: oc apply -f $THIS_SCRIPT_PATH/image-stream.debug.centos8.yml failed" - return 1 - fi - - oc start-build spgwu-tiny-debug-centos8 --follow - return $? -} - -main "$@" diff --git a/openshift/build_image.debug.centos8.3dparty b/openshift/build_image.debug.centos8.3dparty deleted file mode 100755 index 6c52b63..0000000 --- a/openshift/build_image.debug.centos8.3dparty +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash -################################################################################ -# 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 Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 -# -# 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 -################################################################################ -# file build_image.debug.centos8.3dparty -# brief -# author Lionel Gauthier -# company Eurecom -# email: lionel.gauthier@eurecom.fr -# - -set -o pipefail - -THIS_SCRIPT_PATH=$(dirname $(readlink -f $0)) - -function main() -{ - oc apply -f $THIS_SCRIPT_PATH/build-config.debug.centos8.3dparty.yml - if [[ $? -ne 0 ]]; then - echo "Error: oc apply -f $THIS_SCRIPT_PATH/build-config.debug.centos8.3dparty.yml failed" - return 1 - fi - oc apply -f $THIS_SCRIPT_PATH/image-stream.debug.centos8.3dparty.yml - if [[ $? -ne 0 ]]; then - echo "Error: oc apply -f $THIS_SCRIPT_PATH/image-stream.debug.centos8.3dparty.yml failed" - return 1 - fi - - oc start-build spgwu-tiny-debug-centos8-3dparty --follow - return $? -} - -main "$@" diff --git a/openshift/oai-spgwu-tiny-image-stream.yml b/openshift/is-base.yml similarity index 87% rename from openshift/oai-spgwu-tiny-image-stream.yml rename to openshift/is-base.yml index b2f4d7b..43d35e6 100644 --- a/openshift/oai-spgwu-tiny-image-stream.yml +++ b/openshift/is-base.yml @@ -19,10 +19,13 @@ # * contact@openairinterface.org # */ # -apiVersion: v1 +apiVersion: image.openshift.io/v1 kind: ImageStream metadata: - name: oai-spgwu-tiny - namespace: oai + name: oai-spgwu-tiny-base-builder + namespace: oai4g status: - tag: onap-0.1.0 + tag: oai-oc +spec: + lookupPolicy: + local: true \ No newline at end of file diff --git a/openshift/image-stream.debug.centos8.3dparty.yml b/openshift/is-dev.yml similarity index 90% rename from openshift/image-stream.debug.centos8.3dparty.yml rename to openshift/is-dev.yml index 7c4f461..8bdf638 100644 --- a/openshift/image-stream.debug.centos8.3dparty.yml +++ b/openshift/is-dev.yml @@ -19,14 +19,13 @@ # * contact@openairinterface.org # */ # -apiVersion: v1 +apiVersion: image.openshift.io/v1 kind: ImageStream metadata: - name: oai-spgwu-tiny - namespace: oai + name: oai-spgwu-tiny-dev + namespace: oai4g status: - tag: debug-centos8-3rd-party + tag: oai-oc spec: lookupPolicy: - local: true - \ No newline at end of file + local: true \ No newline at end of file diff --git a/openshift/image-stream.debug.centos8.yml b/openshift/is-target.yml similarity index 92% rename from openshift/image-stream.debug.centos8.yml rename to openshift/is-target.yml index 99b78df..ff24df8 100644 --- a/openshift/image-stream.debug.centos8.yml +++ b/openshift/is-target.yml @@ -19,13 +19,13 @@ # * contact@openairinterface.org # */ # -apiVersion: v1 +apiVersion: image.openshift.io/v1 kind: ImageStream metadata: name: oai-spgwu-tiny - namespace: oai + namespace: oai4g status: - tag: multi-spgwu + tag: oai-oc spec: lookupPolicy: - local: true + local: true \ No newline at end of file diff --git a/openshift/oai-spgwu-tiny-build-config.yml b/openshift/oai-spgwu-tiny-build-config.yml deleted file mode 100644 index d2eaca0..0000000 --- a/openshift/oai-spgwu-tiny-build-config.yml +++ /dev/null @@ -1,52 +0,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 -# */ -#--------------------------------------------------------------------- -# -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" - output: - to: - kind: "ImageStreamTag" - name: "oai-spgwu-tiny:onap-0.1.0" From 69c7edf27ab7e331e1a1a27d61257a8334a2c405 Mon Sep 17 00:00:00 2001 From: sagar arora Date: Wed, 11 May 2022 10:15:06 +0200 Subject: [PATCH 16/25] [CI] Clean up of centos naming --- build/scripts/build_helper | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/scripts/build_helper b/build/scripts/build_helper index 6365ecf..a883592 100644 --- a/build/scripts/build_helper +++ b/build/scripts/build_helper @@ -24,7 +24,7 @@ # author Laurent Thomas, Lionel GAUTHIER # ####################################### -SUPPORTED_DISTRO="Ubuntu 18.04, CentOS 8, RHEL 8" +SUPPORTED_DISTRO="Ubuntu 18.04, RHEL 8, UBI8-8.6" if [ ! -f /etc/os-release ]; then echo_fatal "No /etc/os-release file found. You're likely on an unsupported distro." fi From 3827d5dc0f2aef39e9d56376021f4fdfc46a3663 Mon Sep 17 00:00:00 2001 From: sagar arora Date: Wed, 11 May 2022 11:39:25 +0200 Subject: [PATCH 17/25] Remove duplicated lines of cmake --- build/scripts/build_helper.spgw | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/build/scripts/build_helper.spgw b/build/scripts/build_helper.spgw index 66691b0..7441eec 100644 --- a/build/scripts/build_helper.spgw +++ b/build/scripts/build_helper.spgw @@ -139,11 +139,7 @@ install_nlohmann_from_git() { cd json && git checkout -f v3.10.3 ret=$?;[[ $ret -ne 0 ]] && popd && return $ret mkdir _build && cd _build - if [[ "$OS_BASEDISTRO" == "fedora" ]]; then - $CMAKE -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DJSON_BuildTests=OFF .. - else - $CMAKE -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DJSON_BuildTests=OFF .. - fi + $CMAKE -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DJSON_BuildTests=OFF .. ret=$?;[[ $ret -ne 0 ]] && popd && return $ret make ret=$?;[[ $ret -ne 0 ]] && popd && return $ret From 0dc23ed0e3c42b4a028288425edf23d686987f2c Mon Sep 17 00:00:00 2001 From: sagar arora Date: Wed, 11 May 2022 15:03:11 +0200 Subject: [PATCH 18/25] Re-trigger the pipeline --- openshift/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openshift/README.md b/openshift/README.md index 7914ed8..3fa7ae7 100644 --- a/openshift/README.md +++ b/openshift/README.md @@ -1,4 +1,4 @@ -# Build and deploying OAI-SPGW-C in OpenShift cluster # +# Build and deploying OAI-SPGW-U in OpenShift cluster # ## Pre-requisite ## From 2875423430447693471a66c05d2431d97c0622b5 Mon Sep 17 00:00:00 2001 From: kharade Date: Tue, 14 Jun 2022 08:52:01 +0200 Subject: [PATCH 19/25] Display slice info --- src/spgwu/spgwu_config.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/spgwu/spgwu_config.cpp b/src/spgwu/spgwu_config.cpp index 74ec399..71e1067 100644 --- a/src/spgwu/spgwu_config.cpp +++ b/src/spgwu/spgwu_config.cpp @@ -803,16 +803,16 @@ void spgwu_config::display() { upf_5g_features.nrf_addr.fqdn.c_str()); if (upf_5g_features.upf_info.snssai_upf_info_list.size() > 0) { - Logger::spgwu_app().debug(" UPF Info:"); + Logger::spgwu_app().info(" UPF Info:"); } for (auto s : upf_5g_features.upf_info.snssai_upf_info_list) { // Logger::spgwu_app().debug(" Parameters supported by the // UPF:"); - Logger::spgwu_app().debug( + Logger::spgwu_app().info( " SNSSAI (SST %d, SD %s)", s.snssai.sST, s.snssai.sD.c_str()); for (auto d : s.dnn_upf_info_list) { - Logger::spgwu_app().debug(" DNN %s", d.dnn.c_str()); + Logger::spgwu_app().info(" DNN %s", d.dnn.c_str()); } } } From 34cf4c161e079039ed9693944acb23ed20f561cb Mon Sep 17 00:00:00 2001 From: kharade Date: Tue, 14 Jun 2022 12:51:31 +0200 Subject: [PATCH 20/25] Display SD field optionally --- src/spgwu/spgwu_config.cpp | 25 ++++++++++++++----------- src/spgwu/spgwu_config.hpp | 2 ++ src/spgwu/spgwu_profile.cpp | 27 ++++++++++++++++++--------- src/spgwu/spgwu_profile.hpp | 1 + 4 files changed, 35 insertions(+), 20 deletions(-) diff --git a/src/spgwu/spgwu_config.cpp b/src/spgwu/spgwu_config.cpp index 71e1067..d79034a 100644 --- a/src/spgwu/spgwu_config.cpp +++ b/src/spgwu/spgwu_config.cpp @@ -624,8 +624,8 @@ int spgwu_config::load(const string& config_file) { snssai_upf_info_item_t snssai_item = {}; snssai_t snssai = {}; snssai.sST = nssai_sst; - snssai.sD = nssai_sd; - snssai_item.snssai = snssai; + if (snssai.sST > SST_MAX_STANDARDIZED_VALUE) snssai.sD = nssai_sd; + snssai_item.snssai = snssai; const Setting& dnn_cfg = upf_info_item_cfg [SPGWU_CONFIG_STRING_5G_FEATURES_UPF_INFO_DNN_LIST]; @@ -804,15 +804,18 @@ void spgwu_config::display() { if (upf_5g_features.upf_info.snssai_upf_info_list.size() > 0) { Logger::spgwu_app().info(" UPF Info:"); - } - for (auto s : upf_5g_features.upf_info.snssai_upf_info_list) { - // Logger::spgwu_app().debug(" Parameters supported by the - // UPF:"); - Logger::spgwu_app().info( - " SNSSAI (SST %d, SD %s)", s.snssai.sST, - s.snssai.sD.c_str()); - for (auto d : s.dnn_upf_info_list) { - Logger::spgwu_app().info(" DNN %s", d.dnn.c_str()); + + for (auto s : upf_5g_features.upf_info.snssai_upf_info_list) { + // Logger::spgwu_app().debug(" Parameters supported by the UPF:"); + if (s.snssai.sST > SST_MAX_STANDARDIZED_VALUE) + Logger::spgwu_app().info( + " SNSSAI (SST %d, SD %s)", s.snssai.sST, + s.snssai.sD.c_str()); + else + Logger::spgwu_app().info(" SNSSAI (SST %d)", s.snssai.sST); + for (auto d : s.dnn_upf_info_list) { + Logger::spgwu_app().info(" DNN %s", d.dnn.c_str()); + } } } } diff --git a/src/spgwu/spgwu_config.hpp b/src/spgwu/spgwu_config.hpp index d08a9bb..ffd00e6 100644 --- a/src/spgwu/spgwu_config.hpp +++ b/src/spgwu/spgwu_config.hpp @@ -94,6 +94,8 @@ namespace spgwu { #define SPGW_ABORT_ON_ERROR true #define SPGW_WARN_ON_ERROR false +const uint8_t SST_MAX_STANDARDIZED_VALUE = 127; + typedef struct interface_cfg_s { std::string if_name; struct in_addr addr4; diff --git a/src/spgwu/spgwu_profile.cpp b/src/spgwu/spgwu_profile.cpp index 48627b1..3a8d29d 100644 --- a/src/spgwu/spgwu_profile.cpp +++ b/src/spgwu/spgwu_profile.cpp @@ -207,7 +207,10 @@ void spgwu_profile::display() const { Logger::spgwu_app().debug(" SNSSAI:"); } for (auto s : snssais) { - Logger::spgwu_app().debug(" SST, SD: %d, %s", s.sST, s.sD.c_str()); + if (s.sST > SST_MAX_STANDARDIZED_VALUE) + Logger::spgwu_app().debug(" SST, SD: %d, %s", s.sST, s.sD.c_str()); + else + Logger::spgwu_app().debug(" SST: %d, %s", s.sST); } // IPv4 Addresses @@ -223,8 +226,11 @@ void spgwu_profile::display() const { Logger::spgwu_app().debug(" UPF Info:"); } for (auto s : upf_info.snssai_upf_info_list) { - Logger::spgwu_app().debug( - " SNSSAI (SST %d, SD %s)", s.snssai.sST, s.snssai.sD.c_str()); + if (s.snssai.sST > SST_MAX_STANDARDIZED_VALUE) + Logger::spgwu_app().debug( + " SNSSAI (SST %d, SD %s)", s.snssai.sST, s.snssai.sD.c_str()); + else + Logger::spgwu_app().debug(" SST: %d, %s", s.snssai.sST); for (auto d : s.dnn_upf_info_list) { Logger::spgwu_app().debug(" DNN %s", d.dnn.c_str()); } @@ -243,7 +249,7 @@ void spgwu_profile::to_json(nlohmann::json& data) const { for (auto s : snssais) { nlohmann::json tmp = {}; tmp["sst"] = s.sST; - tmp["sd"] = s.sD; + if (s.sST > SST_MAX_STANDARDIZED_VALUE) tmp["sd"] = s.sD; data["sNssais"].push_back(tmp); } data["fqdn"] = fqdn; @@ -261,9 +267,10 @@ void spgwu_profile::to_json(nlohmann::json& data) const { data["upfInfo"] = {}; data["upfInfo"]["sNssaiUpfInfoList"] = nlohmann::json::array(); for (auto s : upf_info.snssai_upf_info_list) { - nlohmann::json tmp = {}; - tmp["sNssai"]["sst"] = s.snssai.sST; - tmp["sNssai"]["sd"] = s.snssai.sD; + nlohmann::json tmp = {}; + tmp["sNssai"]["sst"] = s.snssai.sST; + if (s.snssai.sST > SST_MAX_STANDARDIZED_VALUE) + tmp["sNssai"]["sd"] = s.snssai.sD; tmp["dnnUpfInfoList"] = nlohmann::json::array(); for (auto d : s.dnn_upf_info_list) { nlohmann::json dnn_json = {}; @@ -302,7 +309,8 @@ void spgwu_profile::from_json(const nlohmann::json& data) { for (auto it : data["sNssais"]) { snssai_t s = {}; s.sST = it["sst"].get(); - s.sD = it["sd"].get(); + if (s.sST > SST_MAX_STANDARDIZED_VALUE) + s.sD = it["sd"].get(); snssais.push_back(s); } } @@ -347,7 +355,8 @@ void spgwu_profile::from_json(const nlohmann::json& data) { if (it.find("sNssai") != it.end()) { if (it["sNssai"].find("sst") != it["sNssai"].end()) upf_info_item.snssai.sST = it["sNssai"]["sst"].get(); - if (it["sNssai"].find("sd") != it["sNssai"].end()) + if (it["sNssai"].find("sd") != it["sNssai"].end() && + (upf_info_item.snssai.sST >= SST_MAX_STANDARDIZED_VALUE)) upf_info_item.snssai.sD = it["sNssai"]["sd"].get(); } if (it.find("dnnUpfInfoList") != it.end()) { diff --git a/src/spgwu/spgwu_profile.hpp b/src/spgwu/spgwu_profile.hpp index 257df94..86f89be 100644 --- a/src/spgwu/spgwu_profile.hpp +++ b/src/spgwu/spgwu_profile.hpp @@ -38,6 +38,7 @@ #include "logger.hpp" #include "3gpp_29.510.h" +#include "spgwu_config.hpp" namespace spgwu { From 134eba25cda3e9d9b8dccc070b2ee5fb2e6caae6 Mon Sep 17 00:00:00 2001 From: kharade Date: Thu, 16 Jun 2022 10:43:29 +0200 Subject: [PATCH 21/25] Support for multiple slice in config --- etc/spgw_u.conf | 13 ++++++++----- scripts/entrypoint.sh | 10 ++++++++++ 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/etc/spgw_u.conf b/etc/spgw_u.conf index 511931e..35c63f7 100644 --- a/etc/spgw_u.conf +++ b/etc/spgw_u.conf @@ -115,22 +115,25 @@ SPGW-U = { # STRING, {"yes", "no"}, ENABLE_5G_FEATURES = "@ENABLE_5G_FEATURES@" # Set to 'yes' to support 5G Features - REGISTER_NRF = "@REGISTER_NRF@"; # Set to 'yes' if UPF resgisters to an NRF - USE_FQDN_NRF = "@USE_FQDN_NRF@"; # Set to 'yes' if UPF relies on a DNS/FQDN service to resolve NRF's FQDN - UPF_FQDN_5G = "@UPF_FQDN_5G@"; #Set FQDN of UPF + REGISTER_NRF = "@REGISTER_NRF@"; # Set to 'yes' if UPF resgisters to an NRF + USE_FQDN_NRF = "@USE_FQDN_NRF@"; # Set to 'yes' if UPF relies on a DNS/FQDN service to resolve NRF's FQDN + UPF_FQDN_5G = "@UPF_FQDN_5G@"; # Set FQDN of UPF NRF : { IPV4_ADDRESS = "@NRF_IPV4_ADDRESS@"; # YOUR NRF CONFIG HERE PORT = @NRF_PORT@; # YOUR NRF CONFIG HERE (default: 80) - HTTP_VERSION = @HTTP_VERSION@; #Set HTTP version for NRF (1 or 2)Default 1 + HTTP_VERSION = @HTTP_VERSION@; #Set HTTP version for NRF (1 or 2)Default 1 API_VERSION = "@NRF_API_VERSION@"; # YOUR NRF API VERSION HERE FQDN = "@NRF_FQDN@"; }; # Additional info to be sent to NRF for supporting Network Slicing UPF_INFO = ( - { NSSAI_SST = @NSSAI_SST_0@; NSSAI_SD = "@NSSAI_SD_0@"; DNN_LIST = ({DNN = "@DNN_0@";}); } + { NSSAI_SST = @NSSAI_SST_0@; NSSAI_SD = "@NSSAI_SD_0@"; DNN_LIST = ({DNN = "@DNN_0@";}); }, + { NSSAI_SST = @NSSAI_SST_1@; NSSAI_SD = "@NSSAI_SD_1@"; DNN_LIST = ({DNN = "@DNN_1@";}); }, + { NSSAI_SST = @NSSAI_SST_2@; NSSAI_SD = "@NSSAI_SD_2@"; DNN_LIST = ({DNN = "@DNN_2@";}); }, + { NSSAI_SST = @NSSAI_SST_3@; NSSAI_SD = "@NSSAI_SD_3@"; DNN_LIST = ({DNN = "@DNN_3@";}); } ); } }; diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index b901774..2343887 100755 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -24,6 +24,16 @@ NRF_FQDN=${NRF_FQDN:-gw.openairinterface.org} NSSAI_SST_0=${NSSAI_SST_0:-1} NSSAI_SD_0=${NSSAI_SD_0:-2} DNN_0=${DNN_0:-default} +NSSAI_SST_1=${NSSAI_SST_0:-130} +NSSAI_SD_1=${NSSAI_SD_0:-130} +DNN_1=${DNN_0:-default} +NSSAI_SST_2=${NSSAI_SST_0:-131} +NSSAI_SD_2=${NSSAI_SD_0:-131} +DNN_2=${DNN_0:-default} +NSSAI_SST_3=${NSSAI_SST_0:-132} +NSSAI_SD_3=${NSSAI_SD_0:-132} +DNN_3=${DNN_0:-default} + UPF_FQDN_5G=${UPF_FQDN_5G:-oai-spgwu-tiny-svc} HTTP_VERSION=${HTTP_VERSION:-1} From d2bb37426b4d6d510c53aa663e60bdfb1a3ad1c8 Mon Sep 17 00:00:00 2001 From: kharade Date: Fri, 17 Jun 2022 15:52:21 +0200 Subject: [PATCH 22/25] code clean --- src/common/3gpp_23.003.h | 2 ++ src/spgwu/spgwu_config.hpp | 3 +-- src/spgwu/spgwu_profile.hpp | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/common/3gpp_23.003.h b/src/common/3gpp_23.003.h index 3c6812b..f315c27 100644 --- a/src/common/3gpp_23.003.h +++ b/src/common/3gpp_23.003.h @@ -28,4 +28,6 @@ #ifndef FILE_3GPP_23_003_SEEN #define FILE_3GPP_23_003_SEEN +#define SST_MAX_STANDARDIZED_VALUE 127 + #endif /* FILE_3GPP_23_003_SEEN */ diff --git a/src/spgwu/spgwu_config.hpp b/src/spgwu/spgwu_config.hpp index ffd00e6..5f2c389 100644 --- a/src/spgwu/spgwu_config.hpp +++ b/src/spgwu/spgwu_config.hpp @@ -31,6 +31,7 @@ #include "3gpp_29.244.h" #include "3gpp_29.510.h" +#include "3gpp_23.003.h" #include "gtpv1u.hpp" #include "pfcp.hpp" #include "thread_sched.hpp" @@ -94,8 +95,6 @@ namespace spgwu { #define SPGW_ABORT_ON_ERROR true #define SPGW_WARN_ON_ERROR false -const uint8_t SST_MAX_STANDARDIZED_VALUE = 127; - typedef struct interface_cfg_s { std::string if_name; struct in_addr addr4; diff --git a/src/spgwu/spgwu_profile.hpp b/src/spgwu/spgwu_profile.hpp index 86f89be..4c199ed 100644 --- a/src/spgwu/spgwu_profile.hpp +++ b/src/spgwu/spgwu_profile.hpp @@ -38,7 +38,7 @@ #include "logger.hpp" #include "3gpp_29.510.h" -#include "spgwu_config.hpp" +#include "3gpp_23.003.h" namespace spgwu { From 10d6dfa70ab7c69032daff1b96d6d574ff708d0e Mon Sep 17 00:00:00 2001 From: kharade Date: Tue, 28 Jun 2022 15:40:48 +0200 Subject: [PATCH 23/25] Do not display SD_NO_VALUE --- src/common/3gpp_23.003.h | 1 + src/spgwu/spgwu_config.cpp | 4 +++- src/spgwu/spgwu_profile.cpp | 19 +++++++++++++------ 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/common/3gpp_23.003.h b/src/common/3gpp_23.003.h index f315c27..35d3e8a 100644 --- a/src/common/3gpp_23.003.h +++ b/src/common/3gpp_23.003.h @@ -29,5 +29,6 @@ #define FILE_3GPP_23_003_SEEN #define SST_MAX_STANDARDIZED_VALUE 127 +#define SD_NO_VALUE 0xFFFFFF #endif /* FILE_3GPP_23_003_SEEN */ diff --git a/src/spgwu/spgwu_config.cpp b/src/spgwu/spgwu_config.cpp index d79034a..74fd29f 100644 --- a/src/spgwu/spgwu_config.cpp +++ b/src/spgwu/spgwu_config.cpp @@ -624,6 +624,7 @@ int spgwu_config::load(const string& config_file) { snssai_upf_info_item_t snssai_item = {}; snssai_t snssai = {}; snssai.sST = nssai_sst; + snssai.sD = std::to_string(SD_NO_VALUE); if (snssai.sST > SST_MAX_STANDARDIZED_VALUE) snssai.sD = nssai_sd; snssai_item.snssai = snssai; @@ -807,7 +808,8 @@ void spgwu_config::display() { for (auto s : upf_5g_features.upf_info.snssai_upf_info_list) { // Logger::spgwu_app().debug(" Parameters supported by the UPF:"); - if (s.snssai.sST > SST_MAX_STANDARDIZED_VALUE) + if (s.snssai.sST > SST_MAX_STANDARDIZED_VALUE && + s.snssai.sD.compare(std::to_string(SD_NO_VALUE))) Logger::spgwu_app().info( " SNSSAI (SST %d, SD %s)", s.snssai.sST, s.snssai.sD.c_str()); diff --git a/src/spgwu/spgwu_profile.cpp b/src/spgwu/spgwu_profile.cpp index 3a8d29d..37bf1ea 100644 --- a/src/spgwu/spgwu_profile.cpp +++ b/src/spgwu/spgwu_profile.cpp @@ -207,7 +207,8 @@ void spgwu_profile::display() const { Logger::spgwu_app().debug(" SNSSAI:"); } for (auto s : snssais) { - if (s.sST > SST_MAX_STANDARDIZED_VALUE) + if (s.sST > SST_MAX_STANDARDIZED_VALUE && + s.sD.compare(std::to_string(SD_NO_VALUE))) Logger::spgwu_app().debug(" SST, SD: %d, %s", s.sST, s.sD.c_str()); else Logger::spgwu_app().debug(" SST: %d, %s", s.sST); @@ -226,7 +227,8 @@ void spgwu_profile::display() const { Logger::spgwu_app().debug(" UPF Info:"); } for (auto s : upf_info.snssai_upf_info_list) { - if (s.snssai.sST > SST_MAX_STANDARDIZED_VALUE) + if (s.snssai.sST > SST_MAX_STANDARDIZED_VALUE && + s.snssai.sD.compare(std::to_string(SD_NO_VALUE))) Logger::spgwu_app().debug( " SNSSAI (SST %d, SD %s)", s.snssai.sST, s.snssai.sD.c_str()); else @@ -249,7 +251,9 @@ void spgwu_profile::to_json(nlohmann::json& data) const { for (auto s : snssais) { nlohmann::json tmp = {}; tmp["sst"] = s.sST; - if (s.sST > SST_MAX_STANDARDIZED_VALUE) tmp["sd"] = s.sD; + if (s.sST > SST_MAX_STANDARDIZED_VALUE && + s.sD.compare(std::to_string(SD_NO_VALUE))) + tmp["sd"] = s.sD; data["sNssais"].push_back(tmp); } data["fqdn"] = fqdn; @@ -269,7 +273,8 @@ void spgwu_profile::to_json(nlohmann::json& data) const { for (auto s : upf_info.snssai_upf_info_list) { nlohmann::json tmp = {}; tmp["sNssai"]["sst"] = s.snssai.sST; - if (s.snssai.sST > SST_MAX_STANDARDIZED_VALUE) + if (s.snssai.sST > SST_MAX_STANDARDIZED_VALUE && + s.snssai.sD.compare(std::to_string(SD_NO_VALUE))) tmp["sNssai"]["sd"] = s.snssai.sD; tmp["dnnUpfInfoList"] = nlohmann::json::array(); for (auto d : s.dnn_upf_info_list) { @@ -309,7 +314,8 @@ void spgwu_profile::from_json(const nlohmann::json& data) { for (auto it : data["sNssais"]) { snssai_t s = {}; s.sST = it["sst"].get(); - if (s.sST > SST_MAX_STANDARDIZED_VALUE) + if (s.sST > SST_MAX_STANDARDIZED_VALUE && + s.sD.compare(std::to_string(SD_NO_VALUE))) s.sD = it["sd"].get(); snssais.push_back(s); } @@ -356,7 +362,8 @@ void spgwu_profile::from_json(const nlohmann::json& data) { if (it["sNssai"].find("sst") != it["sNssai"].end()) upf_info_item.snssai.sST = it["sNssai"]["sst"].get(); if (it["sNssai"].find("sd") != it["sNssai"].end() && - (upf_info_item.snssai.sST >= SST_MAX_STANDARDIZED_VALUE)) + (upf_info_item.snssai.sST >= SST_MAX_STANDARDIZED_VALUE) && + upf_info_item.snssai.sD.compare(std::to_string(SD_NO_VALUE))) upf_info_item.snssai.sD = it["sNssai"]["sd"].get(); } if (it.find("dnnUpfInfoList") != it.end()) { From abcc53bea344a5a0c810dfadcf0796bd46400e74 Mon Sep 17 00:00:00 2001 From: kharade Date: Thu, 30 Jun 2022 13:32:49 +0200 Subject: [PATCH 24/25] SD info is included back in profile irrespective of SST --- scripts/entrypoint.sh | 18 +++++++++--------- src/spgwu/spgwu_config.cpp | 8 +++----- src/spgwu/spgwu_profile.cpp | 36 ++++++++++-------------------------- 3 files changed, 22 insertions(+), 40 deletions(-) diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index 2343887..df6c8a5 100755 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -24,15 +24,15 @@ NRF_FQDN=${NRF_FQDN:-gw.openairinterface.org} NSSAI_SST_0=${NSSAI_SST_0:-1} NSSAI_SD_0=${NSSAI_SD_0:-2} DNN_0=${DNN_0:-default} -NSSAI_SST_1=${NSSAI_SST_0:-130} -NSSAI_SD_1=${NSSAI_SD_0:-130} -DNN_1=${DNN_0:-default} -NSSAI_SST_2=${NSSAI_SST_0:-131} -NSSAI_SD_2=${NSSAI_SD_0:-131} -DNN_2=${DNN_0:-default} -NSSAI_SST_3=${NSSAI_SST_0:-132} -NSSAI_SD_3=${NSSAI_SD_0:-132} -DNN_3=${DNN_0:-default} +NSSAI_SST_1=${NSSAI_SST_1:-130} +NSSAI_SD_1=${NSSAI_SD_1:-130} +DNN_1=${DNN_1:-test1} +NSSAI_SST_2=${NSSAI_SST_2:-131} +NSSAI_SD_2=${NSSAI_SD_2:-131} +DNN_2=${DNN_2:-test2} +NSSAI_SST_3=${NSSAI_SST_3:-132} +NSSAI_SD_3=${NSSAI_SD_3:-132} +DNN_3=${DNN_3:-test3} UPF_FQDN_5G=${UPF_FQDN_5G:-oai-spgwu-tiny-svc} HTTP_VERSION=${HTTP_VERSION:-1} diff --git a/src/spgwu/spgwu_config.cpp b/src/spgwu/spgwu_config.cpp index 74fd29f..f28da21 100644 --- a/src/spgwu/spgwu_config.cpp +++ b/src/spgwu/spgwu_config.cpp @@ -624,9 +624,8 @@ int spgwu_config::load(const string& config_file) { snssai_upf_info_item_t snssai_item = {}; snssai_t snssai = {}; snssai.sST = nssai_sst; - snssai.sD = std::to_string(SD_NO_VALUE); - if (snssai.sST > SST_MAX_STANDARDIZED_VALUE) snssai.sD = nssai_sd; - snssai_item.snssai = snssai; + snssai.sD = nssai_sd; + snssai_item.snssai = snssai; const Setting& dnn_cfg = upf_info_item_cfg [SPGWU_CONFIG_STRING_5G_FEATURES_UPF_INFO_DNN_LIST]; @@ -808,8 +807,7 @@ void spgwu_config::display() { for (auto s : upf_5g_features.upf_info.snssai_upf_info_list) { // Logger::spgwu_app().debug(" Parameters supported by the UPF:"); - if (s.snssai.sST > SST_MAX_STANDARDIZED_VALUE && - s.snssai.sD.compare(std::to_string(SD_NO_VALUE))) + if (s.snssai.sD.compare(std::to_string(SD_NO_VALUE))) Logger::spgwu_app().info( " SNSSAI (SST %d, SD %s)", s.snssai.sST, s.snssai.sD.c_str()); diff --git a/src/spgwu/spgwu_profile.cpp b/src/spgwu/spgwu_profile.cpp index 37bf1ea..5023793 100644 --- a/src/spgwu/spgwu_profile.cpp +++ b/src/spgwu/spgwu_profile.cpp @@ -207,11 +207,7 @@ void spgwu_profile::display() const { Logger::spgwu_app().debug(" SNSSAI:"); } for (auto s : snssais) { - if (s.sST > SST_MAX_STANDARDIZED_VALUE && - s.sD.compare(std::to_string(SD_NO_VALUE))) - Logger::spgwu_app().debug(" SST, SD: %d, %s", s.sST, s.sD.c_str()); - else - Logger::spgwu_app().debug(" SST: %d, %s", s.sST); + Logger::spgwu_app().debug(" SST, SD: %d, %s", s.sST, s.sD.c_str()); } // IPv4 Addresses @@ -227,12 +223,8 @@ void spgwu_profile::display() const { Logger::spgwu_app().debug(" UPF Info:"); } for (auto s : upf_info.snssai_upf_info_list) { - if (s.snssai.sST > SST_MAX_STANDARDIZED_VALUE && - s.snssai.sD.compare(std::to_string(SD_NO_VALUE))) - Logger::spgwu_app().debug( - " SNSSAI (SST %d, SD %s)", s.snssai.sST, s.snssai.sD.c_str()); - else - Logger::spgwu_app().debug(" SST: %d, %s", s.snssai.sST); + Logger::spgwu_app().debug( + " SNSSAI (SST %d, SD %s)", s.snssai.sST, s.snssai.sD.c_str()); for (auto d : s.dnn_upf_info_list) { Logger::spgwu_app().debug(" DNN %s", d.dnn.c_str()); } @@ -251,9 +243,7 @@ void spgwu_profile::to_json(nlohmann::json& data) const { for (auto s : snssais) { nlohmann::json tmp = {}; tmp["sst"] = s.sST; - if (s.sST > SST_MAX_STANDARDIZED_VALUE && - s.sD.compare(std::to_string(SD_NO_VALUE))) - tmp["sd"] = s.sD; + tmp["sd"] = s.sD; data["sNssais"].push_back(tmp); } data["fqdn"] = fqdn; @@ -271,11 +261,9 @@ void spgwu_profile::to_json(nlohmann::json& data) const { data["upfInfo"] = {}; data["upfInfo"]["sNssaiUpfInfoList"] = nlohmann::json::array(); for (auto s : upf_info.snssai_upf_info_list) { - nlohmann::json tmp = {}; - tmp["sNssai"]["sst"] = s.snssai.sST; - if (s.snssai.sST > SST_MAX_STANDARDIZED_VALUE && - s.snssai.sD.compare(std::to_string(SD_NO_VALUE))) - tmp["sNssai"]["sd"] = s.snssai.sD; + nlohmann::json tmp = {}; + tmp["sNssai"]["sst"] = s.snssai.sST; + tmp["sNssai"]["sd"] = s.snssai.sD; tmp["dnnUpfInfoList"] = nlohmann::json::array(); for (auto d : s.dnn_upf_info_list) { nlohmann::json dnn_json = {}; @@ -314,9 +302,7 @@ void spgwu_profile::from_json(const nlohmann::json& data) { for (auto it : data["sNssais"]) { snssai_t s = {}; s.sST = it["sst"].get(); - if (s.sST > SST_MAX_STANDARDIZED_VALUE && - s.sD.compare(std::to_string(SD_NO_VALUE))) - s.sD = it["sd"].get(); + s.sD = it["sd"].get(); snssais.push_back(s); } } @@ -361,9 +347,7 @@ void spgwu_profile::from_json(const nlohmann::json& data) { if (it.find("sNssai") != it.end()) { if (it["sNssai"].find("sst") != it["sNssai"].end()) upf_info_item.snssai.sST = it["sNssai"]["sst"].get(); - if (it["sNssai"].find("sd") != it["sNssai"].end() && - (upf_info_item.snssai.sST >= SST_MAX_STANDARDIZED_VALUE) && - upf_info_item.snssai.sD.compare(std::to_string(SD_NO_VALUE))) + if (it["sNssai"].find("sd") != it["sNssai"].end()) upf_info_item.snssai.sD = it["sNssai"]["sd"].get(); } if (it.find("dnnUpfInfoList") != it.end()) { @@ -388,4 +372,4 @@ void spgwu_profile::handle_heartbeart_timeout(uint64_t ms) { "Handle heartbeart timeout profile %s, time %d", nf_instance_id.c_str(), ms); set_nf_status("SUSPENDED"); -} +} \ No newline at end of file From 12f4a8298b908915047b65d6ea610db3c5fa5d5b Mon Sep 17 00:00:00 2001 From: sagar arora Date: Thu, 7 Jul 2022 14:52:36 +0200 Subject: [PATCH 25/25] Release v1.4.0 * 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 --- CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 10b0d68..ecd4971 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # RELEASE NOTES: # +## v1.4.0 -- July 2022 ## + +* 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 + ## v1.2.0 -- February 2022 ## * Obsolescence of Legacy OAI-MME