From 6f868b038f03ed77de9c512bcdd87a1c6ef0893b Mon Sep 17 00:00:00 2001 From: Robert Schmidt <robert.schmidt@openairinterface.org> Date: Thu, 26 Sep 2024 19:39:22 +0200 Subject: [PATCH] Remove more unused CI files --- ci-scripts/cls_containerize.py | 2 - ci-scripts/cots_ue_ctl.yaml | 20 ---- ci-scripts/flatten_image.py | 116 ----------------------- ci-scripts/py_params.yaml | 48 ---------- ci-scripts/py_params_template.yaml | 90 ------------------ ci-scripts/ran_dashboard/Hdashboard.py | 126 ------------------------- ci-scripts/template-host.xml | 27 ------ 7 files changed, 429 deletions(-) delete mode 100644 ci-scripts/cots_ue_ctl.yaml delete mode 100644 ci-scripts/flatten_image.py delete mode 100644 ci-scripts/py_params.yaml delete mode 100644 ci-scripts/py_params_template.yaml delete mode 100644 ci-scripts/ran_dashboard/Hdashboard.py delete mode 100644 ci-scripts/template-host.xml diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index 0f4ff7963fa..9e94d653bcd 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -644,8 +644,6 @@ class Containerize(): buildProxy = mySSH.getBefore().count('o such image') != 0 if buildProxy: mySSH.command(self.cli + ' build ' + self.cliBuildOptions + ' --target oai-lte-multi-ue-proxy --tag proxy:' + tag + ' --file docker/Dockerfile.ubuntu18.04 . > cmake_targets/log/proxy-build.log 2>&1', '\$', 180) - # Note: at this point, OAI images are flattened, but we cannot do this - # here, as the flatten script is not in the proxy repo mySSH.command(self.cli + ' image inspect --format=\'Size = {{.Size}} bytes\' proxy:' + tag, '\$', 5) mySSH.command(self.cli + ' image prune --force || true','\$', 15) if mySSH.getBefore().count('o such image') != 0: diff --git a/ci-scripts/cots_ue_ctl.yaml b/ci-scripts/cots_ue_ctl.yaml deleted file mode 100644 index c22fca246bf..00000000000 --- a/ci-scripts/cots_ue_ctl.yaml +++ /dev/null @@ -1,20 +0,0 @@ -9d690a12: #oppo - - adb shell input keyevent KEYCODE_POWER - - adb shell input swipe 300 700 300 0 - - adb shell am start -a android.settings.AIRPLANE_MODE_SETTINGS - - adb shell input keyevent 20 - - adb shell input tap 968 324 -002: #s10 - - adb shell input keyevent KEYCODE_POWER - - adb shell input swipe 200 900 200 300 - - adb shell am start -a android.settings.AIRPLANE_MODE_SETTINGS - - adb shell input tap 968 324 -003: #s20 - - adb shell input keyevent KEYCODE_POWER - - adb shell input swipe 200 900 200 300 - - adb shell am start -a android.settings.AIRPLANE_MODE_SETTINGS - - adb shell input tap 968 324 -004: #xperia - - tbd - - tbd - - tbd diff --git a/ci-scripts/flatten_image.py b/ci-scripts/flatten_image.py deleted file mode 100644 index 55ac8ff0da4..00000000000 --- a/ci-scripts/flatten_image.py +++ /dev/null @@ -1,116 +0,0 @@ -""" - 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 -""" - -import argparse -import re -import subprocess -import sys - -def main() -> None: - args = _parse_args() - status = perform_flattening(args.tag) - sys.exit(status) - -def _parse_args() -> argparse.Namespace: - parser = argparse.ArgumentParser(description='Flattening Image') - - parser.add_argument( - '--tag', '-t', - action='store', - required=True, - help='Image Tag in image-name:image tag format', - ) - return parser.parse_args() - -def perform_flattening(tag): - # First detect which docker/podman command to use - cli = '' - image_prefix = '' - cmd = 'which podman || true' - podman_check = subprocess.check_output(cmd, shell=True, universal_newlines=True) - if re.search('podman', podman_check.strip()): - cli = 'sudo podman' - image_prefix = 'localhost/' - if cli == '': - cmd = 'which docker || true' - docker_check = subprocess.check_output(cmd, shell=True, universal_newlines=True) - if re.search('docker', docker_check.strip()): - cli = 'docker' - image_prefix = '' - if cli == '': - print ('No docker / podman installed: quitting') - return -1 - print (f'Flattening {tag}') - - # Creating a container - cmd = cli + ' run --name test-flatten --entrypoint /bin/true -d ' + tag - print (cmd) - subprocess.check_output(cmd, shell=True, universal_newlines=True) - - # Export / Import trick - cmd = cli + ' export test-flatten | ' + cli + ' import ' - # Bizarro syntax issue with podman - if cli == 'docker': - cmd += ' --change "ENV PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" ' - else: - cmd += ' --change "ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" ' - if re.search('oai-enb', tag): - cmd += ' --change "WORKDIR /opt/oai-enb" ' - cmd += ' --change "EXPOSE 2152/udp" ' - cmd += ' --change "EXPOSE 36412/udp" ' - cmd += ' --change "EXPOSE 36422/udp" ' - cmd += ' --change "CMD [\\"/opt/oai-enb/bin/lte-softmodem\\", \\"-O\\", \\"/opt/oai-enb/etc/enb.conf\\"]" ' - cmd += ' --change "ENTRYPOINT [\\"/opt/oai-enb/bin/entrypoint.sh\\"]" ' - if re.search('oai-gnb', tag): - cmd += ' --change "WORKDIR /opt/oai-gnb" ' - cmd += ' --change "EXPOSE 2152/udp" ' - cmd += ' --change "EXPOSE 36422/udp" ' - cmd += ' --change "CMD [\\"/opt/oai-gnb/bin/nr-softmodem\\", \\"-O\\", \\"/opt/oai-gnb/etc/gnb.conf\\"]" ' - cmd += ' --change "ENTRYPOINT [\\"/opt/oai-gnb/bin/entrypoint.sh\\"]" ' - if re.search('oai-lte-ue', tag): - cmd += ' --change "WORKDIR /opt/oai-lte-ue" ' - cmd += ' --change "CMD [\\"/opt/oai-lte-ue/bin/lte-uesoftmodem\\"]" ' - cmd += ' --change "ENTRYPOINT [\\"/opt/oai-lte-ue/bin/entrypoint.sh\\"]" ' - if re.search('oai-nr-ue', tag): - cmd += ' --change "WORKDIR /opt/oai-nr-ue" ' - cmd += ' --change "CMD [\\"/opt/oai-nr-ue/bin/nr-uesoftmodem\\", \\"-O\\", \\"/opt/oai-nr-ue/etc/nr-ue.conf\\"]" ' - cmd += ' --change "ENTRYPOINT [\\"/opt/oai-nr-ue/bin/entrypoint.sh\\"]" ' - if re.search('oai-lte-ru', tag): - cmd += ' --change "WORKDIR /opt/oai-lte-ru" ' - cmd += ' --change "CMD [\\"/opt/oai-lte-ru/bin/oairu\\", \\"-O\\", \\"/opt/oai-lte-ru/etc/rru.conf\\"]" ' - cmd += ' --change "ENTRYPOINT [\\"/opt/oai-lte-ru/bin/entrypoint.sh\\"]" ' - if re.search('oai-physim', tag): - cmd += ' --change "WORKDIR /opt/oai-physim" ' - cmd += ' - ' + image_prefix + tag - print (cmd) - subprocess.check_output(cmd, shell=True, universal_newlines=True) - - # Remove container - cmd = cli + ' rm -f test-flatten' - print (cmd) - subprocess.check_output(cmd, shell=True, universal_newlines=True) - - # At this point the original image is a dangling image. - # CI pipeline will clean up (`image prune --force`) - return 0 - -if __name__ == '__main__': - main() diff --git a/ci-scripts/py_params.yaml b/ci-scripts/py_params.yaml deleted file mode 100644 index 0c1d660ee88..00000000000 --- a/ci-scripts/py_params.yaml +++ /dev/null @@ -1,48 +0,0 @@ -eNBRepository : b -ranRepository : c -eNB_AllowMerge : -ranAllowMerge : -eNBBranch : f -ranBranch : g -eNBCommitID : -ranCommitID : i -eNBTargetBranch : j -ranTargetBranch : k - -nodes : - - type : eNB - IPAddress : 001.1.1 - UserName : toto - Password : qwe - SourceCodePath : l - - type : gNB - IPAddress : 002.2.2 - UserName : tata - Password : asd - SourceCodePath : m - - type : eNB - IPAddress : 003.3.3 - UserName : titi - Password : zxc - SourceCodePath : n - - type : gNB - IPAddress : 004.4.4 - UserName : caca - Password : pepe - SourceCodePath : o - -EPCIPAddress : p -EPCUserName : q -EPCPassword : r -EPCSourceCodePath : s -EPCType : t -EPCContainerPrefix : u - -XMLTestFile : z - -UEIPAddress : qqq -UEUserName : www -UEPassword : eee -UESourceCodePath : yyy - -finalStatus : bbb \ No newline at end of file diff --git a/ci-scripts/py_params_template.yaml b/ci-scripts/py_params_template.yaml deleted file mode 100644 index b6ef9c6892d..00000000000 --- a/ci-scripts/py_params_template.yaml +++ /dev/null @@ -1,90 +0,0 @@ -eNBRepository : b -ranRepository : c -eNB_AllowMerge : -ranAllowMerge : -eNBBranch : f -ranBranch : g -eNBCommitID : -ranCommitID : i -eNBTargetBranch : j -ranTargetBranch : k - - -RAN: - RAN_inst_0: - name : RAN_1 - nodes : - - type : eNB - IPAddress : 001.1.1 - UserName : toto - Password : qwe - SourceCodePath : l - - type : gNB - IPAddress : 002.2.2 - UserName : tata - Password : asd - SourceCodePath : m - - type : eNB - IPAddress : 003.3.3 - UserName : titi - Password : zxc - SourceCodePath : n - - type : gNB - IPAddress : 004.4.4 - UserName : caca - Password : pepe - SourceCodePath : o - RAN_inst_1: - name : RAN_2 - nodes : - - type : eNB - IPAddress : 101.1.1 - UserName : toto - Password : qwe - SourceCodePath : l - - type : gNB - IPAddress : 102.2.2 - UserName : zaza - Password : asd - SourceCodePath : m - - type : eNB - IPAddress : 103.3.3 - UserName : zizi - Password : zxc - SourceCodePath : n - - type : gNB - IPAddress : 104.4.4 - UserName : aaaa - Password : pepe - SourceCodePath : o - - - -EPC: - EPC_inst_0: - EPCIPAddress : p - EPCUserName : q - EPCPassword : r - EPCSourceCodePath : s - EPCType : t - EPCContainerPrefix : u - -UE: - UE_inst_0: - name : UE_1 - type : - UEIPAddress : qqq - UEUserName : www - UEPassword : eee - UESourceCodePath : yyy - UE_inst_1: - name : UE_2 - type : - UEIPAddress : bloblob - UEUserName : gwou - UEPassword : zebu - UESourceCodePath : pop - - -XMLTestFile : z -finalStatus : bbb \ No newline at end of file diff --git a/ci-scripts/ran_dashboard/Hdashboard.py b/ci-scripts/ran_dashboard/Hdashboard.py deleted file mode 100644 index 625baa8f46e..00000000000 --- a/ci-scripts/ran_dashboard/Hdashboard.py +++ /dev/null @@ -1,126 +0,0 @@ -#/* -# * 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 -# */ -#--------------------------------------------------------------------- -# Merge Requests Dashboard for RAN on googleSheet -# -# Required Python Version -# Python 3.x -# -#--------------------------------------------------------------------- - -#----------------------------------------------------------- -# Import -#----------------------------------------------------------- - - -#Author Remi -import shlex -import subprocess -import json #json structures -import gitlab -import sys - -#----------------------------------------------------------- -# Class Declaration -#----------------------------------------------------------- - -class Dashboard: - def __init__(self): - #init with data sources : git, test results databases - print("Collecting Data") - cmd="""curl --silent "https://gitlab.eurecom.fr/api/v4/projects/oai%2Fopenairinterface5g/merge_requests?state=opened&per_page=100" """ - self.git = self.__getGitData(cmd) #git data from Gitlab - self.mr_list=[] #mr list in string format - for x in range(len(self.git)): - self.mr_list.append(str(self.git[x]['iid'])) - - def __getGitData(self,cmd): - process = subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE) - output = process.stdout.readline() - tmp=output.decode("utf-8") - d = json.loads(tmp) - return d - - def PostGitNote(self,mr,commit,args): - if len(args)%4 != 0: - print("Wrong Number of Arguments") - return - else : - n_tests=len(args)//4 - - gl = gitlab.Gitlab.from_config('OAI') - project_id = 223 - project = gl.projects.get(project_id) - - #retrieve all the notes from the MR - editable_mr = project.mergerequests.get(int(mr)) - mr_notes = editable_mr.notes.list(all=True) - - body = '[Consolidated Test Results]\\\n' - body += 'Tested CommitID: ' + commit - - for i in range(0,n_tests): - jobname = args[4*i] - buildurl = args[4*i+1] - buildid = args[4*i+2] - status = args[4*i+3] - body += '\\\n' + jobname + ': **'+status+'** ([' + buildid + '](' + buildurl + '))' - - #create new note - mr_note = editable_mr.notes.create({ - 'body': body - }) - editable_mr.save() - - -def main(): - #call from master Jenkinsfile : sh "python3 Hdashboard.py gitpost ${GitPostArgs}" - if len(sys.argv) > 1: - - #individual MR test results + test dashboard, event based (end of slave jenkins pipeline) - if sys.argv[1] != "gitpost": - print("error: only gitpost subcommand is supported") - exit(1) - - elif sys.argv[1]=="gitpost": - mr=sys.argv[2] - commit=sys.argv[3] - args=[] - for i in range (4, len(sys.argv)): #jobname, url, id , result - args.append(sys.argv[i]) - htmlDash=Dashboard() - if mr in htmlDash.mr_list: - htmlDash.PostGitNote(mr,commit, args) - else: - print("Not a Merge Request => this build is for testing/debug purpose, no report to git") - else: - print("Wrong argument at position 1") - exit(1) - - - #test and MR status dashboards, cron based - else: - print("error: only gitpost subcommand is supported") - exit(1) - -if __name__ == "__main__": - # execute only if run as a script - main() diff --git a/ci-scripts/template-host.xml b/ci-scripts/template-host.xml deleted file mode 100644 index efd9912c7ad..00000000000 --- a/ci-scripts/template-host.xml +++ /dev/null @@ -1,27 +0,0 @@ -<domain type='kvm'> - <os> - <type>hvm</type> - <boot dev='hd'/> - </os> - <features> - <acpi/> - <apic/> - <pae/> - </features> - <cpu mode='host-passthrough'> - </cpu> - <devices> - <interface type='network'> - <source network='default'/> - <model type='virtio'/> - </interface> - <serial type='pty'> - <source path='/dev/pts/3'/> - <target port='0'/> - </serial> - <graphics type='vnc' autoport='yes' listen='127.0.0.1'> - <listen type='address' address='127.0.0.1'/> - </graphics> - <video/> - </devices> -</domain> -- GitLab