Commit 90a95369 authored by Raphael Defosseux's avatar Raphael Defosseux

Merge branch 'ci-support-u22-build' into 'develop'

fix(build): limiting the kernel bpf-tool version to 5.7 -- 5.15

See merge request oai/cn5g/oai-cn5g-upf!25
parents b0a7b781 ffcb3efd
archives/
*.html
......@@ -38,14 +38,18 @@ source $THIS_SCRIPT_PATH/../common-build/installation/build_helper.nlohmann
# Get the kernel version
KERNEL_VERSION=$(uname -r | cut -d'-' -f1,2 | cut -d'.' -f1,2)
# Hack to pull at least 5.7 kernel code for build reasons
# The validated kernel versions for bpf-tool are between 5.7 and 5.15
MAJOR_VERSION=`echo $KERNEL_VERSION | cut -d'.' -f1,1`
MINOR_VERSION=`echo $KERNEL_VERSION | cut -d'.' -f2,2`
if [[ $MAJOR_VERSION -lt 5 ]]; then
KERNEL_VERSION=5.7
elif [[ $MAJOR_VERSION -gt 5 ]]; then
KERNEL_VERSION=5.15
elif [[ $MAJOR_VERSION -eq 5 ]]; then
if [[ $MINOR_VERSION -lt 7 ]]; then
KERNEL_VERSION=5.7
elif [[ $MINOR_VERSION -gt 15 ]]; then
KERNEL_VERSION=5.15
fi
fi
......@@ -85,6 +89,7 @@ install_libbpf_from_git() {
binutils-dev \
libbpf-dev \
libelf-dev \
libcap-dev \
libpcap-dev \
zlib1g-dev \
llvm \
......
......@@ -58,7 +58,7 @@ class HtmlReport():
with open(os.path.join(cwd, REPORT_NAME), 'w') as wfile:
wfile.write(generate_header(args))
wfile.write(generate_git_info(args))
wfile.write(build_summary(args, 'upf', '20', '8'))
wfile.write(build_summary(args, 'upf', '22', '8'))
wfile.write(coding_formatting_log_check(args))
wfile.write(analyze_sca_log_check())
wfile.write(generate_footer())
......
......@@ -29,7 +29,7 @@
#---------------------------------------------------------------------
# BASE IMAGE
#---------------------------------------------------------------------
ARG BASE_IMAGE=ubuntu:focal
ARG BASE_IMAGE=ubuntu:jammy
FROM $BASE_IMAGE as oai-upf-base
ENV DEBIAN_FRONTEND=noninteractive
......@@ -93,23 +93,20 @@ RUN apt-get update && \
# Ubuntu 22 --> libasan6
libasan? \
libgssapi-krb5-2 \
# Ubuntu 18/20 --> libldap-2.4-2
libldap-2.4-2 \
# Ubuntu 20 --> libldap-2.4-2
# Ubuntu 22 --> libldap-2.5-0
libldap-2.?-? \
libgoogle-glog0v5 \
# Ubuntu 18 --> libdouble-conversion1
# Ubuntu 20 --> libdouble-conversion3
libdouble-conversion? \
libdouble-conversion3 \
libconfig++9v5 \
librtmp1 \
libpsl5 \
libnghttp2-14 \
libcurl?-gnutls \
# Ubuntu 18 --> boost62/65 -> will remove both
# Ubuntu 20 --> boost67/71 -> will remove 67
libboost-thread1.??.0 \
&& rm -rf /var/lib/apt/lists/* \
/lib/x86_64-linux-gnu/libboost_system.so.1.6*.0 \
/lib/x86_64-linux-gnu/libboost_thread.so.1.6*.0
# Ubuntu 20 --> boost71
# Ubuntu 22 --> boost74
libboost-thread1.7?.0 \
&& rm -rf /var/lib/apt/lists/*
# Copying executable and generated libraries
WORKDIR /openair-upf/bin
......@@ -121,15 +118,12 @@ COPY --from=oai-upf-builder \
WORKDIR /usr/local/lib
COPY --from=oai-upf-builder \
# I need a dummy even if I already installed it.
# Once Ubuntu18 support is dropped, we can remove whole copy section
/usr/lib/x86_64-linux-gnu/libpsl.so.5 \
/usr/local/lib/libfmt.so \
/usr/local/lib/libyaml-cpp.so.0.? \
/usr/lib/x86_64-linux-gnu/libbfd-2.34-system.so \
/usr/lib/x86_64-linux-gnu/libopcodes-2.34-system.so \
# Ubuntu 18 --> boost 67 will be copied
/usr/lib/libboost_system.so.1.6*.0 \
# Ubuntu 20 --> libbfd-2.34
# Ubuntu 22 --> libbfd-2.38
/usr/lib/x86_64-linux-gnu/libbfd-2.3?-system.so \
/usr/lib/x86_64-linux-gnu/libopcodes-2.3?-system.so \
/openair-upf/build/ext/libbpf/src/libbpf.so.0 \
# /openair-upf/build/upf/build/upf_app/utils/libupfutils.so \
./
......
# jinj2-generated configuration file #
We are switching to `python3-jinja2` tool in order to generate more complex configuration for our 5G core network functions.
Pre-requisites: install python3 and jinja2 packages:
```bash
sudo apt-get install -y python3 python3-jinja2
# or
sudo yum install -y python3 python3-pip
pip3 install jinja2
```
In a container deployment, you will still have to provide environment variables through a `docker-compose-file` or helm charts.
But you can also emulate how the entrypoint behaves locally on your workspace
## LTE 4G Legacy configuration ##
Create a `test-jinja.sh` file and edit it:
```bash
$ vi test-jinja.sh
#!/bin/bash
cp etc/upf.conf etc/upf_copy.conf
export CONFIG_FILE=./etc/upf_copy.conf
export MOUNT_CONFIG=NO
export TZ=Europe/Paris
export PID_DIRECTORY=/var/run
#export SGW_INTERFACE_NAME_FOR_N3=eth0
#export PGW_INTERFACE_NAME_FOR_SGI=eth0
#export SGW_INTERFACE_NAME_FOR_SX=eth0
export SPGWC0_IP_ADDRESS=192.168.61.70
export NETWORK_UE_IP=12.0.0.0/24
export NETWORK_UE_NAT_OPTION=yes
export MCC=208
export MNC=96
export MNC03=096
export TAC=1
export GW_ID=1
export REALM=openairinterface.org
./scripts/entrypoint.py
$ chmod 755 test-jinja.sh
$ ./test-jinja.sh
Configuration file ./etc/upf_copy.conf is ready
```
## 5G SA Core Network configuration ##
Create a `test-jinja-5g.sh` file and edit it:
```bash
$ vi test-jinja-5g.sh
#!/bin/bash
cp etc/upf.conf etc/upf_copy.conf
export CONFIG_FILE=./etc/upf_copy.conf
export MOUNT_CONFIG=NO
export TZ=Europe/Paris
export PID_DIRECTORY=/var/run
export SGW_INTERFACE_NAME_FOR_N3=eth0
export SGW_INTERFACE_NAME_FOR_SX=eth0
export PGW_INTERFACE_NAME_FOR_SGI=eth0
export NETWORK_UE_NAT_OPTION=yes
export NETWORK_UE_IP=12.1.1.0/24
export BYPASS_UL_PFCP_RULES=no
export MCC=208
export MNC=95
export MNC03=095
export TAC=40960
export GW_ID=1
export THREAD_S1U_PRIO=80
export S1U_THREADS=8
export THREAD_SX_PRIO=81
export SX_THREADS=1
export THREAD_SGI_PRIO=80
export SGI_THREADS=8
export REALM=openairinterface.org
export ENABLE_5G_FEATURES=yes
export REGISTER_NRF=yes
export USE_FQDN_NRF=yes
export UPF_FQDN_5G=oai-spgwu
export NRF_IPV4_ADDRESS=192.168.70.130
export NRF_PORT=80
export NRF_API_VERSION=v1
export NRF_FQDN=oai-nrf
export NSSAI_SST_0=1
export NSSAI_SD_0=0xFFFFFF
export DNN_0=oai
export NSSAI_SST_1=1
export NSSAI_SD_1=1
export DNN_1=oai.ipv4
export NSSAI_SST_2=222
export NSSAI_SD_2=123
export DNN_2=default
./scripts/entrypoint.py
$ chmod 755 test-jinja-5g.sh
$ ./test-jinja-5g.sh
Configuration file ./etc/upf_copy.conf is ready
```
## List of fields ##
Here is the current list of fields, with their mandatory status and any default values.
If there is no default value associated to a field, it means it is **MANDATORY** to provide one.
| Field Name | Mandatory / Optional | 4G / 5G / Both | Default value if any |
|:-----------|----------------------|----------------|---------------------:|
| GW_ID | Mandatory | 4G | |
| MNC03 | Mandatory | 4G | |
| MCC | Mandatory | 4G | |
| REALM | Mandatory | 4G | |
| PID_DIRECTORY | Mandatory | 4G and 5G | |
| SGW_INTERFACE_NAME_FOR_N3 | Optional | 4G and 5G | eth0 |
| THREAD_S1U_PRIO | Optional | 4G and 5G | 80 |
| S1U_THREADS | Optional | 4G and 5G | 8 |
| SGW_INTERFACE_NAME_FOR_SX | Optional | 4G and 5G | eth0 |
| THREAD_SX_PRIO | Optional | 4G and 5G | 81 |
| SX_THREADS | Optional | 4G and 5G | 1 |
| PGW_INTERFACE_NAME_FOR_SGI | Optional | 4G and 5G | eth0 |
| THREAD_SGI_PRIO | Optional | 4G and 5G | 80 |
| SGI_THREADS | Optional | 4G and 5G | 8 |
| NETWORK_UE_NAT_OPTION | Optional | 4G and 5G | no |
| NETWORK_UE_IP | Mandatory | 4G and 5G | |
| BYPASS_UL_PFCP_RULES | Optional | 4G and 5G | no |
| SPGWC_HOSTNAME | Optional | 4G | |
| SPGWC0_IP_ADDRESS | Mandatory | 4G | mandatory if SPGWC_HOSTNAME undefined |
| ENABLE_5G_FEATURES | Optional | 5G | no |
| REGISTER_NRF | Optional | 5G | no |
| USE_FQDN_NRF | Optional | 5G | no |
| UPF_FQDN_5G | Optional | 5G | |
| NRF_HOSTNAME | Optional | 5G | |
| NRF_PORT | Optional | 5G | 80 |
| HTTP_VERSION | Optional | 5G | 1 |
| NRF_API_VERSION | Optional | 5G | v1 |
| NRF_FQDN | Optional | 5G | |
| NSSAI_SST_0 | Optional | 5G | |
| NSSAI_SD_0 | Optional | 5G | 0xFFFFFF |
| DNN_0 | Optional | 5G | |
......@@ -62,7 +62,6 @@ nfs:
upf:
host: oai-upf
sbi:
#port_http1: 80
port: 8080
api_version: v1
interface_name: demo-oai
......@@ -231,45 +230,17 @@ upf:
dnnUpfInfoList:
- dnn: "default"
# upf_info:
# - sst: 1
# sd: 123
# dnnList:
# - dnn: oai
# - dnn: default
# - sst: 1
# sd: 0xFFFFFF
# dnnList:
# - dnn: oai.ipv4
## DNN configuration
dnns:
- dnn: "oai"
pdu_session_type: "IPV4"
ipv4_pool: "12.1.1.151 - 12.1.1.253"
ipv4_subnet: "12.1.1.0/24"
- dnn: "oai.ipv4"
pdu_session_type: "IPV4"
ipv4_pool: "12.1.1.51 - 12.1.1.150"
ipv4_subnet: "12.1.1.0/24"
ipv4_subnet: "12.1.2.0/24"
- dnn: "default"
pdu_session_type: "IPV4"
ipv4_pool: "12.1.1.2 - 12.1.1.50"
ipv4_subnet: "12.1.1.0/24"
ipv4_subnet: "12.1.3.0/24"
- dnn: "ims"
pdu_session_type: "IPV4V6"
ipv4_pool: "14.1.1.2 - 14.1.1.253"
# dnns:
# - dnn: "oai"
# pdu_session_type: "IPV4"
# ipv4_subnet: "12.1.1.0/24"
# - dnn: "oai.ipv4"
# pdu_session_type: "IPV4"
# ipv4_subnet: "12.1.2.0/24"
# - dnn: "default"
# pdu_session_type: "IPV4"
# ipv4_subnet: "12.1.3.0/24"
# - dnn: "ims"
# pdu_session_type: "IPV4V6"
# ipv4_subnet: "12.1.4.0/24"
ipv4_subnet: "14.1.1.2/24"
################################################################################
# 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
################################################################################
UPF =
{
# FQDN for 4G
FQDN = "gw{{ env["GW_ID"] }}.upf.node.epc.mnc{{ env["MNC03"] }}.mcc{{ env["MCC"] }}.{{ env["REALM"] }}";
# 0 is the default
INSTANCE = 0;
# /var/run is the default
PID_DIRECTORY = "{{ env["PID_DIRECTORY"] if "PID_DIRECTORY" in env.keys() else '/var/run' }}";
LOG_LEVEL = "{{ env["LOG_LEVEL"] if "LOG_LEVEL" in env.keys() else 'none' }}";
#ITTI_TASKS :
#{
#ITTI_TIMER_SCHED_PARAMS :
#{
#CPU_ID = 1;
#SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
#SCHED_PRIORITY = 85;
#};
#N3_SCHED_PARAMS :
#{
#CPU_ID = 1;
#SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
#SCHED_PRIORITY = 84;
#};
#SX_SCHED_PARAMS :
#{
#CPU_ID = 1;
#SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
#SCHED_PRIORITY = 84;
#};
#ASYNC_CMD_SCHED_PARAMS :
#{
#CPU_ID = 1;
#SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
#SCHED_PRIORITY = 84;
#};
#};
INTERFACES :
{
N3 :
{
# S-GW binded interface for S1-U communication (GTPV1-U) can be ethernet interface, virtual ethernet interface, we don't advise wireless interfaces
# STRING, interface name, YOUR NETWORK CONFIG HERE
INTERFACE_NAME = "{{ env["SGW_INTERFACE_NAME_FOR_N3"] if "SGW_INTERFACE_NAME_FOR_N3" in env.keys() else 'eth0' }}";
# STRING, CIDR or "read to let app read interface configured IP address
IPV4_ADDRESS = "{{ env["SGW_ADDRESS_FOR_N3"] if "SGW_ADDRESS_FOR_N3" in env.keys() else 'read' }}";
#PORT = 2152; # Default is 2152
SCHED_PARAMS :
{
#CPU_ID = 2;
# Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
SCHED_POLICY = "SCHED_FIFO";
SCHED_PRIORITY = {{ env["THREAD_N3_PRIO"] if "THREAD_N3_PRIO" in env.keys() else '88' }};
POOL_SIZE = {{ env["N3_THREADS"] if "N3_THREADS" in env.keys() else '1' }};
};
};
N4 :
{
# S/P-GW binded interface for SX communication
INTERFACE_NAME = "{{ env["SGW_INTERFACE_NAME_FOR_SX"] if "SGW_INTERFACE_NAME_FOR_SX" in env.keys() else 'eth0' }}";
IPV4_ADDRESS = "read";
#PORT = 8805; # Default is 8805
SCHED_PARAMS :
{
#CPU_ID = 1;
SCHED_POLICY = "SCHED_FIFO";
SCHED_PRIORITY = {{ env["THREAD_SX_PRIO"] if "THREAD_SX_PRIO" in env.keys() else '88' }};
POOL_SIZE = {{ env["SX_THREADS"] if "SX_THREADS" in env.keys() else '1' }};
};
};
N6 :
{
# No config to set, the software will set the N6 interface to the interface used for the default route.
INTERFACE_NAME = "{{ env["PGW_INTERFACE_NAME_FOR_SGI"] if "PGW_INTERFACE_NAME_FOR_SGI" in env.keys() else 'eth0' }}";
IPV4_ADDRESS = "read";
SCHED_PARAMS :
{
#CPU_ID = 3;
SCHED_POLICY = "SCHED_FIFO";
SCHED_PRIORITY = {{ env["THREAD_SGI_PRIO"] if "THREAD_SGI_PRIO" in env.keys() else '98' }};
POOL_SIZE = {{ env["SGI_THREADS"] if "SGI_THREADS" in env.keys() else '1' }};
};
};
};
# SNAT Values in {yes, no}
SNAT = "{{ env["NETWORK_UE_NAT_OPTION"] if "NETWORK_UE_NAT_OPTION" in env.keys() else 'no' }}";
PDN_NETWORK_LIST = (
{NETWORK_IPV4 = "{{ env["NETWORK_UE_IP"] }}";} # 1 ITEM SUPPORTED ONLY
);
SMF_LIST = (
{#- To be backward-compatible #}
{%- if env["SMF_HOSTNAME"] is defined %}
{IPV4_ADDRESS="{{ resolve(env["SMF_HOSTNAME"]) }}" ;}
{#- Force dummy value in 5G case #}
{%- elif env["ENABLE_5G_FEATURES"] is defined and env["ENABLE_5G_FEATURES"] == "yes" %}
{IPV4_ADDRESS="127.0.0.1" ;}
{%- else %}
{IPV4_ADDRESS="{{ env["SMF_IP_ADDRESS"] }}" ;}
{%- endif %}
);
NON_STANDART_FEATURES :
{
# 'no' for standard features, yes for enhancing UL throughput
BYPASS_UL_PFCP_RULES = "{{ env["BYPASS_UL_PFCP_RULES"] if "BYPASS_UL_PFCP_RULES" in env.keys() else 'no' }}";
};
SUPPORT_5G_FEATURES:
{
{%- if env["ENABLE_5G_FEATURES"] is defined %}
# STRING, {"yes", "no"},
# Set to 'yes' to support 5G Features
ENABLE_5G_FEATURES = "{{ env["ENABLE_5G_FEATURES"] }}";
# Set yes to enable BPF Datapath
ENABLE_BPF_DATAPATH = "{{ env["ENABLE_BPF_DATAPATH"] if "ENABLE_BPF_DATAPATH" in env.keys() else 'no' }}";
# Set to 'yes' if UPF registers to an NRF
REGISTER_NRF = "{{ env["REGISTER_NRF"] }}";
# Set to 'yes' if UPF relies on a DNS/FQDN service to resolve NRF's FQDN
USE_FQDN_NRF = "{{ env["USE_FQDN_NRF"] if "USE_FQDN_NRF" in env.keys() else 'no' }}";
HTTP_VERSION = {{ env["HTTP_VERSION"] if "HTTP_VERSION" in env.keys() else '1' }};
# Set FQDN of UPF
UPF_FQDN_5G = "{{ env["UPF_FQDN_5G"] if "UPF_FQDN_5G" in env.keys() else 'localhost' }}";
REMOTE_N6_GW = "{{ env["REMOTE_N6_GW"] if "REMOTE_N6_GW" in env.keys() else 'oai-ext-dn' }}";
{%- else %}
ENABLE_5G_FEATURES = "no" # Set to 'yes' to support 5G Features
REGISTER_NRF = "no"; # Set to 'yes' if UPF registers to an NRF
USE_FQDN_NRF = "no"; # Set to 'yes' if UPF relies on a DNS/FQDN service to resolve NRF's FQDN
UPF_FQDN_5G = "none"; # Set FQDN of UPF
{%- endif %}
NRF :
{
{#- To be backward-compatible #}
{%- if env["NRF_HOSTNAME"] is defined %}
IPV4_ADDRESS = "{{ resolve(env["NRF_HOSTNAME"]) }}";
{%- else %}
IPV4_ADDRESS = "{{ env["NRF_IPV4_ADDRESS"] }}";
{%- endif %}
# YOUR NRF CONFIG HERE (default: 80)
PORT = {{ env["NRF_PORT"] if "NRF_PORT" in env.keys() else '80' }};
# Set HTTP version for NRF (1 or 2). Default 1
HTTP_VERSION = {{ env["HTTP_VERSION"] if "HTTP_VERSION" in env.keys() else '1' }};
# YOUR NRF API VERSION HERE. Default v1
API_VERSION = "{{ env["NRF_API_VERSION"] if "NRF_API_VERSION" in env.keys() else 'v1' }}";
# Set FQDN of NRF
FQDN = "{{ env["NRF_FQDN"] }}";
};
# Additional info to be sent to NRF for supporting Network Slicing
UPF_INFO = (
{%- if env["NSSAI_SST_0"] is defined %}
{
NSSAI_SST = {{ env["NSSAI_SST_0"] }};
NSSAI_SD = {{ env["NSSAI_SD_0"] if "NSSAI_SD_0" in env.keys() else '0xFFFFFF' }};
DNN_LIST = (
{
DNN = "{{ env["DNN_0"] if "DNN_0" in env.keys() else 'oai' }}";
}
);
}
{%- if env["NSSAI_SST_1"] is defined %}
,{
NSSAI_SST = {{ env["NSSAI_SST_1"] }};
NSSAI_SD = {{ env["NSSAI_SD_1"] if "NSSAI_SD_1" in env.keys() else '0xFFFFFF' }};
DNN_LIST = (
{
DNN = "{{ env["DNN_1"] }}";
}
);
}
{%- endif %}
{%- if env["NSSAI_SST_2"] is defined %}
,{
NSSAI_SST = {{ env["NSSAI_SST_2"] }};
NSSAI_SD = {{ env["NSSAI_SD_2"] if "NSSAI_SD_2" in env.keys() else '0xFFFFFF' }};
DNN_LIST = (
{
DNN = "{{ env["DNN_2"] }}";
}
);
}
{%- endif %}
{%- if env["NSSAI_SST_3"] is defined %}
,{
NSSAI_SST = {{ env["NSSAI_SST_3"] }};
NSSAI_SD = {{ env["NSSAI_SD_3"] if "NSSAI_SD_3" in env.keys() else '0xFFFFFF' }};
DNN_LIST = (
{
DNN = "{{ env["DNN_3"] }}";
}
);
}
{%- endif %}
{%- else %}
{ NSSAI_SST = 1; NSSAI_SD = 0xFFFFFF; DNN_LIST = ({DNN = "oai";}); }
{%- endif %}
);
}
};
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment