mirror of
https://gitlab.eurecom.fr/oai/openairinterface5g.git
synced 2026-07-13 04:30:28 +00:00
CI: Remove L2sim proxy build support
Remove the `BuildProxy` method, `Build_Proxy` action, `proxyCommit` attribute, and all associated XML configuration and unit tests. The oai-lte-5g-multi-ue-proxy repository has not received any updates in over two years, and the proxy commit currently used for the build is outdated as well. Although the proxy image is still required by RAN-L2-Sim-Test-4G and must remain available on the test machine, building it as part of the CI pipeline is dropped in this commit. Instead, the CI will now assume that the corresponding proxy image is already present as an external dependency, similarly to how CN images are handled. Signed-off-by: Jaroslava Fiedlerova <jaroslava.fiedlerova@openairinterface.org>
This commit is contained in:
@@ -178,7 +178,6 @@ class Containerize():
|
||||
self.ranTargetBranch = ''
|
||||
self.eNBSourceCodePath = ''
|
||||
self.imageKind = ''
|
||||
self.proxyCommit = None
|
||||
self.yamlPath = ''
|
||||
self.services = ''
|
||||
self.deploymentTag = ''
|
||||
@@ -375,88 +374,6 @@ class Containerize():
|
||||
logging.error('\u001B[1m Building OAI Images Failed\u001B[0m')
|
||||
return status
|
||||
|
||||
def BuildProxy(self, ctx, node, HTML):
|
||||
lSourcePath = self.eNBSourceCodePath
|
||||
logging.debug('Building on server: ' + node)
|
||||
ssh = cls_cmd.getConnection(node)
|
||||
|
||||
oldRanCommidID = self.ranCommitID
|
||||
oldRanRepository = self.ranRepository
|
||||
oldRanAllowMerge = self.ranAllowMerge
|
||||
oldRanTargetBranch = self.ranTargetBranch
|
||||
self.ranCommitID = self.proxyCommit
|
||||
self.ranRepository = 'https://github.com/EpiSci/oai-lte-5g-multi-ue-proxy.git'
|
||||
self.ranAllowMerge = False
|
||||
self.ranTargetBranch = 'master'
|
||||
|
||||
# Let's remove any previous run artifacts if still there
|
||||
ssh.run('docker image prune --force')
|
||||
# Remove any previous proxy image
|
||||
ssh.run('docker image rm oai-lte-multi-ue-proxy:latest')
|
||||
|
||||
tag = self.proxyCommit
|
||||
logging.debug('building L2sim proxy image for tag ' + tag)
|
||||
# check if the corresponding proxy image with tag exists. If not, build it
|
||||
ret = ssh.run(f'docker image inspect --format=\'Size = {{{{.Size}}}} bytes\' proxy:{tag}')
|
||||
buildProxy = ret.returncode != 0 # if no image, build new proxy
|
||||
if buildProxy:
|
||||
ssh.run(f'rm -Rf {lSourcePath}')
|
||||
success = CreateWorkspace(node, lSourcePath, self.ranRepository, self.ranCommitID, self.ranTargetBranch, self.ranAllowMerge)
|
||||
if not success:
|
||||
raise Exception("could not clone proxy repository")
|
||||
|
||||
fullpath = f'{lSourcePath}/proxy_build.log'
|
||||
|
||||
ssh.run(f'docker build --target oai-lte-multi-ue-proxy --tag proxy:{tag} --file {lSourcePath}/docker/Dockerfile.ubuntu18.04 {lSourcePath} > {fullpath} 2>&1')
|
||||
archiveArtifact(ssh, ctx, fullpath)
|
||||
|
||||
ssh.run('docker image prune --force')
|
||||
ret = ssh.run(f'docker image inspect --format=\'Size = {{{{.Size}}}} bytes\' proxy:{tag}')
|
||||
if ret.returncode != 0:
|
||||
logging.error('\u001B[1m Build of L2sim proxy failed\u001B[0m')
|
||||
ssh.close()
|
||||
HTML.CreateHtmlTestRow('commit ' + tag, 'KO', CONST.ALL_PROCESSES_OK)
|
||||
return False
|
||||
else:
|
||||
logging.debug('L2sim proxy image for tag ' + tag + ' already exists, skipping build')
|
||||
|
||||
# retag the build images to that we pick it up later
|
||||
ssh.run(f'docker image tag proxy:{tag} oai-lte-multi-ue-proxy:latest')
|
||||
|
||||
# we assume that the host on which this is built will also run the proxy. The proxy
|
||||
# currently requires the following command, and the docker-compose up mechanism of
|
||||
# the CI does not allow to run arbitrary commands. Note that the following actually
|
||||
# belongs to the deployment, not the build of the proxy...
|
||||
logging.warning('the following command belongs to deployment, but no mechanism exists to exec it there!')
|
||||
ssh.run('sudo ifconfig lo: 127.0.0.2 netmask 255.0.0.0 up')
|
||||
|
||||
# to prevent accidentally overwriting data that might be used later
|
||||
self.ranCommitID = oldRanCommidID
|
||||
self.ranRepository = oldRanRepository
|
||||
self.ranAllowMerge = oldRanAllowMerge
|
||||
self.ranTargetBranch = oldRanTargetBranch
|
||||
|
||||
ret = ssh.run(f'docker image inspect --format=\'Size = {{{{.Size}}}} bytes\' proxy:{tag}')
|
||||
result = re.search(r'Size *= *(?P<size>[0-9\-]+) *bytes', ret.stdout)
|
||||
# Cleaning any created tmp volume
|
||||
ssh.run('docker volume prune --force')
|
||||
ssh.close()
|
||||
|
||||
allImagesSize = {}
|
||||
if result is not None:
|
||||
imageSize = float(result.group('size')) / 1000000
|
||||
logging.debug('\u001B[1m proxy size is ' + ('%.0f' % imageSize) + ' Mbytes\u001B[0m')
|
||||
allImagesSize['proxy'] = str(round(imageSize,1)) + ' Mbytes'
|
||||
logging.info('\u001B[1m Building L2sim Proxy Image Pass\u001B[0m')
|
||||
HTML.CreateHtmlTestRow('commit ' + tag, 'OK', CONST.ALL_PROCESSES_OK)
|
||||
return True
|
||||
else:
|
||||
logging.error('proxy size is unknown')
|
||||
allImagesSize['proxy'] = 'unknown'
|
||||
logging.error('\u001B[1m Build of L2sim proxy failed\u001B[0m')
|
||||
HTML.CreateHtmlTestRow('commit ' + tag, 'KO', CONST.ALL_PROCESSES_OK)
|
||||
return False
|
||||
|
||||
def BuildRunTests(self, ctx, node, dockerfile, runtime_opt, ctest_opt, HTML):
|
||||
lSourcePath = self.eNBSourceCodePath
|
||||
logging.debug('Building on server: ' + node)
|
||||
|
||||
@@ -65,21 +65,16 @@ def ExecuteActionWithParam(action, ctx, node):
|
||||
global HTML
|
||||
global CONTAINERS
|
||||
global CLUSTER
|
||||
if action == 'Build_eNB' or action == 'Build_Image' or action == 'Build_Proxy' or action == "Build_Cluster_Image" or action == "Build_Run_Tests":
|
||||
if action == 'Build_eNB' or action == 'Build_Image' or action == "Build_Cluster_Image" or action == "Build_Run_Tests":
|
||||
RAN.Build_eNB_args=test.findtext('Build_eNB_args')
|
||||
CONTAINERS.imageKind=test.findtext('kind')
|
||||
proxy_commit = test.findtext('proxy_commit')
|
||||
dockerfile = test.findtext('dockerfile') or ''
|
||||
runtime_opt = test.findtext('runtime-opt') or ''
|
||||
ctest_opt = test.findtext('ctest-opt') or ''
|
||||
if proxy_commit is not None:
|
||||
CONTAINERS.proxyCommit = proxy_commit
|
||||
if action == 'Build_eNB':
|
||||
success = cls_native.Native.Build(ctx, node, HTML, RAN.eNBSourceCodePath, RAN.Build_eNB_args)
|
||||
elif action == 'Build_Image':
|
||||
success = CONTAINERS.BuildImage(ctx, node, HTML)
|
||||
elif action == 'Build_Proxy':
|
||||
success = CONTAINERS.BuildProxy(ctx, node, HTML)
|
||||
elif action == 'Build_Cluster_Image':
|
||||
success = CLUSTER.BuildClusterImage(ctx, node, HTML)
|
||||
elif action == 'Build_Run_Tests':
|
||||
|
||||
@@ -33,10 +33,5 @@ class TestBuild(unittest.TestCase):
|
||||
cmd.run(f"rm -rf {self._d}")
|
||||
cmd.run(f'rm -rf {self.ctx.logPath}')
|
||||
|
||||
def test_build_proxy(self):
|
||||
self.cont.proxyCommit = "b64d9bce986b38ca59e8582864ade3fcdd05c0dc"
|
||||
success = self.cont.BuildProxy(self.ctx, self.node, self.html)
|
||||
self.assertTrue(success)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
# SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
||||
- Build_Proxy
|
||||
- Build_Cluster_Image
|
||||
- Pull_Cluster_Image
|
||||
- Build_eNB
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
<!-- SPDX-License-Identifier: LicenseRef-CSSL-1.0 -->
|
||||
|
||||
<testCaseList>
|
||||
<htmlTabRef>l2sim-4glte-5gnr-proxy-build</htmlTabRef>
|
||||
<htmlTabName>Build L2sim proxy image</htmlTabName>
|
||||
<htmlTabIcon>wrench</htmlTabIcon>
|
||||
|
||||
<testCase>
|
||||
<class>Build_Proxy</class>
|
||||
<desc>Build L2sim Proxy Image</desc>
|
||||
<node>localhost</node>
|
||||
<proxy_commit>b64d9bce986b38ca59e8582864ade3fcdd05c0dc</proxy_commit>
|
||||
</testCase>
|
||||
|
||||
</testCaseList>
|
||||
Reference in New Issue
Block a user