-
Notifications
You must be signed in to change notification settings - Fork 273
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
Implement a basic Jenkins job for running OpenSearch Dashboards integ test #1368
Changes from all commits
70539ae
322920d
dba0dc2
5427288
f3d22d0
44524e2
68f611d
b7cff49
abcb17e
b3b0884
3ef367c
811578d
eb60751
5fa90a7
989af3a
e36b524
99fee2d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,99 @@ | ||||||
lib = library(identifier: 'jenkins@20211123', retriever: legacySCM(scm)) | ||||||
|
||||||
pipeline { | ||||||
agent none | ||||||
parameters { | ||||||
string( | ||||||
defaultValue: '', | ||||||
name: 'opensearch_version', | ||||||
description: 'OpenSearch version to run test on', | ||||||
trim: true | ||||||
) | ||||||
|
||||||
string( | ||||||
defaultValue: '', | ||||||
name: 'opensearch_dashboards_version', | ||||||
description: 'OpenSearch Dashboards version to run test on', | ||||||
trim: true | ||||||
) | ||||||
string( | ||||||
defaultValue: '', | ||||||
name: 'opensearch_build_id', | ||||||
description: 'The build number of OpenSearch for which tests should be run', | ||||||
trim: true | ||||||
) | ||||||
string( | ||||||
defaultValue: '', | ||||||
name: 'opensearch_dashboards_build_id', | ||||||
description: 'The build number of OpenSearch Dashboards for which tests should be run', | ||||||
trim: true | ||||||
) | ||||||
string( | ||||||
defaultValue: '', | ||||||
name: 'architecture', | ||||||
description: 'Architecture of the build of OpenSearch/OpenSearch Dashboards', | ||||||
trim: true | ||||||
) | ||||||
string( | ||||||
defaultValue: '', | ||||||
name: 'platform', | ||||||
description: 'Platform of the build of OpenSearch/OpenSearch Dashboards', | ||||||
trim: true | ||||||
) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would prefer if the parameters to this job was 1) an OpenSearch Dashboards build URL (e.g. ci.opensearch....) that contains a manifest that would get loaded and all these features such as build ID and architecture and platform were to be extracted, and 2) an OpenSearch URL. Otherwise we keep building assumptions in the URL structure of where things are built, ie. this job "knows" something it shouldn't about the location of builds. Then this code loads the manifest(s) and has everything it needs, it would be shorter and easier to grok. Use CAPS for variables similarly to other Jenkinsfile. |
||||||
} | ||||||
stages { | ||||||
stage('integ-test') { | ||||||
agent { | ||||||
docker { | ||||||
label 'Jenkins-Agent-al2-x64-c54xlarge-Docker-Host' | ||||||
image 'opensearchstaging/ci-runner:centos7-x64-arm64-jdkmulti-node10.24.1-cypress6.9.1-20211028' | ||||||
alwaysPull true | ||||||
} | ||||||
} | ||||||
steps { | ||||||
script { | ||||||
basePathOpenSearch = getPublicUrl( | ||||||
name:'Open Search', | ||||||
jobName:'distribution-build-opensearch', | ||||||
architecture:architecture, | ||||||
platform:platform, | ||||||
buildNumber:opensearch_build_id, | ||||||
version: opensearch_version | ||||||
) | ||||||
|
||||||
basePathOpenSearchDashboards = getPublicUrl( | ||||||
name:'Open Search Dashboards', | ||||||
jobName:'distribution-build-opensearch-dashboards', | ||||||
architecture:architecture, | ||||||
platform:platform, | ||||||
buildNumber:opensearch_dashboards_build_id, | ||||||
version: opensearch_dashboards_version | ||||||
) | ||||||
|
||||||
sh "./test.sh integ-test manifests/${opensearch_dashboards_version}/opensearch-dashboards-${opensearch_dashboards_version}-test.yml -p opensearch=${basePathOpenSearch} opensearch-dashboards=${basePathOpenSearchDashboards} --test-run-id ${env.BUILD_NUMBER}" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lets just pass the test manifest path, this is forward compatible with path changes
Suggested change
|
||||||
} | ||||||
} | ||||||
post { | ||||||
always { | ||||||
postCleanup() | ||||||
} | ||||||
} | ||||||
} | ||||||
} | ||||||
post { | ||||||
success { | ||||||
node('Jenkins-Agent-al2-x64-c54xlarge-Docker-Host') { | ||||||
script { | ||||||
postCleanup() | ||||||
} | ||||||
} | ||||||
Comment on lines
+85
to
+89
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could always cover? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wasn't able to extract the whole |
||||||
} | ||||||
failure { | ||||||
node('Jenkins-Agent-al2-x64-c54xlarge-Docker-Host') { | ||||||
script { | ||||||
postCleanup() | ||||||
} | ||||||
} | ||||||
} | ||||||
} | ||||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Map call(Map args = [:]) { | ||
def lib = library(identifier: 'jenkins@20211123', retriever: legacySCM(scm)) | ||
|
||
def buildManifest = lib.jenkins.BuildManifest.new( | ||
build: [ | ||
name: args.name, | ||
version: args.version, | ||
platform: args.platform, | ||
architecture: args.architecture | ||
] | ||
) | ||
|
||
return buildManifest.getArtifactRootUrl(args.jobName, args.buildNumber) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this identifier, why use fixed date value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jenkins caches the library sometimes, so when we make code changes we tend to increment this everywhere.