Skip to content

Commit

Permalink
[jenkins] convert baseline capture job to use tasks (#93288) (#93343)
Browse files Browse the repository at this point in the history
Co-authored-by: spalger <spalger@users.noreply.github.com>

Co-authored-by: Spencer <email@spalger.com>
Co-authored-by: spalger <spalger@users.noreply.github.com>
  • Loading branch information
3 people authored Mar 3, 2021
1 parent 3d78159 commit abd1422
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 85 deletions.
62 changes: 35 additions & 27 deletions .ci/Jenkinsfile_baseline_capture
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,48 @@
library 'kibana-pipeline-library'
kibanaLibrary.load()

kibanaPipeline(timeoutMinutes: 120) {
kibanaPipeline(timeoutMinutes: 210) {
githubCommitStatus.trackBuild(params.commit, 'kibana-ci-baseline') {
ciStats.trackBuild {
catchError {
withEnv([
'CI_PARALLEL_PROCESS_NUMBER=1'
]) {
parallel([
'oss-baseline': {
workers.ci(name: 'oss-baseline', size: 'l', ramDisk: true, runErrorReporter: false, bootstrapped: false) {
// bootstrap ourselves, but with the env needed to upload the ts refs cache
withGcpServiceAccount.fromVaultSecret('secret/kibana-issues/dev/ci-artifacts-key', 'value') {
withEnv([
'BUILD_TS_REFS_CACHE_ENABLE=true',
'BUILD_TS_REFS_CACHE_CAPTURE=true'
]) {
kibanaPipeline.doSetup()
}
}
catchErrors {
slackNotifications.onFailure(
title: "*<${env.BUILD_URL}|[${params.branch}] Baseline Capture Failure>*",
message: "[${params.branch}/${params.commit}] Baseline Capture Failure",
) {
retryable.enable(2)

kibanaPipeline.functionalTestProcess('oss-baseline', './test/scripts/jenkins_baseline.sh')()
catchErrors {
workers.ci(
name: 'baseline-worker',
size: 'xl',
ramDisk: true,
runErrorReporter: false,
bootstrapped: false
) {
withGcpServiceAccount.fromVaultSecret('secret/kibana-issues/dev/ci-artifacts-key', 'value') {
withEnv([
'BUILD_TS_REFS_CACHE_ENABLE=true',
'BUILD_TS_REFS_CACHE_CAPTURE=true',
'DISABLE_BOOTSTRAP_VALIDATIONS=true',
]) {
kibanaPipeline.doSetup()
}
}
},
'xpack-baseline': {
workers.ci(name: 'xpack-baseline', size: 'l', ramDisk: true, runErrorReporter: false) {
kibanaPipeline.functionalTestProcess('xpack-baseline', './test/scripts/jenkins_xpack_baseline.sh')()

kibanaPipeline.withCiTaskQueue([parallel: 2]) {
catchErrors {
tasks([
kibanaPipeline.functionalTestProcess('oss-baseline', './test/scripts/jenkins_baseline.sh'),
kibanaPipeline.functionalTestProcess('xpack-baseline', './test/scripts/jenkins_xpack_baseline.sh'),
])
}
}
},
])
}
}
}
}

kibanaPipeline.sendMail()
slackNotifications.onFailure()
}

kibanaPipeline.sendMail()
}
}
64 changes: 64 additions & 0 deletions src/dev/ci_setup/bootstrap_validations.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#!/usr/bin/env bash

set -e

###
### verify no git modifications caused by bootstrap
###
if [[ $DISABLE_BOOTSTRAP_VALIDATIONS != "true" ]]; then
GIT_CHANGES="$(git ls-files --modified)"
if [ "$GIT_CHANGES" ]; then
echo -e "\n${RED}ERROR: 'yarn kbn bootstrap' caused changes to the following files:${C_RESET}\n"
echo -e "$GIT_CHANGES\n"
exit 1
fi
fi


###
### rebuild kbn-pm distributable to ensure it's not out of date
###
echo " -- building kbn-pm distributable"
yarn kbn run build -i @kbn/pm

###
### verify no git modifications
###
GIT_CHANGES="$(git ls-files --modified)"
if [ "$GIT_CHANGES" ]; then
echo -e "\n${RED}ERROR: 'yarn kbn run build -i @kbn/pm' caused changes to the following files:${C_RESET}\n"
echo -e "$GIT_CHANGES\n"
exit 1
fi

###
### rebuild plugin list to ensure it's not out of date
###
echo " -- building plugin list docs"
node scripts/build_plugin_list_docs

###
### verify no git modifications
###
GIT_CHANGES="$(git ls-files --modified)"
if [ "$GIT_CHANGES" ]; then
echo -e "\n${RED}ERROR: 'node scripts/build_plugin_list_docs' caused changes to the following files:${C_RESET}\n"
echo -e "$GIT_CHANGES\n"
exit 1
fi

###
### rebuild plugin api docs to ensure it's not out of date
###
echo " -- building api docs"
node scripts/build_api_docs

###
### verify no api changes
###
GIT_CHANGES="$(git ls-files --modified)"
if [ "$GIT_CHANGES" ]; then
echo -e "\n${RED}ERROR: 'node scripts/build_api_docs' caused changes to the following files:${C_RESET}\n"
echo -e "$GIT_CHANGES\n"
exit 1
fi
62 changes: 4 additions & 58 deletions src/dev/ci_setup/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,66 +40,12 @@ if [[ "$BUILD_TS_REFS_CACHE_CAPTURE" == "true" ]]; then
cd "$KIBANA_DIR"
fi

if [[ "$DISABLE_BOOTSTRAP_VALIDATIONS" != "true" ]]; then
source "$KIBANA_DIR/src/dev/ci_setup/bootstrap_validations.sh"
fi

###
### Download es snapshots
###
echo " -- downloading es snapshot"
node scripts/es snapshot --download-only;

###
### verify no git modifications
###
GIT_CHANGES="$(git ls-files --modified)"
if [ "$GIT_CHANGES" ]; then
echo -e "\n${RED}ERROR: 'yarn kbn bootstrap' caused changes to the following files:${C_RESET}\n"
echo -e "$GIT_CHANGES\n"
exit 1
fi

###
### rebuild kbn-pm distributable to ensure it's not out of date
###
echo " -- building kbn-pm distributable"
yarn kbn run build -i @kbn/pm

###
### verify no git modifications
###
GIT_CHANGES="$(git ls-files --modified)"
if [ "$GIT_CHANGES" ]; then
echo -e "\n${RED}ERROR: 'yarn kbn run build -i @kbn/pm' caused changes to the following files:${C_RESET}\n"
echo -e "$GIT_CHANGES\n"
exit 1
fi

###
### rebuild plugin list to ensure it's not out of date
###
echo " -- building plugin list docs"
node scripts/build_plugin_list_docs

###
### verify no git modifications
###
GIT_CHANGES="$(git ls-files --modified)"
if [ "$GIT_CHANGES" ]; then
echo -e "\n${RED}ERROR: 'node scripts/build_plugin_list_docs' caused changes to the following files:${C_RESET}\n"
echo -e "$GIT_CHANGES\n"
exit 1
fi

###
### rebuild plugin api docs to ensure it's not out of date
###
echo " -- building api docs"
node scripts/build_api_docs

###
### verify no api changes
###
GIT_CHANGES="$(git ls-files --modified)"
if [ "$GIT_CHANGES" ]; then
echo -e "\n${RED}ERROR: 'node scripts/build_api_docs' caused changes to the following files:${C_RESET}\n"
echo -e "$GIT_CHANGES\n"
exit 1
fi

0 comments on commit abd1422

Please sign in to comment.