forked from opensearch-project/opensearch-build
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Divya Madala <[email protected]>
- Loading branch information
Showing
1 changed file
with
39 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,25 +4,25 @@ lib = library(identifier: '[email protected]', retriever: modernSCM([ | |
])) | ||
|
||
def docker_images = [ | ||
"tar": "opensearchstaging/ci-runner:ci-runner-rockylinux8-opensearch-dashboards-integtest-v4", | ||
"rpm": "opensearchstaging/ci-runner:ci-runner-rockylinux8-systemd-base-integtest-v3", | ||
"yum": "opensearchstaging/ci-runner:ci-runner-rockylinux8-systemd-base-integtest-v3", | ||
"tar": "opensearchstaging/ci-runner:ci-runner-rockylinux8-opensearch-dashboards-integtest-v2", | ||
"rpm": "opensearchstaging/ci-runner:ci-runner-rockylinux8-systemd-base-integtest-v1", | ||
"yum": "opensearchstaging/ci-runner:ci-runner-rockylinux8-systemd-base-integtest-v1", | ||
] | ||
|
||
def docker_args = [ | ||
"tar": "-u 1000", | ||
"rpm": "--entrypoint=/usr/lib/systemd/systemd -u root --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:rw --cgroupns=host", | ||
"yum": "--entrypoint=/usr/lib/systemd/systemd -u root --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:rw --cgroupns=host", | ||
"rpm": "--entrypoint=/usr/sbin/init -u root --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro", | ||
"yum": "--entrypoint=/usr/sbin/init -u root --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro", | ||
] | ||
|
||
def agent_nodes_docker = [ | ||
"x64": "Jenkins-Agent-AL2023-X64-C54xlarge-Single-Host", | ||
"arm64": "Jenkins-Agent-AL2023-Arm64-C6g4xlarge-Single-Host", | ||
"x64": "Jenkins-Agent-AL2-X64-C54xlarge-Single-Host", | ||
"arm64": "Jenkins-Agent-AL2-Arm64-C6g4xlarge-Single-Host", | ||
] | ||
|
||
def agent_nodes = [ | ||
"x64": "Jenkins-Agent-AL2023-X64-C54xlarge-Docker-Host", | ||
"arm64": "Jenkins-Agent-AL2023-Arm64-C6g4xlarge-Docker-Host", | ||
"x64": "Jenkins-Agent-AL2-X64-C54xlarge-Docker-Host", | ||
"arm64": "Jenkins-Agent-AL2-Arm64-C6g4xlarge-Docker-Host", | ||
] | ||
|
||
pipeline { | ||
|
@@ -36,6 +36,11 @@ pipeline { | |
description: 'Enter the OpenSearch and OpenSearch Dashboards version that needs to be validated', | ||
trim: true | ||
) | ||
string( | ||
name: 'FILE_PATH', | ||
description: 'Enter url link of the corresponding artifact', | ||
trim: true | ||
) | ||
string( | ||
name: 'DISTRIBUTION', | ||
description: 'Enter the distribution type among tar, rpm, yum, docker separated by space. Defaults to "tar rpm yum docker"', | ||
|
@@ -65,6 +70,19 @@ pipeline { | |
trim: true, | ||
defaultValue: "using-staging-artifact-only" | ||
) | ||
string( | ||
name: 'PROJECTS', | ||
description: 'Enter opensearch or opensearch-dashboards', | ||
trim: true, | ||
defaultValue: "opensearch" | ||
) | ||
string( | ||
name: 'ARTIFACT_TYPE', | ||
description: 'Enter staging or production', | ||
trim: true, | ||
defaultValue: "production" | ||
) | ||
|
||
|
||
} | ||
|
||
|
@@ -73,10 +91,6 @@ pipeline { | |
agent { label agent_nodes["x64"] } | ||
steps { | ||
script { | ||
if (VERSION == '') { | ||
currentBuild.result = 'ABORTED' | ||
error('VERSION cannot be empty. Please provide version of the artifacts to validate') | ||
} | ||
|
||
if (params.DISTRIBUTION.contains('docker') && (OS_BUILD_NUMBER == '' || OSD_BUILD_NUMBER == '')) { | ||
currentBuild.result = 'ABORTED' | ||
|
@@ -115,7 +129,7 @@ pipeline { | |
// Using scripted pipelines to trigger dynamic parallel stages | ||
timeout(time: 30) { | ||
if ("${local_distribution}" == "docker"){ | ||
node(agent_nodes_docker["$local_architecture"]) { | ||
node(agent_nodes["$local_architecture"]) { | ||
try { | ||
stage("${local_distribution}") { | ||
unstash "validate-artifacts-$BUILD_NUMBER" | ||
|
@@ -126,8 +140,12 @@ pipeline { | |
arch: "${local_architecture}", | ||
"os-build-number": "$OS_BUILD_NUMBER", | ||
"osd-build-number": "$OSD_BUILD_NUMBER", | ||
projects: "$PROJECTS", | ||
"$OPTIONAL_ARGS" : "" | ||
) | ||
validateArtifacts( | ||
"file-path": "$FILE_PATH" | ||
) | ||
} | ||
} catch (e) { | ||
echo "Error occurred while validating ${local_distribution}-${local_architecture}" | ||
|
@@ -148,8 +166,14 @@ pipeline { | |
validateArtifacts( | ||
version: "$VERSION", | ||
distribution: "${local_distribution}", | ||
arch: "${local_architecture}" | ||
arch: "${local_architecture}", | ||
projects: "$PROJECTS", | ||
"artifact-type": "$ARTIFACT_TYPE" | ||
) | ||
validateArtifacts( | ||
"file-path": "$FILE_PATH" | ||
) | ||
|
||
} | ||
} catch (e) { | ||
echo "Error occurred while validating ${local_distribution}-${local_architecture}" | ||
|