From d4d07767746cfe18f120a0c71b2eeafb6ceb194a Mon Sep 17 00:00:00 2001 From: Mohammed Ismail Date: Tue, 27 Oct 2020 14:57:03 +0100 Subject: [PATCH 01/10] sctp_event_subscribe updated Signed-off-by: Mohammed Ismail --- openair3/SCTP/sctp_eNB_task.c | 20 ++++++++++++++++---- openair3/SCTP/sctp_primitives_client.c | 10 ++++++++-- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/openair3/SCTP/sctp_eNB_task.c b/openair3/SCTP/sctp_eNB_task.c index 972bef0a07..25e2f68c5f 100644 --- a/openair3/SCTP/sctp_eNB_task.c +++ b/openair3/SCTP/sctp_eNB_task.c @@ -413,10 +413,16 @@ sctp_handle_new_association_req( } /* Subscribe to all events */ - memset((void *)&events, 1, sizeof(struct sctp_event_subscribe)); + event.sctp_data_io_event = 1; + event.sctp_association_event = 1; + event.sctp_address_event = 1; + event.sctp_send_failure_event = 1; + event.sctp_peer_error_event = 1; + event.sctp_shutdown_event = 1; + event.sctp_partial_delivery_event = 1; if (setsockopt(sd, IPPROTO_SCTP, SCTP_EVENTS, &events, - sizeof(struct sctp_event_subscribe)) < 0) { + 8) < 0) { SCTP_ERROR("Setsockopt IPPROTO_SCTP_EVENTS failed: %s\n", strerror(errno)); close(sd); @@ -759,10 +765,16 @@ static int sctp_create_new_listener( } } - memset((void *)&event, 1, sizeof(struct sctp_event_subscribe)); + event.sctp_data_io_event = 1; + event.sctp_association_event = 1; + event.sctp_address_event = 1; + event.sctp_send_failure_event = 1; + event.sctp_peer_error_event = 1; + event.sctp_shutdown_event = 1; + event.sctp_partial_delivery_event = 1; if (setsockopt(sd, IPPROTO_SCTP, SCTP_EVENTS, &event, - sizeof(struct sctp_event_subscribe)) < 0) { + 8) < 0) { SCTP_ERROR("setsockopt: %s:%d\n", strerror(errno), errno); if (sd != -1) { close(sd); diff --git a/openair3/SCTP/sctp_primitives_client.c b/openair3/SCTP/sctp_primitives_client.c index bb71a854e1..4510f1e8e2 100644 --- a/openair3/SCTP/sctp_primitives_client.c +++ b/openair3/SCTP/sctp_primitives_client.c @@ -241,10 +241,16 @@ int sctp_connect_to_remote_host(char *local_ip_addr[], } /* Subscribe to all events */ - memset((void *)&events, 1, sizeof(struct sctp_event_subscribe)); + event.sctp_data_io_event = 1; + event.sctp_association_event = 1; + event.sctp_address_event = 1; + event.sctp_send_failure_event = 1; + event.sctp_peer_error_event = 1; + event.sctp_shutdown_event = 1; + event.sctp_partial_delivery_event = 1; if (setsockopt(sd, IPPROTO_SCTP, SCTP_EVENTS, &events, - sizeof(struct sctp_event_subscribe)) < 0) { + 8) < 0) { SCTP_ERROR("Setsockopt IPPROTO_SCTP_EVENTS failed: %s\n", strerror(errno)); return -1; From 524354aebca1b462f2bddace97de0e02d93556e0 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Tue, 27 Oct 2020 15:56:31 +0100 Subject: [PATCH 02/10] OC: fix typos Signed-off-by: Raphael Defosseux --- openair3/SCTP/sctp_eNB_task.c | 14 +++++++------- openair3/SCTP/sctp_primitives_client.c | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/openair3/SCTP/sctp_eNB_task.c b/openair3/SCTP/sctp_eNB_task.c index 25e2f68c5f..ee006338c5 100644 --- a/openair3/SCTP/sctp_eNB_task.c +++ b/openair3/SCTP/sctp_eNB_task.c @@ -413,13 +413,13 @@ sctp_handle_new_association_req( } /* Subscribe to all events */ - event.sctp_data_io_event = 1; - event.sctp_association_event = 1; - event.sctp_address_event = 1; - event.sctp_send_failure_event = 1; - event.sctp_peer_error_event = 1; - event.sctp_shutdown_event = 1; - event.sctp_partial_delivery_event = 1; + events.sctp_data_io_event = 1; + events.sctp_association_event = 1; + events.sctp_address_event = 1; + events.sctp_send_failure_event = 1; + events.sctp_peer_error_event = 1; + events.sctp_shutdown_event = 1; + events.sctp_partial_delivery_event = 1; if (setsockopt(sd, IPPROTO_SCTP, SCTP_EVENTS, &events, 8) < 0) { diff --git a/openair3/SCTP/sctp_primitives_client.c b/openair3/SCTP/sctp_primitives_client.c index 4510f1e8e2..e19f20c957 100644 --- a/openair3/SCTP/sctp_primitives_client.c +++ b/openair3/SCTP/sctp_primitives_client.c @@ -241,13 +241,13 @@ int sctp_connect_to_remote_host(char *local_ip_addr[], } /* Subscribe to all events */ - event.sctp_data_io_event = 1; - event.sctp_association_event = 1; - event.sctp_address_event = 1; - event.sctp_send_failure_event = 1; - event.sctp_peer_error_event = 1; - event.sctp_shutdown_event = 1; - event.sctp_partial_delivery_event = 1; + events.sctp_data_io_event = 1; + events.sctp_association_event = 1; + events.sctp_address_event = 1; + events.sctp_send_failure_event = 1; + events.sctp_peer_error_event = 1; + events.sctp_shutdown_event = 1; + events.sctp_partial_delivery_event = 1; if (setsockopt(sd, IPPROTO_SCTP, SCTP_EVENTS, &events, 8) < 0) { From af1495f124a44651e1fbf7d380d60a71825df875 Mon Sep 17 00:00:00 2001 From: Mohammed Ismail Date: Thu, 5 Nov 2020 15:29:17 +0100 Subject: [PATCH 03/10] script for config files generation Signed-off-by: Mohammed Ismail --- docker/scripts/generateTemplate.py | 68 +++++++ docker/scripts/parameters.json | 304 +++++++++++++++++++++++++++++ 2 files changed, 372 insertions(+) create mode 100644 docker/scripts/generateTemplate.py create mode 100644 docker/scripts/parameters.json diff --git a/docker/scripts/generateTemplate.py b/docker/scripts/generateTemplate.py new file mode 100644 index 0000000000..05d52fab99 --- /dev/null +++ b/docker/scripts/generateTemplate.py @@ -0,0 +1,68 @@ +import re +import json +import os + + +dir = os.listdir('/home/mohammed/Documents/conf_files/') + +#read json config file +f = open('parameters.json',) +data = json.load(f) +for config in data: + + filePrefix = config["filePrefix"] + print(filePrefix) + for inputfile in dir: + if inputfile.find(filePrefix) >=0: + if filePrefix == "cu": + outputfile1 = 'config/cu.fdd.config' + elif filePrefix == "du": + outputfile1 = 'config/du.fdd.config' + elif filePrefix == "du": + outputfile1 = 'config/du.fdd.config' + elif filePrefix == "rru.fdd": + outputfile1 = 'config/rru.fdd.config' + elif filePrefix == "rru.tdd": + outputfile1 = 'config/rru.tdd.config' + elif filePrefix == "enb.band7.tm1.25PRB.usrpb210": + outputfile1 = 'config/enb.fdd.config' + elif filePrefix == "enb.band40.tm1.25PRB.FairScheduler.usrpb210": + outputfile1 = 'config/enb.tdd.config' +# elif filePrefix == "rcc.band7.tm1.nfapi": +# outputfile1 = 'config/rcc.if4p5.enb.fdd.config' +# elif filePrefix == "rcc.band7.tm1.nfapi": +# outputfile1 = 'config/rcc.if4p5.enb.tdd.config' + + directory = 'config/' + if not os.path.exists(directory): + os.makedirs(directory, exist_ok=True) + + with open("/home/mohammed/Documents/conf_files/%s" % (inputfile), mode='r') as inputfile, \ + open(outputfile1, mode='w') as outputfile: + for line in inputfile: + count = 0 + for key in config["config"]: + if line.find(key["key"]) >= 0: + count += 1 + if re.search(r'preference', line): + templine = line + elif re.search(r'plmn_list', line): + templine = re.sub(r'[0-9]+', '""', line) + templine = re.sub(r'\"\"', key["env"]["mcc"], templine, 1) + templine = re.sub(r'\"\"', key["env"]["mnc"], templine, 1) + templine = re.sub(r'\"\"', key["env"]["mnc_length"], templine, 1) + elif re.search('downlink_frequency', line): + templine = re.sub(r'[0-9]+', key["env"], line) + elif re.search('uplink_frequency_offset', line): + templine = re.sub(r'[0-9]+', key["env"], line) + + elif re.search(r'"(.*?)"', line): + templine = re.sub(r'(?<=")[^"]*(?=")', key["env"], line) # for quotes + elif re.search(r'[0-9]', line): + templine = re.sub(r'\d+', key["env"], line) + outputfile.write(templine) + + if count == 0: + outputfile.write(line) +#read file and replace with ... + diff --git a/docker/scripts/parameters.json b/docker/scripts/parameters.json new file mode 100644 index 0000000000..5e3fde5769 --- /dev/null +++ b/docker/scripts/parameters.json @@ -0,0 +1,304 @@ +[ + { + "filePrefix": "cu", + "config": [ + { + "key": "Active_eNBs", + "env": "@ENB_NAME@" + }, + { + "key": "eNB_name", + "env": "@ENB_NAME@" + }, + { + "key": "plmn_list", + "env": {"mcc": "@MCC@", "mnc": "@MNC@", "mnc_length": "@MNC_LENGTH@"} + }, + { + "key": "tracking_area_code", + "env": "@TAC@" + }, + { + "key": "local_s_if_name", + "env": "@F1_IF_NAME@" + }, + { + "key": "remote_s_address", + "env": "@F1_DU_IP_ADDRESS@" + }, + { + "key": "local_s_address", + "env": "@F1_CU_IP_ADDRESS@" + }, + { + "key": "eutra_band", + "env": "@UTRA_BAND_ID@" + }, + { + "key": "downlink_frequency", + "env": "@DL_FREQUENCY_IN_MHZ@000000" + }, + { + "key": "uplink_frequency_offset", + "env": "@UL_FREQUENCY_OFFSET_IN_MHZ@000000" + }, + { + "key": "Nid_cell", + "env": "@NID_CELL@" + }, + { + "key": "N_RB_DL", + "env": "@NB_PRB@" + }, + { + "key": "ipv4", + "env": "@MME_S1C_IP_ADDRESS@" + }, + { + "key": "ENB_INTERFACE_NAME_FOR_S1_MME", + "env": "@S1C_IF_NAME@" + }, + { + "key": "ENB_IPV4_ADDRESS_FOR_S1_MME", + "env": "@F1_CU_IP_ADDRESS@" + }, + { + "key": "ENB_INTERFACE_NAME_FOR_S1U", + "env": "@S1U_IF_NAME@" + }, + { + "key": "ENB_IPV4_ADDRESS_FOR_S1U", + "env": "@F1_CU_IP_ADDRESS@" + }, + { + "key": "ENB_IPV4_ADDRESS_FOR_X2C", + "env": "@F1_CU_IP_ADDRESS@" + } + ] + }, + { + "filePrefix": "du", + "config": [ + { + "key": "Active_eNBs", + "env": "@ENB_NAME@" + }, + { + "key": "eNB_name", + "env": "@ENB_NAME@" + }, + { + "key": "plmn_list", + "env": {"mcc": "@MCC@", "mnc": "@MNC@", "mnc_length": "@MNC_LENGTH@"} + }, + { + "key": "tracking_area_code", + "env": "@TAC@" + }, + { + "key": "local_n_if_name", + "env": "@F1_IF_NAME@" + }, + { + "key": "remote_n_address", + "env": "@F1_DU_IP_ADDRESS@" + }, + { + "key": "local_n_address", + "env": "@F1_CU_IP_ADDRESS@" + }, + { + "key": "eutra_band", + "env": "@UTRA_BAND_ID@" + }, + { + "key": "downlink_frequency", + "env": "@DL_FREQUENCY_IN_MHZ@000000" + }, + { + "key": "uplink_frequency_offset", + "env": "@UL_FREQUENCY_OFFSET_IN_MHZ@000000" + }, + { + "key": "Nid_cell", + "env": "@NID_CELL@" + }, + { + "key": "N_RB_DL", + "env": "@NB_PRB@" + } + ] + }, + { + "filePrefix": "rru.fdd", + "config": [ + { + "key": "local_if_name", + "env": "@@" + }, + { + "key": "remote_address", + "env": "@@" + }, + { + "key": "local_address", + "env": "@@" + }, + { + "key": "bands", + "env": "@@" + } + ] + }, + { + "filePrefix": "rru.tdd", + "config": [ + { + "key": "local_if_name", + "env": "@@" + }, + { + "key": "remote_address", + "env": "@@" + }, + { + "key": "local_address", + "env": "@@" + }, + { + "key": "bands", + "env": "@@" + } + ] + }, + { + "filePrefix": "enb.band7.tm1.25PRB.usrpb210", + "config": [ + { + "key": "Active_eNBs", + "env": "@ENB_NAME@" + }, + { + "key": "eNB_name", + "env": "@ENB_NAME@" + }, + { + "key": "plmn_list", + "env": {"mcc": "@MCC@", "mnc": "@MNC@", "mnc_length": "@MNC_LENGTH@"} + }, + { + "key": "tracking_area_code", + "env": "@TAC@" + }, + { + "key": "eutra_band", + "env": "@UTRA_BAND_ID@" + }, + { + "key": "downlink_frequency", + "env": "@DL_FREQUENCY_IN_MHZ@000000" + }, + { + "key": "uplink_frequency_offset", + "env": "@UL_FREQUENCY_OFFSET_IN_MHZ@000000" + }, + { + "key": "Nid_cell", + "env": "@NID_CELL@" + }, + { + "key": "N_RB_DL", + "env": "@NB_PRB@" + }, + { + "key": "ipv4", + "env": "@MME_S1C_IP_ADDRESS@" + }, + { + "key": "ENB_INTERFACE_NAME_FOR_S1_MME", + "env": "@S1C_IF_NAME@" + }, + { + "key": "ENB_IPV4_ADDRESS_FOR_S1_MME", + "env": "@F1_CU_IP_ADDRESS@" + }, + { + "key": "ENB_INTERFACE_NAME_FOR_S1U", + "env": "@S1U_IF_NAME@" + }, + { + "key": "ENB_IPV4_ADDRESS_FOR_S1U", + "env": "@F1_CU_IP_ADDRESS@" + }, + { + "key": "ENB_IPV4_ADDRESS_FOR_X2C", + "env": "@F1_CU_IP_ADDRESS@" + } + ] + }, + { + "filePrefix": "enb.band40.tm1.25PRB.FairScheduler.usrpb210", + "config": [ + { + "key": "Active_eNBs", + "env": "@ENB_NAME@" + }, + { + "key": "eNB_name", + "env": "@ENB_NAME@" + }, + { + "key": "plmn_list", + "env": {"mcc": "@MCC@", "mnc": "@MNC@", "mnc_length": "@MNC_LENGTH@"} + }, + { + "key": "tracking_area_code", + "env": "@TAC@" + }, + { + "key": "eutra_band", + "env": "@UTRA_BAND_ID@" + }, + { + "key": "downlink_frequency", + "env": "@DL_FREQUENCY_IN_MHZ@000000" + }, + { + "key": "uplink_frequency_offset", + "env": "@UL_FREQUENCY_OFFSET_IN_MHZ@000000" + }, + { + "key": "Nid_cell", + "env": "@NID_CELL@" + }, + { + "key": "N_RB_DL", + "env": "@NB_PRB@" + }, + { + "key": "ipv4", + "env": "@MME_S1C_IP_ADDRESS@" + }, + { + "key": "ENB_INTERFACE_NAME_FOR_S1_MME", + "env": "@S1C_IF_NAME@" + }, + { + "key": "ENB_IPV4_ADDRESS_FOR_S1_MME", + "env": "@F1_CU_IP_ADDRESS@" + }, + { + "key": "ENB_INTERFACE_NAME_FOR_S1U", + "env": "@S1U_IF_NAME@" + }, + { + "key": "ENB_IPV4_ADDRESS_FOR_S1U", + "env": "@F1_CU_IP_ADDRESS@" + }, + { + "key": "ENB_IPV4_ADDRESS_FOR_X2C", + "env": "@F1_CU_IP_ADDRESS@" + } + ] + } +] From abf2693b38d8c0614e965f7cd4cafad502c729e4 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Tue, 3 Nov 2020 18:12:06 +0100 Subject: [PATCH 04/10] [OC][docker][build] support for new RHEL8.3 version Signed-off-by: Raphael Defosseux --- cmake_targets/tools/build_helper | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index 7c50bc106a..0ad020a5ef 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -114,6 +114,8 @@ check_supported_distribution() { "rhel7.7") return 0 ;; "rhel7.8") return 0 ;; "rhel8.2") return 0 ;; + "rhel8.3") return 0 ;; + "rhel8.4") return 0 ;; "centos7") return 0 ;; esac return 1 From a9a334f294b7378ca0e6bb9cd3fceb1791def33b Mon Sep 17 00:00:00 2001 From: Mohammed Ismail Date: Fri, 6 Nov 2020 13:33:45 +0100 Subject: [PATCH 05/10] updated: Python scripts to generate eNB's templates for container images Signed-off-by: Mohammed Ismail --- docker/scripts/generateTemplate.py | 138 ++++++++++-------- docker/scripts/parameters.yaml | 221 +++++++++++++++++++++++++++++ 2 files changed, 299 insertions(+), 60 deletions(-) create mode 100644 docker/scripts/parameters.yaml diff --git a/docker/scripts/generateTemplate.py b/docker/scripts/generateTemplate.py index 05d52fab99..aaaed1d5a8 100644 --- a/docker/scripts/generateTemplate.py +++ b/docker/scripts/generateTemplate.py @@ -1,68 +1,86 @@ +# * 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 +#----------------------------------------------------------- import re -import json +import yaml import os +import sys -dir = os.listdir('/home/mohammed/Documents/conf_files/') +def main(): + #read yaml input parameters + f = open(f'{sys.argv[1]}',) + data = yaml.full_load(f) + dir = os.listdir(f'{data[0]["paths"]["source_dir"]}') -#read json config file -f = open('parameters.json',) -data = json.load(f) -for config in data: - filePrefix = config["filePrefix"] - print(filePrefix) - for inputfile in dir: - if inputfile.find(filePrefix) >=0: - if filePrefix == "cu": - outputfile1 = 'config/cu.fdd.config' - elif filePrefix == "du": - outputfile1 = 'config/du.fdd.config' - elif filePrefix == "du": - outputfile1 = 'config/du.fdd.config' - elif filePrefix == "rru.fdd": - outputfile1 = 'config/rru.fdd.config' - elif filePrefix == "rru.tdd": - outputfile1 = 'config/rru.tdd.config' - elif filePrefix == "enb.band7.tm1.25PRB.usrpb210": - outputfile1 = 'config/enb.fdd.config' - elif filePrefix == "enb.band40.tm1.25PRB.FairScheduler.usrpb210": - outputfile1 = 'config/enb.tdd.config' -# elif filePrefix == "rcc.band7.tm1.nfapi": -# outputfile1 = 'config/rcc.if4p5.enb.fdd.config' -# elif filePrefix == "rcc.band7.tm1.nfapi": -# outputfile1 = 'config/rcc.if4p5.enb.tdd.config' + #identify configs, read and replace corresponding values + for config in data[1]["configurations"]: + filePrefix = config["filePrefix"] + outputfilename = config["outputfilename"] + for inputfile in dir: + if inputfile.find(filePrefix) >=0: + prefix_outputfile = {"cu": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}', + "du": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}', + "rru.fdd": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}', + "rru.tdd": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}', + "enb.band7.tm1.25PRB.usrpb210": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}', + "enb.band40.tm1.25PRB.FairScheduler.usrpb210": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}' + "rcc.band7.tm1.nfapi": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}' + } + if filePrefix in prefix_outputfile: + outputfile1 = prefix_outputfile[filePrefix] - directory = 'config/' - if not os.path.exists(directory): - os.makedirs(directory, exist_ok=True) - - with open("/home/mohammed/Documents/conf_files/%s" % (inputfile), mode='r') as inputfile, \ - open(outputfile1, mode='w') as outputfile: - for line in inputfile: - count = 0 - for key in config["config"]: - if line.find(key["key"]) >= 0: - count += 1 - if re.search(r'preference', line): - templine = line - elif re.search(r'plmn_list', line): - templine = re.sub(r'[0-9]+', '""', line) - templine = re.sub(r'\"\"', key["env"]["mcc"], templine, 1) - templine = re.sub(r'\"\"', key["env"]["mnc"], templine, 1) - templine = re.sub(r'\"\"', key["env"]["mnc_length"], templine, 1) - elif re.search('downlink_frequency', line): - templine = re.sub(r'[0-9]+', key["env"], line) - elif re.search('uplink_frequency_offset', line): - templine = re.sub(r'[0-9]+', key["env"], line) - - elif re.search(r'"(.*?)"', line): - templine = re.sub(r'(?<=")[^"]*(?=")', key["env"], line) # for quotes - elif re.search(r'[0-9]', line): - templine = re.sub(r'\d+', key["env"], line) - outputfile.write(templine) - - if count == 0: - outputfile.write(line) -#read file and replace with ... + directory = f'{data[0]["paths"]["dest_dir"]}' + if not os.path.exists(directory): + os.makedirs(directory, exist_ok=True) + with open(f'{data[0]["paths"]["source_dir"]}{inputfile}', mode='r') as inputfile, \ + open(outputfile1, mode='w') as outputfile: + for line in inputfile: + count = 0 + for key in config["config"]: + if line.find(key["key"]) >= 0: + count += 1 + if re.search(r'preference', line): + templine = line + elif re.search(r'plmn_list', line): + templine = re.sub(r'[0-9]+', '""', line) + templine = re.sub(r'\"\"', key["env"]["mcc"], templine, 1) + templine = re.sub(r'\"\"', key["env"]["mnc"], templine, 1) + templine = re.sub(r'\"\"', key["env"]["mnc_length"], templine, 1) + elif re.search('downlink_frequency', line): + templine = re.sub(r'[0-9]+', key["env"], line) + elif re.search('uplink_frequency_offset', line): + templine = re.sub(r'[0-9]+', key["env"], line) + + elif re.search(r'"(.*?)"', line): + templine = re.sub(r'(?<=")[^"]*(?=")', key["env"], line) + elif re.search(r'[0-9]', line): + templine = re.sub(r'\d+', key["env"], line) + outputfile.write(templine) + + if count == 0: + outputfile.write(line) + +if __name__ == "__main__": + main() diff --git a/docker/scripts/parameters.yaml b/docker/scripts/parameters.yaml new file mode 100644 index 0000000000..be8df2bac4 --- /dev/null +++ b/docker/scripts/parameters.yaml @@ -0,0 +1,221 @@ +--- +- paths: + source_dir: "/home/mohammed/Documents/conf_files/" + dest_dir: docker/etc + +- configurations: + - filePrefix: cu + outputfilename: "cu.fdd.conf" + config: + - key: Active_eNBs + env: "@ENB_NAME@" + - key: eNB_name + env: "@ENB_NAME@" + - key: plmn_list + env: + mcc: "@MCC@" + mnc: "@MNC@" + mnc_length: "@MNC_LENGTH@" + - key: tracking_area_code + env: "@TAC@" + - key: local_s_if_name + env: "@F1_IF_NAME@" + - key: remote_s_address + env: "@F1_DU_IP_ADDRESS@" + - key: local_s_address + env: "@F1_CU_IP_ADDRESS@" + - key: eutra_band + env: "@UTRA_BAND_ID@" + - key: downlink_frequency + env: "@DL_FREQUENCY_IN_MHZ@000000" + - key: uplink_frequency_offset + env: "@UL_FREQUENCY_OFFSET_IN_MHZ@000000" + - key: Nid_cell + env: "@NID_CELL@" + - key: N_RB_DL + env: "@NB_PRB@" + - key: ipv4 + env: "@MME_S1C_IP_ADDRESS@" + - key: ENB_INTERFACE_NAME_FOR_S1_MME + env: "@S1C_IF_NAME@" + - key: ENB_IPV4_ADDRESS_FOR_S1_MME + env: "@F1_CU_IP_ADDRESS@" + - key: ENB_INTERFACE_NAME_FOR_S1U + env: "@S1U_IF_NAME@" + - key: ENB_IPV4_ADDRESS_FOR_S1U + env: "@F1_CU_IP_ADDRESS@" + - key: ENB_IPV4_ADDRESS_FOR_X2C + env: "@F1_CU_IP_ADDRESS@" + + - filePrefix: du + outputfilename: "du.fdd.conf" + config: + - key: Active_eNBs + env: "@ENB_NAME@" + - key: eNB_name + env: "@ENB_NAME@" + - key: plmn_list + env: + mcc: "@MCC@" + mnc: "@MNC@" + mnc_length: "@MNC_LENGTH@" + - key: tracking_area_code + env: "@TAC@" + - key: local_n_if_name + env: "@F1_IF_NAME@" + - key: remote_n_address + env: "@F1_DU_IP_ADDRESS@" + - key: local_n_address + env: "@F1_CU_IP_ADDRESS@" + - key: eutra_band + env: "@UTRA_BAND_ID@" + - key: downlink_frequency + env: "@DL_FREQUENCY_IN_MHZ@000000" + - key: uplink_frequency_offset + env: "@UL_FREQUENCY_OFFSET_IN_MHZ@000000" + - key: Nid_cell + env: "@NID_CELL@" + - key: N_RB_DL + env: "@NB_PRB@" + + - filePrefix: rru.fdd + outputfilename: "rru.fdd.conf" + config: + - key: local_if_name + env: "@@" + - key: remote_address + env: "@@" + - key: local_address + env: "@@" + - key: bands + env: "@@" + + - filePrefix: rru.tdd + outputfilename: "rru.tdd.conf" + config: + - key: local_if_name + env: "@@" + - key: remote_address + env: "@@" + - key: local_address + env: "@@" + - key: bands + env: "@@" + + - filePrefix: enb.band7.tm1.25PRB.usrpb210 + outputfilename: "enb.fdd.conf" + config: + - key: Active_eNBs + env: "@ENB_NAME@" + - key: eNB_name + env: "@ENB_NAME@" + - key: plmn_list + env: + mcc: "@MCC@" + mnc: "@MNC@" + mnc_length: "@MNC_LENGTH@" + - key: tracking_area_code + env: "@TAC@" + - key: eutra_band + env: "@UTRA_BAND_ID@" + - key: downlink_frequency + env: "@DL_FREQUENCY_IN_MHZ@000000" + - key: uplink_frequency_offset + env: "@UL_FREQUENCY_OFFSET_IN_MHZ@000000" + - key: Nid_cell + env: "@NID_CELL@" + - key: N_RB_DL + env: "@NB_PRB@" + - key: ipv4 + env: "@MME_S1C_IP_ADDRESS@" + - key: ENB_INTERFACE_NAME_FOR_S1_MME + env: "@S1C_IF_NAME@" + - key: ENB_IPV4_ADDRESS_FOR_S1_MME + env: "@F1_CU_IP_ADDRESS@" + - key: ENB_INTERFACE_NAME_FOR_S1U + env: "@S1U_IF_NAME@" + - key: ENB_IPV4_ADDRESS_FOR_S1U + env: "@F1_CU_IP_ADDRESS@" + - key: ENB_IPV4_ADDRESS_FOR_X2C + env: "@F1_CU_IP_ADDRESS@" + + - filePrefix: enb.band40.tm1.25PRB.FairScheduler.usrpb210 + outputfilename: "enb.tdd.conf" + config: + - key: Active_eNBs + env: "@ENB_NAME@" + - key: eNB_name + env: "@ENB_NAME@" + - key: plmn_list + env: + mcc: "@MCC@" + mnc: "@MNC@" + mnc_length: "@MNC_LENGTH@" + - key: tracking_area_code + env: "@TAC@" + - key: eutra_band + env: "@UTRA_BAND_ID@" + - key: downlink_frequency + env: "@DL_FREQUENCY_IN_MHZ@000000" + - key: uplink_frequency_offset + env: "@UL_FREQUENCY_OFFSET_IN_MHZ@000000" + - key: Nid_cell + env: "@NID_CELL@" + - key: N_RB_DL + env: "@NB_PRB@" + - key: ipv4 + env: "@MME_S1C_IP_ADDRESS@" + - key: ENB_INTERFACE_NAME_FOR_S1_MME + env: "@S1C_IF_NAME@" + - key: ENB_IPV4_ADDRESS_FOR_S1_MME + env: "@F1_CU_IP_ADDRESS@" + - key: ENB_INTERFACE_NAME_FOR_S1U + env: "@S1U_IF_NAME@" + - key: ENB_IPV4_ADDRESS_FOR_S1U + env: "@F1_CU_IP_ADDRESS@" + - key: ENB_IPV4_ADDRESS_FOR_X2C + env: "@F1_CU_IP_ADDRESS@" + + - filePrefix: "rcc.band7.tm1.nfapi" + outputfilename: "rcc.if4p5.enb.fdd.conf" + config: + - key: Active_eNBs + env: "@ENB_NAME@" + - key: eNB_name + env: "@ENB_NAME@" + - key: plmn_list + env: + mcc: "@MCC@" + mnc: "@MNC@" + mnc_length: "@MNC_LENGTH@" + - key: tracking_area_code + env: "@TAC@" + - key: local_s_if_name + env: "@F1_IF_NAME@" + - key: remote_s_address + env: "@F1_DU_IP_ADDRESS@" + - key: local_s_address + env: "@F1_CU_IP_ADDRESS@" + - key: eutra_band + env: "@UTRA_BAND_ID@" + - key: downlink_frequency + env: "@DL_FREQUENCY_IN_MHZ@000000" + - key: uplink_frequency_offset + env: "@UL_FREQUENCY_OFFSET_IN_MHZ@000000" + - key: Nid_cell + env: "@NID_CELL@" + - key: N_RB_DL + env: "@NB_PRB@" + - key: ipv4 + env: "@MME_S1C_IP_ADDRESS@" + - key: ENB_INTERFACE_NAME_FOR_S1_MME + env: "@S1C_IF_NAME@" + - key: ENB_IPV4_ADDRESS_FOR_S1_MME + env: "@F1_CU_IP_ADDRESS@" + - key: ENB_INTERFACE_NAME_FOR_S1U + env: "@S1U_IF_NAME@" + - key: ENB_IPV4_ADDRESS_FOR_S1U + env: "@F1_CU_IP_ADDRESS@" + - key: ENB_IPV4_ADDRESS_FOR_X2C + env: "@F1_CU_IP_ADDRESS@" + From da5a034e2bfe8ed5b3f13d4424387d41caa1ab49 Mon Sep 17 00:00:00 2001 From: Mohammed Ismail Date: Fri, 6 Nov 2020 13:38:26 +0100 Subject: [PATCH 06/10] updated Signed-off-by: Mohammed Ismail --- docker/scripts/generateTemplate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/scripts/generateTemplate.py b/docker/scripts/generateTemplate.py index aaaed1d5a8..acbf4819a5 100644 --- a/docker/scripts/generateTemplate.py +++ b/docker/scripts/generateTemplate.py @@ -44,7 +44,7 @@ def main(): "rru.fdd": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}', "rru.tdd": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}', "enb.band7.tm1.25PRB.usrpb210": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}', - "enb.band40.tm1.25PRB.FairScheduler.usrpb210": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}' + "enb.band40.tm1.25PRB.FairScheduler.usrpb210": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}', "rcc.band7.tm1.nfapi": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}' } if filePrefix in prefix_outputfile: From 152f73458d900bb77a6f6a50186b30d30b155352 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Mon, 16 Nov 2020 13:32:38 +0100 Subject: [PATCH 07/10] [DOCKER] fixes after review Signed-off-by: Raphael Defosseux --- docker/scripts/generateTemplate.py | 3 + docker/scripts/parameters.json | 304 ----------------------------- docker/scripts/parameters.yaml | 23 ++- 3 files changed, 25 insertions(+), 305 deletions(-) delete mode 100644 docker/scripts/parameters.json diff --git a/docker/scripts/generateTemplate.py b/docker/scripts/generateTemplate.py index acbf4819a5..4949e9cf21 100644 --- a/docker/scripts/generateTemplate.py +++ b/docker/scripts/generateTemplate.py @@ -1,3 +1,6 @@ +#/* +# * 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 diff --git a/docker/scripts/parameters.json b/docker/scripts/parameters.json deleted file mode 100644 index 5e3fde5769..0000000000 --- a/docker/scripts/parameters.json +++ /dev/null @@ -1,304 +0,0 @@ -[ - { - "filePrefix": "cu", - "config": [ - { - "key": "Active_eNBs", - "env": "@ENB_NAME@" - }, - { - "key": "eNB_name", - "env": "@ENB_NAME@" - }, - { - "key": "plmn_list", - "env": {"mcc": "@MCC@", "mnc": "@MNC@", "mnc_length": "@MNC_LENGTH@"} - }, - { - "key": "tracking_area_code", - "env": "@TAC@" - }, - { - "key": "local_s_if_name", - "env": "@F1_IF_NAME@" - }, - { - "key": "remote_s_address", - "env": "@F1_DU_IP_ADDRESS@" - }, - { - "key": "local_s_address", - "env": "@F1_CU_IP_ADDRESS@" - }, - { - "key": "eutra_band", - "env": "@UTRA_BAND_ID@" - }, - { - "key": "downlink_frequency", - "env": "@DL_FREQUENCY_IN_MHZ@000000" - }, - { - "key": "uplink_frequency_offset", - "env": "@UL_FREQUENCY_OFFSET_IN_MHZ@000000" - }, - { - "key": "Nid_cell", - "env": "@NID_CELL@" - }, - { - "key": "N_RB_DL", - "env": "@NB_PRB@" - }, - { - "key": "ipv4", - "env": "@MME_S1C_IP_ADDRESS@" - }, - { - "key": "ENB_INTERFACE_NAME_FOR_S1_MME", - "env": "@S1C_IF_NAME@" - }, - { - "key": "ENB_IPV4_ADDRESS_FOR_S1_MME", - "env": "@F1_CU_IP_ADDRESS@" - }, - { - "key": "ENB_INTERFACE_NAME_FOR_S1U", - "env": "@S1U_IF_NAME@" - }, - { - "key": "ENB_IPV4_ADDRESS_FOR_S1U", - "env": "@F1_CU_IP_ADDRESS@" - }, - { - "key": "ENB_IPV4_ADDRESS_FOR_X2C", - "env": "@F1_CU_IP_ADDRESS@" - } - ] - }, - { - "filePrefix": "du", - "config": [ - { - "key": "Active_eNBs", - "env": "@ENB_NAME@" - }, - { - "key": "eNB_name", - "env": "@ENB_NAME@" - }, - { - "key": "plmn_list", - "env": {"mcc": "@MCC@", "mnc": "@MNC@", "mnc_length": "@MNC_LENGTH@"} - }, - { - "key": "tracking_area_code", - "env": "@TAC@" - }, - { - "key": "local_n_if_name", - "env": "@F1_IF_NAME@" - }, - { - "key": "remote_n_address", - "env": "@F1_DU_IP_ADDRESS@" - }, - { - "key": "local_n_address", - "env": "@F1_CU_IP_ADDRESS@" - }, - { - "key": "eutra_band", - "env": "@UTRA_BAND_ID@" - }, - { - "key": "downlink_frequency", - "env": "@DL_FREQUENCY_IN_MHZ@000000" - }, - { - "key": "uplink_frequency_offset", - "env": "@UL_FREQUENCY_OFFSET_IN_MHZ@000000" - }, - { - "key": "Nid_cell", - "env": "@NID_CELL@" - }, - { - "key": "N_RB_DL", - "env": "@NB_PRB@" - } - ] - }, - { - "filePrefix": "rru.fdd", - "config": [ - { - "key": "local_if_name", - "env": "@@" - }, - { - "key": "remote_address", - "env": "@@" - }, - { - "key": "local_address", - "env": "@@" - }, - { - "key": "bands", - "env": "@@" - } - ] - }, - { - "filePrefix": "rru.tdd", - "config": [ - { - "key": "local_if_name", - "env": "@@" - }, - { - "key": "remote_address", - "env": "@@" - }, - { - "key": "local_address", - "env": "@@" - }, - { - "key": "bands", - "env": "@@" - } - ] - }, - { - "filePrefix": "enb.band7.tm1.25PRB.usrpb210", - "config": [ - { - "key": "Active_eNBs", - "env": "@ENB_NAME@" - }, - { - "key": "eNB_name", - "env": "@ENB_NAME@" - }, - { - "key": "plmn_list", - "env": {"mcc": "@MCC@", "mnc": "@MNC@", "mnc_length": "@MNC_LENGTH@"} - }, - { - "key": "tracking_area_code", - "env": "@TAC@" - }, - { - "key": "eutra_band", - "env": "@UTRA_BAND_ID@" - }, - { - "key": "downlink_frequency", - "env": "@DL_FREQUENCY_IN_MHZ@000000" - }, - { - "key": "uplink_frequency_offset", - "env": "@UL_FREQUENCY_OFFSET_IN_MHZ@000000" - }, - { - "key": "Nid_cell", - "env": "@NID_CELL@" - }, - { - "key": "N_RB_DL", - "env": "@NB_PRB@" - }, - { - "key": "ipv4", - "env": "@MME_S1C_IP_ADDRESS@" - }, - { - "key": "ENB_INTERFACE_NAME_FOR_S1_MME", - "env": "@S1C_IF_NAME@" - }, - { - "key": "ENB_IPV4_ADDRESS_FOR_S1_MME", - "env": "@F1_CU_IP_ADDRESS@" - }, - { - "key": "ENB_INTERFACE_NAME_FOR_S1U", - "env": "@S1U_IF_NAME@" - }, - { - "key": "ENB_IPV4_ADDRESS_FOR_S1U", - "env": "@F1_CU_IP_ADDRESS@" - }, - { - "key": "ENB_IPV4_ADDRESS_FOR_X2C", - "env": "@F1_CU_IP_ADDRESS@" - } - ] - }, - { - "filePrefix": "enb.band40.tm1.25PRB.FairScheduler.usrpb210", - "config": [ - { - "key": "Active_eNBs", - "env": "@ENB_NAME@" - }, - { - "key": "eNB_name", - "env": "@ENB_NAME@" - }, - { - "key": "plmn_list", - "env": {"mcc": "@MCC@", "mnc": "@MNC@", "mnc_length": "@MNC_LENGTH@"} - }, - { - "key": "tracking_area_code", - "env": "@TAC@" - }, - { - "key": "eutra_band", - "env": "@UTRA_BAND_ID@" - }, - { - "key": "downlink_frequency", - "env": "@DL_FREQUENCY_IN_MHZ@000000" - }, - { - "key": "uplink_frequency_offset", - "env": "@UL_FREQUENCY_OFFSET_IN_MHZ@000000" - }, - { - "key": "Nid_cell", - "env": "@NID_CELL@" - }, - { - "key": "N_RB_DL", - "env": "@NB_PRB@" - }, - { - "key": "ipv4", - "env": "@MME_S1C_IP_ADDRESS@" - }, - { - "key": "ENB_INTERFACE_NAME_FOR_S1_MME", - "env": "@S1C_IF_NAME@" - }, - { - "key": "ENB_IPV4_ADDRESS_FOR_S1_MME", - "env": "@F1_CU_IP_ADDRESS@" - }, - { - "key": "ENB_INTERFACE_NAME_FOR_S1U", - "env": "@S1U_IF_NAME@" - }, - { - "key": "ENB_IPV4_ADDRESS_FOR_S1U", - "env": "@F1_CU_IP_ADDRESS@" - }, - { - "key": "ENB_IPV4_ADDRESS_FOR_X2C", - "env": "@F1_CU_IP_ADDRESS@" - } - ] - } -] diff --git a/docker/scripts/parameters.yaml b/docker/scripts/parameters.yaml index be8df2bac4..2661e89793 100644 --- a/docker/scripts/parameters.yaml +++ b/docker/scripts/parameters.yaml @@ -1,6 +1,27 @@ +#/* +# * 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 +# */ + --- - paths: - source_dir: "/home/mohammed/Documents/conf_files/" + source_dir: "ci-scripts/conf_files/" dest_dir: docker/etc - configurations: From e9b6d0705d34ac982de6baff93ecaf0534056327 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Mon, 23 Nov 2020 16:31:45 +0100 Subject: [PATCH 08/10] [docker] adding entrypoint and template generation to dockerfile for u18 Signed-off-by: Raphael Defosseux --- docker/Dockerfile.eNB.ubuntu18 | 22 +++++----- docker/scripts/enb_entrypoint.sh | 44 +++++++++++++++++++ .../{parameters.yaml => enb_parameters.yaml} | 0 3 files changed, 55 insertions(+), 11 deletions(-) create mode 100755 docker/scripts/enb_entrypoint.sh rename docker/scripts/{parameters.yaml => enb_parameters.yaml} (100%) diff --git a/docker/Dockerfile.eNB.ubuntu18 b/docker/Dockerfile.eNB.ubuntu18 index 9b6e5cb47d..600bbb0631 100644 --- a/docker/Dockerfile.eNB.ubuntu18 +++ b/docker/Dockerfile.eNB.ubuntu18 @@ -35,6 +35,10 @@ RUN /bin/sh oaienv && \ mkdir -p log && \ ./build_oai --eNB --ninja -w USRP +RUN apt-get install -y python3-pip && \ + pip3 install --ignore-installed pyyaml && \ + python3 ./docker/scripts/generateTemplate.py ./docker/scripts/parameters.yaml + # debug #RUN ldconfig -v && ldd /oai-ran/targets/bin/lte-softmodem.Rel15 #RUN ls -ls /oai-ran/targets/bin @@ -73,6 +77,7 @@ RUN apt-get update && \ WORKDIR /opt/oai-enb/bin COPY --from=enb-build /oai-ran/targets/bin/lte-softmodem.Rel15 . +COPY --from=enb-build /oai-ran/docker/scripts/enb_entrypoint.sh entrypoint.sh WORKDIR /usr/local/lib/ COPY --from=enb-build /oai-ran/targets/bin/liboai_eth_transpro.so.Rel15 . @@ -104,21 +109,16 @@ RUN ldconfig # Copy the relevant configuration files for eNB WORKDIR /opt/oai-enb/etc -COPY --from=enb-build /oai-ran/ci-scripts/conf_files/enb.* ./ -COPY --from=enb-build /oai-ran/ci-scripts/conf_files/rcc.* ./ -COPY --from=enb-build /oai-ran/ci-scripts/conf_files/cu.* ./ -COPY --from=enb-build /oai-ran/ci-scripts/conf_files/du.* ./ -COPY --from=enb-build /oai-ran/ci-scripts/conf_files/rru.* ./ +COPY --from=enb-build /oai-ran/docker/etc . WORKDIR /opt/oai-enb -#EXPOSE 2152/udp # S1U, GTP/UDP +EXPOSE 2152/udp # S1U, GTP/UDP +EXPOSE 36412/udp # S1C, SCTP/UDP +EXPOSE 36422/udp # X2C, SCTP/UDP #EXPOSE 22100/tcp # ? -#EXPOSE 36412/udp # S1C, SCTP/UDP -#EXPOSE 36422/udp # X2C, SCTP/UDP #EXPOSE 50000/udp # IF5 / ORI (control) #EXPOSE 50001/udp # IF5 / ECPRI (data) -#CMD ["/opt/oai-enb/bin/lte-softmodem", "-O", "/opt/oai-enb/etc/enb.conf"] -#ENTRYPOINT ["/opt/oai-enb/bin/entrypoint.sh"] -CMD ["sleep", "infinity"] +ENTRYPOINT ["/opt/oai-enb/bin/entrypoint.sh"] +CMD ["/opt/oai-enb/bin/lte-softmodem.Rel15", "-O", "/opt/oai-enb/etc/enb.conf"] diff --git a/docker/scripts/enb_entrypoint.sh b/docker/scripts/enb_entrypoint.sh new file mode 100755 index 0000000000..110030c139 --- /dev/null +++ b/docker/scripts/enb_entrypoint.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +set -euo pipefail + +# Based another env var +if [[ -v USE_FDD_CU ]]; then ln -s /opt/oai-enb/etc/cu.fdd.conf /opt/oai-enb/etc/enb.conf; fi +if [[ -v USE_FDD_DU ]]; then ln -s /opt/oai-enb/etc/du.fdd.conf /opt/oai-enb/etc/enb.conf; fi +if [[ -v USE_FDD_MONO ]]; then ln -s /opt/oai-enb/etc/enb.fdd.conf /opt/oai-enb/etc/enb.conf; fi +if [[ -v USE_TDD_MONO ]]; then ln -s /opt/oai-enb/etc/enb.tdd.conf /opt/oai-enb/etc/enb.conf; fi +if [[ -v USE_FDD_RCC ]]; then ln -s /opt/oai-enb/etc/rcc.if4p5.enb.fdd.conf /opt/oai-enb/etc/enb.conf; fi +if [[ -v USE_FDD_RRU ]]; then ln -s /opt/oai-enb/etc/rru.fdd.conf /opt/oai-enb/etc/enb.conf; fi +if [[ -v USE_TDD_RRU ]]; then ln -s /opt/oai-enb/etc/rru.tdd.conf /opt/oai-enb/etc/enb.conf; fi + +CONFIG_FILES=`ls /opt/oai-enb/etc/enb.conf` + +for c in ${CONFIG_FILES}; do + # grep variable names (format: ${VAR}) from template to be rendered + VARS=$(grep -oP '@[a-zA-Z0-9_]+@' ${c} | sort | uniq | xargs) + + # create sed expressions for substituting each occurrence of ${VAR} + # with the value of the environment variable "VAR" + EXPRESSIONS="" + for v in ${VARS}; do + NEW_VAR=`echo $v | sed -e "s#@##g"` + if [[ "${!NEW_VAR}x" == "x" ]]; then + echo "Error: Environment variable '${NEW_VAR}' is not set." \ + "Config file '$(basename $c)' requires all of $VARS." + exit 1 + fi + EXPRESSIONS="${EXPRESSIONS};s|${v}|${!NEW_VAR}|g" + done + EXPRESSIONS="${EXPRESSIONS#';'}" + + # render template and inline replace config file + sed -i "${EXPRESSIONS}" ${c} +done + +# Later-on, how to add command lines options? + +# Load the USRP binaries +# --> later conditional (when doing simulators) +/usr/lib/uhd/utils/uhd_images_downloader.py + +exec "$@" diff --git a/docker/scripts/parameters.yaml b/docker/scripts/enb_parameters.yaml similarity index 100% rename from docker/scripts/parameters.yaml rename to docker/scripts/enb_parameters.yaml From 9af06d7ec57b19ed7e07b3e5c5b573f2b7cf733d Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Thu, 26 Nov 2020 20:31:36 +0100 Subject: [PATCH 09/10] [DOCKER] fix in dockerfile, cannot have comment in same line Signed-off-by: Raphael Defosseux --- docker/Dockerfile.eNB.ubuntu18 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docker/Dockerfile.eNB.ubuntu18 b/docker/Dockerfile.eNB.ubuntu18 index 600bbb0631..cb9c97cbf8 100644 --- a/docker/Dockerfile.eNB.ubuntu18 +++ b/docker/Dockerfile.eNB.ubuntu18 @@ -113,9 +113,10 @@ COPY --from=enb-build /oai-ran/docker/etc . WORKDIR /opt/oai-enb -EXPOSE 2152/udp # S1U, GTP/UDP -EXPOSE 36412/udp # S1C, SCTP/UDP -EXPOSE 36422/udp # X2C, SCTP/UDP +# 2152 --> S1U, GTP/UDP +# 36412 --> S1C, SCTP/UDP +# 36422 --> X2C, SCTP/UDP +EXPOSE 2152/udp 36412/udp 36422/udp #EXPOSE 22100/tcp # ? #EXPOSE 50000/udp # IF5 / ORI (control) #EXPOSE 50001/udp # IF5 / ECPRI (data) From 858a1dc0904a191f504abf4d134fa1ff8e1a4761 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Sat, 28 Nov 2020 22:35:47 +0100 Subject: [PATCH 10/10] [DOCKER] remove log folder (contains the install logs) Signed-off-by: Raphael Defosseux --- docker/Dockerfile.eNB.rhel8.2 | 1 + docker/Dockerfile.eNB.rhel8.2.oc4-4 | 1 + docker/Dockerfile.eNB.ubuntu18 | 1 + docker/Dockerfile.gNB.rhel8.2 | 1 + docker/Dockerfile.gNB.rhel8.2.oc4-4 | 1 + docker/Dockerfile.gNB.ubuntu18 | 1 + docker/Dockerfile.lteUE.rhel8.2 | 1 + docker/Dockerfile.lteUE.rhel8.2.oc4-4 | 1 + docker/Dockerfile.lteUE.ubuntu18 | 1 + docker/Dockerfile.nrUE.rhel8.2 | 1 + docker/Dockerfile.nrUE.rhel8.2.oc4-4 | 1 + docker/Dockerfile.nrUE.ubuntu18 | 1 + 12 files changed, 12 insertions(+) diff --git a/docker/Dockerfile.eNB.rhel8.2 b/docker/Dockerfile.eNB.rhel8.2 index 363b070934..5fcd5a7b9f 100644 --- a/docker/Dockerfile.eNB.rhel8.2 +++ b/docker/Dockerfile.eNB.rhel8.2 @@ -32,6 +32,7 @@ WORKDIR /oai-ran #run build_oai to build the target image RUN /bin/sh oaienv && \ cd cmake_targets && \ + rm -Rf log && \ mkdir -p log && \ ./build_oai --eNB --ninja -w USRP diff --git a/docker/Dockerfile.eNB.rhel8.2.oc4-4 b/docker/Dockerfile.eNB.rhel8.2.oc4-4 index 039183a0f2..5b784c08a2 100644 --- a/docker/Dockerfile.eNB.rhel8.2.oc4-4 +++ b/docker/Dockerfile.eNB.rhel8.2.oc4-4 @@ -33,6 +33,7 @@ WORKDIR /oai-ran #run build_oai to build the target image RUN /bin/sh oaienv && \ cd cmake_targets && \ + rm -Rf log && \ mkdir -p log && \ ./build_oai --eNB --ninja -w USRP diff --git a/docker/Dockerfile.eNB.ubuntu18 b/docker/Dockerfile.eNB.ubuntu18 index cb9c97cbf8..1349a0c7e1 100644 --- a/docker/Dockerfile.eNB.ubuntu18 +++ b/docker/Dockerfile.eNB.ubuntu18 @@ -32,6 +32,7 @@ WORKDIR /oai-ran #run build_oai to build the target image RUN /bin/sh oaienv && \ cd cmake_targets && \ + rm -Rf log && \ mkdir -p log && \ ./build_oai --eNB --ninja -w USRP diff --git a/docker/Dockerfile.gNB.rhel8.2 b/docker/Dockerfile.gNB.rhel8.2 index 901df9757c..fb9ade927f 100644 --- a/docker/Dockerfile.gNB.rhel8.2 +++ b/docker/Dockerfile.gNB.rhel8.2 @@ -32,6 +32,7 @@ WORKDIR /oai-ran #run build_oai to build the target image RUN /bin/sh oaienv && \ cd cmake_targets && \ + rm -Rf log && \ mkdir -p log && \ ./build_oai --gNB --ninja -w USRP diff --git a/docker/Dockerfile.gNB.rhel8.2.oc4-4 b/docker/Dockerfile.gNB.rhel8.2.oc4-4 index 197bc2a92a..1e1eba016e 100644 --- a/docker/Dockerfile.gNB.rhel8.2.oc4-4 +++ b/docker/Dockerfile.gNB.rhel8.2.oc4-4 @@ -33,6 +33,7 @@ WORKDIR /oai-ran #run build_oai to build the target image RUN /bin/sh oaienv && \ cd cmake_targets && \ + rm -Rf log && \ mkdir -p log && \ ./build_oai --gNB --ninja -w USRP diff --git a/docker/Dockerfile.gNB.ubuntu18 b/docker/Dockerfile.gNB.ubuntu18 index 4135b0e785..d43ad4709d 100644 --- a/docker/Dockerfile.gNB.ubuntu18 +++ b/docker/Dockerfile.gNB.ubuntu18 @@ -32,6 +32,7 @@ WORKDIR /oai-ran #run build_oai to build the target image RUN /bin/sh oaienv && \ cd cmake_targets && \ + rm -Rf log && \ mkdir -p log && \ ./build_oai --gNB --ninja -w USRP diff --git a/docker/Dockerfile.lteUE.rhel8.2 b/docker/Dockerfile.lteUE.rhel8.2 index 6b64fdec1e..0a853dcd6b 100644 --- a/docker/Dockerfile.lteUE.rhel8.2 +++ b/docker/Dockerfile.lteUE.rhel8.2 @@ -33,6 +33,7 @@ WORKDIR /oai-ran #run build_oai to build the target image RUN /bin/sh oaienv && \ cd cmake_targets && \ + rm -Rf log && \ mkdir -p log && \ ./build_oai --UE --ninja -w USRP diff --git a/docker/Dockerfile.lteUE.rhel8.2.oc4-4 b/docker/Dockerfile.lteUE.rhel8.2.oc4-4 index c390e01e3b..1339d18de6 100644 --- a/docker/Dockerfile.lteUE.rhel8.2.oc4-4 +++ b/docker/Dockerfile.lteUE.rhel8.2.oc4-4 @@ -33,6 +33,7 @@ WORKDIR /oai-ran #run build_oai to build the target image RUN /bin/sh oaienv && \ cd cmake_targets && \ + rm -Rf log && \ mkdir -p log && \ ./build_oai --UE --ninja -w USRP diff --git a/docker/Dockerfile.lteUE.ubuntu18 b/docker/Dockerfile.lteUE.ubuntu18 index f1233d6a01..8793cc54f7 100644 --- a/docker/Dockerfile.lteUE.ubuntu18 +++ b/docker/Dockerfile.lteUE.ubuntu18 @@ -32,6 +32,7 @@ WORKDIR /oai-ran #run build_oai to build the target image RUN /bin/sh oaienv && \ cd cmake_targets && \ + rm -Rf log && \ mkdir -p log && \ ./build_oai --UE --ninja -w USRP diff --git a/docker/Dockerfile.nrUE.rhel8.2 b/docker/Dockerfile.nrUE.rhel8.2 index 466eeedd40..f9f3f8e4bf 100644 --- a/docker/Dockerfile.nrUE.rhel8.2 +++ b/docker/Dockerfile.nrUE.rhel8.2 @@ -32,6 +32,7 @@ WORKDIR /oai-ran #run build_oai to build the target image RUN /bin/sh oaienv && \ cd cmake_targets && \ + rm -Rf log && \ mkdir -p log && \ ./build_oai --nrUE --ninja -w USRP diff --git a/docker/Dockerfile.nrUE.rhel8.2.oc4-4 b/docker/Dockerfile.nrUE.rhel8.2.oc4-4 index 3b09b18b55..d900fff998 100644 --- a/docker/Dockerfile.nrUE.rhel8.2.oc4-4 +++ b/docker/Dockerfile.nrUE.rhel8.2.oc4-4 @@ -33,6 +33,7 @@ WORKDIR /oai-ran #run build_oai to build the target image RUN /bin/sh oaienv && \ cd cmake_targets && \ + rm -Rf log && \ mkdir -p log && \ ./build_oai --nrUE --ninja -w USRP diff --git a/docker/Dockerfile.nrUE.ubuntu18 b/docker/Dockerfile.nrUE.ubuntu18 index eecadacb50..5450194f35 100644 --- a/docker/Dockerfile.nrUE.ubuntu18 +++ b/docker/Dockerfile.nrUE.ubuntu18 @@ -32,6 +32,7 @@ WORKDIR /oai-ran #run build_oai to build the target image RUN /bin/sh oaienv && \ cd cmake_targets && \ + rm -Rf log && \ mkdir -p log && \ ./build_oai --nrUE --ninja -w USRP