Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make rpm build on centos7 and assemble on rockylinux8 to generate digest correctly for FIPS-enabled nodes #2113

Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 71 additions & 41 deletions jenkins/opensearch-dashboards/distribution-build.jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ lib = library(identifier: 'jenkins@20211123', retriever: legacySCM(scm))
pipeline {
options {
timeout(time: 4, unit: 'HOURS')
copyArtifactPermission("${JOB_BASE_NAME}")
buildDiscarder(logRotator(artifactNumToKeepStr: '1'))
}
agent none
environment {
AGENT_X64 = 'Jenkins-Agent-al2-x64-c54xlarge-Docker-Host'
AGENT_ARM64 = 'Jenkins-Agent-al2-arm64-c6g4xlarge-Docker-Host'
IMAGE_RPM = 'opensearchstaging/ci-runner:ci-runner-rockylinux8-opensearch-dashboards-integtest-v2' // required for rpm to create digest sha256 correctly with rpm 4.12+
peterzhuamazon marked this conversation as resolved.
Show resolved Hide resolved
}
parameters {
string(
Expand Down Expand Up @@ -156,47 +155,78 @@ pipeline {
}
}
stage('build-and-test-linux-x64-rpm') {
agent {
docker {
label AGENT_X64
image dockerAgent.image
args dockerAgent.args
alwaysPull true
agent { label AGENT_X64 }
stages {
stage('build-archive-linux-x64-rpm') {
agent {
docker {
label AGENT_X64
image dockerAgent.image
args dockerAgent.args
alwaysPull true
}
}
steps {
script {
buildArchive(
componentName: "${COMPONENT_NAME}",
inputManifest: "manifests/${INPUT_MANIFEST}",
platform: 'linux',
architecture: 'x64',
distribution: 'rpm'
)
}
}
post {
always {
postCleanup()
}
}
}
}
steps {
script {
def buildManifestObj = buildAssembleUpload(
componentName: "${COMPONENT_NAME}",
inputManifest: "manifests/${INPUT_MANIFEST}",
platform: 'linux',
architecture: 'x64',
distribution: 'rpm'
)
String buildManifestUrl = buildManifestObj.getUrl(JOB_NAME, BUILD_NUMBER)
String artifactUrl = buildManifestObj.getArtifactUrl(JOB_NAME, BUILD_NUMBER)
env.ARTIFACT_URL_X64_RPM = artifactUrl
stage('assemble-archive-and-test-linux-x64-rpm') {
agent {
docker {
label AGENT_X64
image IMAGE_RPM
args dockerAgent.args
alwaysPull true
}
}
steps {
script {
def buildManifestObj = archiveAssembleUpload(
componentName: "${COMPONENT_NAME}",
inputManifest: "manifests/${INPUT_MANIFEST}",
platform: 'linux',
architecture: 'x64',
distribution: 'rpm'
)
String buildManifestUrl = buildManifestObj.getUrl(JOB_NAME, BUILD_NUMBER)
String artifactUrl = buildManifestObj.getArtifactUrl(JOB_NAME, BUILD_NUMBER)
env.ARTIFACT_URL_X64_RPM = artifactUrl

echo "buildManifestUrl (x64, rpm): ${buildManifestUrl}"
echo "artifactUrl (x64, rpm): ${artifactUrl}"
echo "buildManifestUrl (x64, rpm): ${buildManifestUrl}"
echo "artifactUrl (x64, rpm): ${artifactUrl}"

String bundleManifestUrl = buildManifestObj.getBundleManifestUrl(JOB_NAME, BUILD_NUMBER)
String bundleManifestUrl = buildManifestObj.getBundleManifestUrl(JOB_NAME, BUILD_NUMBER)

echo "Trigger rpm validation for x64 rpm ${bundleManifestUrl}"
def rpmValidationResults =
build job: 'rpm-validation',
propagate: false,
wait: true,
parameters: [
string(name: 'BUNDLE_MANIFEST_URL', value: bundleManifestUrl),
string(name: 'AGENT_LABEL', value: AGENT_X64)
]
echo "Trigger rpm validation for x64 rpm ${bundleManifestUrl}"
def rpmValidationResults =
build job: 'rpm-validation',
propagate: false,
wait: true,
parameters: [
string(name: 'BUNDLE_MANIFEST_URL', value: bundleManifestUrl),
string(name: 'AGENT_LABEL', value: AGENT_X64)
]

env.RPM_VALIDATION_X64_RPM_TEST_RESULT = createTestResultsMessage(
testType: "RPM Validation (x64, rpm)",
status: rpmValidationResults.getResult(),
absoluteUrl: rpmValidationResults.getAbsoluteUrl()
)
env.RPM_VALIDATION_X64_RPM_TEST_RESULT = createTestResultsMessage(
testType: "RPM Validation (x64, rpm)",
status: rpmValidationResults.getResult(),
absoluteUrl: rpmValidationResults.getAbsoluteUrl()
)
}
}
}
}
post {
Expand All @@ -214,7 +244,7 @@ pipeline {
}
}
stage('build-and-test-linux-arm64-tar') {
agent none
agent { label AGENT_X64 }
stages {
stage('build-archive-linux-arm64-tar') {
agent {
Expand Down Expand Up @@ -331,7 +361,7 @@ pipeline {
}
}
stage('build-and-test-linux-arm64-rpm') {
agent none
agent { label AGENT_X64 }
stages {
stage('build-archive-linux-arm64-rpm') {
agent {
Expand Down Expand Up @@ -363,7 +393,7 @@ pipeline {
agent {
docker {
label AGENT_ARM64
image dockerAgent.image
image IMAGE_RPM
args dockerAgent.args
alwaysPull true
}
Expand Down
Loading