From 7e1eabe70070753cb396d5baf196b0efdd72c289 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 24 Jul 2025 14:13:15 +0200 Subject: [PATCH] Switch to new (internal) registry --- ci-scripts/Jenkinsfile-GitLab-Container | 6 ++++-- ci-scripts/Jenkinsfile-push-registry | 17 ++++++++++------- ci-scripts/cls_containerize.py | 5 +++-- ci-scripts/tests/pull-clean-int-registry.py | 2 +- 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/ci-scripts/Jenkinsfile-GitLab-Container b/ci-scripts/Jenkinsfile-GitLab-Container index 4bdb20d371..c3f3037c78 100644 --- a/ci-scripts/Jenkinsfile-GitLab-Container +++ b/ci-scripts/Jenkinsfile-GitLab-Container @@ -35,6 +35,8 @@ def gitCommitAuthorEmailAddr // list of failing stages def failingStages = "" +def OAI_Registry = "gracehopper3-oai.sboai.cs.eurecom.fr" + pipeline { agent { label nodeExecutor @@ -834,11 +836,11 @@ def triggerCN5GSlaveJob (jobName, gitlabStatusName) { shortenShaOne = sh returnStdout: true, script: 'git log -1 --pretty=format:"%h" --abbrev=8 ' + env.gitlabMergeRequestLastCommit shortenShaOne = shortenShaOne.trim() branchName = env.gitlabSourceBranch.replaceAll("/", "-").trim() - fullRanTag = 'porcepix.sboai.cs.eurecom.fr/oai-gnb:' + env.gitlabSourceBranch + '-' + shortenShaOne + fullRanTag = OAI_Registry + '/oai-gnb:' + env.gitlabSourceBranch + '-' + shortenShaOne } else { shortenShaOne = sh returnStdout: true, script: 'git log -1 --pretty=format:"%h" --abbrev=8 ' + env.GIT_COMMIT shortenShaOne = shortenShaOne.trim() - fullRanTag = 'porcepix.sboai.cs.eurecom.fr/oai-gnb:develop-' + shortenShaOne + fullRanTag = OAI_Registry + '/oai-gnb:develop-' + shortenShaOne } // Workaround for the "cancelled" GitLab pipeline notification // The slave job is triggered with the propagate false so the following commands are executed diff --git a/ci-scripts/Jenkinsfile-push-registry b/ci-scripts/Jenkinsfile-push-registry index d3bd5e6e64..8f54d352b1 100644 --- a/ci-scripts/Jenkinsfile-push-registry +++ b/ci-scripts/Jenkinsfile-push-registry @@ -31,6 +31,9 @@ if (params.LockResources != null && params.LockResources.trim().length() > 0) // Docker Hub account to push to def DH_Account = "oaisoftwarealliance" +// internal registry to use +def OAI_Registry = "gracehopper3-oai.sboai.cs.eurecom.fr" + pipeline { agent { label nodeExecutor @@ -79,14 +82,14 @@ pipeline { def listOfImages = ["oai-enb", "oai-gnb", "oai-lte-ue", "oai-nr-ue", "oai-nr-cuup", "oai-gnb-fhi72"] // Logging in on both registries sh "docker login -u ${DH_Username} -p ${DH_Password} > /dev/null 2>&1" - sh "docker login -u oaicicd -p oaicicd porcepix.sboai.cs.eurecom.fr > /dev/null 2>&1" + sh "docker login -u oaicicd -p oaicicd ${OAI_Registry} > /dev/null 2>&1" listOfImages.eachWithIndex { item, iindex -> - sh "docker pull --quiet porcepix.sboai.cs.eurecom.fr/${item}:develop-${WEEK_SHA}" - sh "docker image tag porcepix.sboai.cs.eurecom.fr/${item}:develop-${WEEK_SHA} ${DH_Account}/${item}:develop" - sh "docker image tag porcepix.sboai.cs.eurecom.fr/${item}:develop-${WEEK_SHA} ${DH_Account}/${item}:${WEEK_TAG}" + sh "docker pull --quiet ${OAI_Registry}/${item}:develop-${WEEK_SHA}" + sh "docker image tag ${OAI_Registry}/${item}:develop-${WEEK_SHA} ${DH_Account}/${item}:develop" + sh "docker image tag ${OAI_Registry}/${item}:develop-${WEEK_SHA} ${DH_Account}/${item}:${WEEK_TAG}" sh "docker push --quiet ${DH_Account}/${item}:${WEEK_TAG}" sh "docker push --quiet ${DH_Account}/${item}:develop" - sh "docker rmi ${DH_Account}/${item}:${WEEK_TAG} ${DH_Account}/${item}:develop porcepix.sboai.cs.eurecom.fr/${item}:develop-${WEEK_SHA}" + sh "docker rmi ${DH_Account}/${item}:${WEEK_TAG} ${DH_Account}/${item}:develop ${OAI_Registry}/${item}:develop-${WEEK_SHA}" } // Proxy is not following the same pattern. sh "docker image tag proxy:develop ${DH_Account}/proxy:develop" @@ -95,7 +98,7 @@ pipeline { sh "docker push --quiet ${DH_Account}/proxy:${WEEK_TAG}" sh "docker rmi ${DH_Account}/proxy:develop ${DH_Account}/proxy:${WEEK_TAG}" // Logging out on both registries - sh "docker logout porcepix.sboai.cs.eurecom.fr > /dev/null 2>&1" + sh "docker logout ${OAI_Registry} > /dev/null 2>&1" sh "docker logout > /dev/null 2>&1" } } @@ -105,7 +108,7 @@ pipeline { post { always { script { - sh "docker logout porcepix.sboai.cs.eurecom.fr > /dev/null 2>&1" + sh "docker logout ${OAI_Registry} > /dev/null 2>&1" sh "docker logout > /dev/null 2>&1" echo "End of Registry Push" } diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index 965ff6a6db..3fe2729c77 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -53,6 +53,7 @@ from cls_ci_helper import archiveArtifact # (e.g., cls_cluster.py) #----------------------------------------------------------- IMAGES = ['oai-enb', 'oai-lte-ru', 'oai-lte-ue', 'oai-gnb', 'oai-nr-cuup', 'oai-gnb-aw2s', 'oai-nr-ue', 'oai-enb-asan', 'oai-gnb-asan', 'oai-lte-ue-asan', 'oai-nr-ue-asan', 'oai-nr-cuup-asan', 'oai-gnb-aerial', 'oai-gnb-fhi72'] +DEFAULT_REGISTRY = "gracehopper3-oai.sboai.cs.eurecom.fr" def CreateWorkspace(host, sourcePath, ranRepository, ranCommitID, ranTargetBranch, ranAllowMerge): if ranCommitID == '': @@ -596,7 +597,7 @@ class Containerize(): lSourcePath = self.eNBSourceCodePath logging.debug('Pushing images to server: ' + node) ssh = cls_cmd.getConnection(node) - imagePrefix = 'porcepix.sboai.cs.eurecom.fr' + imagePrefix = DEFAULT_REGISTRY ret = ssh.run(f'docker login -u oaicicd -p oaicicd {imagePrefix}') if ret.returncode != 0: msg = 'Could not log into local registry' @@ -667,7 +668,7 @@ class Containerize(): msg = "Pulled Images:\n" + '\n'.join(pulled_images) return True, msg - def Pull_Image_from_Registry(self, HTML, node, images, tag=None, tag_prefix="", registry="porcepix.sboai.cs.eurecom.fr", username="oaicicd", password="oaicicd"): + def Pull_Image_from_Registry(self, HTML, node, images, tag=None, tag_prefix="", registry=DEFAULT_REGISTRY, username="oaicicd", password="oaicicd"): logging.debug(f'\u001B[1m Pulling image(s) on server: {node}\u001B[0m') if not tag: tag = CreateTag(self.ranCommitID, self.ranBranch, self.ranAllowMerge) diff --git a/ci-scripts/tests/pull-clean-int-registry.py b/ci-scripts/tests/pull-clean-int-registry.py index f17c1c7a1d..3bf4b9e67e 100644 --- a/ci-scripts/tests/pull-clean-int-registry.py +++ b/ci-scripts/tests/pull-clean-int-registry.py @@ -26,7 +26,7 @@ class TestDeploymentMethods(unittest.TestCase): # the pull function has the authentication at the internal cluster hardcoded # this is a refactoring opportunity: we should do it in a separate step # and allow to have pull work with any registry - registry = "porcepix.sboai.cs.eurecom.fr" + registry = cls_containerize.DEFAULT_REGISTRY with cls_cmd.getConnection("localhost") as cmd: ret = cmd.run(f"ping -c1 -w1 {registry}") if ret.returncode != 0: # could not ping once -> skip test