mirror of
https://github.com/elastic/kibana.git
synced 2025-06-28 11:05:39 -04:00
parent
c4720e3b3d
commit
62ea6e63cd
15 changed files with 406 additions and 386 deletions
|
@ -3,62 +3,48 @@
|
||||||
library 'kibana-pipeline-library'
|
library 'kibana-pipeline-library'
|
||||||
kibanaLibrary.load() // load from the Jenkins instance
|
kibanaLibrary.load() // load from the Jenkins instance
|
||||||
|
|
||||||
stage("Kibana Pipeline") { // This stage is just here to help the BlueOcean UI a little bit
|
kibanaPipeline(timeoutMinutes: 180) {
|
||||||
timeout(time: 180, unit: 'MINUTES') {
|
catchErrors {
|
||||||
timestamps {
|
|
||||||
ansiColor('xterm') {
|
|
||||||
catchError {
|
|
||||||
withEnv([
|
withEnv([
|
||||||
'CODE_COVERAGE=1', // Needed for multiple ci scripts, such as remote.ts, test/scripts/*.sh, schema.js, etc.
|
'CODE_COVERAGE=1', // Needed for multiple ci scripts, such as remote.ts, test/scripts/*.sh, schema.js, etc.
|
||||||
]) {
|
]) {
|
||||||
parallel([
|
parallel([
|
||||||
'kibana-intake-agent': {
|
'kibana-intake-agent': workers.intake('kibana-intake', './test/scripts/jenkins_unit.sh'),
|
||||||
withEnv([
|
|
||||||
'NODE_ENV=test' // Needed for jest tests only
|
|
||||||
]) {
|
|
||||||
kibanaPipeline.intakeWorker('kibana-intake', './test/scripts/jenkins_unit.sh')()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
'x-pack-intake-agent': {
|
'x-pack-intake-agent': {
|
||||||
withEnv([
|
withEnv([
|
||||||
'NODE_ENV=test' // Needed for jest tests only
|
'NODE_ENV=test' // Needed for jest tests only
|
||||||
]) {
|
]) {
|
||||||
kibanaPipeline.intakeWorker('x-pack-intake', './test/scripts/jenkins_xpack.sh')()
|
workers.intake('x-pack-intake', './test/scripts/jenkins_xpack.sh')()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'kibana-oss-agent': kibanaPipeline.withWorkers('kibana-oss-tests', { kibanaPipeline.buildOss() }, [
|
'kibana-oss-agent': workers.functional('kibana-oss-tests', { kibanaPipeline.buildOss() }, [
|
||||||
'oss-ciGroup1': kibanaPipeline.getOssCiGroupWorker(1),
|
'oss-ciGroup1': kibanaPipeline.ossCiGroupProcess(1),
|
||||||
'oss-ciGroup2': kibanaPipeline.getOssCiGroupWorker(2),
|
'oss-ciGroup2': kibanaPipeline.ossCiGroupProcess(2),
|
||||||
'oss-ciGroup3': kibanaPipeline.getOssCiGroupWorker(3),
|
'oss-ciGroup3': kibanaPipeline.ossCiGroupProcess(3),
|
||||||
'oss-ciGroup4': kibanaPipeline.getOssCiGroupWorker(4),
|
'oss-ciGroup4': kibanaPipeline.ossCiGroupProcess(4),
|
||||||
'oss-ciGroup5': kibanaPipeline.getOssCiGroupWorker(5),
|
'oss-ciGroup5': kibanaPipeline.ossCiGroupProcess(5),
|
||||||
'oss-ciGroup6': kibanaPipeline.getOssCiGroupWorker(6),
|
'oss-ciGroup6': kibanaPipeline.ossCiGroupProcess(6),
|
||||||
'oss-ciGroup7': kibanaPipeline.getOssCiGroupWorker(7),
|
'oss-ciGroup7': kibanaPipeline.ossCiGroupProcess(7),
|
||||||
'oss-ciGroup8': kibanaPipeline.getOssCiGroupWorker(8),
|
'oss-ciGroup8': kibanaPipeline.ossCiGroupProcess(8),
|
||||||
'oss-ciGroup9': kibanaPipeline.getOssCiGroupWorker(9),
|
'oss-ciGroup9': kibanaPipeline.ossCiGroupProcess(9),
|
||||||
'oss-ciGroup10': kibanaPipeline.getOssCiGroupWorker(10),
|
'oss-ciGroup10': kibanaPipeline.ossCiGroupProcess(10),
|
||||||
'oss-ciGroup11': kibanaPipeline.getOssCiGroupWorker(11),
|
'oss-ciGroup11': kibanaPipeline.ossCiGroupProcess(11),
|
||||||
'oss-ciGroup12': kibanaPipeline.getOssCiGroupWorker(12),
|
'oss-ciGroup12': kibanaPipeline.ossCiGroupProcess(12),
|
||||||
]),
|
]),
|
||||||
'kibana-xpack-agent-1': kibanaPipeline.withWorkers('kibana-xpack-tests-1', { kibanaPipeline.buildXpack() }, [
|
'kibana-xpack-agent': workers.functional('kibana-xpack-tests', { kibanaPipeline.buildXpack() }, [
|
||||||
'xpack-ciGroup1': kibanaPipeline.getXpackCiGroupWorker(1),
|
'xpack-ciGroup1': kibanaPipeline.xpackCiGroupProcess(1),
|
||||||
'xpack-ciGroup2': kibanaPipeline.getXpackCiGroupWorker(2),
|
'xpack-ciGroup2': kibanaPipeline.xpackCiGroupProcess(2),
|
||||||
]),
|
'xpack-ciGroup3': kibanaPipeline.xpackCiGroupProcess(3),
|
||||||
'kibana-xpack-agent-2': kibanaPipeline.withWorkers('kibana-xpack-tests-2', { kibanaPipeline.buildXpack() }, [
|
'xpack-ciGroup4': kibanaPipeline.xpackCiGroupProcess(4),
|
||||||
'xpack-ciGroup3': kibanaPipeline.getXpackCiGroupWorker(3),
|
'xpack-ciGroup5': kibanaPipeline.xpackCiGroupProcess(5),
|
||||||
'xpack-ciGroup4': kibanaPipeline.getXpackCiGroupWorker(4),
|
'xpack-ciGroup6': kibanaPipeline.xpackCiGroupProcess(6),
|
||||||
]),
|
'xpack-ciGroup7': kibanaPipeline.xpackCiGroupProcess(7),
|
||||||
|
'xpack-ciGroup8': kibanaPipeline.xpackCiGroupProcess(8),
|
||||||
'kibana-xpack-agent-3': kibanaPipeline.withWorkers('kibana-xpack-tests-3', { kibanaPipeline.buildXpack() }, [
|
'xpack-ciGroup9': kibanaPipeline.xpackCiGroupProcess(9),
|
||||||
'xpack-ciGroup5': kibanaPipeline.getXpackCiGroupWorker(5),
|
'xpack-ciGroup10': kibanaPipeline.xpackCiGroupProcess(10),
|
||||||
'xpack-ciGroup6': kibanaPipeline.getXpackCiGroupWorker(6),
|
|
||||||
'xpack-ciGroup7': kibanaPipeline.getXpackCiGroupWorker(7),
|
|
||||||
'xpack-ciGroup8': kibanaPipeline.getXpackCiGroupWorker(8),
|
|
||||||
'xpack-ciGroup9': kibanaPipeline.getXpackCiGroupWorker(9),
|
|
||||||
'xpack-ciGroup10': kibanaPipeline.getXpackCiGroupWorker(10),
|
|
||||||
]),
|
]),
|
||||||
])
|
])
|
||||||
kibanaPipeline.jobRunner('tests-l', false) {
|
workers.base(name: 'coverage-worker', label: 'tests-l', ramDisk: false, bootstrapped: false) {
|
||||||
kibanaPipeline.downloadCoverageArtifacts()
|
kibanaPipeline.downloadCoverageArtifacts()
|
||||||
kibanaPipeline.bash(
|
kibanaPipeline.bash(
|
||||||
'''
|
'''
|
||||||
|
@ -75,9 +61,7 @@ stage("Kibana Pipeline") { // This stage is just here to help the BlueOcean UI a
|
||||||
echo extracting kibana-oss-tests
|
echo extracting kibana-oss-tests
|
||||||
tar -xzf /tmp/downloaded_coverage/coverage/kibana-oss-tests/kibana-coverage.tar.gz -C /tmp/extracted_coverage
|
tar -xzf /tmp/downloaded_coverage/coverage/kibana-oss-tests/kibana-coverage.tar.gz -C /tmp/extracted_coverage
|
||||||
echo extracting kibana-xpack-tests
|
echo extracting kibana-xpack-tests
|
||||||
for i in {1..3}; do
|
tar -xzf /tmp/downloaded_coverage/coverage/kibana-xpack-tests/kibana-coverage.tar.gz -C /tmp/extracted_coverage
|
||||||
tar -xzf /tmp/downloaded_coverage/coverage/kibana-xpack-tests-${i}/kibana-coverage.tar.gz -C /tmp/extracted_coverage
|
|
||||||
done
|
|
||||||
# replace path in json files to have valid html report
|
# replace path in json files to have valid html report
|
||||||
pwd=$(pwd)
|
pwd=$(pwd)
|
||||||
du -sh /tmp/extracted_coverage/target/kibana-coverage/
|
du -sh /tmp/extracted_coverage/target/kibana-coverage/
|
||||||
|
@ -106,7 +90,4 @@ stage("Kibana Pipeline") { // This stage is just here to help the BlueOcean UI a
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
kibanaPipeline.sendMail()
|
kibanaPipeline.sendMail()
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,19 +21,16 @@ def workerFailures = []
|
||||||
currentBuild.displayName += trunc(" ${params.GITHUB_OWNER}:${params.branch_specifier}", 24)
|
currentBuild.displayName += trunc(" ${params.GITHUB_OWNER}:${params.branch_specifier}", 24)
|
||||||
currentBuild.description = "${params.CI_GROUP}<br />Agents: ${AGENT_COUNT}<br />Executions: ${params.NUMBER_EXECUTIONS}"
|
currentBuild.description = "${params.CI_GROUP}<br />Agents: ${AGENT_COUNT}<br />Executions: ${params.NUMBER_EXECUTIONS}"
|
||||||
|
|
||||||
stage("Kibana Pipeline") {
|
kibanaPipeline(timeoutMinutes: 180) {
|
||||||
timeout(time: 180, unit: 'MINUTES') {
|
|
||||||
timestamps {
|
|
||||||
ansiColor('xterm') {
|
|
||||||
def agents = [:]
|
def agents = [:]
|
||||||
for(def agentNumber = 1; agentNumber <= AGENT_COUNT; agentNumber++) {
|
for(def agentNumber = 1; agentNumber <= AGENT_COUNT; agentNumber++) {
|
||||||
def agentNumberInside = agentNumber
|
def agentNumberInside = agentNumber
|
||||||
def agentExecutions = floor(EXECUTIONS/AGENT_COUNT) + (agentNumber <= EXECUTIONS%AGENT_COUNT ? 1 : 0)
|
def agentExecutions = floor(EXECUTIONS/AGENT_COUNT) + (agentNumber <= EXECUTIONS%AGENT_COUNT ? 1 : 0)
|
||||||
agents["agent-${agentNumber}"] = {
|
agents["agent-${agentNumber}"] = {
|
||||||
catchError {
|
catchErrors {
|
||||||
print "Agent ${agentNumberInside} - ${agentExecutions} executions"
|
print "Agent ${agentNumberInside} - ${agentExecutions} executions"
|
||||||
|
|
||||||
kibanaPipeline.withWorkers('flaky-test-runner', {
|
workers.functional('flaky-test-runner', {
|
||||||
if (NEED_BUILD) {
|
if (NEED_BUILD) {
|
||||||
if (!IS_XPACK) {
|
if (!IS_XPACK) {
|
||||||
kibanaPipeline.buildOss()
|
kibanaPipeline.buildOss()
|
||||||
|
@ -59,15 +56,12 @@ stage("Kibana Pipeline") {
|
||||||
print workerFailures.join("\n")
|
print workerFailures.join("\n")
|
||||||
print "Please check 'Test Result' and 'Pipeline Steps' pages for more info"
|
print "Please check 'Test Result' and 'Pipeline Steps' pages for more info"
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def getWorkerFromParams(isXpack, job, ciGroup) {
|
def getWorkerFromParams(isXpack, job, ciGroup) {
|
||||||
if (!isXpack) {
|
if (!isXpack) {
|
||||||
if (job == 'serverMocha') {
|
if (job == 'serverMocha') {
|
||||||
return kibanaPipeline.getPostBuildWorker('serverMocha', {
|
return kibanaPipeline.functionalTestProcess('serverMocha', {
|
||||||
kibanaPipeline.bash(
|
kibanaPipeline.bash(
|
||||||
"""
|
"""
|
||||||
source src/dev/ci_setup/setup_env.sh
|
source src/dev/ci_setup/setup_env.sh
|
||||||
|
@ -77,20 +71,20 @@ def getWorkerFromParams(isXpack, job, ciGroup) {
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
} else if (job == 'firefoxSmoke') {
|
} else if (job == 'firefoxSmoke') {
|
||||||
return kibanaPipeline.getPostBuildWorker('firefoxSmoke', { runbld('./test/scripts/jenkins_firefox_smoke.sh', 'Execute kibana-firefoxSmoke') })
|
return kibanaPipeline.functionalTestProcess('firefoxSmoke', './test/scripts/jenkins_firefox_smoke.sh')
|
||||||
} else if(job == 'visualRegression') {
|
} else if(job == 'visualRegression') {
|
||||||
return kibanaPipeline.getPostBuildWorker('visualRegression', { runbld('./test/scripts/jenkins_visual_regression.sh', 'Execute kibana-visualRegression') })
|
return kibanaPipeline.functionalTestProcess('visualRegression', './test/scripts/jenkins_visual_regression.sh')
|
||||||
} else {
|
} else {
|
||||||
return kibanaPipeline.getOssCiGroupWorker(ciGroup)
|
return kibanaPipeline.ossCiGroupProcess(ciGroup)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (job == 'firefoxSmoke') {
|
if (job == 'firefoxSmoke') {
|
||||||
return kibanaPipeline.getPostBuildWorker('xpack-firefoxSmoke', { runbld('./test/scripts/jenkins_xpack_firefox_smoke.sh', 'Execute xpack-firefoxSmoke') })
|
return kibanaPipeline.functionalTestProcess('xpack-firefoxSmoke', './test/scripts/jenkins_xpack_firefox_smoke.sh')
|
||||||
} else if(job == 'visualRegression') {
|
} else if(job == 'visualRegression') {
|
||||||
return kibanaPipeline.getPostBuildWorker('xpack-visualRegression', { runbld('./test/scripts/jenkins_xpack_visual_regression.sh', 'Execute xpack-visualRegression') })
|
return kibanaPipeline.functionalTestProcess('xpack-visualRegression', './test/scripts/jenkins_xpack_visual_regression.sh')
|
||||||
} else {
|
} else {
|
||||||
return kibanaPipeline.getXpackCiGroupWorker(ciGroup)
|
return kibanaPipeline.xpackCiGroupProcess(ciGroup)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,10 +99,9 @@ def getWorkerMap(agentNumber, numberOfExecutions, worker, workerFailures, maxWor
|
||||||
for(def j = 0; j < workerExecutions; j++) {
|
for(def j = 0; j < workerExecutions; j++) {
|
||||||
print "Execute agent-${agentNumber} worker-${workerNumber}: ${j}"
|
print "Execute agent-${agentNumber} worker-${workerNumber}: ${j}"
|
||||||
withEnv([
|
withEnv([
|
||||||
"JOB=agent-${agentNumber}-worker-${workerNumber}-${j}",
|
|
||||||
"REMOVE_KIBANA_INSTALL_DIR=1",
|
"REMOVE_KIBANA_INSTALL_DIR=1",
|
||||||
]) {
|
]) {
|
||||||
catchError {
|
catchErrors {
|
||||||
try {
|
try {
|
||||||
worker(workerNumber)
|
worker(workerNumber)
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
|
|
|
@ -26,7 +26,7 @@ timeout(time: 120, unit: 'MINUTES') {
|
||||||
timestamps {
|
timestamps {
|
||||||
ansiColor('xterm') {
|
ansiColor('xterm') {
|
||||||
node('linux && immutable') {
|
node('linux && immutable') {
|
||||||
catchError {
|
catchErrors {
|
||||||
def VERSION
|
def VERSION
|
||||||
def SNAPSHOT_ID
|
def SNAPSHOT_ID
|
||||||
def DESTINATION
|
def DESTINATION
|
||||||
|
|
|
@ -19,40 +19,37 @@ currentBuild.description = "ES: ${SNAPSHOT_VERSION}<br />Kibana: ${params.branch
|
||||||
|
|
||||||
def SNAPSHOT_MANIFEST = "https://storage.googleapis.com/kibana-ci-es-snapshots-daily/${SNAPSHOT_VERSION}/archives/${SNAPSHOT_ID}/manifest.json"
|
def SNAPSHOT_MANIFEST = "https://storage.googleapis.com/kibana-ci-es-snapshots-daily/${SNAPSHOT_VERSION}/archives/${SNAPSHOT_ID}/manifest.json"
|
||||||
|
|
||||||
timeout(time: 120, unit: 'MINUTES') {
|
kibanaPipeline(timeoutMinutes: 120) {
|
||||||
timestamps {
|
catchErrors {
|
||||||
ansiColor('xterm') {
|
|
||||||
catchError {
|
|
||||||
withEnv(["ES_SNAPSHOT_MANIFEST=${SNAPSHOT_MANIFEST}"]) {
|
withEnv(["ES_SNAPSHOT_MANIFEST=${SNAPSHOT_MANIFEST}"]) {
|
||||||
parallel([
|
parallel([
|
||||||
// TODO we just need to run integration tests from intake?
|
'kibana-intake-agent': workers.intake('kibana-intake', './test/scripts/jenkins_unit.sh'),
|
||||||
'kibana-intake-agent': kibanaPipeline.intakeWorker('kibana-intake', './test/scripts/jenkins_unit.sh'),
|
'x-pack-intake-agent': workers.intake('x-pack-intake', './test/scripts/jenkins_xpack.sh'),
|
||||||
'x-pack-intake-agent': kibanaPipeline.intakeWorker('x-pack-intake', './test/scripts/jenkins_xpack.sh'),
|
'kibana-oss-agent': workers.functional('kibana-oss-tests', { kibanaPipeline.buildOss() }, [
|
||||||
'kibana-oss-agent': kibanaPipeline.withWorkers('kibana-oss-tests', { kibanaPipeline.buildOss() }, [
|
'oss-ciGroup1': kibanaPipeline.ossCiGroupProcess(1),
|
||||||
'oss-ciGroup1': kibanaPipeline.getOssCiGroupWorker(1),
|
'oss-ciGroup2': kibanaPipeline.ossCiGroupProcess(2),
|
||||||
'oss-ciGroup2': kibanaPipeline.getOssCiGroupWorker(2),
|
'oss-ciGroup3': kibanaPipeline.ossCiGroupProcess(3),
|
||||||
'oss-ciGroup3': kibanaPipeline.getOssCiGroupWorker(3),
|
'oss-ciGroup4': kibanaPipeline.ossCiGroupProcess(4),
|
||||||
'oss-ciGroup4': kibanaPipeline.getOssCiGroupWorker(4),
|
'oss-ciGroup5': kibanaPipeline.ossCiGroupProcess(5),
|
||||||
'oss-ciGroup5': kibanaPipeline.getOssCiGroupWorker(5),
|
'oss-ciGroup6': kibanaPipeline.ossCiGroupProcess(6),
|
||||||
'oss-ciGroup6': kibanaPipeline.getOssCiGroupWorker(6),
|
'oss-ciGroup7': kibanaPipeline.ossCiGroupProcess(7),
|
||||||
'oss-ciGroup7': kibanaPipeline.getOssCiGroupWorker(7),
|
'oss-ciGroup8': kibanaPipeline.ossCiGroupProcess(8),
|
||||||
'oss-ciGroup8': kibanaPipeline.getOssCiGroupWorker(8),
|
'oss-ciGroup9': kibanaPipeline.ossCiGroupProcess(9),
|
||||||
'oss-ciGroup9': kibanaPipeline.getOssCiGroupWorker(9),
|
'oss-ciGroup10': kibanaPipeline.ossCiGroupProcess(10),
|
||||||
'oss-ciGroup10': kibanaPipeline.getOssCiGroupWorker(10),
|
'oss-ciGroup11': kibanaPipeline.ossCiGroupProcess(11),
|
||||||
'oss-ciGroup11': kibanaPipeline.getOssCiGroupWorker(11),
|
'oss-ciGroup12': kibanaPipeline.ossCiGroupProcess(12),
|
||||||
'oss-ciGroup12': kibanaPipeline.getOssCiGroupWorker(12),
|
|
||||||
]),
|
]),
|
||||||
'kibana-xpack-agent': kibanaPipeline.withWorkers('kibana-xpack-tests', { kibanaPipeline.buildXpack() }, [
|
'kibana-xpack-agent': workers.functional('kibana-xpack-tests', { kibanaPipeline.buildXpack() }, [
|
||||||
'xpack-ciGroup1': kibanaPipeline.getXpackCiGroupWorker(1),
|
'xpack-ciGroup1': kibanaPipeline.xpackCiGroupProcess(1),
|
||||||
'xpack-ciGroup2': kibanaPipeline.getXpackCiGroupWorker(2),
|
'xpack-ciGroup2': kibanaPipeline.xpackCiGroupProcess(2),
|
||||||
'xpack-ciGroup3': kibanaPipeline.getXpackCiGroupWorker(3),
|
'xpack-ciGroup3': kibanaPipeline.xpackCiGroupProcess(3),
|
||||||
'xpack-ciGroup4': kibanaPipeline.getXpackCiGroupWorker(4),
|
'xpack-ciGroup4': kibanaPipeline.xpackCiGroupProcess(4),
|
||||||
'xpack-ciGroup5': kibanaPipeline.getXpackCiGroupWorker(5),
|
'xpack-ciGroup5': kibanaPipeline.xpackCiGroupProcess(5),
|
||||||
'xpack-ciGroup6': kibanaPipeline.getXpackCiGroupWorker(6),
|
'xpack-ciGroup6': kibanaPipeline.xpackCiGroupProcess(6),
|
||||||
'xpack-ciGroup7': kibanaPipeline.getXpackCiGroupWorker(7),
|
'xpack-ciGroup7': kibanaPipeline.xpackCiGroupProcess(7),
|
||||||
'xpack-ciGroup8': kibanaPipeline.getXpackCiGroupWorker(8),
|
'xpack-ciGroup8': kibanaPipeline.xpackCiGroupProcess(8),
|
||||||
'xpack-ciGroup9': kibanaPipeline.getXpackCiGroupWorker(9),
|
'xpack-ciGroup9': kibanaPipeline.xpackCiGroupProcess(9),
|
||||||
'xpack-ciGroup10': kibanaPipeline.getXpackCiGroupWorker(10),
|
'xpack-ciGroup10': kibanaPipeline.xpackCiGroupProcess(10),
|
||||||
]),
|
]),
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
|
@ -61,8 +58,6 @@ timeout(time: 120, unit: 'MINUTES') {
|
||||||
}
|
}
|
||||||
|
|
||||||
kibanaPipeline.sendMail()
|
kibanaPipeline.sendMail()
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def promoteSnapshot(snapshotVersion, snapshotId) {
|
def promoteSnapshot(snapshotVersion, snapshotId) {
|
||||||
|
|
88
Jenkinsfile
vendored
88
Jenkinsfile
vendored
|
@ -3,63 +3,44 @@
|
||||||
library 'kibana-pipeline-library'
|
library 'kibana-pipeline-library'
|
||||||
kibanaLibrary.load()
|
kibanaLibrary.load()
|
||||||
|
|
||||||
stage("Kibana Pipeline") { // This stage is just here to help the BlueOcean UI a little bit
|
kibanaPipeline(timeoutMinutes: 135) {
|
||||||
timeout(time: 135, unit: 'MINUTES') {
|
|
||||||
timestamps {
|
|
||||||
ansiColor('xterm') {
|
|
||||||
githubPr.withDefaultPrComments {
|
githubPr.withDefaultPrComments {
|
||||||
catchError {
|
catchError {
|
||||||
retryable.enable()
|
retryable.enable()
|
||||||
parallel([
|
parallel([
|
||||||
'kibana-intake-agent': kibanaPipeline.intakeWorker('kibana-intake', './test/scripts/jenkins_unit.sh'),
|
'kibana-intake-agent': workers.intake('kibana-intake', './test/scripts/jenkins_unit.sh'),
|
||||||
'x-pack-intake-agent': kibanaPipeline.intakeWorker('x-pack-intake', './test/scripts/jenkins_xpack.sh'),
|
'x-pack-intake-agent': workers.intake('x-pack-intake', './test/scripts/jenkins_xpack.sh'),
|
||||||
'kibana-oss-agent': kibanaPipeline.withWorkers('kibana-oss-tests', { kibanaPipeline.buildOss() }, [
|
'kibana-oss-agent': workers.functional('kibana-oss-tests', { kibanaPipeline.buildOss() }, [
|
||||||
// 'oss-firefoxSmoke': kibanaPipeline.getPostBuildWorker('firefoxSmoke', {
|
// 'oss-firefoxSmoke': kibanaPipeline.functionalTestProcess('kibana-firefoxSmoke', './test/scripts/jenkins_firefox_smoke.sh'),
|
||||||
// retryable('kibana-firefoxSmoke') {
|
'oss-ciGroup1': kibanaPipeline.ossCiGroupProcess(1),
|
||||||
// runbld('./test/scripts/jenkins_firefox_smoke.sh', 'Execute kibana-firefoxSmoke')
|
'oss-ciGroup2': kibanaPipeline.ossCiGroupProcess(2),
|
||||||
// }
|
'oss-ciGroup3': kibanaPipeline.ossCiGroupProcess(3),
|
||||||
// }),
|
'oss-ciGroup4': kibanaPipeline.ossCiGroupProcess(4),
|
||||||
'oss-ciGroup1': kibanaPipeline.getOssCiGroupWorker(1),
|
'oss-ciGroup5': kibanaPipeline.ossCiGroupProcess(5),
|
||||||
'oss-ciGroup2': kibanaPipeline.getOssCiGroupWorker(2),
|
'oss-ciGroup6': kibanaPipeline.ossCiGroupProcess(6),
|
||||||
'oss-ciGroup3': kibanaPipeline.getOssCiGroupWorker(3),
|
'oss-ciGroup7': kibanaPipeline.ossCiGroupProcess(7),
|
||||||
'oss-ciGroup4': kibanaPipeline.getOssCiGroupWorker(4),
|
'oss-ciGroup8': kibanaPipeline.ossCiGroupProcess(8),
|
||||||
'oss-ciGroup5': kibanaPipeline.getOssCiGroupWorker(5),
|
'oss-ciGroup9': kibanaPipeline.ossCiGroupProcess(9),
|
||||||
'oss-ciGroup6': kibanaPipeline.getOssCiGroupWorker(6),
|
'oss-ciGroup10': kibanaPipeline.ossCiGroupProcess(10),
|
||||||
'oss-ciGroup7': kibanaPipeline.getOssCiGroupWorker(7),
|
'oss-ciGroup11': kibanaPipeline.ossCiGroupProcess(11),
|
||||||
'oss-ciGroup8': kibanaPipeline.getOssCiGroupWorker(8),
|
'oss-ciGroup12': kibanaPipeline.ossCiGroupProcess(12),
|
||||||
'oss-ciGroup9': kibanaPipeline.getOssCiGroupWorker(9),
|
'oss-accessibility': kibanaPipeline.functionalTestProcess('kibana-accessibility', './test/scripts/jenkins_accessibility.sh'),
|
||||||
'oss-ciGroup10': kibanaPipeline.getOssCiGroupWorker(10),
|
// 'oss-visualRegression': kibanaPipeline.functionalTestProcess('visualRegression', './test/scripts/jenkins_visual_regression.sh'),
|
||||||
'oss-ciGroup11': kibanaPipeline.getOssCiGroupWorker(11),
|
|
||||||
'oss-ciGroup12': kibanaPipeline.getOssCiGroupWorker(12),
|
|
||||||
'oss-accessibility': kibanaPipeline.getPostBuildWorker('accessibility', {
|
|
||||||
retryable('kibana-accessibility') {
|
|
||||||
runbld('./test/scripts/jenkins_accessibility.sh', 'Execute accessibility tests')
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
// 'oss-visualRegression': kibanaPipeline.getPostBuildWorker('visualRegression', { runbld('./test/scripts/jenkins_visual_regression.sh', 'Execute kibana-visualRegression') }),
|
|
||||||
]),
|
]),
|
||||||
'kibana-xpack-agent': kibanaPipeline.withWorkers('kibana-xpack-tests', { kibanaPipeline.buildXpack() }, [
|
'kibana-xpack-agent': workers.functional('kibana-xpack-tests', { kibanaPipeline.buildXpack() }, [
|
||||||
// 'xpack-firefoxSmoke': kibanaPipeline.getPostBuildWorker('xpack-firefoxSmoke', {
|
// 'xpack-firefoxSmoke': kibanaPipeline.functionalTestProcess('xpack-firefoxSmoke', './test/scripts/jenkins_xpack_firefox_smoke.sh'),
|
||||||
// retryable('xpack-firefoxSmoke') {
|
'xpack-ciGroup1': kibanaPipeline.xpackCiGroupProcess(1),
|
||||||
// runbld('./test/scripts/jenkins_xpack_firefox_smoke.sh', 'Execute xpack-firefoxSmoke')
|
'xpack-ciGroup2': kibanaPipeline.xpackCiGroupProcess(2),
|
||||||
// }
|
'xpack-ciGroup3': kibanaPipeline.xpackCiGroupProcess(3),
|
||||||
// }),
|
'xpack-ciGroup4': kibanaPipeline.xpackCiGroupProcess(4),
|
||||||
'xpack-ciGroup1': kibanaPipeline.getXpackCiGroupWorker(1),
|
'xpack-ciGroup5': kibanaPipeline.xpackCiGroupProcess(5),
|
||||||
'xpack-ciGroup2': kibanaPipeline.getXpackCiGroupWorker(2),
|
'xpack-ciGroup6': kibanaPipeline.xpackCiGroupProcess(6),
|
||||||
'xpack-ciGroup3': kibanaPipeline.getXpackCiGroupWorker(3),
|
'xpack-ciGroup7': kibanaPipeline.xpackCiGroupProcess(7),
|
||||||
'xpack-ciGroup4': kibanaPipeline.getXpackCiGroupWorker(4),
|
'xpack-ciGroup8': kibanaPipeline.xpackCiGroupProcess(8),
|
||||||
'xpack-ciGroup5': kibanaPipeline.getXpackCiGroupWorker(5),
|
'xpack-ciGroup9': kibanaPipeline.xpackCiGroupProcess(9),
|
||||||
'xpack-ciGroup6': kibanaPipeline.getXpackCiGroupWorker(6),
|
'xpack-ciGroup10': kibanaPipeline.xpackCiGroupProcess(10),
|
||||||
'xpack-ciGroup7': kibanaPipeline.getXpackCiGroupWorker(7),
|
'xpack-accessibility': kibanaPipeline.functionalTestProcess('xpack-accessibility', './test/scripts/jenkins_xpack_accessibility.sh'),
|
||||||
'xpack-ciGroup8': kibanaPipeline.getXpackCiGroupWorker(8),
|
// 'xpack-visualRegression': kibanaPipeline.functionalTestProcess('xpack-visualRegression', './test/scripts/jenkins_xpack_visual_regression.sh'),
|
||||||
'xpack-ciGroup9': kibanaPipeline.getXpackCiGroupWorker(9),
|
|
||||||
'xpack-ciGroup10': kibanaPipeline.getXpackCiGroupWorker(10),
|
|
||||||
'xpack-accessibility': kibanaPipeline.getPostBuildWorker('xpack-accessibility', {
|
|
||||||
retryable('xpack-accessibility') {
|
|
||||||
runbld('./test/scripts/jenkins_xpack_accessibility.sh', 'Execute xpack-accessibility tests')
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
// 'xpack-visualRegression': kibanaPipeline.getPostBuildWorker('xpack-visualRegression', { runbld('./test/scripts/jenkins_xpack_visual_regression.sh', 'Execute xpack-visualRegression') }),
|
|
||||||
]),
|
]),
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
|
@ -67,7 +48,4 @@ stage("Kibana Pipeline") { // This stage is just here to help the BlueOcean UI a
|
||||||
|
|
||||||
retryable.printFlakyFailures()
|
retryable.printFlakyFailures()
|
||||||
kibanaPipeline.sendMail()
|
kibanaPipeline.sendMail()
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,9 @@
|
||||||
import { resolve } from 'path';
|
import { resolve } from 'path';
|
||||||
|
|
||||||
const job = process.env.JOB ? `job-${process.env.JOB}-` : '';
|
const job = process.env.JOB ? `job-${process.env.JOB}-` : '';
|
||||||
const num = process.env.CI_WORKER_NUMBER ? `worker-${process.env.CI_WORKER_NUMBER}-` : '';
|
const num = process.env.CI_PARALLEL_PROCESS_NUMBER
|
||||||
|
? `worker-${process.env.CI_PARALLEL_PROCESS_NUMBER}-`
|
||||||
|
: '';
|
||||||
|
|
||||||
export function makeJunitReportPath(rootDirectory: string, reportName: string) {
|
export function makeJunitReportPath(rootDirectory: string, reportName: string) {
|
||||||
return resolve(
|
return resolve(
|
||||||
|
|
|
@ -4,7 +4,7 @@ source test/scripts/jenkins_test_setup.sh
|
||||||
|
|
||||||
if [[ -z "$CODE_COVERAGE" ]] ; then
|
if [[ -z "$CODE_COVERAGE" ]] ; then
|
||||||
installDir="$(realpath $PARENT_DIR/kibana/build/oss/kibana-*-SNAPSHOT-linux-x86_64)"
|
installDir="$(realpath $PARENT_DIR/kibana/build/oss/kibana-*-SNAPSHOT-linux-x86_64)"
|
||||||
destDir=${installDir}-${CI_WORKER_NUMBER}
|
destDir=${installDir}-${CI_PARALLEL_PROCESS_NUMBER}
|
||||||
cp -R "$installDir" "$destDir"
|
cp -R "$installDir" "$destDir"
|
||||||
|
|
||||||
export KIBANA_INSTALL_DIR="$destDir"
|
export KIBANA_INSTALL_DIR="$destDir"
|
||||||
|
|
|
@ -4,7 +4,7 @@ source test/scripts/jenkins_test_setup.sh
|
||||||
|
|
||||||
if [[ -z "$CODE_COVERAGE" ]]; then
|
if [[ -z "$CODE_COVERAGE" ]]; then
|
||||||
installDir="$PARENT_DIR/install/kibana"
|
installDir="$PARENT_DIR/install/kibana"
|
||||||
destDir="${installDir}-${CI_WORKER_NUMBER}"
|
destDir="${installDir}-${CI_PARALLEL_PROCESS_NUMBER}"
|
||||||
cp -R "$installDir" "$destDir"
|
cp -R "$installDir" "$destDir"
|
||||||
|
|
||||||
export KIBANA_INSTALL_DIR="$destDir"
|
export KIBANA_INSTALL_DIR="$destDir"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
def print() {
|
def print() {
|
||||||
try {
|
catchError(catchInterruptions: false, buildResult: null) {
|
||||||
def startTime = sh(script: "date -d '-3 minutes' -Iseconds | sed s/+/%2B/", returnStdout: true).trim()
|
def startTime = sh(script: "date -d '-3 minutes' -Iseconds | sed s/+/%2B/", returnStdout: true).trim()
|
||||||
def endTime = sh(script: "date -d '+1 hour 30 minutes' -Iseconds | sed s/+/%2B/", returnStdout: true).trim()
|
def endTime = sh(script: "date -d '+1 hour 30 minutes' -Iseconds | sed s/+/%2B/", returnStdout: true).trim()
|
||||||
|
|
||||||
|
@ -34,8 +34,6 @@ def print() {
|
||||||
echo 'SSH Command:'
|
echo 'SSH Command:'
|
||||||
echo "ssh -F ssh_config \$(hostname --ip-address)"
|
echo "ssh -F ssh_config \$(hostname --ip-address)"
|
||||||
""", label: "Worker/Agent/Node debug links"
|
""", label: "Worker/Agent/Node debug links"
|
||||||
} catch(ex) {
|
|
||||||
print ex.toString()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
8
vars/catchErrors.groovy
Normal file
8
vars/catchErrors.groovy
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
// Basically, this is a shortcut for catchError(catchInterruptions: false) {}
|
||||||
|
// By default, catchError will swallow aborts/timeouts, which we almost never want
|
||||||
|
def call(Map params = [:], Closure closure) {
|
||||||
|
params.catchInterruptions = false
|
||||||
|
return catchError(params, closure)
|
||||||
|
}
|
||||||
|
|
||||||
|
return this
|
|
@ -14,8 +14,8 @@
|
||||||
So, there is only ever one build status comment on a PR at any given time, the most recent one.
|
So, there is only ever one build status comment on a PR at any given time, the most recent one.
|
||||||
*/
|
*/
|
||||||
def withDefaultPrComments(closure) {
|
def withDefaultPrComments(closure) {
|
||||||
catchError {
|
catchErrors {
|
||||||
catchError {
|
catchErrors {
|
||||||
closure()
|
closure()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,92 +1,36 @@
|
||||||
def withWorkers(machineName, preWorkerClosure = {}, workerClosures = [:]) {
|
|
||||||
return {
|
|
||||||
jobRunner('tests-xl', true) {
|
|
||||||
withGcsArtifactUpload(machineName, {
|
|
||||||
withPostBuildReporting {
|
|
||||||
doSetup()
|
|
||||||
preWorkerClosure()
|
|
||||||
|
|
||||||
def nextWorker = 1
|
|
||||||
def worker = { workerClosure ->
|
|
||||||
def workerNumber = nextWorker
|
|
||||||
nextWorker++
|
|
||||||
|
|
||||||
return {
|
|
||||||
// This delay helps smooth out CPU load caused by ES/Kibana instances starting up at the same time
|
|
||||||
def delay = (workerNumber-1)*20
|
|
||||||
sleep(delay)
|
|
||||||
|
|
||||||
workerClosure(workerNumber)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
def workers = [:]
|
|
||||||
workerClosures.each { workerName, workerClosure ->
|
|
||||||
workers[workerName] = worker(workerClosure)
|
|
||||||
}
|
|
||||||
|
|
||||||
parallel(workers)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
def withWorker(machineName, label, Closure closure) {
|
|
||||||
return {
|
|
||||||
jobRunner(label, false) {
|
|
||||||
withGcsArtifactUpload(machineName) {
|
|
||||||
withPostBuildReporting {
|
|
||||||
doSetup()
|
|
||||||
closure()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
def intakeWorker(jobName, String script) {
|
|
||||||
return withWorker(jobName, 'linux && immutable') {
|
|
||||||
withEnv([
|
|
||||||
"JOB=${jobName}",
|
|
||||||
]) {
|
|
||||||
runbld(script, "Execute ${jobName}")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
def withPostBuildReporting(Closure closure) {
|
def withPostBuildReporting(Closure closure) {
|
||||||
try {
|
try {
|
||||||
closure()
|
closure()
|
||||||
} finally {
|
} finally {
|
||||||
catchError {
|
catchErrors {
|
||||||
runErrorReporter()
|
runErrorReporter()
|
||||||
}
|
}
|
||||||
|
|
||||||
catchError {
|
catchErrors {
|
||||||
runbld.junit()
|
runbld.junit()
|
||||||
}
|
}
|
||||||
|
|
||||||
catchError {
|
catchErrors {
|
||||||
publishJunit()
|
publishJunit()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def getPostBuildWorker(name, closure) {
|
def functionalTestProcess(String name, Closure closure) {
|
||||||
return { workerNumber ->
|
return { processNumber ->
|
||||||
def kibanaPort = "61${workerNumber}1"
|
def kibanaPort = "61${processNumber}1"
|
||||||
def esPort = "61${workerNumber}2"
|
def esPort = "61${processNumber}2"
|
||||||
def esTransportPort = "61${workerNumber}3"
|
def esTransportPort = "61${processNumber}3"
|
||||||
|
|
||||||
withEnv([
|
withEnv([
|
||||||
"CI_WORKER_NUMBER=${workerNumber}",
|
"CI_PARALLEL_PROCESS_NUMBER=${processNumber}",
|
||||||
"TEST_KIBANA_HOST=localhost",
|
"TEST_KIBANA_HOST=localhost",
|
||||||
"TEST_KIBANA_PORT=${kibanaPort}",
|
"TEST_KIBANA_PORT=${kibanaPort}",
|
||||||
"TEST_KIBANA_URL=http://elastic:changeme@localhost:${kibanaPort}",
|
"TEST_KIBANA_URL=http://elastic:changeme@localhost:${kibanaPort}",
|
||||||
"TEST_ES_URL=http://elastic:changeme@localhost:${esPort}",
|
"TEST_ES_URL=http://elastic:changeme@localhost:${esPort}",
|
||||||
"TEST_ES_TRANSPORT_PORT=${esTransportPort}",
|
"TEST_ES_TRANSPORT_PORT=${esTransportPort}",
|
||||||
"IS_PIPELINE_JOB=1",
|
"IS_PIPELINE_JOB=1",
|
||||||
|
"JOB=${name}",
|
||||||
"KBN_NP_PLUGINS_BUILT=true",
|
"KBN_NP_PLUGINS_BUILT=true",
|
||||||
]) {
|
]) {
|
||||||
closure()
|
closure()
|
||||||
|
@ -94,8 +38,16 @@ def getPostBuildWorker(name, closure) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def getOssCiGroupWorker(ciGroup) {
|
def functionalTestProcess(String name, String script) {
|
||||||
return getPostBuildWorker("ciGroup" + ciGroup, {
|
return functionalTestProcess(name) {
|
||||||
|
retryable(name) {
|
||||||
|
runbld(script, "Execute ${name}")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def ossCiGroupProcess(ciGroup) {
|
||||||
|
return functionalTestProcess("ciGroup" + ciGroup) {
|
||||||
withEnv([
|
withEnv([
|
||||||
"CI_GROUP=${ciGroup}",
|
"CI_GROUP=${ciGroup}",
|
||||||
"JOB=kibana-ciGroup${ciGroup}",
|
"JOB=kibana-ciGroup${ciGroup}",
|
||||||
|
@ -104,11 +56,11 @@ def getOssCiGroupWorker(ciGroup) {
|
||||||
runbld("./test/scripts/jenkins_ci_group.sh", "Execute kibana-ciGroup${ciGroup}")
|
runbld("./test/scripts/jenkins_ci_group.sh", "Execute kibana-ciGroup${ciGroup}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def getXpackCiGroupWorker(ciGroup) {
|
def xpackCiGroupProcess(ciGroup) {
|
||||||
return getPostBuildWorker("xpack-ciGroup" + ciGroup, {
|
return functionalTestProcess("xpack-ciGroup" + ciGroup) {
|
||||||
withEnv([
|
withEnv([
|
||||||
"CI_GROUP=${ciGroup}",
|
"CI_GROUP=${ciGroup}",
|
||||||
"JOB=xpack-kibana-ciGroup${ciGroup}",
|
"JOB=xpack-kibana-ciGroup${ciGroup}",
|
||||||
|
@ -117,56 +69,6 @@ def getXpackCiGroupWorker(ciGroup) {
|
||||||
runbld("./test/scripts/jenkins_xpack_ci_group.sh", "Execute xpack-kibana-ciGroup${ciGroup}")
|
runbld("./test/scripts/jenkins_xpack_ci_group.sh", "Execute xpack-kibana-ciGroup${ciGroup}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
def jobRunner(label, useRamDisk, closure) {
|
|
||||||
node(label) {
|
|
||||||
agentInfo.print()
|
|
||||||
|
|
||||||
if (useRamDisk) {
|
|
||||||
// Move to a temporary workspace, so that we can symlink the real workspace into /dev/shm
|
|
||||||
def originalWorkspace = env.WORKSPACE
|
|
||||||
ws('/tmp/workspace') {
|
|
||||||
sh(
|
|
||||||
script: """
|
|
||||||
mkdir -p /dev/shm/workspace
|
|
||||||
mkdir -p '${originalWorkspace}' # create all of the directories leading up to the workspace, if they don't exist
|
|
||||||
rm --preserve-root -rf '${originalWorkspace}' # then remove just the workspace, just in case there's stuff in it
|
|
||||||
ln -s /dev/shm/workspace '${originalWorkspace}'
|
|
||||||
""",
|
|
||||||
label: "Move workspace to RAM - /dev/shm/workspace"
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
def scmVars
|
|
||||||
|
|
||||||
// Try to clone from Github up to 8 times, waiting 15 secs between attempts
|
|
||||||
retryWithDelay(8, 15) {
|
|
||||||
scmVars = checkout scm
|
|
||||||
}
|
|
||||||
|
|
||||||
withEnv([
|
|
||||||
"CI=true",
|
|
||||||
"HOME=${env.JENKINS_HOME}",
|
|
||||||
"PR_SOURCE_BRANCH=${env.ghprbSourceBranch ?: ''}",
|
|
||||||
"PR_TARGET_BRANCH=${env.ghprbTargetBranch ?: ''}",
|
|
||||||
"PR_AUTHOR=${env.ghprbPullAuthorLogin ?: ''}",
|
|
||||||
"TEST_BROWSER_HEADLESS=1",
|
|
||||||
"GIT_BRANCH=${scmVars.GIT_BRANCH}",
|
|
||||||
]) {
|
|
||||||
withCredentials([
|
|
||||||
string(credentialsId: 'vault-addr', variable: 'VAULT_ADDR'),
|
|
||||||
string(credentialsId: 'vault-role-id', variable: 'VAULT_ROLE_ID'),
|
|
||||||
string(credentialsId: 'vault-secret-id', variable: 'VAULT_SECRET_ID'),
|
|
||||||
]) {
|
|
||||||
// scm is configured to check out to the ./kibana directory
|
|
||||||
dir('kibana') {
|
|
||||||
closure()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -198,7 +100,7 @@ def withGcsArtifactUpload(workerName, closure) {
|
||||||
try {
|
try {
|
||||||
closure()
|
closure()
|
||||||
} finally {
|
} finally {
|
||||||
catchError {
|
catchErrors {
|
||||||
ARTIFACT_PATTERNS.each { pattern ->
|
ARTIFACT_PATTERNS.each { pattern ->
|
||||||
uploadGcsArtifact(uploadPrefix, pattern)
|
uploadGcsArtifact(uploadPrefix, pattern)
|
||||||
}
|
}
|
||||||
|
@ -226,7 +128,7 @@ def sendMail() {
|
||||||
}
|
}
|
||||||
|
|
||||||
def sendInfraMail() {
|
def sendInfraMail() {
|
||||||
catchError {
|
catchErrors {
|
||||||
step([
|
step([
|
||||||
$class: 'Mailer',
|
$class: 'Mailer',
|
||||||
notifyEveryUnstableBuild: true,
|
notifyEveryUnstableBuild: true,
|
||||||
|
@ -237,7 +139,7 @@ def sendInfraMail() {
|
||||||
}
|
}
|
||||||
|
|
||||||
def sendKibanaMail() {
|
def sendKibanaMail() {
|
||||||
catchError {
|
catchErrors {
|
||||||
def buildStatus = buildUtils.getBuildStatus()
|
def buildStatus = buildUtils.getBuildStatus()
|
||||||
if(params.NOTIFY_ON_FAILURE && buildStatus != 'SUCCESS' && buildStatus != 'ABORTED') {
|
if(params.NOTIFY_ON_FAILURE && buildStatus != 'SUCCESS' && buildStatus != 'ABORTED') {
|
||||||
emailext(
|
emailext(
|
||||||
|
@ -282,4 +184,18 @@ def runErrorReporter() {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def call(Map params = [:], Closure closure) {
|
||||||
|
def config = [timeoutMinutes: 135] + params
|
||||||
|
|
||||||
|
stage("Kibana Pipeline") {
|
||||||
|
timeout(time: config.timeoutMinutes, unit: 'MINUTES') {
|
||||||
|
timestamps {
|
||||||
|
ansiColor('xterm') {
|
||||||
|
closure()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return this
|
return this
|
||||||
|
|
|
@ -2,7 +2,9 @@ def call(retryTimes, delaySecs, closure) {
|
||||||
retry(retryTimes) {
|
retry(retryTimes) {
|
||||||
try {
|
try {
|
||||||
closure()
|
closure()
|
||||||
} catch (ex) {
|
} catch (org.jenkinsci.plugins.workflow.steps.FlowInterruptedException ex) {
|
||||||
|
throw ex // Immediately re-throw build abort exceptions, don't sleep first
|
||||||
|
} catch (Exception ex) {
|
||||||
sleep delaySecs
|
sleep delaySecs
|
||||||
throw ex
|
throw ex
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ def getFlakyFailures() {
|
||||||
}
|
}
|
||||||
|
|
||||||
def printFlakyFailures() {
|
def printFlakyFailures() {
|
||||||
catchError {
|
catchErrors {
|
||||||
def failures = getFlakyFailures()
|
def failures = getFlakyFailures()
|
||||||
|
|
||||||
if (failures && failures.size() > 0) {
|
if (failures && failures.size() > 0) {
|
||||||
|
|
147
vars/workers.groovy
Normal file
147
vars/workers.groovy
Normal file
|
@ -0,0 +1,147 @@
|
||||||
|
// "Workers" in this file will spin up an instance, do some setup etc depending on the configuration, and then execute some work that you define
|
||||||
|
// e.g. workers.base(name: 'my-worker') { sh "echo 'ready to execute some kibana scripts'" }
|
||||||
|
|
||||||
|
/*
|
||||||
|
The base worker that all of the others use. Will clone the scm (assumed to be kibana), and run kibana bootstrap processes by default.
|
||||||
|
|
||||||
|
Parameters:
|
||||||
|
label - gobld/agent label to use, e.g. 'linux && immutable'
|
||||||
|
ramDisk - Should the workspace be mounted in memory? Default: true
|
||||||
|
bootstrapped - If true, download kibana dependencies, run kbn bootstrap, etc. Default: true
|
||||||
|
name - Name of the worker for display purposes, filenames, etc.
|
||||||
|
scm - Jenkins scm configuration for checking out code. Use `null` to disable checkout. Default: inherited from job
|
||||||
|
*/
|
||||||
|
def base(Map params, Closure closure) {
|
||||||
|
def config = [label: '', ramDisk: true, bootstrapped: true, name: 'unnamed-worker', scm: scm] + params
|
||||||
|
if (!config.label) {
|
||||||
|
error "You must specify an agent label, such as 'tests-xl' or 'linux && immutable', when using workers.base()"
|
||||||
|
}
|
||||||
|
|
||||||
|
node(config.label) {
|
||||||
|
agentInfo.print()
|
||||||
|
|
||||||
|
if (config.ramDisk) {
|
||||||
|
// Move to a temporary workspace, so that we can symlink the real workspace into /dev/shm
|
||||||
|
def originalWorkspace = env.WORKSPACE
|
||||||
|
ws('/tmp/workspace') {
|
||||||
|
sh(
|
||||||
|
script: """
|
||||||
|
mkdir -p /dev/shm/workspace
|
||||||
|
mkdir -p '${originalWorkspace}' # create all of the directories leading up to the workspace, if they don't exist
|
||||||
|
rm --preserve-root -rf '${originalWorkspace}' # then remove just the workspace, just in case there's stuff in it
|
||||||
|
ln -s /dev/shm/workspace '${originalWorkspace}'
|
||||||
|
""",
|
||||||
|
label: "Move workspace to RAM - /dev/shm/workspace"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def scmVars = [:]
|
||||||
|
|
||||||
|
if (config.scm) {
|
||||||
|
// Try to clone from Github up to 8 times, waiting 15 secs between attempts
|
||||||
|
retryWithDelay(8, 15) {
|
||||||
|
scmVars = checkout scm
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
withEnv([
|
||||||
|
"CI=true",
|
||||||
|
"HOME=${env.JENKINS_HOME}",
|
||||||
|
"PR_SOURCE_BRANCH=${env.ghprbSourceBranch ?: ''}",
|
||||||
|
"PR_TARGET_BRANCH=${env.ghprbTargetBranch ?: ''}",
|
||||||
|
"PR_AUTHOR=${env.ghprbPullAuthorLogin ?: ''}",
|
||||||
|
"TEST_BROWSER_HEADLESS=1",
|
||||||
|
"GIT_BRANCH=${scmVars.GIT_BRANCH ?: ''}",
|
||||||
|
]) {
|
||||||
|
withCredentials([
|
||||||
|
string(credentialsId: 'vault-addr', variable: 'VAULT_ADDR'),
|
||||||
|
string(credentialsId: 'vault-role-id', variable: 'VAULT_ROLE_ID'),
|
||||||
|
string(credentialsId: 'vault-secret-id', variable: 'VAULT_SECRET_ID'),
|
||||||
|
]) {
|
||||||
|
// scm is configured to check out to the ./kibana directory
|
||||||
|
dir('kibana') {
|
||||||
|
if (config.bootstrapped) {
|
||||||
|
kibanaPipeline.doSetup()
|
||||||
|
}
|
||||||
|
|
||||||
|
closure()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Worker for ci processes. Extends the base worker and adds GCS artifact upload, error reporting, junit processing
|
||||||
|
def ci(Map params, Closure closure) {
|
||||||
|
def config = [ramDisk: true, bootstrapped: true] + params
|
||||||
|
|
||||||
|
return base(config) {
|
||||||
|
kibanaPipeline.withGcsArtifactUpload(config.name) {
|
||||||
|
kibanaPipeline.withPostBuildReporting {
|
||||||
|
closure()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Worker for running the current intake jobs. Just runs a single script after bootstrap.
|
||||||
|
def intake(jobName, String script) {
|
||||||
|
return {
|
||||||
|
ci(name: jobName, label: 'linux && immutable', ramDisk: false) {
|
||||||
|
withEnv(["JOB=${jobName}"]) {
|
||||||
|
runbld(script, "Execute ${jobName}")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Worker for running functional tests. Runs a setup process (e.g. the kibana build) then executes a map of closures in parallel (e.g. one for each ciGroup)
|
||||||
|
def functional(name, Closure setup, Map processes) {
|
||||||
|
return {
|
||||||
|
parallelProcesses(name: name, setup: setup, processes: processes, delayBetweenProcesses: 20, label: 'tests-xl')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Creates a ci worker that can run a setup process, followed by a group of processes in parallel.
|
||||||
|
|
||||||
|
Parameters:
|
||||||
|
name: Name of the worker for display purposes, filenames, etc.
|
||||||
|
setup: Closure to execute after the agent is bootstrapped, before starting the parallel work
|
||||||
|
processes: Map of closures that will execute in parallel after setup. Each closure is passed a unique number.
|
||||||
|
delayBetweenProcesses: Number of seconds to wait between starting the parallel processes. Useful to spread the load of heavy init processes, e.g. Elasticsearch starting up. Default: 0
|
||||||
|
label: gobld/agent label to use, e.g. 'linux && immutable'. Default: 'tests-xl', a 32 CPU machine used for running many functional test suites in parallel
|
||||||
|
*/
|
||||||
|
def parallelProcesses(Map params) {
|
||||||
|
def config = [name: 'parallel-worker', setup: {}, processes: [:], delayBetweenProcesses: 0, label: 'tests-xl'] + params
|
||||||
|
|
||||||
|
ci(label: config.label, name: config.name) {
|
||||||
|
config.setup()
|
||||||
|
|
||||||
|
def nextProcessNumber = 1
|
||||||
|
def process = { processName, processClosure ->
|
||||||
|
def processNumber = nextProcessNumber
|
||||||
|
nextProcessNumber++
|
||||||
|
|
||||||
|
return {
|
||||||
|
if (config.delayBetweenProcesses && config.delayBetweenProcesses > 0) {
|
||||||
|
// This delay helps smooth out CPU load caused by ES/Kibana instances starting up at the same time
|
||||||
|
def delay = (processNumber-1)*config.delayBetweenProcesses
|
||||||
|
sleep(delay)
|
||||||
|
}
|
||||||
|
|
||||||
|
processClosure(processNumber)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def processes = [:]
|
||||||
|
config.processes.each { processName, processClosure ->
|
||||||
|
processes[processName] = process(processName, processClosure)
|
||||||
|
}
|
||||||
|
|
||||||
|
parallel(processes)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return this
|
Loading…
Add table
Add a link
Reference in a new issue