From a219585443ac90390722795826b09dd5678e89cd Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Mon, 15 Feb 2021 15:31:58 +0000 Subject: [PATCH 1/6] [CI] Add ARM packaging --- Jenkinsfile | 20 ++++++++++++++++++-- auditbeat/Jenkinsfile.yml | 6 ++++++ filebeat/Jenkinsfile.yml | 6 ++++++ heartbeat/Jenkinsfile.yml | 6 ++++++ journalbeat/Jenkinsfile.yml | 6 ++++++ metricbeat/Jenkinsfile.yml | 6 ++++++ packetbeat/Jenkinsfile.yml | 6 ++++++ x-pack/auditbeat/Jenkinsfile.yml | 6 ++++++ x-pack/elastic-agent/Jenkinsfile.yml | 6 ++++++ x-pack/filebeat/Jenkinsfile.yml | 8 +++++++- x-pack/heartbeat/Jenkinsfile.yml | 6 ++++++ x-pack/metricbeat/Jenkinsfile.yml | 6 ++++++ x-pack/packetbeat/Jenkinsfile.yml | 6 ++++++ 13 files changed, 91 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3cee434b6e6..7d5cc927396 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -261,7 +261,21 @@ def k8sTest(Map args = [:]) { } /** -* This method runs the packaging +* This method runs the packaging for ARM +*/ +def packagingArm(Map args = [:]) { + PACKAGES = "docker" + def PLATFORMS = [ 'linux/arm64' ].join(' ') + withEnv([ + "PLATFORMS=${PLATFORMS}", + "PACKAGES=docker" + ]) { + target(args) + } +} + +/** +* This method runs the packaging for Linux */ def packagingLinux(Map args = [:]) { def PLATFORMS = [ '+all', @@ -285,7 +299,6 @@ def packagingLinux(Map args = [:]) { } } - /** * Upload the packages to their snapshot or pull request buckets * @param beatsFolder beats folder @@ -920,6 +933,9 @@ class RunCommand extends co.elastic.beats.BeatsFunction { if(args?.content?.containsKey('mage')) { steps.target(context: args.context, command: args.content.mage, directory: args.project, label: args.label, withModule: withModule, isMage: true, id: args.id) } + if(args?.content?.containsKey('packaging-arm')) { + steps.packagingArm(context: args.context, command: args.content.get('packaging-arm'), directory: args.project, label: args.label, isMage: true, id: args.id, e2e: args.content.get('e2e'), package: true) + } if(args?.content?.containsKey('packaging-linux')) { steps.packagingLinux(context: args.context, command: args.content.get('packaging-linux'), directory: args.project, label: args.label, isMage: true, id: args.id, e2e: args.content.get('e2e'), package: true) } diff --git a/auditbeat/Jenkinsfile.yml b/auditbeat/Jenkinsfile.yml index 346145606b5..aadb8b52ce8 100644 --- a/auditbeat/Jenkinsfile.yml +++ b/auditbeat/Jenkinsfile.yml @@ -87,3 +87,9 @@ stages: packaging-linux: "mage package" e2e: enabled: false + packaging-arm: + packaging-arm: "mage package" + e2e: + enabled: false + platforms: ## override default label in this specific stage. + - "arm" diff --git a/filebeat/Jenkinsfile.yml b/filebeat/Jenkinsfile.yml index 10947425828..b5083f0b068 100644 --- a/filebeat/Jenkinsfile.yml +++ b/filebeat/Jenkinsfile.yml @@ -85,3 +85,9 @@ stages: packaging-linux: "mage package" e2e: enabled: false + packaging-arm: + packaging-arm: "mage package" + e2e: + enabled: false + platforms: ## override default label in this specific stage. + - "arm" diff --git a/heartbeat/Jenkinsfile.yml b/heartbeat/Jenkinsfile.yml index 8c1bbeaa574..0d4be939c18 100644 --- a/heartbeat/Jenkinsfile.yml +++ b/heartbeat/Jenkinsfile.yml @@ -84,3 +84,9 @@ stages: packaging-linux: "mage package" e2e: enabled: false + packaging-arm: + packaging-arm: "mage package" + e2e: + enabled: false + platforms: ## override default label in this specific stage. + - "arm" diff --git a/journalbeat/Jenkinsfile.yml b/journalbeat/Jenkinsfile.yml index 0336f113162..a91d99dd115 100644 --- a/journalbeat/Jenkinsfile.yml +++ b/journalbeat/Jenkinsfile.yml @@ -37,3 +37,9 @@ stages: packaging-linux: "mage package" e2e: enabled: false + packaging-arm: + packaging-arm: "mage package" + e2e: + enabled: false + platforms: ## override default label in this specific stage. + - "arm" diff --git a/metricbeat/Jenkinsfile.yml b/metricbeat/Jenkinsfile.yml index 70874ab1277..1e219ea95b1 100644 --- a/metricbeat/Jenkinsfile.yml +++ b/metricbeat/Jenkinsfile.yml @@ -79,3 +79,9 @@ stages: packaging-linux: "mage package" e2e: enabled: false ## e2e is enabled only for x-pack beats + packaging-arm: + packaging-arm: "mage package" + e2e: + enabled: false + platforms: ## override default label in this specific stage. + - "arm" diff --git a/packetbeat/Jenkinsfile.yml b/packetbeat/Jenkinsfile.yml index 3205b791b79..be0dd1d9522 100644 --- a/packetbeat/Jenkinsfile.yml +++ b/packetbeat/Jenkinsfile.yml @@ -85,3 +85,9 @@ stages: packaging-linux: "mage package" e2e: enabled: false + packaging-arm: + packaging-arm: "mage package" + e2e: + enabled: false + platforms: ## override default label in this specific stage. + - "arm" diff --git a/x-pack/auditbeat/Jenkinsfile.yml b/x-pack/auditbeat/Jenkinsfile.yml index 7a1edec5dd2..fe8ef3658c7 100644 --- a/x-pack/auditbeat/Jenkinsfile.yml +++ b/x-pack/auditbeat/Jenkinsfile.yml @@ -85,3 +85,9 @@ stages: packaging-linux: "mage package" e2e: enabled: false + packaging-arm: + packaging-arm: "mage package" + e2e: + enabled: false + platforms: ## override default label in this specific stage. + - "arm" diff --git a/x-pack/elastic-agent/Jenkinsfile.yml b/x-pack/elastic-agent/Jenkinsfile.yml index 9a30d836391..dc642ce1ca3 100644 --- a/x-pack/elastic-agent/Jenkinsfile.yml +++ b/x-pack/elastic-agent/Jenkinsfile.yml @@ -89,3 +89,9 @@ stages: packaging-linux: "mage package" e2e: enabled: false + packaging-arm: + packaging-arm: "mage package" + e2e: + enabled: false + platforms: ## override default label in this specific stage. + - "arm" diff --git a/x-pack/filebeat/Jenkinsfile.yml b/x-pack/filebeat/Jenkinsfile.yml index 5985900fcda..d6961a6a4b1 100644 --- a/x-pack/filebeat/Jenkinsfile.yml +++ b/x-pack/filebeat/Jenkinsfile.yml @@ -91,4 +91,10 @@ stages: packaging-linux: packaging-linux: "mage package" e2e: - enabled: false \ No newline at end of file + enabled: false + packaging-arm: + packaging-arm: "mage package" + e2e: + enabled: false + platforms: ## override default label in this specific stage. + - "arm" \ No newline at end of file diff --git a/x-pack/heartbeat/Jenkinsfile.yml b/x-pack/heartbeat/Jenkinsfile.yml index b715d109a12..bc5823048d1 100644 --- a/x-pack/heartbeat/Jenkinsfile.yml +++ b/x-pack/heartbeat/Jenkinsfile.yml @@ -17,3 +17,9 @@ stages: packaging-linux: "mage package" e2e: enabled: false + packaging-arm: + packaging-arm: "mage package" + e2e: + enabled: false + platforms: ## override default label in this specific stage. + - "arm" diff --git a/x-pack/metricbeat/Jenkinsfile.yml b/x-pack/metricbeat/Jenkinsfile.yml index 08aaa1d6fc0..f38240dbf4a 100644 --- a/x-pack/metricbeat/Jenkinsfile.yml +++ b/x-pack/metricbeat/Jenkinsfile.yml @@ -84,3 +84,9 @@ stages: e2e: enabled: false entrypoint: 'metricbeat-test.sh' + packaging-arm: + packaging-arm: "mage package" + e2e: + enabled: false + platforms: ## override default label in this specific stage. + - "arm" diff --git a/x-pack/packetbeat/Jenkinsfile.yml b/x-pack/packetbeat/Jenkinsfile.yml index dcefc94c669..be199fa928e 100644 --- a/x-pack/packetbeat/Jenkinsfile.yml +++ b/x-pack/packetbeat/Jenkinsfile.yml @@ -86,3 +86,9 @@ stages: packaging-linux: "mage package" e2e: enabled: false + packaging-arm: + packaging-arm: "mage package" + e2e: + enabled: false + platforms: ## override default label in this specific stage. + - "arm" From 7b7ce071944be819d9dd946009b8c226a56e934f Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 16 Feb 2021 12:42:29 +0000 Subject: [PATCH 2/6] As suggested in the code review --- Jenkinsfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index ede5b7f9056..02d4622be0d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -265,11 +265,9 @@ def k8sTest(Map args = [:]) { * This method runs the packaging for ARM */ def packagingArm(Map args = [:]) { - PACKAGES = "docker" def PLATFORMS = [ 'linux/arm64' ].join(' ') withEnv([ - "PLATFORMS=${PLATFORMS}", - "PACKAGES=docker" + "PLATFORMS=${PLATFORMS}" ]) { target(args) } From 716ccca5aed04a8d2a3810db0b3ad51cbf9928a6 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 16 Feb 2021 14:03:03 +0000 Subject: [PATCH 3/6] Revert "As suggested in the code review" This reverts commit 7b7ce071944be819d9dd946009b8c226a56e934f. --- Jenkinsfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 02d4622be0d..ede5b7f9056 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -265,9 +265,11 @@ def k8sTest(Map args = [:]) { * This method runs the packaging for ARM */ def packagingArm(Map args = [:]) { + PACKAGES = "docker" def PLATFORMS = [ 'linux/arm64' ].join(' ') withEnv([ - "PLATFORMS=${PLATFORMS}" + "PLATFORMS=${PLATFORMS}", + "PACKAGES=docker" ]) { target(args) } From e4f9497ad59fc68256222cc375bf58e6a5e143be Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Wed, 17 Feb 2021 10:27:16 +0000 Subject: [PATCH 4/6] Caused by #24034 --- x-pack/dockerlogbeat/Jenkinsfile.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/x-pack/dockerlogbeat/Jenkinsfile.yml b/x-pack/dockerlogbeat/Jenkinsfile.yml index ee9a4b06aca..d31c4e32b5f 100644 --- a/x-pack/dockerlogbeat/Jenkinsfile.yml +++ b/x-pack/dockerlogbeat/Jenkinsfile.yml @@ -25,3 +25,9 @@ stages: packaging-linux: "mage package" e2e: enabled: false + packaging-arm: + packaging-arm: "mage package" + e2e: + enabled: false + platforms: ## override default label in this specific stage. + - "arm" From d3df41520bdd1edff459695d1ca2f1428e55c0c8 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Thu, 18 Feb 2021 16:08:15 +0000 Subject: [PATCH 5/6] Update Jenkinsfile --- Jenkinsfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index ede5b7f9056..60cdd946e19 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -265,7 +265,6 @@ def k8sTest(Map args = [:]) { * This method runs the packaging for ARM */ def packagingArm(Map args = [:]) { - PACKAGES = "docker" def PLATFORMS = [ 'linux/arm64' ].join(' ') withEnv([ "PLATFORMS=${PLATFORMS}", From 4bbb59aa71253caba41e3730afcc6696c539d14f Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 23 Feb 2021 14:37:14 +0000 Subject: [PATCH 6/6] Add docker arch arm64 --- Jenkinsfile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index eea9a0ce044..ea2eed980ff 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -936,7 +936,15 @@ class RunCommand extends co.elastic.beats.BeatsFunction { steps.target(context: args.context, command: args.content.mage, directory: args.project, label: args.label, withModule: withModule, isMage: true, id: args.id) } if(args?.content?.containsKey('packaging-arm')) { - steps.packagingArm(context: args.context, command: args.content.get('packaging-arm'), directory: args.project, label: args.label, isMage: true, id: args.id, e2e: args.content.get('e2e'), package: true) + steps.packagingArm(context: args.context, + command: args.content.get('packaging-arm'), + directory: args.project, + label: args.label, + isMage: true, + id: args.id, + e2e: args.content.get('e2e'), + package: true, + dockerArch: 'arm64') } if(args?.content?.containsKey('packaging-linux')) { steps.packagingLinux(context: args.context,