Commit 0dff2c9b authored by Raphael Defosseux's avatar Raphael Defosseux

fix(docker): fixes when generating the templates for gNB conf files

  * The '0x' format was forgetting that an hexadecimal value can have a-f chars
  * If someone wants to use a dedicated NSSAI_SD value, it is possible now
  * For experimental purpose in cluster, SDR addresses can be provided for one config
    - could be expended later on other conf files
Signed-off-by: default avatarRaphael Defosseux <raphael.defosseux@eurecom.fr>
parent 18ead40b
......@@ -90,7 +90,7 @@ def main():
if templine.find(key["key"]) >= 0:
if re.search(r'preference', templine): # false positive
continue
if re.search(r'sdr_addrs', templine): # false positive
if key["key"] != 'sdr_addrs' and re.search(r'sdr_addrs', templine): # false positive
continue
elif re.search('downlink_frequency', line):
templine = re.sub(r'[0-9]+', key["env"], line)
......@@ -106,7 +106,10 @@ def main():
r'\1' + key["env"] + r"\2", templine)
# next: matches key = NUMBER
elif re.search(key["key"] + "\s*=\s*[x0-9]+", templine): # x for "0x" hex start
templine = re.sub("(" + key["key"] + "\s*=\s*(?:0x)?)[x0-9]+", r"\1" + key["env"], templine)
templine = re.sub("(" + key["key"] + "\s*=\s*(?:0x)?)[x0-9a-fA-F]+", r"\1" + key["env"], templine)
# next: special case for sdr_addrs
elif key["key"] == 'sdr_addrs' and re.search(key["key"] + "\s*=\s*", templine):
templine = re.sub("(" + key["key"] + "\s*=\s*.*$)", key["key"] + " = \"" + key["env"] + "\"", templine)
outputfile.write(templine)
if __name__ == "__main__":
......
......@@ -20,9 +20,14 @@ if [[ -v USE_SA_NFAPI_VNF ]]; then cp $PREFIX/etc/gnb.sa.nfapi.vnf.conf $PREFIX/
if [[ -v USE_VOLUMED_CONF ]]; then cp $PREFIX/etc/mounted.conf $PREFIX/etc/gnb.conf; fi
# Defualt Parameters
GNB_ID=${GNB_ID:-0xe00}
GNB_ID=${GNB_ID:-e00}
USE_FQDN=${USE_FQDN:-false}
AMF_FQDN=${AMF_FQDN:-oai-amf-svc}
# if you explicitly want to use an SD, it should be added in the docker-compose or the helm chart
# if you want to support more than 1 NSSAI, then you need to mount a more-complex conf file
if [[ -v NSSAI_SST ]] && [[ -v NSSAI_SD ]] then
NSSAI_SST=$NSSAI_SST" , sd = "$NSSAI_SD
fi
# Resolve AMF FQDN
if ($USE_FQDN); then AMF_IP_ADDRESS=(`getent hosts $AMF_FQDN | awk '{print $1}'`); fi
......
......@@ -28,7 +28,7 @@
- filePrefix: gnb.band78.tm1.fr1.106PRB.usrpb210.conf
outputfilename: "gnb.nsa.tdd.conf"
config:
- key: GNB_ID
- key: gNB_ID
env: "@GNB_ID@"
- key: Active_gNBs
env: "@GNB_NAME@"
......@@ -42,8 +42,6 @@
env: "@MNC_LENGTH@"
- key: sst
env: "@NSSAI_SST@"
- key: sd
env: "@NSSAI_SD@"
- key: tracking_area_code
env: "@TAC@"
- key: enable_x2
......@@ -74,7 +72,7 @@
- filePrefix: gnb.band78.sa.fr1.106PRB.usrpn310.conf
outputfilename: "gnb.sa.tdd.conf"
config:
- key: GNB_ID
- key: gNB_ID
env: "@GNB_ID@"
- key: Active_gNBs
env: "@GNB_NAME@"
......@@ -90,8 +88,6 @@
env: "@TAC@"
- key: sst
env: "@NSSAI_SST@"
- key: sd
env: "@NSSAI_SD@"
- key: ipv4
env: "@AMF_IP_ADDRESS@"
- key: GNB_INTERFACE_NAME_FOR_NG_AMF
......@@ -102,13 +98,15 @@
env: "@GNB_NGU_IF_NAME@"
- key: GNB_IPV4_ADDRESS_FOR_NGU
env: "@GNB_NGU_IP_ADDRESS@"
- key: sdr_addrs
env: "@SDR_ADDRESSES@"
- key: parallel_config
env: "@THREAD_PARALLEL_CONFIG@"
- filePrefix: gnb.sa.band78.fr1.106PRB.usrpb210.conf
outputfilename: "gnb.sa.tdd.b2xx.conf"
config:
- key: GNB_ID
- key: gNB_ID
env: "@GNB_ID@"
- key: Active_gNBs
env: "@GNB_NAME@"
......@@ -140,7 +138,7 @@
- filePrefix: gnb.sa.band66.fr1.106PRB.usrpn300.conf
outputfilename: "gnb.sa.fdd.conf"
config:
- key: GNB_ID
- key: gNB_ID
env: "@GNB_ID@"
- key: Active_gNBs
env: "@GNB_NAME@"
......@@ -156,8 +154,6 @@
env: "@TAC@"
- key: sst
env: "@NSSAI_SST@"
- key: sd
env: "@NSSAI_SD@"
- key: ipv4
env: "@AMF_IP_ADDRESS@"
- key: GNB_INTERFACE_NAME_FOR_NG_AMF
......@@ -174,7 +170,7 @@
- filePrefix: gNB_SA_CU.conf
outputfilename: "gnb.sa.cu.conf"
config:
- key: GNB_ID
- key: gNB_ID
env: "@GNB_ID@"
- key: Active_gNBs
env: "@GNB_NAME@"
......@@ -190,8 +186,6 @@
env: "@TAC@"
- key: sst
env: "@NSSAI_SST@"
- key: sd
env: "@NSSAI_SD@"
- key: ipv4
env: "@AMF_IP_ADDRESS@"
- key: GNB_INTERFACE_NAME_FOR_NG_AMF
......@@ -216,7 +210,7 @@
- filePrefix: gNB_SA_DU.conf
outputfilename: "gnb.sa.du.tdd.conf"
config:
- key: GNB_ID
- key: gNB_ID
env: "@GNB_ID@"
- key: Active_gNBs
env: "@GNB_NAME@"
......@@ -232,8 +226,6 @@
env: "@TAC@"
- key: sst
env: "@NSSAI_SST@"
- key: sd
env: "@NSSAI_SD@"
- key: ipv4
env: "@AMF_IP_ADDRESS@"
- key: GNB_INTERFACE_NAME_FOR_NG_AMF
......@@ -260,7 +252,7 @@
- filePrefix: proxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf
outputfilename: "gnb.sa.nfapi.vnf.conf"
config:
- key: GNB_ID
- key: gNB_ID
env: "@GNB_ID@"
- key: Active_gNBs
env: "@GNB_NAME@"
......@@ -276,8 +268,6 @@
env: "@TAC@"
- key: sst
env: "@NSSAI_SST@"
- key: sd
env: "@NSSAI_SD@"
- key: ipv4
env: "@AMF_IP_ADDRESS@"
- key: GNB_INTERFACE_NAME_FOR_NG_AMF
......
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