Commit 04730de7 authored by Pop OS!'s avatar Pop OS!

Initial boiler plate for building pnf-vnf split containers

parent 1268b27c
<!-- cd ci-scripts/yaml_files/5g_rfsimulator_pnf-vnf_split/ -->
In `template/.env` put VNF_ADDR, PNF_ADDR and UE0_ADDR
run `python3 configure.py -t env`
All other options can be modified after generating .env file.
BUILD_CLEAN string can be changed as required for different options at the time
of running docker compose oai_build (in generated .env file, and not in template).
To explicitly generate vnf config:
`VNF_ADDR="ipaddress" python3 configure.py -t vnf`
To explicitly generate pnf config:
`VNF_ADDR="ipaddress" PNF_ADDR="ipaddress" python3 configure.py -t pnf`
# Build
```
docker compose up oai_build
```
# VNF
```
docker compose up oai_vnf
```
# PNF
```
docker compose up oai_pnf
```
# UE
```
docker compose up oai_ue
```
# vnf, pnf, ue all together
```
docker compose up oai_vnf oai_pnf oai_ue
```
# Remove unused docker networks
```
docker network prune
```
#!/usr/bin/env python3
import argparse
import os
import signal
from pathlib import Path
def interrupt(signum, frame):
raise Exception("")
def stdinWait(text, default, time, timeoutDisplay = None, **kwargs):
signal.signal(signal.SIGALRM, interrupt)
signal.alarm(time) # sets timeout
global timeout
try:
inp = input(text)
signal.alarm(0)
timeout = False
except (KeyboardInterrupt):
printInterrupt = kwargs.get("printInterrupt", True)
if printInterrupt:
print ("Keyboard interrupt")
timeout = True # Do this so you don't mistakenly get input when there is none
inp = default
except:
timeout = True
if not timeoutDisplay is None:
print (f"{timeoutDisplay}")
signal.alarm(0)
inp = default
return inp
def get_active_branch_name(mainFolder):
head_dir = os.path.join(mainFolder, 'openairinterface5g', '.git', 'HEAD')
with open(head_dir,"r") as f:
content = f.read().splitlines()
for line in content:
if line[0:4] == "ref:":
return line.partition("refs/heads/")[2]
parser = argparse.ArgumentParser()
parser.add_argument("-t", "--type",
action="store",
default=None,
required=True,
help="env/gnb/ue")
args = parser.parse_args()
py_file_path = os.path.dirname(os.path.realpath(__file__))
print('\n\n')
if args.type == "env":
conf_file_name = '.env'
template_file_path = os.path.join(py_file_path, 'template', conf_file_name)
final_conf_dir = py_file_path
final_conf_path = os.path.join(final_conf_dir, conf_file_name)
with open(template_file_path,"r") as f:
conf = f.read()
if os.environ.get('USER') is not None:
print(f"Hi, {os.environ['USER'].split('.')[0]}")
print(f".env file path: {final_conf_path}")
print(f"Root folder is: {py_file_path.split('openairinterface5g')[0]}")
conf = conf.replace("{{DEV}}", os.environ['USER'].split('.')[0])
conf = conf.replace("{{USERID}}", str(os.getuid()))
conf = conf.replace("{{ROOT_VOL}}", py_file_path.split('openairinterface5g')[0][:-1])
cpn = os.environ['USER'].split('.')[0] \
+ '_' \
+ Path(py_file_path.split('openairinterface5g')[0][:-1]).parts[-1] \
+ '_' \
+ get_active_branch_name(py_file_path.split('openairinterface5g')[0][:-1])[:10] # consider first 10 chars
timeout = None
timeoutLimit = 5
inp = stdinWait(f"\nEnter Y/y within {timeoutLimit} seconds to create your own COMPOSE_PROJECT_NAME:{cpn} (present) and press <Enter>...: ", cpn, timeoutLimit, f"\nOkay, nothing entered.")
if not timeout:
print (f"You entered {inp}")
if (inp=='Y' or inp=='y'):
cpn_inp = input(f"\nEnter your COMPOSE_PROJECT_NAME and press Enter: ")
if cpn_inp.strip() != '':
cpn = cpn_inp.strip()
else:
print("COMPOSE_PROJECT_NAME can not be blank.")
print (f"\nWill be using COMPOSE_PROJECT_NAME={cpn}")
else:
print (f"\nWill be using COMPOSE_PROJECT_NAME={cpn}")
conf = conf.replace("{{PROJECT_NAME}}", cpn)
with open(final_conf_path, "w") as conf_file:
conf_file.write(conf)
else:
print("USER is not available in environment variable")
print("\n.env file generated.")
elif args.type == "vnf":
conf_file_name = 'sCont.vnf.sa.band78.106prb.rfsim.conf'
template_file_path = os.path.join(py_file_path, 'template', conf_file_name)
final_conf_dir = os.path.join(py_file_path, 'conf')
final_conf_path = os.path.join(final_conf_dir, conf_file_name)
Path(final_conf_dir).mkdir(parents=True, exist_ok=True)
with open(template_file_path,"r") as f:
conf = f.read()
if os.environ.get('VNF_ADDR') is not None:
print(f"VNF_ADDR = {os.environ['VNF_ADDR']}")
print(f"Conf file path: {final_conf_path}")
conf = conf.replace("{{VNF_ADDR}}", os.environ['VNF_ADDR'])
with open(final_conf_path, "w") as conf_file:
conf_file.write(conf)
else:
print("VNF_ADDR is not available in environment variable")
elif args.type == "pnf":
conf_file_name = 'sCont.pnf.sa.band78.rfsim.conf'
template_file_path = os.path.join(py_file_path, 'template', conf_file_name)
final_conf_dir = os.path.join(py_file_path, 'conf')
final_conf_path = os.path.join(final_conf_dir, conf_file_name)
Path(final_conf_dir).mkdir(parents=True, exist_ok=True)
print(f"Conf file path: {final_conf_path}")
with open(template_file_path,"r") as f:
conf = f.read()
if os.environ.get('VNF_ADDR') is not None:
print(f"VNF_ADDR = {os.environ['VNF_ADDR']}")
conf = conf.replace("{{VNF_ADDR}}", os.environ['VNF_ADDR'])
else:
print("VNF_ADDR is not available in environment variable")
if os.environ.get('PNF_ADDR') is not None:
print(f"PNF_ADDR = {os.environ['PNF_ADDR']}")
conf = conf.replace("{{PNF_ADDR}}", os.environ['PNF_ADDR'])
else:
print("PNF_ADDR is not available in environment variable")
with open(final_conf_path, "w") as conf_file:
conf_file.write(conf)
elif args.type == "ue":
conf_file_name = 'sCont.ue.conf'
template_file_path = os.path.join(py_file_path, 'template', conf_file_name)
final_conf_dir = os.path.join(py_file_path, 'conf')
final_conf_path = os.path.join(final_conf_dir, conf_file_name)
Path(final_conf_dir).mkdir(parents=True, exist_ok=True)
with open(template_file_path,"r") as f:
conf = f.read()
with open(final_conf_path, "w") as conf_file:
conf_file.write(conf)
else:
print(f"Wrong argument type")
version: '3.8'
services:
oai_build:
image: oai-base
# container_name: ${DEV}_oai_ranwiser_build
volumes:
- ${ROOT_VOL}/openairinterface5g:${ROOT_VOL}/openairinterface5g
entrypoint: "/bin/bash -c"
command: >
"cd ${ROOT_VOL}/openairinterface5g
&& source oaienv
&& cd cmake_targets
&& ./build_oai -w SIMU --gNB --nrUE --build-lib nrscope ${BUILD_CLEAN} |& tee build.log"
oai_vnf:
image: oai-base
privileged: true
# container_name: ${DEV}_oai_ranwiser_vnf0
volumes:
- ${ROOT_VOL}/openairinterface5g:${ROOT_VOL}/openairinterface5g
environment:
VNF_ADDR: ${VNF_ADDR}
USERID: ${USERID}
# NFAPI_TRACE_LEVEL: debug
networks:
rfsim5g-oai-public-net:
ipv4_address: ${VNF_ADDR}
entrypoint: "/bin/bash -c"
command: >
"cd ${ROOT_VOL}/openairinterface5g
&& source oaienv
&& cd ci-scripts/yaml_files/5g_rfsimulator_tdd_pvnf
&& python3 conf_generator.py -t vnf
&& chown -R ${USERID}:${USERID} ${ROOT_VOL}/openairinterface5g/ci-scripts/yaml_files/5g_rfsimulator_tdd_pvnf/conf
&& cd ${ROOT_VOL}/openairinterface5g/cmake_targets
&& ./ran_build/build/nr-softmodem ${R_W_SCOPE} -O ${ROOT_VOL}/openairinterface5g/ci-scripts/yaml_files/5g_rfsimulator_tdd_pvnf/conf/sCont.vnf.sa.band78.106prb.rfsim.conf --rfsim --sa -E --nfapi VNF |& tee vnf.log"
healthcheck:
test: /bin/bash -c "pgrep nr-softmodem"
interval: 10s
timeout: 5s
retries: 5
oai_pnf:
image: oai-base
privileged: true
# container_name: ${DEV}_oai_ranwiser_pnf0
volumes:
- ${ROOT_VOL}/openairinterface5g:${ROOT_VOL}/openairinterface5g
- /tmp/.X11-unix:/tmp/.X11-unix
environment:
RFSIMULATOR: server
VNF_ADDR: ${VNF_ADDR}
PNF_ADDR: ${PNF_ADDR}
USERID: ${USERID}
DISPLAY: ${DISPLAY}
# NFAPI_TRACE_LEVEL: debug
networks:
rfsim5g-oai-public-net:
ipv4_address: ${PNF_ADDR}
entrypoint: "/bin/bash -c"
command: >
"cd ${ROOT_VOL}/openairinterface5g
&& source oaienv
&& cd ci-scripts/yaml_files/5g_rfsimulator_tdd_pvnf
&& python3 conf_generator.py -t pnf
&& chown -R ${USERID}:${USERID} ${ROOT_VOL}/openairinterface5g/ci-scripts/yaml_files/5g_rfsimulator_tdd_pvnf/conf
&& cd ${ROOT_VOL}/openairinterface5g/cmake_targets
&& ./ran_build/build/nr-softmodem ${R_W_SCOPE} -O ${ROOT_VOL}/openairinterface5g/ci-scripts/yaml_files/5g_rfsimulator_tdd_pvnf/conf/sCont.pnf.sa.band78.rfsim.conf --rfsim --sa -E --nfapi PNF |& tee pnf.log"
depends_on:
- oai_vnf
healthcheck:
test: /bin/bash -c "pgrep nr-softmodem"
interval: 10s
timeout: 5s
retries: 5
oai_ue:
image: oai-base
privileged: true
# container_name: ${DEV}_oai_ranwiser_ue0
volumes:
- ${ROOT_VOL}/openairinterface5g:${ROOT_VOL}/openairinterface5g
- /tmp/.X11-unix:/tmp/.X11-unix
environment:
# NFAPI_TRACE_LEVEL: debug
RFSIMULATOR: ${PNF_ADDR}
USERID: ${USERID}
DISPLAY: ${DISPLAY}
networks:
rfsim5g-oai-public-net:
ipv4_address: ${UE0_ADDR}
# working_dir: ${ROOT_VOL}/openairinterface5g/cmake_targets/
entrypoint: "/bin/bash -c"
command: >
"cd ${ROOT_VOL}/openairinterface5g
&& source oaienv
&& cd ci-scripts/yaml_files/5g_rfsimulator_tdd_pvnf
&& python3 conf_generator.py -t ue
&& chown -R ${USERID}:${USERID} ${ROOT_VOL}/openairinterface5g/ci-scripts/yaml_files/5g_rfsimulator_tdd_pvnf/conf
&& cd ${ROOT_VOL}/openairinterface5g/cmake_targets
&& ./ran_build/build/nr-uesoftmodem ${R_W_SCOPE} -O ${ROOT_VOL}/openairinterface5g/ci-scripts/yaml_files/5g_rfsimulator_tdd_pvnf/conf/sCont.ue.conf -C 3619200000 --rfsim --sa -E |& tee ue_pvnf.log"
depends_on:
- oai_pnf
networks:
rfsim5g-oai-public-net:
external: true
# =========Change the following IPs as needed===================================
# should be in rfsim5g-oai-public-net (check core network)
# VNF_ADDR in vnf.conf file for local_s_address, GNB_IPV4_ADDRESS_FOR_NG_AMF, GNB_IPV4_ADDRESS_FOR_NGU are replaced automatically
# VNF_ADDR in pnf.conf file for remote_n_address is replaced automatically
VNF_ADDR=192.168.71.182
# should be in rfsim5g-oai-public-net (check core network)
# PNF_ADDR in pnf.conf file for local_n_address is replaced automatically
PNF_ADDR=192.168.71.181
UE0_ADDR=192.168.71.183 # should be in rfsim5g-oai-public-net (check core network)
BUILD_CLEAN="" # "-C", ""
DISPLAY=${DISPLAY}
R_W_SCOPE="" # "-d", ""
# ==============Do not change===================================================
DEV={{DEV}}
ROOT_VOL="{{ROOT_VOL}}" # where openairinterface5g is located
COMPOSE_PROJECT_NAME="{{PROJECT_NAME}}"
USERID={{USERID}}
L1s = (
{
num_cc = 1;
tr_n_preference = "nfapi";
local_n_if_name = "eth0";
remote_n_address = "{{VNF_ADDR}}"; // vnf addr
local_n_address = "{{PNF_ADDR}}"; // pnf addr
local_n_portc = 50000; // pnf p5 port [!]
remote_n_portc = 50001; // vnf p5 port
local_n_portd = 50010; // pnf p7 port
remote_n_portd = 50011; // vnf p7 port
prach_dtx_threshold = 120;
pucch0_dtx_threshold = 150;
ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0
}
);
RUs = (
{
local_rf = "yes"
nb_tx = 1
nb_rx = 1
att_tx = 0
att_rx = 0;
bands = [78];
max_pdschReferenceSignalPower = -27;
max_rxgain = 114;
}
);
rfsimulator :
{
serveraddr = "server";
serverport = "4043";
options = (); #("saviq"); or/and "chanmod"
modelname = "AWGN";
IQfile = "/tmp/rfsimulator.iqs";
};
log_config :
{
global_log_level ="info";
hw_log_level ="info";
phy_log_level ="info";
mac_log_level ="info";
rlc_log_level ="info";
pdcp_log_level ="info";
rrc_log_level ="info";
ngap_log_level ="debug";
f1ap_log_level ="debug";
};
uicc0 = {
imsi = "208990100001100";
key = "fec86ba6eb707ed08905757b1bb44b8f";
opc= "C42449363BBAD02B66D16BC975D77CC1";
dnn= "oai";
nssai_sst=1;
# nssai_sd=1;
}
Active_gNBs = ( "gnb-rfsim");
# Asn1_verbosity, choice in: none, info, annoying
Asn1_verbosity = "none";
gNBs =
(
{
////////// Identification parameters:
gNB_ID = 0xe00;
gNB_name = "gnb-rfsim";
// Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = 1;
# plmn_list = ({
# mcc = 208;
# mnc = 99;
# mnc_length = 2;
# snssaiList = (
# {
# sst = 1;
# sd = 0x1; // 0 false, else true
# },
# {
# sst = 1;
# sd = 0x112233; // 0 false, else true
# }
# );
#
# });
#
plmn_list = ({ mcc = 208; mnc = 99; mnc_length = 2; snssaiList = ({sst = 1}) });
nr_cellid = 12345678L;
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
pdsch_AntennaPorts = 1;
pusch_AntennaPorts = 1;
min_rxtxtime = 6;
#sib1_tda = 0;
pdcch_ConfigSIB1 = (
{
controlResourceSetZero = 12;
searchSpaceZero = 0;
}
);
servingCellConfigCommon = (
{
#spCellConfigCommon
physCellId = 0;
# downlinkConfigCommon
#frequencyInfoDL
# this is 3600 MHz + 43 PRBs@30kHz SCS (same as initial BWP)
absoluteFrequencySSB = 641280;
dl_frequencyBand = 78;
# this is 3600 MHz
dl_absoluteFrequencyPointA = 640008;
#scs-SpecificCarrierList
dl_offstToCarrier = 0;
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
dl_subcarrierSpacing = 1;
dl_carrierBandwidth = 106;
#initialDownlinkBWP
#genericParameters
# this is RBstart=27,L=48 (275*(L-1))+RBstart
initialDLBWPlocationAndBandwidth = 28875; # 6366 12925 12956 28875 12952
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
initialDLBWPsubcarrierSpacing = 1;
#pdcch-ConfigCommon
initialDLBWPcontrolResourceSetZero = 12;
initialDLBWPsearchSpaceZero = 0;
#uplinkConfigCommon
#frequencyInfoUL
ul_frequencyBand = 78;
#scs-SpecificCarrierList
ul_offstToCarrier = 0;
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
ul_subcarrierSpacing = 1;
ul_carrierBandwidth = 106;
pMax = 20;
#initialUplinkBWP
#genericParameters
initialULBWPlocationAndBandwidth = 28875;
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
initialULBWPsubcarrierSpacing = 1;
#rach-ConfigCommon
#rach-ConfigGeneric
prach_ConfigurationIndex = 98;
#prach_msg1_FDM
#0 = one, 1=two, 2=four, 3=eight
prach_msg1_FDM = 0;
prach_msg1_FrequencyStart = 0;
zeroCorrelationZoneConfig = 13;
preambleReceivedTargetPower = -96;
#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200)
preambleTransMax = 6;
#powerRampingStep
# 0=dB0,1=dB2,2=dB4,3=dB6
powerRampingStep = 1;
#ra_ReponseWindow
#1,2,4,8,10,20,40,80
ra_ResponseWindow = 5;
#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR
#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen
ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 4;
#oneHalf (0..15) 4,8,12,16,...60,64
ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 14;
#ra_ContentionResolutionTimer
#(0..7) 8,16,24,32,40,48,56,64
ra_ContentionResolutionTimer = 7;
rsrp_ThresholdSSB = 19;
#prach-RootSequenceIndex_PR
#1 = 839, 2 = 139
prach_RootSequenceIndex_PR = 2;
prach_RootSequenceIndex = 1;
# SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex
#
msg1_SubcarrierSpacing = 1,
# restrictedSetConfig
# 0=unrestricted, 1=restricted type A, 2=restricted type B
restrictedSetConfig = 0,
msg3_DeltaPreamble = 1;
p0_NominalWithGrant =-90;
# pucch-ConfigCommon setup :
# pucchGroupHopping
# 0 = neither, 1= group hopping, 2=sequence hopping
pucchGroupHopping = 0;
hoppingId = 40;
p0_nominal = -90;
# ssb_PositionsInBurs_BitmapPR
# 1=short, 2=medium, 3=long
ssb_PositionsInBurst_PR = 2;
ssb_PositionsInBurst_Bitmap = 1;
# ssb_periodicityServingCell
# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1
ssb_periodicityServingCell = 2;
# dmrs_TypeA_position
# 0 = pos2, 1 = pos3
dmrs_TypeA_Position = 0;
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
subcarrierSpacing = 1;
#tdd-UL-DL-ConfigurationCommon
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
referenceSubcarrierSpacing = 1;
# pattern1
# dl_UL_TransmissionPeriodicity
# 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10
dl_UL_TransmissionPeriodicity = 6;
nrofDownlinkSlots = 7;
nrofDownlinkSymbols = 6;
nrofUplinkSlots = 2;
nrofUplinkSymbols = 4;
# DDDDD DDFUU DDDDD DDFUU
# 01234 56789 01234 56789
ssPBCH_BlockPower = -25;
}
);
# ------- SCTP definitions
SCTP :
{
# Number of streams to use in input/output
SCTP_INSTREAMS = 2;
SCTP_OUTSTREAMS = 2;
};
////////// AMF parameters:
amf_ip_address = ( { ipv4 = "192.168.71.132";
ipv6 = "192:168:30::17";
active = "yes";
preference = "ipv4";
}
);
NETWORK_INTERFACES :
{
GNB_INTERFACE_NAME_FOR_NG_AMF = "eth0";
GNB_IPV4_ADDRESS_FOR_NG_AMF = "{{VNF_ADDR}}"; # vnf addr
GNB_INTERFACE_NAME_FOR_NGU = "eth0";
GNB_IPV4_ADDRESS_FOR_NGU = "{{VNF_ADDR}}"; # vnf addr
GNB_PORT_FOR_S1U = 2152; # Spec 2152
};
}
);
MACRLCs = (
{
num_cc = 1;
local_s_if_name = "eth0";
local_s_address = "{{VNF_ADDR}}"; // vnf addr
local_s_portc = 50001; // vnf p5 port
local_s_portd = 50011; // vnf p7 port [!]
tr_s_preference = "nfapi";
tr_n_preference = "local_RRC";
# remote_s_address = "192.168.71.181"; // pnf addr [!]
# remote_s_portc = 50000; // pnf p5 port [!]
# remote_s_portd = 50010; // pnf p7 port [!]
}
)
security = {
# preferred ciphering algorithms
# the first one of the list that an UE supports in chosen
# valid values: nea0, nea1, nea2, nea3
ciphering_algorithms = ( "nea0" );
# preferred integrity algorithms
# the first one of the list that an UE supports in chosen
# valid values: nia0, nia1, nia2, nia3
integrity_algorithms = ( "nia2", "nia0" );
# setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter
# what 'ciphering_algorithms' configures; same thing for 'drb_integrity'
drb_ciphering = "yes";
drb_integrity = "no";
};
log_config :
{
global_log_level ="info";
hw_log_level ="info";
phy_log_level ="info";
mac_log_level ="info";
rlc_log_level ="info";
pdcp_log_level ="info";
rrc_log_level ="info";
ngap_log_level ="debug";
f1ap_log_level ="debug";
};
...@@ -30,6 +30,7 @@ if [ ! -f /etc/os-release ]; then ...@@ -30,6 +30,7 @@ if [ ! -f /etc/os-release ]; then
fi fi
OS_DISTRO=$(grep "^ID=" /etc/os-release | sed "s/ID=//" | sed "s/\"//g") OS_DISTRO=$(grep "^ID=" /etc/os-release | sed "s/ID=//" | sed "s/\"//g")
OS_RELEASE=$(grep "^VERSION_ID=" /etc/os-release | sed "s/VERSION_ID=//" | sed "s/\"//g") OS_RELEASE=$(grep "^VERSION_ID=" /etc/os-release | sed "s/VERSION_ID=//" | sed "s/\"//g")
#echo "$OS_DISTRO", "$OS_RELEASE"
case "$OS_DISTRO" in case "$OS_DISTRO" in
fedora) OS_BASEDISTRO="fedora"; INSTALLER="dnf"; CMAKE="cmake" ;; fedora) OS_BASEDISTRO="fedora"; INSTALLER="dnf"; CMAKE="cmake" ;;
rhel) OS_BASEDISTRO="fedora"; INSTALLER="yum"; CMAKE="cmake3" ;; rhel) OS_BASEDISTRO="fedora"; INSTALLER="yum"; CMAKE="cmake3" ;;
...@@ -37,6 +38,7 @@ case "$OS_DISTRO" in ...@@ -37,6 +38,7 @@ case "$OS_DISTRO" in
centos) OS_BASEDISTRO="centos"; INSTALLER="yum"; CMAKE="cmake3" ;; centos) OS_BASEDISTRO="centos"; INSTALLER="yum"; CMAKE="cmake3" ;;
debian) OS_BASEDISTRO="debian"; INSTALLER="apt-get"; CMAKE="cmake" ;; debian) OS_BASEDISTRO="debian"; INSTALLER="apt-get"; CMAKE="cmake" ;;
ubuntu) OS_BASEDISTRO="debian"; INSTALLER="apt-get"; CMAKE="cmake" ;; ubuntu) OS_BASEDISTRO="debian"; INSTALLER="apt-get"; CMAKE="cmake" ;;
pop) OS_BASEDISTRO="debian"; INSTALLER="apt-get"; CMAKE="cmake" ;;
esac esac
KERNEL_VERSION=$(uname -r | cut -d '.' -f1) KERNEL_VERSION=$(uname -r | cut -d '.' -f1)
KERNEL_MAJOR=$(uname -r | cut -d '.' -f2) KERNEL_MAJOR=$(uname -r | cut -d '.' -f2)
...@@ -133,6 +135,7 @@ check_supported_distribution() { ...@@ -133,6 +135,7 @@ check_supported_distribution() {
"rocky9.1") return 0 ;; "rocky9.1") return 0 ;;
"rocky9.2") return 0 ;; "rocky9.2") return 0 ;;
"rocky9.3") return 0 ;; "rocky9.3") return 0 ;;
"pop22.04") return 0 ;;
esac esac
return 1 return 1
} }
...@@ -329,7 +332,7 @@ check_install_usrp_uhd_driver(){ ...@@ -329,7 +332,7 @@ check_install_usrp_uhd_driver(){
$SUDO apt-get remove libuhd3.14.1 -y || true $SUDO apt-get remove libuhd3.14.1 -y || true
$SUDO apt-get remove libuhd3.15.0 -y || true $SUDO apt-get remove libuhd3.15.0 -y || true
local distribution=$(get_distribution_release) local distribution=$(get_distribution_release)
if [[ "$distribution" == "ubuntu18.04" || "$distribution" == "ubuntu20.04" || "$distribution" == "ubuntu22.04" ]]; then if [[ "$distribution" == "ubuntu18.04" || "$distribution" == "ubuntu20.04" || "$distribution" == "ubuntu22.04" || "$distribution" == "pop22.04" ]]; then
$SUDO apt-get remove libuhd4.0.0 -y || true $SUDO apt-get remove libuhd4.0.0 -y || true
$SUDO apt-get remove libuhd4.1.0 -y || true $SUDO apt-get remove libuhd4.1.0 -y || true
fi fi
...@@ -360,7 +363,7 @@ check_install_usrp_uhd_driver(){ ...@@ -360,7 +363,7 @@ check_install_usrp_uhd_driver(){
$SUDO apt-get update $SUDO apt-get update
$SUDO apt-get -y install python-tk $boost_libs_ubuntu libusb-1.0-0-dev $SUDO apt-get -y install python-tk $boost_libs_ubuntu libusb-1.0-0-dev
case "$(get_distribution_release)" in case "$(get_distribution_release)" in
"ubuntu18.04" | "ubuntu20.04" | "ubuntu22.04") "ubuntu18.04" | "ubuntu20.04" | "ubuntu22.04" | "pop22.04" )
$SUDO apt-get -y install libuhd-dev libuhd4.4.0 uhd-host $SUDO apt-get -y install libuhd-dev libuhd4.4.0 uhd-host
;; ;;
esac esac
...@@ -555,7 +558,7 @@ check_install_additional_tools (){ ...@@ -555,7 +558,7 @@ check_install_additional_tools (){
"ubuntu18.04") "ubuntu18.04")
optional_packages="python-dev python-pip python-pyroute2 python python-numpy python-scipy python-matplotlib ctags" optional_packages="python-dev python-pip python-pyroute2 python python-numpy python-scipy python-matplotlib ctags"
;; ;;
"ubuntu20.04" | "ubuntu21.04" | "ubuntu22.04" | "debian11" ) "ubuntu20.04" | "ubuntu21.04" | "ubuntu22.04" | "debian11" | "pop22.04" )
optional_packages="python3 python3-pip python3-dev python3-scipy python3-matplotlib python3-pyroute2 universal-ctags" optional_packages="python3 python3-pip python3-dev python3-scipy python3-matplotlib python3-pyroute2 universal-ctags"
;; ;;
esac esac
......
# docker build --tag oai-base:latest --file ./docker/Dockerfile.oai-base.ubuntu20.04 .
# oai-base
FROM ubuntu:focal
ENV TZ=Asia/Calcutta
ENV DEBIAN_FRONTEND=noninteractive
#install developers pkg/repo
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && \
DEBIAN_FRONTEND=noninteractive apt-get install --yes \
#gcc needed for build_oai
build-essential \
psmisc \
git \
xxd \
# python3-pip for conf template generation
python3-pip && \
pip3 install --ignore-installed pyyaml
RUN git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git \
&& cd /openairinterface5g \
&& . ./oaienv \
&& cd cmake_targets \
&& mkdir -p log \
&& ./build_oai -I --phy_simulators \
&& ./build_oai -I -w USRP --install-optional-packages
# Now for runtime
# gNB
RUN cd /openairinterface5g \
&& python3 /openairinterface5g/docker/scripts/generateTemplate.py /openairinterface5g/docker/scripts/gnb_parameters.yaml
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && \
DEBIAN_FRONTEND=noninteractive apt-get install --yes \
software-properties-common \
procps \
libsctp1 \
tzdata \
libblas3 \
libatlas3-base \
libconfig9 \
openssl \
net-tools \
iperf \
iproute2 \
iputils-ping \
gdb \
python \
python3 \
python3-six \
python3-requests \
libusb-1.0-0 && \
rm -rf /var/lib/apt/lists/*
# UE
RUN cd /openairinterface5g \
&& python3 /openairinterface5g/docker/scripts/generateTemplate.py /openairinterface5g/docker/scripts/nr_ue_parameters.yaml
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && \
DEBIAN_FRONTEND=noninteractive apt-get install --yes \
liblapacke \
&& rm -rf /var/lib/apt/lists/*
RUN apt-get update \
&& apt-get install -y nano tcpdump
RUN cd / \
&& rm -rf openairinterface5g
ENTRYPOINT ["/bin/bash"]
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