Commit b0797c08 authored by hardy's avatar hardy

Merge remote-tracking branch 'origin/finalize-oaicn-integration' into integration_2020_wk44

parents 97d284be 41d05979
*.log
cmake_targets/log/
cmake_targets/ran_build/
common/utils/T/T_IDs.h
common/utils/T/T_messages.txt.h
common/utils/T/genids
common/utils/T/genids.o
targets/bin/
...@@ -35,6 +35,9 @@ def doFlexranCtrlTest = false ...@@ -35,6 +35,9 @@ def doFlexranCtrlTest = false
// Location of the executor node // Location of the executor node
def nodeExecutor = params.nodeExecutor def nodeExecutor = params.nodeExecutor
// VM Lockable resources
def vmResource = params.vmLockableResource
pipeline { pipeline {
agent { agent {
label nodeExecutor label nodeExecutor
...@@ -159,65 +162,81 @@ pipeline { ...@@ -159,65 +162,81 @@ pipeline {
stage ("Start VM -- basic-sim") { stage ("Start VM -- basic-sim") {
steps { steps {
lock (vmResource) {
timeout (time: 5, unit: 'MINUTES') { timeout (time: 5, unit: 'MINUTES') {
sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant basic-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon" sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant basic-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon"
} }
}
} }
} }
stage ("Start VM -- gnb-usrp") { stage ("Start VM -- gnb-usrp") {
steps { steps {
lock (vmResource) {
timeout (time: 5, unit: 'MINUTES') { timeout (time: 5, unit: 'MINUTES') {
sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant gnb-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon" sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant gnb-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon"
} }
}
} }
} }
stage ("Start VM -- nr-ue-usrp") { stage ("Start VM -- nr-ue-usrp") {
steps { steps {
lock (vmResource) {
timeout (time: 5, unit: 'MINUTES') { timeout (time: 5, unit: 'MINUTES') {
sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant nr-ue-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon" sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant nr-ue-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon"
} }
}
} }
} }
stage ("Start VM -- enb-usrp") { stage ("Start VM -- enb-usrp") {
steps { steps {
lock (vmResource) {
timeout (time: 5, unit: 'MINUTES') { timeout (time: 5, unit: 'MINUTES') {
sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant enb-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon" sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant enb-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon"
} }
}
} }
} }
stage ("Start VM -- phy-sim") { stage ("Start VM -- phy-sim") {
steps { steps {
lock (vmResource) {
timeout (time: 5, unit: 'MINUTES') { timeout (time: 5, unit: 'MINUTES') {
sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant phy-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon" sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant phy-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon"
} }
}
} }
} }
stage ("Start VM -- enb-ethernet") { stage ("Start VM -- enb-ethernet") {
steps { steps {
lock (vmResource) {
timeout (time: 7, unit: 'MINUTES') { timeout (time: 7, unit: 'MINUTES') {
sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant enb-ethernet --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon" sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant enb-ethernet --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon"
} }
}
} }
} }
stage ("Start VM -- ue-ethernet") { stage ("Start VM -- ue-ethernet") {
steps { steps {
lock (vmResource) {
timeout (time: 7, unit: 'MINUTES') { timeout (time: 7, unit: 'MINUTES') {
sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant ue-ethernet --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon" sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant ue-ethernet --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon"
} }
}
} }
} }
stage ("Start VM -- cppcheck") { stage ("Start VM -- cppcheck") {
steps { steps {
lock (vmResource) {
timeout (time: 7, unit: 'MINUTES') { timeout (time: 7, unit: 'MINUTES') {
sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant cppcheck --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon" sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant cppcheck --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon"
} }
}
} }
} }
...@@ -288,11 +307,14 @@ pipeline { ...@@ -288,11 +307,14 @@ pipeline {
} }
stage ("Build UE-ethernet") { stage ("Build UE-ethernet") {
steps { steps {
// This is typically the last one to finish.
lock (vmResource) {
gitlabCommitStatus(name: "Build UE-ethernet") { gitlabCommitStatus(name: "Build UE-ethernet") {
timeout (time: 20, unit: 'MINUTES') { timeout (time: 20, unit: 'MINUTES') {
sh "./ci-scripts/oai-ci-vm-tool wait --workspace $WORKSPACE --variant ue-ethernet --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive" sh "./ci-scripts/oai-ci-vm-tool wait --workspace $WORKSPACE --variant ue-ethernet --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive"
} }
} }
}
} }
} }
} }
...@@ -354,6 +376,7 @@ pipeline { ...@@ -354,6 +376,7 @@ pipeline {
stages { stages {
stage ("Test physical simulators") { stage ("Test physical simulators") {
steps { steps {
lock (vmResource) {
script { script {
timeout (time: 90, unit: 'MINUTES') { timeout (time: 90, unit: 'MINUTES') {
try { try {
...@@ -365,6 +388,7 @@ pipeline { ...@@ -365,6 +388,7 @@ pipeline {
} }
} }
} }
}
} }
} }
stage ("Build Flexran Controller") { stage ("Build Flexran Controller") {
...@@ -372,6 +396,7 @@ pipeline { ...@@ -372,6 +396,7 @@ pipeline {
expression {doFlexranCtrlTest} expression {doFlexranCtrlTest}
} }
steps { steps {
lock (vmResource) {
script { script {
timeout (time: 20, unit: 'MINUTES') { timeout (time: 20, unit: 'MINUTES') {
try { try {
...@@ -381,10 +406,12 @@ pipeline { ...@@ -381,10 +406,12 @@ pipeline {
} }
} }
} }
}
} }
} }
stage ("Test basic simulator") { stage ("Test basic simulator") {
steps { steps {
lock (vmResource) {
script { script {
timeout (time: 30, unit: 'MINUTES') { timeout (time: 30, unit: 'MINUTES') {
try { try {
...@@ -396,10 +423,12 @@ pipeline { ...@@ -396,10 +423,12 @@ pipeline {
} }
} }
} }
}
} }
} }
stage ("Test L1 simulator") { stage ("Test L1 simulator") {
steps { steps {
lock (vmResource) {
script { script {
timeout (time: 30, unit: 'MINUTES') { timeout (time: 30, unit: 'MINUTES') {
try { try {
...@@ -411,10 +440,12 @@ pipeline { ...@@ -411,10 +440,12 @@ pipeline {
} }
} }
} }
}
} }
} }
stage ("Test RF simulator") { stage ("Test RF simulator") {
steps { steps {
lock (vmResource) {
script { script {
timeout (time: 40, unit: 'MINUTES') { timeout (time: 40, unit: 'MINUTES') {
try { try {
...@@ -426,10 +457,12 @@ pipeline { ...@@ -426,10 +457,12 @@ pipeline {
} }
} }
} }
}
} }
} }
stage ("Test L2 simulator") { stage ("Test L2 simulator") {
steps { steps {
lock (vmResource) {
script { script {
timeout (time: 30, unit: 'MINUTES') { timeout (time: 30, unit: 'MINUTES') {
try { try {
...@@ -441,11 +474,14 @@ pipeline { ...@@ -441,11 +474,14 @@ pipeline {
} }
} }
} }
}
} }
} }
stage ("Destroy all Virtual Machines") { stage ("Destroy all Virtual Machines") {
steps { steps {
lock (vmResource) {
sh "./ci-scripts/oai-ci-vm-tool destroy --job-name ${JOB_NAME} --build-id ${BUILD_ID}" sh "./ci-scripts/oai-ci-vm-tool destroy --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
}
} }
} }
} }
......
...@@ -72,6 +72,9 @@ class OaiCiTest(): ...@@ -72,6 +72,9 @@ class OaiCiTest():
self.ADBCentralized = True self.ADBCentralized = True
self.testCase_id = '' self.testCase_id = ''
self.testXMLfiles = [] self.testXMLfiles = []
self.testUnstable = False
self.testMinStableId = '999999'
self.testStabilityPointReached = False
self.desc = '' self.desc = ''
self.ping_args = '' self.ping_args = ''
self.ping_packetloss_threshold = '' self.ping_packetloss_threshold = ''
...@@ -211,7 +214,7 @@ class OaiCiTest(): ...@@ -211,7 +214,7 @@ class OaiCiTest():
logging.error('\u001B[1m Building OAI UE Failed\u001B[0m') logging.error('\u001B[1m Building OAI UE Failed\u001B[0m')
HTML.CreateHtmlTestRow(self.Build_OAI_UE_args, 'KO', CONST.ALL_PROCESSES_OK, 'OAI UE') HTML.CreateHtmlTestRow(self.Build_OAI_UE_args, 'KO', CONST.ALL_PROCESSES_OK, 'OAI UE')
HTML.CreateHtmlTabFooter(False) HTML.CreateHtmlTabFooter(False)
sys.exit(1) self.ConditionalExit()
def CheckFlexranCtrlInstallation(self,RAN,EPC): def CheckFlexranCtrlInstallation(self,RAN,EPC):
if EPC.IPAddress == '' or EPC.UserName == '' or EPC.Password == '': if EPC.IPAddress == '' or EPC.UserName == '' or EPC.Password == '':
...@@ -335,7 +338,7 @@ class OaiCiTest(): ...@@ -335,7 +338,7 @@ class OaiCiTest():
if (pStatus < 0): if (pStatus < 0):
HTML.CreateHtmlTestRow(self.air_interface + ' ' + self.Initialize_OAI_UE_args, 'KO', pStatus) HTML.CreateHtmlTestRow(self.air_interface + ' ' + self.Initialize_OAI_UE_args, 'KO', pStatus)
HTML.CreateHtmlTabFooter(False) HTML.CreateHtmlTabFooter(False)
sys.exit(1) self.ConditionalExit()
UE_prefix = '' UE_prefix = ''
else: else:
UE_prefix = 'NR ' UE_prefix = 'NR '
...@@ -719,7 +722,7 @@ class OaiCiTest(): ...@@ -719,7 +722,7 @@ class OaiCiTest():
logging.debug('Using the OAI EPC HSS: not implemented yet') logging.debug('Using the OAI EPC HSS: not implemented yet')
HTML.CreateHtmlTestRow(self.ping_args, 'KO', pStatus) HTML.CreateHtmlTestRow(self.ping_args, 'KO', pStatus)
HTML.CreateHtmlTabFooter(False) HTML.CreateHtmlTabFooter(False)
sys.exit(1) self.ConditionalExit()
else: else:
SSH.command('egrep --color=never "Allocated ipv4 addr" /opt/ltebox/var/log/xGwLog.0', '\$', 5) SSH.command('egrep --color=never "Allocated ipv4 addr" /opt/ltebox/var/log/xGwLog.0', '\$', 5)
result = re.search('Allocated ipv4 addr: (?P<ipaddr>[0-9\.]+) from Pool', SSH.getBefore()) result = re.search('Allocated ipv4 addr: (?P<ipaddr>[0-9\.]+) from Pool', SSH.getBefore())
...@@ -1046,7 +1049,7 @@ class OaiCiTest(): ...@@ -1046,7 +1049,7 @@ class OaiCiTest():
if (pStatus < 0): if (pStatus < 0):
HTML.CreateHtmlTestRow('N/A', 'KO', pStatus) HTML.CreateHtmlTestRow('N/A', 'KO', pStatus)
HTML.CreateHtmlTabFooter(False) HTML.CreateHtmlTabFooter(False)
sys.exit(1) self.ConditionalExit()
multi_jobs = [] multi_jobs = []
for device_id in self.UEDevices: for device_id in self.UEDevices:
p = Process(target = self.RebootUE_common, args = (device_id,)) p = Process(target = self.RebootUE_common, args = (device_id,))
...@@ -1154,15 +1157,18 @@ class OaiCiTest(): ...@@ -1154,15 +1157,18 @@ class OaiCiTest():
self.UEDevicesRebootCmd.append(comma_split[5]) self.UEDevicesRebootCmd.append(comma_split[5])
phone_list_file.close() phone_list_file.close()
# better handling of the case when no UE detected
# Sys-exit is now dealt by the calling function
if terminate_ue_flag == True: if terminate_ue_flag == True:
if len(self.UEDevices) == 0: if len(self.UEDevices) == 0:
logging.debug('\u001B[1;37;41m UE Not Found! \u001B[0m') logging.debug('\u001B[1;37;41m UE Not Found! \u001B[0m')
sys.exit(1) return False
if len(self.UEDevicesStatus) == 0: if len(self.UEDevicesStatus) == 0:
cnt = 0 cnt = 0
while cnt < len(self.UEDevices): while cnt < len(self.UEDevices):
self.UEDevicesStatus.append(CONST.UE_STATUS_DETACHED) self.UEDevicesStatus.append(CONST.UE_STATUS_DETACHED)
cnt += 1 cnt += 1
return True
def GetAllCatMDevices(self, terminate_ue_flag): def GetAllCatMDevices(self, terminate_ue_flag):
if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '': if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '':
...@@ -1248,7 +1254,7 @@ class OaiCiTest(): ...@@ -1248,7 +1254,7 @@ class OaiCiTest():
if (pStatus < 0): if (pStatus < 0):
HTML.CreateHtmlTestRow('N/A', 'KO', pStatus) HTML.CreateHtmlTestRow('N/A', 'KO', pStatus)
HTML.CreateHtmlTabFooter(False) HTML.CreateHtmlTabFooter(False)
sys.exit(1) self.ConditionalExit()
multi_jobs = [] multi_jobs = []
lock = Lock() lock = Lock()
status_queue = SimpleQueue() status_queue = SimpleQueue()
...@@ -1386,7 +1392,14 @@ class OaiCiTest(): ...@@ -1386,7 +1392,14 @@ class OaiCiTest():
SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password) SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password)
SSH.command('cd ' + EPC.SourceCodePath, '\$', 5) SSH.command('cd ' + EPC.SourceCodePath, '\$', 5)
SSH.command('cd scripts', '\$', 5) SSH.command('cd scripts', '\$', 5)
ping_status = SSH.command('stdbuf -o0 ping ' + self.ping_args + ' ' + UE_IPAddress + ' 2>&1 | stdbuf -o0 tee ping_' + self.testCase_id + '_' + device_id + '.log', '\$', int(ping_time[0])*1.5) # In case of a docker-based deployment, we need to ping from the trf-gen container
launchFromTrfContainer = False
if re.match('OAI-Rel14-Docker', EPC.Type, re.IGNORECASE):
launchFromTrfContainer = True
if launchFromTrfContainer:
ping_status = SSH.command('docker exec -it prod-trf-gen /bin/bash -c "ping ' + self.ping_args + ' ' + UE_IPAddress + '" 2>&1 | tee ping_' + self.testCase_id + '_' + device_id + '.log', '\$', int(ping_time[0])*1.5)
else:
ping_status = SSH.command('stdbuf -o0 ping ' + self.ping_args + ' ' + UE_IPAddress + ' 2>&1 | stdbuf -o0 tee ping_' + self.testCase_id + '_' + device_id + '.log', '\$', int(ping_time[0])*1.5)
else: else:
cmd = 'ping ' + self.ping_args + ' ' + UE_IPAddress + ' 2>&1 > ping_' + self.testCase_id + '_' + device_id + '.log' cmd = 'ping ' + self.ping_args + ' ' + UE_IPAddress + ' 2>&1 > ping_' + self.testCase_id + '_' + device_id + '.log'
message = cmd + '\n' message = cmd + '\n'
...@@ -2028,7 +2041,8 @@ class OaiCiTest(): ...@@ -2028,7 +2041,8 @@ class OaiCiTest():
SSH.command('adb -s ' + device_id + ' shell "ls /data/local/tmp"', '\$', 5) SSH.command('adb -s ' + device_id + ' shell "ls /data/local/tmp"', '\$', 5)
else: else:
SSH.command('ssh ' + self.UEDevicesRemoteUser[idx] + '@' + self.UEDevicesRemoteServer[idx] + ' \'adb -s ' + device_id + ' shell "ls /data/local/tmp"\'', '\$', 60) SSH.command('ssh ' + self.UEDevicesRemoteUser[idx] + '@' + self.UEDevicesRemoteServer[idx] + ' \'adb -s ' + device_id + ' shell "ls /data/local/tmp"\'', '\$', 60)
result = re.search('iperf3', SSH.getBefore()) # DEBUG: disabling iperf3 usage for the moment
result = re.search('iperf4', SSH.getBefore())
if result is None: if result is None:
result = re.search('iperf', SSH.getBefore()) result = re.search('iperf', SSH.getBefore())
if result is None: if result is None:
...@@ -2105,6 +2119,10 @@ class OaiCiTest(): ...@@ -2105,6 +2119,10 @@ class OaiCiTest():
launchFromEpc = True launchFromEpc = True
if re.match('OAI-Rel14-CUPS', EPC.Type, re.IGNORECASE): if re.match('OAI-Rel14-CUPS', EPC.Type, re.IGNORECASE):
launchFromEpc = False launchFromEpc = False
# When using a docker-based deployment, IPERF client shall be launched from trf container
launchFromTrfContainer = False
if re.match('OAI-Rel14-Docker', EPC.Type, re.IGNORECASE):
launchFromTrfContainer = True
if launchFromEpc: if launchFromEpc:
SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password) SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password)
SSH.command('cd ' + EPC.SourceCodePath + '/scripts', '\$', 5) SSH.command('cd ' + EPC.SourceCodePath + '/scripts', '\$', 5)
...@@ -2129,7 +2147,16 @@ class OaiCiTest(): ...@@ -2129,7 +2147,16 @@ class OaiCiTest():
self.Iperf_analyzeV3Output(lock, UE_IPAddress, device_id, statusQueue,SSH) self.Iperf_analyzeV3Output(lock, UE_IPAddress, device_id, statusQueue,SSH)
else: else:
if launchFromEpc: if launchFromEpc:
iperf_status = SSH.command('stdbuf -o0 iperf -c ' + UE_IPAddress + ' ' + modified_options + ' 2>&1 | stdbuf -o0 tee iperf_' + self.testCase_id + '_' + device_id + '.log', '\$', int(iperf_time)*5.0) if launchFromTrfContainer:
if self.ueIperfVersion == self.dummyIperfVersion:
prefix = ''
else:
prefix = ''
if self.ueIperfVersion == '2.0.5':
prefix = '/iperf-2.0.5/bin/'
iperf_status = SSH.command('docker exec -it prod-trf-gen /bin/bash -c "' + prefix + 'iperf -c ' + UE_IPAddress + ' ' + modified_options + '" 2>&1 | tee iperf_' + self.testCase_id + '_' + device_id + '.log', '\$', int(iperf_time)*5.0)
else:
iperf_status = SSH.command('stdbuf -o0 iperf -c ' + UE_IPAddress + ' ' + modified_options + ' 2>&1 | stdbuf -o0 tee iperf_' + self.testCase_id + '_' + device_id + '.log', '\$', int(iperf_time)*5.0)
else: else:
if self.ueIperfVersion == self.dummyIperfVersion: if self.ueIperfVersion == self.dummyIperfVersion:
prefix = '' prefix = ''
...@@ -3148,6 +3175,12 @@ class OaiCiTest(): ...@@ -3148,6 +3175,12 @@ class OaiCiTest():
HTML.CpuMHz[idx]=CpuMHz HTML.CpuMHz[idx]=CpuMHz
SSH.close() SSH.close()
def ConditionalExit(self):
if self.testUnstable:
if self.testStabilityPointReached or self.testMinStableId == '999999':
sys.exit(0)
sys.exit(1)
def ShowTestID(self): def ShowTestID(self):
logging.debug('\u001B[1m----------------------------------------\u001B[0m') logging.debug('\u001B[1m----------------------------------------\u001B[0m')
logging.debug('\u001B[1mTest ID:' + self.testCase_id + '\u001B[0m') logging.debug('\u001B[1mTest ID:' + self.testCase_id + '\u001B[0m')
......
...@@ -65,6 +65,7 @@ class EPCManagement(): ...@@ -65,6 +65,7 @@ class EPCManagement():
self.testCase_id = '' self.testCase_id = ''
self.MmeIPAddress = '' self.MmeIPAddress = ''
self.containerPrefix = 'prod' self.containerPrefix = 'prod'
self.mmeConfFile = 'mme.conf'
#----------------------------------------------------------- #-----------------------------------------------------------
...@@ -127,7 +128,7 @@ class EPCManagement(): ...@@ -127,7 +128,7 @@ class EPCManagement():
logging.debug('Using the OAI EPC Release 14 MME in Docker') logging.debug('Using the OAI EPC Release 14 MME in Docker')
mySSH.command('docker exec -d ' + self.containerPrefix + '-oai-mme /bin/bash -c "nohup tshark -i eth0 -i lo:s10 -w /tmp/mme_check_run.pcap 2>&1 > /dev/null"', '\$', 5) mySSH.command('docker exec -d ' + self.containerPrefix + '-oai-mme /bin/bash -c "nohup tshark -i eth0 -i lo:s10 -w /tmp/mme_check_run.pcap 2>&1 > /dev/null"', '\$', 5)
time.sleep(5) time.sleep(5)
mySSH.command('docker exec -d ' + self.containerPrefix + '-oai-mme /bin/bash -c "nohup ./bin/oai_mme -c ./etc/mme.conf > mme_check_run.log 2>&1"', '\$', 5) mySSH.command('docker exec -d ' + self.containerPrefix + '-oai-mme /bin/bash -c "nohup ./bin/oai_mme -c ./etc/' + self.mmeConfFile + ' > mme_check_run.log 2>&1"', '\$', 5)
elif re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): elif re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE):
logging.debug('Using the OAI EPC Release 14 MME') logging.debug('Using the OAI EPC Release 14 MME')
mySSH.command('cd ' + self.SourceCodePath + '/scripts', '\$', 5) mySSH.command('cd ' + self.SourceCodePath + '/scripts', '\$', 5)
......
...@@ -64,6 +64,10 @@ class HTMLManagement(): ...@@ -64,6 +64,10 @@ class HTMLManagement():
self.htmlTabIcons = [] self.htmlTabIcons = []
self.testXMLfiles = [] self.testXMLfiles = []
self.testUnstable = False
self.testMinStableId = '999999'
self.testStabilityPointReached = False
self.htmleNBFailureMsg = '' self.htmleNBFailureMsg = ''
self.htmlUEFailureMsg = '' self.htmlUEFailureMsg = ''
...@@ -230,13 +234,20 @@ class HTMLManagement(): ...@@ -230,13 +234,20 @@ class HTMLManagement():
def CreateHtmlTabFooter(self, passStatus): def CreateHtmlTabFooter(self, passStatus):
if ((not self.htmlFooterCreated) and (self.htmlHeaderCreated)): if ((not self.htmlFooterCreated) and (self.htmlHeaderCreated)):
testOkEvenIfUnstable = False
if self.testUnstable and not passStatus:
if self.testStabilityPointReached or self.testMinStableId == '999999':
testOkEvenIfUnstable = True
self.htmlFile = open('test_results.html', 'a') self.htmlFile = open('test_results.html', 'a')
self.htmlFile.write(' <tr>\n') self.htmlFile.write(' <tr>\n')
self.htmlFile.write(' <th bgcolor = "#33CCFF" colspan=3>Final Tab Status</th>\n') self.htmlFile.write(' <th bgcolor = "#33CCFF" colspan=3>Final Tab Status</th>\n')
if passStatus: if passStatus:
self.htmlFile.write(' <th bgcolor = "green" colspan=' + str(2 + self.htmlUEConnected) + '><font color="white">PASS <span class="glyphicon glyphicon-ok"></span> </font></th>\n') self.htmlFile.write(' <th bgcolor = "green" colspan=' + str(2 + self.htmlUEConnected) + '><font color="white">PASS <span class="glyphicon glyphicon-ok"></span> </font></th>\n')
else: else:
self.htmlFile.write(' <th bgcolor = "red" colspan=' + str(2 + self.htmlUEConnected) + '><font color="white">FAIL <span class="glyphicon glyphicon-remove"></span> </font></th>\n') if testOkEvenIfUnstable:
self.htmlFile.write(' <th bgcolor = "orange" colspan=' + str(2 + self.htmlUEConnected) + '><font color="white">KNOWN UNSTABLE SCENARIO <span class="glyphicon glyphicon-exclamation-sign"></span> </font></th>\n')
else:
self.htmlFile.write(' <th bgcolor = "red" colspan=' + str(2 + self.htmlUEConnected) + '><font color="white">FAIL <span class="glyphicon glyphicon-remove"></span> </font></th>\n')
self.htmlFile.write(' </tr>\n') self.htmlFile.write(' </tr>\n')
self.htmlFile.write(' </table>\n') self.htmlFile.write(' </table>\n')
self.htmlFile.write(' </div>\n') self.htmlFile.write(' </div>\n')
...@@ -246,7 +257,10 @@ class HTMLManagement(): ...@@ -246,7 +257,10 @@ class HTMLManagement():
cmd = "sed -i -e 's/__STATE_" + self.htmlTabNames[0] + "__//' test_results.html" cmd = "sed -i -e 's/__STATE_" + self.htmlTabNames[0] + "__//' test_results.html"
subprocess.run(cmd, shell=True) subprocess.run(cmd, shell=True)
else: else:
cmd = "sed -i -e 's/__STATE_" + self.htmlTabNames[0] + "__/<span class=\"glyphicon glyphicon-remove\"><\/span>/' test_results.html" if testOkEvenIfUnstable:
cmd = "sed -i -e 's/__STATE_" + self.htmlTabNames[0] + "__/<span class=\"glyphicon glyphicon-exclamation-sign\"><\/span>/' test_results.html"
else:
cmd = "sed -i -e 's/__STATE_" + self.htmlTabNames[0] + "__/<span class=\"glyphicon glyphicon-remove\"><\/span>/' test_results.html"
subprocess.run(cmd, shell=True) subprocess.run(cmd, shell=True)
self.htmlFooterCreated = False self.htmlFooterCreated = False
......
...@@ -283,6 +283,11 @@ def GetParametersFromXML(action): ...@@ -283,6 +283,11 @@ def GetParametersFromXML(action):
else: else:
ldpc.forced_workspace_cleanup=False ldpc.forced_workspace_cleanup=False
elif action == 'Initialize_MME':
string_field = test.findtext('option')
if (string_field is not None):
EPC.mmeConfFile = string_field
else: # ie action == 'Run_PhySim': else: # ie action == 'Run_PhySim':
ldpc.runargs = test.findtext('physim_run_args') ldpc.runargs = test.findtext('physim_run_args')
...@@ -489,6 +494,9 @@ elif re.match('^FinalizeHtml$', mode, re.IGNORECASE): ...@@ -489,6 +494,9 @@ elif re.match('^FinalizeHtml$', mode, re.IGNORECASE):
CiTestObj.RetrieveSystemVersion('UE',HTML,RAN) CiTestObj.RetrieveSystemVersion('UE',HTML,RAN)
HTML.CreateHtmlFooter(CiTestObj.finalStatus) HTML.CreateHtmlFooter(CiTestObj.finalStatus)
elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re.IGNORECASE): elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re.IGNORECASE):
logging.debug('\u001B[1m----------------------------------------\u001B[0m')
logging.debug('\u001B[1m Starting Scenario \u001B[0m')
logging.debug('\u001B[1m----------------------------------------\u001B[0m')
if re.match('^TesteNB$', mode, re.IGNORECASE): if re.match('^TesteNB$', mode, re.IGNORECASE):
if RAN.eNBIPAddress == '' or RAN.ranRepository == '' or RAN.ranBranch == '' or RAN.eNBUserName == '' or RAN.eNBPassword == '' or RAN.eNBSourceCodePath == '' or EPC.IPAddress == '' or EPC.UserName == '' or EPC.Password == '' or EPC.Type == '' or EPC.SourceCodePath == '' or CiTestObj.ADBIPAddress == '' or CiTestObj.ADBUserName == '' or CiTestObj.ADBPassword == '': if RAN.eNBIPAddress == '' or RAN.ranRepository == '' or RAN.ranBranch == '' or RAN.eNBUserName == '' or RAN.eNBPassword == '' or RAN.eNBSourceCodePath == '' or EPC.IPAddress == '' or EPC.UserName == '' or EPC.Password == '' or EPC.Type == '' or EPC.SourceCodePath == '' or CiTestObj.ADBIPAddress == '' or CiTestObj.ADBUserName == '' or CiTestObj.ADBPassword == '':
HELP.GenericHelp(CONST.Version) HELP.GenericHelp(CONST.Version)
...@@ -524,7 +532,14 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re ...@@ -524,7 +532,14 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
HTML.htmlTabRefs.append(xmlRoot.findtext('htmlTabRef',default='test-tab-0')) HTML.htmlTabRefs.append(xmlRoot.findtext('htmlTabRef',default='test-tab-0'))
HTML.htmlTabNames.append(xmlRoot.findtext('htmlTabName',default='Test-0')) HTML.htmlTabNames.append(xmlRoot.findtext('htmlTabName',default='Test-0'))
repeatCount = xmlRoot.findtext('repeatCount',default='1') repeatCount = xmlRoot.findtext('repeatCount',default='1')
testStability = xmlRoot.findtext('TestUnstable',default='False')
CiTestObj.repeatCounts.append(int(repeatCount)) CiTestObj.repeatCounts.append(int(repeatCount))
if testStability == 'True':
CiTestObj.testUnstable = True
HTML.testUnstable = True
CiTestObj.testMinStableId = xmlRoot.findtext('TestMinId',default='999999')
HTML.testMinStableId = CiTestObj.testMinStableId
logging.debug('Test is tagged as Unstable -- starting from TestID ' + str(CiTestObj.testMinStableId))
all_tests=xmlRoot.findall('testCase') all_tests=xmlRoot.findall('testCase')
exclusion_tests=exclusion_tests.split() exclusion_tests=exclusion_tests.split()
...@@ -605,7 +620,11 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re ...@@ -605,7 +620,11 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
if (CiTestObj.ADBIPAddress != 'none'): if (CiTestObj.ADBIPAddress != 'none'):
#in these cases, having no devices is critical, GetAllUEDevices function has to manage it as a critical error, reason why terminate_ue_flag is set to True #in these cases, having no devices is critical, GetAllUEDevices function has to manage it as a critical error, reason why terminate_ue_flag is set to True
terminate_ue_flag = True terminate_ue_flag = True
CiTestObj.GetAllUEDevices(terminate_ue_flag) # Now we stop properly the test-suite --> clean reporting
status = CiTestObj.GetAllUEDevices(terminate_ue_flag)
if not status:
RAN.prematureExit = True
break
if action == 'Build_eNB': if action == 'Build_eNB':
RAN.BuildeNB() RAN.BuildeNB()
elif action == 'WaitEndBuild_eNB': elif action == 'WaitEndBuild_eNB':
...@@ -681,11 +700,19 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re ...@@ -681,11 +700,19 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
HTML=ldpc.Run_PhySim(HTML,CONST,id) HTML=ldpc.Run_PhySim(HTML,CONST,id)
else: else:
sys.exit('Invalid class (action) from xml') sys.exit('Invalid class (action) from xml')
if not RAN.prematureExit:
if CiTestObj.testCase_id == CiTestObj.testMinStableId:
logging.debug('Scenario has reached minimal stability point')
CiTestObj.testStabilityPointReached = True
HTML.testStabilityPointReached = True
CiTestObj.FailReportCnt += 1 CiTestObj.FailReportCnt += 1
if CiTestObj.FailReportCnt == CiTestObj.repeatCounts[0] and RAN.prematureExit: if CiTestObj.FailReportCnt == CiTestObj.repeatCounts[0] and RAN.prematureExit:
logging.debug('Testsuite failed ' + str(CiTestObj.FailReportCnt) + ' time(s)') logging.debug('Testsuite failed ' + str(CiTestObj.FailReportCnt) + ' time(s)')
HTML.CreateHtmlTabFooter(False) HTML.CreateHtmlTabFooter(False)
sys.exit('Failed Scenario') if CiTestObj.testUnstable and (CiTestObj.testStabilityPointReached or CiTestObj.testMinStableId == '999999'):
logging.debug('Scenario has reached minimal stability point -- Not a Failure')
else:
sys.exit('Failed Scenario')
else: else:
logging.info('Testsuite passed after ' + str(CiTestObj.FailReportCnt) + ' time(s)') logging.info('Testsuite passed after ' + str(CiTestObj.FailReportCnt) + ' time(s)')
HTML.CreateHtmlTabFooter(True) HTML.CreateHtmlTabFooter(True)
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
<htmlTabName>Test-LTE-M-10MHz-TM1</htmlTabName> <htmlTabName>Test-LTE-M-10MHz-TM1</htmlTabName>
<htmlTabIcon>tasks</htmlTabIcon> <htmlTabIcon>tasks</htmlTabIcon>
<repeatCount>1</repeatCount> <repeatCount>1</repeatCount>
<TestUnstable>True</TestUnstable>
<TestCaseRequestedList> <TestCaseRequestedList>
030201 030201
040102 040102
......
...@@ -26,6 +26,8 @@ ...@@ -26,6 +26,8 @@
<htmlTabName>Test-05MHz-TM2</htmlTabName> <htmlTabName>Test-05MHz-TM2</htmlTabName>
<htmlTabIcon>tasks</htmlTabIcon> <htmlTabIcon>tasks</htmlTabIcon>
<repeatCount>2</repeatCount> <repeatCount>2</repeatCount>
<TestUnstable>True</TestUnstable>
<TestMinId>040608</TestMinId>
<TestCaseRequestedList> <TestCaseRequestedList>
030201 030201
040101 040101
......
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
<htmlTabRef>test-10-tm1</htmlTabRef> <htmlTabRef>test-10-tm1</htmlTabRef>
<htmlTabName>Test-10MHz-TM1</htmlTabName> <htmlTabName>Test-10MHz-TM1</htmlTabName>
<htmlTabIcon>tasks</htmlTabIcon> <htmlTabIcon>tasks</htmlTabIcon>
<TestUnstable>True</TestUnstable>
<TestMinId>040615</TestMinId>
<TestCaseRequestedList> <TestCaseRequestedList>
030201 030201
040101 040101
......
...@@ -25,6 +25,8 @@ ...@@ -25,6 +25,8 @@
<htmlTabName>Test-20MHz-TM1</htmlTabName> <htmlTabName>Test-20MHz-TM1</htmlTabName>
<htmlTabIcon>tasks</htmlTabIcon> <htmlTabIcon>tasks</htmlTabIcon>
<repeatCount>4</repeatCount> <repeatCount>4</repeatCount>
<TestUnstable>True</TestUnstable>
<TestMinId>040623</TestMinId>
<TestCaseRequestedList> <TestCaseRequestedList>
030201 030201
040101 040101
......
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
<htmlTabRef>test-20-tm1-defSched</htmlTabRef> <htmlTabRef>test-20-tm1-defSched</htmlTabRef>
<htmlTabName>Test-20MHz-TM1-default-scheduler</htmlTabName> <htmlTabName>Test-20MHz-TM1-default-scheduler</htmlTabName>
<htmlTabIcon>tasks</htmlTabIcon> <htmlTabIcon>tasks</htmlTabIcon>
<TestUnstable>True</TestUnstable>
<TestMinId>040522</TestMinId>
<TestCaseRequestedList> <TestCaseRequestedList>
030201 030201
040101 040101
......
<!--
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
-->
<testCaseList>
<htmlTabRef>epc-start-tab</htmlTabRef>
<htmlTabName>EPC-Start</htmlTabName>
<htmlTabIcon>log-in</htmlTabIcon>
<TestCaseRequestedList>
000100 000101 000102
</TestCaseRequestedList>
<TestCaseExclusionList>
</TestCaseExclusionList>
<testCase id="000100">
<class>Initialize_HSS</class>
<desc>Initialize HSS</desc>
</testCase>
<testCase id="000101">
<class>Initialize_MME</class>
<desc>Initialize MME</desc>
<option>mme-verizon.conf</option>
</testCase>
<testCase id="000102">
<class>Initialize_SPGW</class>
<desc>Initialize SPGW</desc>
</testCase>
</testCaseList>
<!--
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
030101 040301 040501 040603 040604 040605 040606 040607 040641 040642 040643 040644 040401 040201 030201
-->
<testCaseList>
<htmlTabRef>test-05-tm1</htmlTabRef>
<htmlTabName>Test-05MHz-TM1</htmlTabName>
<htmlTabIcon>tasks</htmlTabIcon>
<TestCaseRequestedList>
030201
040101
030101 040301 000001 040501 040603 040401 030201
</TestCaseRequestedList>
<TestCaseExclusionList></TestCaseExclusionList>
<testCase id="000001">
<class>IdleSleep</class>
<desc>Sleep</desc>
<idle_sleep_time_in_sec>5</idle_sleep_time_in_sec>
</testCase>
<testCase id="030101">
<class>Initialize_eNB</class>
<desc>Initialize eNB (FDD/Band7/5MHz)</desc>
<Initialize_eNB_args>-O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf --eNBs.[0].plmn_list.[0].mcc 311 --eNBs.[0].plmn_list.[0].mnc 480 --eNBs.[0].plmn_list.[0].mnc_length 3 --eNBs.[0].component_carriers.[0].Nid_cell 10</Initialize_eNB_args>
</testCase>
<testCase id="030201">
<class>Terminate_eNB</class>
<desc>Terminate eNB</desc>
</testCase>
<testCase id="040101">
<class>Initialize_UE</class>
<desc>Initialize UE</desc>
</testCase>
<testCase id="040201">
<class>Terminate_UE</class>
<desc>Terminate UE</desc>
</testCase>
<testCase id="040301">
<class>Attach_UE</class>
<desc>Attach UE</desc>
</testCase>
<testCase id="040401">
<class>Detach_UE</class>
<desc>Detach UE</desc>
</testCase>
<testCase id="040501">
<class>Ping</class>
<desc>ping (5MHz - 20 sec)</desc>
<ping_args>-c 20</ping_args>
<ping_packetloss_threshold>5</ping_packetloss_threshold>
</testCase>
<testCase id="040603">
<class>Iperf</class>
<desc>iperf (5MHz - DL/15Mbps/UDP)(30 sec)(balanced profile)</desc>
<iperf_args>-u -b 15M -t 30 -i 1</iperf_args>
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
<iperf_profile>balanced</iperf_profile>
</testCase>
<testCase id="040604">
<class>Iperf</class>
<desc>iperf (5MHz - DL/15Mbps/UDP)(30 sec)(single-ue profile)</desc>
<iperf_args>-u -b 15M -t 30 -i 1</iperf_args>
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
<iperf_profile>single-ue</iperf_profile>
</testCase>
<testCase id="040605">
<class>Iperf</class>
<desc>iperf (5MHz - DL/15Mbps/UDP)(30 sec)(unbalanced profile)</desc>
<iperf_args>-u -b 15M -t 30 -i 1</iperf_args>
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
<iperf_profile>unbalanced</iperf_profile>
</testCase>
<testCase id="040606">
<class>Iperf</class>
<desc>iperf (5MHz - DL/TCP)(30 sec)(single-ue profile)</desc>
<iperf_args>-t 30 -i 1 -fm</iperf_args>
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
<iperf_profile>single-ue</iperf_profile>
</testCase>
<testCase id="040607">
<class>Iperf</class>
<desc>iperf (5MHz - DL/TCP)(30 sec)(balanced profile)</desc>
<iperf_args>-t 30 -i 1 -fm</iperf_args>
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
<iperf_profile>balanced</iperf_profile>
</testCase>
<testCase id="040641">
<class>Iperf</class>
<desc>iperf (5MHz - UL/9Mbps/UDP)(30 sec)(balanced profile)</desc>
<iperf_args>-u -b 9M -t 30 -i 1 -R</iperf_args>
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
<iperf_profile>balanced</iperf_profile>
</testCase>
<testCase id="040642">
<class>Iperf</class>
<desc>iperf (5MHz - UL/9Mbps/UDP)(30 sec)(single-ue profile)</desc>
<iperf_args>-u -b 9M -t 30 -i 1 -R</iperf_args>
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
<iperf_profile>single-ue</iperf_profile>
</testCase>
<testCase id="040643">
<class>Iperf</class>
<desc>iperf (5MHz - UL/TCP)(30 sec)(single-ue profile)</desc>
<iperf_args>-t 30 -i 1 -fm -R</iperf_args>
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
<iperf_profile>single-ue</iperf_profile>
</testCase>
<testCase id="040644">
<class>Iperf</class>
<desc>iperf (5MHz - UL/TCP)(30 sec)(balanced profile)</desc>
<iperf_args>-t 30 -i 1 -fm -R</iperf_args>
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
<iperf_profile>balanced</iperf_profile>
</testCase>
</testCaseList>
...@@ -25,6 +25,8 @@ ...@@ -25,6 +25,8 @@
<htmlTabName>Test-10MHz</htmlTabName> <htmlTabName>Test-10MHz</htmlTabName>
<htmlTabIcon>tasks</htmlTabIcon> <htmlTabIcon>tasks</htmlTabIcon>
<repeatCount>2</repeatCount> <repeatCount>2</repeatCount>
<TestUnstable>True</TestUnstable>
<TestMinId>040612</TestMinId>
<TestCaseRequestedList> <TestCaseRequestedList>
030201 030201
040101 040101
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
<htmlTabName>Test-X2-HO-FDD-05MHz-TM1</htmlTabName> <htmlTabName>Test-X2-HO-FDD-05MHz-TM1</htmlTabName>
<htmlTabIcon>tasks</htmlTabIcon> <htmlTabIcon>tasks</htmlTabIcon>
<repeatCount>2</repeatCount> <repeatCount>2</repeatCount>
<TestUnstable>True</TestUnstable>
<TestCaseRequestedList> <TestCaseRequestedList>
030201 030202 030201 030202
040101 040101
......
...@@ -49,6 +49,7 @@ RUN yum update -y && \ ...@@ -49,6 +49,7 @@ RUN yum update -y && \
nettle \ nettle \
atlas \ atlas \
net-tools \ net-tools \
iputils \
iproute \ iproute \
libyaml && \ libyaml && \
echo "/usr/local/lib" > /etc/ld.so.conf.d/local-lib.conf && \ echo "/usr/local/lib" > /etc/ld.so.conf.d/local-lib.conf && \
...@@ -120,3 +121,4 @@ WORKDIR /opt/oai-enb ...@@ -120,3 +121,4 @@ WORKDIR /opt/oai-enb
#CMD ["/opt/oai-enb/bin/lte-softmodem", "-O", "/opt/oai-enb/etc/enb.conf"] #CMD ["/opt/oai-enb/bin/lte-softmodem", "-O", "/opt/oai-enb/etc/enb.conf"]
#ENTRYPOINT ["/opt/oai-enb/bin/entrypoint.sh"] #ENTRYPOINT ["/opt/oai-enb/bin/entrypoint.sh"]
CMD ["sleep", "infinity"]
...@@ -51,6 +51,7 @@ RUN yum update -y && \ ...@@ -51,6 +51,7 @@ RUN yum update -y && \
atlas \ atlas \
net-tools \ net-tools \
iproute \ iproute \
iputils \
libyaml && \ libyaml && \
echo "/usr/local/lib" > /etc/ld.so.conf.d/local-lib.conf && \ echo "/usr/local/lib" > /etc/ld.so.conf.d/local-lib.conf && \
echo "/usr/local/lib64" >> /etc/ld.so.conf.d/local-lib.conf echo "/usr/local/lib64" >> /etc/ld.so.conf.d/local-lib.conf
...@@ -121,4 +122,4 @@ WORKDIR /opt/oai-enb ...@@ -121,4 +122,4 @@ WORKDIR /opt/oai-enb
#CMD ["/opt/oai-enb/bin/lte-softmodem", "-O", "/opt/oai-enb/etc/enb.conf"] #CMD ["/opt/oai-enb/bin/lte-softmodem", "-O", "/opt/oai-enb/etc/enb.conf"]
#ENTRYPOINT ["/opt/oai-enb/bin/entrypoint.sh"] #ENTRYPOINT ["/opt/oai-enb/bin/entrypoint.sh"]
CMD ["sleep", "infinity"]
...@@ -57,6 +57,7 @@ RUN apt-get update && \ ...@@ -57,6 +57,7 @@ RUN apt-get update && \
libconfig9 \ libconfig9 \
openssl \ openssl \
net-tools \ net-tools \
iputils-ping \
iproute2 \ iproute2 \
libyaml-0-2 && \ libyaml-0-2 && \
# Install UHD driver from ettus ppa # Install UHD driver from ettus ppa
...@@ -120,3 +121,4 @@ WORKDIR /opt/oai-enb ...@@ -120,3 +121,4 @@ WORKDIR /opt/oai-enb
#CMD ["/opt/oai-enb/bin/lte-softmodem", "-O", "/opt/oai-enb/etc/enb.conf"] #CMD ["/opt/oai-enb/bin/lte-softmodem", "-O", "/opt/oai-enb/etc/enb.conf"]
#ENTRYPOINT ["/opt/oai-enb/bin/entrypoint.sh"] #ENTRYPOINT ["/opt/oai-enb/bin/entrypoint.sh"]
CMD ["sleep", "infinity"]
#/*
# * 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 eNB service
# Valid for RHEL7 in the OpenShift context (v4.4)
#
#---------------------------------------------------------------------
ARG REGISTRY=localhost
FROM $REGISTRY/oai-build-base:latest.el7 AS builder
ARG GIT_TAG=v1.1.1
WORKDIR /root
RUN if [ "$EURECOM_PROXY" == true ]; then git config --global http.proxy http://:@proxy.eurecom.fr:8080; fi
RUN git clone --depth=1 --branch=$GIT_TAG https://gitlab.eurecom.fr/oai/openairinterface5g.git
COPY patches patches/
RUN patch -p1 -d openairinterface5g < patches/disable_building_nasmesh_and_rbtool.patch \
&& patch -p1 -d openairinterface5g < patches/disable_sched_fifo_fail_exits.patch
RUN cd openairinterface5g/cmake_targets \
&& ln -sf /usr/local/bin/asn1c_oai /usr/local/bin/asn1c \
&& ln -sf /usr/local/share/asn1c_oai /usr/local/share/asn1c \
&& ./build_oai -c --eNB -w USRP --verbose-compile
FROM registry.redhat.io/ubi7/ubi
LABEL name="oai-enb" \
version="$GIT_TAG" \
maintainer="Frank A. Zdarsky <fzdarsky@redhat.com>" \
io.k8s.description="openairinterface5g eNB $GIT_TAG." \
io.openshift.tags="oai,enb" \
io.openshift.non-scalable="true"
RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm \
&& REPOLIST="rhel-7-server-optional-rpms" \
&& PKGLIST="boost libconfig lksctp-tools protobuf-c iproute iputils procps-ng bind-utils xforms nettle libyaml libusb" \
# && yum -y upgrade-minimal --setopt=tsflags=nodocs --security --sec-severity=Critical --sec-severity=Important && \
&& yum -y install --enablerepo ${REPOLIST} --setopt=tsflag=nodocs ${PKGLIST} \
&& yum -y clean all \
&& rm -rf /var/cache/yum
ENV APP_ROOT=/opt/oai-enb
ENV PATH=${APP_ROOT}:${PATH} HOME=${APP_ROOT}
COPY --from=builder /root/openairinterface5g/cmake_targets/lte_build_oai/build/lte-softmodem ${APP_ROOT}/bin/
COPY --from=builder /root/openairinterface5g/cmake_targets/lte_build_oai/build/*.so* /lib64
COPY --from=builder /usr/local/lib64 /lib64
COPY --from=builder /usr/local/bin/uhd_* /usr/local/bin
COPY --from=builder /usr/local/share/uhd /usr/local/share/uhd
RUN cd /lib64 \
&& ln -sf liboai_eth_transpro.so liboai_transpro.so \
&& ln -sf liboai_usrpdevif.so liboai_device.so \
&& ln -sf libuhd.so.3.13 libuhd.so.3 \
&& ln -sf libuhd.so.3 libuhd.so
COPY scripts ${APP_ROOT}/bin/
COPY configs ${APP_ROOT}/etc/
RUN chmod -R u+x ${APP_ROOT} && \
chgrp -R 0 ${APP_ROOT} && \
chmod -R g=u ${APP_ROOT} /etc/passwd
USER 10001
WORKDIR ${APP_ROOT}
EXPOSE 2152/udp # S1U, GTP/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"]
...@@ -52,6 +52,8 @@ RUN yum repolist --disablerepo=* && \ ...@@ -52,6 +52,8 @@ RUN yum repolist --disablerepo=* && \
atlas \ atlas \
lksctp-tools \ lksctp-tools \
nettle \ nettle \
net-tools \
iputils \
libyaml && \ libyaml && \
echo "/usr/local/lib" > /etc/ld.so.conf.d/local-lib.conf && \ echo "/usr/local/lib" > /etc/ld.so.conf.d/local-lib.conf && \
echo "/usr/local/lib64" >> /etc/ld.so.conf.d/local-lib.conf echo "/usr/local/lib64" >> /etc/ld.so.conf.d/local-lib.conf
...@@ -123,4 +125,4 @@ WORKDIR /opt/oai-gnb ...@@ -123,4 +125,4 @@ WORKDIR /opt/oai-gnb
#CMD ["/opt/oai-gnb/bin/nr-softmodem", "-O", "/opt/oai-gnb/etc/gnb.conf"] #CMD ["/opt/oai-gnb/bin/nr-softmodem", "-O", "/opt/oai-gnb/etc/gnb.conf"]
#ENTRYPOINT ["/opt/oai-gnb/bin/entrypoint.sh"] #ENTRYPOINT ["/opt/oai-gnb/bin/entrypoint.sh"]
CMD ["sleep", "infinity"]
...@@ -53,6 +53,8 @@ RUN yum repolist --disablerepo=* && \ ...@@ -53,6 +53,8 @@ RUN yum repolist --disablerepo=* && \
atlas \ atlas \
lksctp-tools \ lksctp-tools \
nettle \ nettle \
net-tools \
iputils \
libyaml && \ libyaml && \
echo "/usr/local/lib" > /etc/ld.so.conf.d/local-lib.conf && \ echo "/usr/local/lib" > /etc/ld.so.conf.d/local-lib.conf && \
echo "/usr/local/lib64" >> /etc/ld.so.conf.d/local-lib.conf echo "/usr/local/lib64" >> /etc/ld.so.conf.d/local-lib.conf
...@@ -124,4 +126,4 @@ WORKDIR /opt/oai-gnb ...@@ -124,4 +126,4 @@ WORKDIR /opt/oai-gnb
#CMD ["/opt/oai-gnb/bin/nr-softmodem", "-O", "/opt/oai-gnb/etc/gnb.conf"] #CMD ["/opt/oai-gnb/bin/nr-softmodem", "-O", "/opt/oai-gnb/etc/gnb.conf"]
#ENTRYPOINT ["/opt/oai-gnb/bin/entrypoint.sh"] #ENTRYPOINT ["/opt/oai-gnb/bin/entrypoint.sh"]
CMD ["sleep", "infinity"]
...@@ -59,6 +59,7 @@ RUN apt-get update && \ ...@@ -59,6 +59,7 @@ RUN apt-get update && \
openssl \ openssl \
net-tools \ net-tools \
iproute2 \ iproute2 \
iputils-ping \
libyaml-0-2 && \ libyaml-0-2 && \
# Install UHD driver from ettus ppa # Install UHD driver from ettus ppa
# At time of writing, it is 3.14 # At time of writing, it is 3.14
...@@ -121,4 +122,4 @@ WORKDIR /opt/oai-gnb ...@@ -121,4 +122,4 @@ WORKDIR /opt/oai-gnb
#CMD ["/opt/oai-gnb/bin/nr-softmodem", "-O", "/opt/oai-gnb/etc/gnb.conf"] #CMD ["/opt/oai-gnb/bin/nr-softmodem", "-O", "/opt/oai-gnb/etc/gnb.conf"]
#ENTRYPOINT ["/opt/oai-gnb/bin/entrypoint.sh"] #ENTRYPOINT ["/opt/oai-gnb/bin/entrypoint.sh"]
CMD ["sleep", "infinity"]
...@@ -51,6 +51,7 @@ RUN yum update -y && \ ...@@ -51,6 +51,7 @@ RUN yum update -y && \
atlas \ atlas \
iproute \ iproute \
net-tools \ net-tools \
iputils \
libyaml && \ libyaml && \
echo "/usr/local/lib" > /etc/ld.so.conf.d/local-lib.conf && \ echo "/usr/local/lib" > /etc/ld.so.conf.d/local-lib.conf && \
echo "/usr/local/lib64" >> /etc/ld.so.conf.d/local-lib.conf echo "/usr/local/lib64" >> /etc/ld.so.conf.d/local-lib.conf
...@@ -114,8 +115,9 @@ RUN ldconfig ...@@ -114,8 +115,9 @@ RUN ldconfig
# Copy the relevant configuration files for eNB # Copy the relevant configuration files for eNB
WORKDIR /opt/oai-lte-ue/etc WORKDIR /opt/oai-lte-ue/etc
COPY --from=lte-ue-build /oai-ran/ci-scripts/conf_files/ue.* . COPY --from=lte-ue-build /oai-ran/ci-scripts/conf_files/ue.* .
COPY --from=lte-ue-build /oai-ran/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf ./ue_usim.conf
WORKDIR /opt/oai-lte-ue WORKDIR /opt/oai-lte-ue
#CMD ["/opt/oai-lte-ue/bin/lte-uesoftmodem", "-O", "/opt/oai-lte-ue/etc/enb.conf"] #CMD ["/opt/oai-lte-ue/bin/lte-uesoftmodem", "-O", "/opt/oai-lte-ue/etc/enb.conf"]
#ENTRYPOINT ["/opt/oai-lte-ue/bin/entrypoint.sh"] #ENTRYPOINT ["/opt/oai-lte-ue/bin/entrypoint.sh"]
CMD ["sleep", "infinity"]
...@@ -51,6 +51,7 @@ RUN yum update -y && \ ...@@ -51,6 +51,7 @@ RUN yum update -y && \
atlas \ atlas \
iproute \ iproute \
net-tools \ net-tools \
iputils \
libyaml && \ libyaml && \
echo "/usr/local/lib" > /etc/ld.so.conf.d/local-lib.conf && \ echo "/usr/local/lib" > /etc/ld.so.conf.d/local-lib.conf && \
echo "/usr/local/lib64" >> /etc/ld.so.conf.d/local-lib.conf echo "/usr/local/lib64" >> /etc/ld.so.conf.d/local-lib.conf
...@@ -114,8 +115,9 @@ RUN ldd /usr/local/lib/libdfts.so ...@@ -114,8 +115,9 @@ RUN ldd /usr/local/lib/libdfts.so
# Copy the relevant configuration files for eNB # Copy the relevant configuration files for eNB
WORKDIR /opt/oai-lte-ue/etc WORKDIR /opt/oai-lte-ue/etc
COPY --from=lte-ue-build /oai-ran/ci-scripts/conf_files/ue.* . COPY --from=lte-ue-build /oai-ran/ci-scripts/conf_files/ue.* .
COPY --from=lte-ue-build /oai-ran/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf ./ue_usim.conf
WORKDIR /opt/oai-lte-ue WORKDIR /opt/oai-lte-ue
#CMD ["/opt/oai-lte-ue/bin/lte-uesoftmodem", "-O", "/opt/oai-lte-ue/etc/enb.conf"] #CMD ["/opt/oai-lte-ue/bin/lte-uesoftmodem", "-O", "/opt/oai-lte-ue/etc/enb.conf"]
#ENTRYPOINT ["/opt/oai-lte-ue/bin/entrypoint.sh"] #ENTRYPOINT ["/opt/oai-lte-ue/bin/entrypoint.sh"]
CMD ["sleep", "infinity"]
...@@ -58,6 +58,7 @@ RUN apt-get update && \ ...@@ -58,6 +58,7 @@ RUN apt-get update && \
libconfig9 \ libconfig9 \
openssl \ openssl \
net-tools \ net-tools \
iputils-ping \
iproute2 \ iproute2 \
libyaml-0-2 && \ libyaml-0-2 && \
# Install UHD driver from ettus ppa # Install UHD driver from ettus ppa
...@@ -114,8 +115,9 @@ RUN ldconfig ...@@ -114,8 +115,9 @@ RUN ldconfig
# Copy the relevant configuration files for eNB # Copy the relevant configuration files for eNB
WORKDIR /opt/oai-lte-ue/etc WORKDIR /opt/oai-lte-ue/etc
COPY --from=lte-ue-build /oai-ran/ci-scripts/conf_files/ue.* ./ COPY --from=lte-ue-build /oai-ran/ci-scripts/conf_files/ue.* ./
COPY --from=lte-ue-build /oai-ran/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf ./ue_usim.conf
WORKDIR /opt/oai-lte-ue WORKDIR /opt/oai-lte-ue
#CMD ["/opt/oai-lte-ue/bin/lte-uesoftmodem", "-O", "/opt/oai-lte-ue/etc/enb.conf"] #CMD ["/opt/oai-lte-ue/bin/lte-uesoftmodem", "-O", "/opt/oai-lte-ue/etc/enb.conf"]
#ENTRYPOINT ["/opt/oai-lte-ue/bin/entrypoint.sh"] #ENTRYPOINT ["/opt/oai-lte-ue/bin/entrypoint.sh"]
CMD ["sleep", "infinity"]
...@@ -48,6 +48,8 @@ RUN yum update -y && \ ...@@ -48,6 +48,8 @@ RUN yum update -y && \
yum install -y --enablerepo="ubi-8-codeready-builder" \ yum install -y --enablerepo="ubi-8-codeready-builder" \
lksctp-tools \ lksctp-tools \
nettle \ nettle \
net-tools \
iputils \
atlas \ atlas \
libXpm \ libXpm \
libX11 \ libX11 \
...@@ -114,4 +116,4 @@ COPY --from=nr-ue-build /oai-ran/ci-scripts/conf_files/ue.* . ...@@ -114,4 +116,4 @@ COPY --from=nr-ue-build /oai-ran/ci-scripts/conf_files/ue.* .
WORKDIR /opt/oai-nr-ue WORKDIR /opt/oai-nr-ue
#CMD ["/opt/oai-nr-ue/bin/nr-uesoftmodem", "-O", "/opt/oai-nr-ue/etc/enb.conf"] #CMD ["/opt/oai-nr-ue/bin/nr-uesoftmodem", "-O", "/opt/oai-nr-ue/etc/enb.conf"]
#ENTRYPOINT ["/opt/oai-nr-ue/bin/entrypoint.sh"] #ENTRYPOINT ["/opt/oai-nr-ue/bin/entrypoint.sh"]
CMD ["sleep", "infinity"]
...@@ -49,6 +49,8 @@ RUN yum update -y && \ ...@@ -49,6 +49,8 @@ RUN yum update -y && \
yum install -y --enablerepo="ubi-8-codeready-builder" \ yum install -y --enablerepo="ubi-8-codeready-builder" \
lksctp-tools \ lksctp-tools \
nettle \ nettle \
net-tools \
iputils \
atlas \ atlas \
libXpm \ libXpm \
libX11 \ libX11 \
...@@ -115,4 +117,4 @@ COPY --from=nr-ue-build /oai-ran/ci-scripts/conf_files/ue.* . ...@@ -115,4 +117,4 @@ COPY --from=nr-ue-build /oai-ran/ci-scripts/conf_files/ue.* .
WORKDIR /opt/oai-nr-ue WORKDIR /opt/oai-nr-ue
#CMD ["/opt/oai-nr-ue/bin/nr-uesoftmodem", "-O", "/opt/oai-nr-ue/etc/enb.conf"] #CMD ["/opt/oai-nr-ue/bin/nr-uesoftmodem", "-O", "/opt/oai-nr-ue/etc/enb.conf"]
#ENTRYPOINT ["/opt/oai-nr-ue/bin/entrypoint.sh"] #ENTRYPOINT ["/opt/oai-nr-ue/bin/entrypoint.sh"]
CMD ["sleep", "infinity"]
...@@ -58,6 +58,7 @@ RUN apt-get update && \ ...@@ -58,6 +58,7 @@ RUN apt-get update && \
libconfig9 \ libconfig9 \
openssl \ openssl \
net-tools \ net-tools \
iputils-ping \
iproute2 \ iproute2 \
libyaml-0-2 && \ libyaml-0-2 && \
# Install UHD driver from ettus ppa # Install UHD driver from ettus ppa
...@@ -114,4 +115,4 @@ COPY --from=nr-ue-build /oai-ran/ci-scripts/conf_files/ue.* . ...@@ -114,4 +115,4 @@ COPY --from=nr-ue-build /oai-ran/ci-scripts/conf_files/ue.* .
WORKDIR /opt/oai-nr-ue WORKDIR /opt/oai-nr-ue
#CMD ["/opt/oai-nr-ue/bin/nr-uesoftmodem", "-O", "/opt/oai-nr-ue/etc/enb.conf"] #CMD ["/opt/oai-nr-ue/bin/nr-uesoftmodem", "-O", "/opt/oai-nr-ue/etc/enb.conf"]
#ENTRYPOINT ["/opt/oai-nr-ue/bin/entrypoint.sh"] #ENTRYPOINT ["/opt/oai-nr-ue/bin/entrypoint.sh"]
CMD ["sleep", "infinity"]
<table style="border-collapse: collapse; border: none;">
<tr style="border-collapse: collapse; border: none;">
<td style="border-collapse: collapse; border: none;">
<a href="http://www.openairinterface.org/">
<img src="../doc/images/oai_final_logo.png" alt="" border=3 height=50 width=150>
</img>
</a>
</td>
<td style="border-collapse: collapse; border: none; vertical-align: center;">
<b><font size = "5">OAI Docker/Podman Build and Usage Procedures</font></b>
</td>
</tr>
</table>
--- ---
to be done **Table of Contents**
1. [Build Strategy](#1-build-strategy)
2. [File organization](#2-file-organization)
3. [Building using docker under Ubuntu 18.04](#3-building-using-docker-under-ubuntu-1804)
4. [Building using podman under Red Hat Entreprise Linux 8.2](#4-building-using-podman-under-red-hat-entreprise-linux-82)
5. [Running modems using docker under Ubuntu 18.04](#5-running-modems-using-docker-under-ubuntu-1804)
6. [Running modems using podman under Red Hat Entreprise Linux 8.2](#6-running-modems-using-podman-under-red-hat-entreprise-linux-82)
--- ---
# 1. Build Strategy #
For all platforms, the strategy for building docker/podman images is the same:
* First we create a common shared image that contains:
- the latest source files (by using the `COPY` function)
- all the means to build an OAI RAN executable
* all packages, compilers, ...
* especially UHD is installed
* Then from this shared image (`ran-build`) we can build target images for:
- eNB
- gNB
- lte-UE
- nr-UE
* These target images will only contain:
- the generated executable (for example `lte-softmodem.Rel15`)
- the generated shared libraries (for example `liboai_usrpdevif.so.Rel15`)
- the needed libraries and packages to run these generated binaries
- Some configuration file templates
- Some tools (such as `ping`, `ifconfig`)
TO DO:
- Proper entrypoints
- Proper port exposure
- ...
# 2. File organization #
Dockerfiles are named with the following naming convention: `Dockerfile.${target}.${OS-version}.${cluster-version}`
Targets can be:
- `ran` for an image named `ran-build` (the shared image)
- `eNB` for an image named `oai-enb`
- `gNB` for an image named `oai-gnb`
- `lteUE` for an image named `oai-lte-ue`
- `nrUE` for an image named `oai-nr-ue`
The currently-supported OS are:
- `rhel8.2` for Red Hat Entreprise Linux
- `ubuntu18` for Ubuntu 18.04 LTS
The currently-supported cluster version is:
- `rhel8.2.oc4-4`
We have also `rhel7.oc4-4` support but it will be discontinued soon.
For more details in build within a Openshift Cluster, see [OpenShift README](../openshift/README.md) for more details.
# 3. Building using `docker` under Ubuntu 18.04 #
## 3.1. Pre-requisites ##
* `git` installed
* `docker-ce` installed
* Pulling `ubuntu:bionic` from DockerHub
## 3.2. Building the shared image ##
This can be done starting `2020.w41` tag on the `develop` branch, or any branch that includes that tag.
```bash
git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git
cd openairinterface5g
git checkout develop
```
In our Eurecom/OSA environment we need to pass a GIT proxy.
```bash
docker build --target ran-build --tag ran-build:latest --file docker/Dockerfile.ran.ubuntu18 --build-arg NEEDED_GIT_PROXY="http://proxy.eurecom.fr:8080" .
```
if you don't need it, do NOT pass any value:
```bash
docker build --target ran-build --tag ran-build:latest --file docker/Dockerfile.ran.ubuntu18 .
```
After a while:
```bash
docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
ran-build latest ccb721bc0b57 1 minute ago 4.06GB
...
```
## 3.3. Building any target image ##
For example, the eNB:
```bash
docker build --target oai-enb --tag oai-enb:latest --file docker/Dockerfile.eNB.ubuntu18 .
```
After a while:
```
docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
oai-enb latest 25ddbd8b7187 1 minute ago 516MB
<none> <none> 875ea3b05b60 8 minutes ago 8.18GB
ran-build latest ccb721bc0b57 1 hour ago 4.06GB
```
Do not forget to remove the temporary image:
```
docker image prune --force
```
# 4. Building using `podman` under Red Hat Entreprise Linux 8.2 #
TODO.
# 5. Running modems using `docker` under Ubuntu 18.04 #
TODO.
# 6. Running modems using `podman` under Red Hat Entreprise Linux 8.2 #
TODO.
<table style="border-collapse: collapse; border: none;">
<tr style="border-collapse: collapse; border: none;">
<td style="border-collapse: collapse; border: none;">
<a href="http://www.openairinterface.org/">
<img src="../doc/images/oai_final_logo.png" alt="" border=3 height=50 width=150>
</img>
</a>
</td>
<td style="border-collapse: collapse; border: none; vertical-align: center;">
<b><font size = "5">OpenShift Build and Usage Procedures</font></b>
</td>
</tr>
</table>
-----
**CAUTION: this is experimental. Still a lot to be done.**
-----
# 1. Build pre-requisites #
To build our RAN images, we SHALL use the `codeready-builder-for-rhel-8-x86_64-rpms` repository with all the proper development libraries.
This repository is not directly accessible from the UBI RHEL8 image (`registry.access.redhat.com/ubi8/ubi:latest`).
So we need to copy from a register RHEL8 machine certificates and subsccription manager configuration files.
SO on a `RHEL8` physical machine (or a virtual machine) connected to the OpenShift Cluster, recover the entitlement and the RH subscription manager configs:
```bash
oc create configmap rhsm-conf --from-file /etc/rhsm/rhsm.conf
oc create configmap rhsm-ca --from-file /etc/rhsm/ca/redhat-uep.pem
oc create secret generic etc-pki-entitlement --from-file /etc/pki/entitlement/{NUMBER_ON_YOUR_COMPUTER}.pem --from-file /etc/pki/entitlement/{NUMBER_ON_YOUR_COMPUTER}-key.pem
```
These configmaps and secret will be shared by all the build configs in your OC project. No need to do it each time.
**CAUTION: these files expire every month or so. If you have done a build on your OC project and try again a few weeks later, you may need to re-copy them**.
```bash
oc delete secret etc-pki-entitlement
oc delete cm rhsm-conf
oc delete cm rhsm-ca
```
**LAST POINT: your OC project SHALL be `oai`.**
# 2. Build the Builder shared image #
In our Eurecom/OSA environment we need to pass a GIT proxy.
2 things are impacted by this situation:
* In `openshift/oai-ran-rh8-build-config.yml` file
* `httpProxy: http://proxy.eurecom.fr:8080`
* `httpsProxy: https://proxy.eurecom.fr:8080`
* Add a environment variable to the build config
```bash
oc apply -f openshift/oai-ran-rh8-image-stream.yml
oc apply -f openshift/oai-ran-rh8-build-config.yml
oc set env bc/oai-ran-rhel8-build-config NEEDED_GIT_PROXY=http://proxy.eurecom.fr:8080
oc start-build oai-ran-rhel8-build-config --follow
```
In case you do NOT require a GIT proxy: **you SHALL remove the 2 lines in `openshift/oai-ran-rh8-build-config.yml` file.**
And no need to add a `NEEDED_GIT_PROXY` variable to the build config.
```bash
oc apply -f openshift/oai-ran-rh8-image-stream.yml
oc apply -f openshift/modified-oai-ran-rh8-build-config.yml
oc start-build oai-ran-rhel8-build-config --follow
```
After a while it should be successful.
# 3. Build an OAI target image #
For the example the eNB:
```bash
oc apply -f openshift/oai-enb-rh8-image-stream.yml
oc apply -f openshift/oai-enb-rh8-build-config.yml
oc start-build oai-enb-rh8-build-config --follow
```
**CAUTION: if you are pushing modifications to the branch you are using, it won't be taken into account besides the Dockerfile.**
**Because the source files are copied during the shared image creation.**
**Only way to regenerate images w/ modified source code is to re-start from step #2.**
# 4. Deployment using HELM charts #
**CAUTION: even more experimental.**
Helm charts are located in another repository:
```bash
git clone https://github.com/OPENAIRINTERFACE/openair-k8s.git
cd openair-k8s
git checkout helm-deployment-S6a-S1C-S1U-in-network-18-with-enb
helm install mme /path-to-your-cloned/openair-k8s/charts/oai-mme/
```
#!/bin/sh
oc apply -f openshift/oai-enb-image-stream.yml
oc apply -f openshift/oai-enb-build-config.yml
oc set env bc/oai-enb-build-config NEEDED_GIT_PROXY=http://proxy.eurecom.fr:8080
oc start-build oai-enb-build-config --follow
#!/bin/sh
oc apply -f openshift/oai-gnb-image-stream.yml
oc apply -f openshift/oai-gnb-build-config.yml
oc set env bc/oai-gnb-build-config NEEDED_GIT_PROXY=http://proxy.eurecom.fr:8080
oc start-build oai-gnb-build-config --follow
#!/bin/sh
oc apply -f openshift/oai-ran-image-stream.yml
oc apply -f openshift/oai-ran-build-config.yml
oc set env bc/oai-ran-build-config NEEDED_GIT_PROXY=http://proxy.eurecom.fr:8080
oc start-build oai-ran-build-config --follow
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