Skip to content

Commit a890585

Browse files
Merge branch 'master' into add_sysv_init_functions
2 parents 6e941f9 + 3fb77fb commit a890585

41,573 files changed

Lines changed: 2917487 additions & 1370459 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.backportrc.json

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,33 @@
11
{
22
"upstream": "elastic/kibana",
3-
"branches": [{ "name": "7.x", "checked": true }, "7.4", "7.3", "7.2", "7.1", "7.0", "6.8", "6.7", "6.6", "6.5", "6.4", "6.3", "6.2", "6.1", "6.0", "5.6"],
4-
"labels": ["backport"]
3+
"targetBranchChoices": [
4+
{ "name": "master", "checked": true },
5+
{ "name": "7.x", "checked": true },
6+
"7.9",
7+
"7.8",
8+
"7.7",
9+
"7.6",
10+
"7.5",
11+
"7.4",
12+
"7.3",
13+
"7.2",
14+
"7.1",
15+
"7.0",
16+
"6.8",
17+
"6.7",
18+
"6.6",
19+
"6.5",
20+
"6.4",
21+
"6.3",
22+
"6.2",
23+
"6.1",
24+
"6.0",
25+
"5.6"
26+
],
27+
"targetPRLabels": ["backport"],
28+
"branchLabelMapping": {
29+
"^v8.0.0$": "master",
30+
"^v7.10.0$": "7.x",
31+
"^v(\\d+).(\\d+).\\d+$": "$1.$2"
32+
}
533
}

.browserslistrc

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1-
last 2 versions
2-
> 5%
3-
Safari 7 # for PhantomJS support: https://github.com/elastic/kibana/issues/27136
1+
[production]
2+
last 2 Firefox versions
3+
last 2 Chrome versions
4+
last 2 Safari versions
5+
> 0.25%
6+
not ie 11
7+
8+
[dev]
9+
last 1 chrome versions
10+
last 1 firefox versions
11+
last 1 safari versions

.ci/Dockerfile

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# NOTE: This Dockerfile is ONLY used to run certain tasks in CI. It is not used to run Kibana or as a distributable.
2+
# If you're looking for the Kibana Docker image distributable, please see: src/dev/build/tasks/os_packages/docker_generator/templates/dockerfile.template.ts
3+
4+
ARG NODE_VERSION=10.21.0
5+
6+
FROM node:${NODE_VERSION} AS base
7+
8+
RUN apt-get update && \
9+
apt-get -y install xvfb gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 \
10+
libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 \
11+
libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 \
12+
libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 \
13+
libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget openjdk-8-jre && \
14+
rm -rf /var/lib/apt/lists/*
15+
16+
RUN curl -sSL https://dl.google.com/linux/linux_signing_key.pub | apt-key add - \
17+
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
18+
&& apt-get update \
19+
&& apt-get install -y rsync jq bsdtar google-chrome-stable \
20+
--no-install-recommends \
21+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
22+
23+
RUN LATEST_VAULT_RELEASE=$(curl -s https://api.github.com/repos/hashicorp/vault/tags | jq --raw-output .[0].name[1:]) \
24+
&& curl -L https://releases.hashicorp.com/vault/${LATEST_VAULT_RELEASE}/vault_${LATEST_VAULT_RELEASE}_linux_amd64.zip -o vault.zip \
25+
&& unzip vault.zip \
26+
&& rm vault.zip \
27+
&& chmod +x vault \
28+
&& mv vault /usr/local/bin/vault
29+
30+
RUN groupadd -r kibana && useradd -r -g kibana kibana && mkdir /home/kibana && chown kibana:kibana /home/kibana
31+
32+
COPY ./bash_standard_lib.sh /usr/local/bin/bash_standard_lib.sh
33+
RUN chmod +x /usr/local/bin/bash_standard_lib.sh
34+
35+
COPY ./runbld /usr/local/bin/runbld
36+
RUN chmod +x /usr/local/bin/runbld
37+
38+
USER kibana

.ci/Jenkinsfile_baseline_capture

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/groovy
2+
3+
library 'kibana-pipeline-library'
4+
kibanaLibrary.load()
5+
6+
kibanaPipeline(timeoutMinutes: 120) {
7+
githubCommitStatus.trackBuild(params.commit, 'kibana-ci-baseline') {
8+
ciStats.trackBuild {
9+
catchError {
10+
withEnv([
11+
'CI_PARALLEL_PROCESS_NUMBER=1'
12+
]) {
13+
parallel([
14+
'oss-visualRegression': {
15+
workers.ci(name: 'oss-visualRegression', size: 's-highmem', ramDisk: true) {
16+
kibanaPipeline.functionalTestProcess('oss-visualRegression', './test/scripts/jenkins_visual_regression.sh')()
17+
}
18+
},
19+
'xpack-visualRegression': {
20+
workers.ci(name: 'xpack-visualRegression', size: 's-highmem', ramDisk: true) {
21+
kibanaPipeline.functionalTestProcess('xpack-visualRegression', './test/scripts/jenkins_xpack_visual_regression.sh')()
22+
}
23+
},
24+
])
25+
}
26+
}
27+
28+
kibanaPipeline.sendMail()
29+
slackNotifications.onFailure()
30+
}
31+
}
32+
}

.ci/Jenkinsfile_baseline_trigger

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
#!/bin/groovy
2+
3+
def MAXIMUM_COMMITS_TO_CHECK = 10
4+
def MAXIMUM_COMMITS_TO_BUILD = 5
5+
6+
if (!params.branches_yaml) {
7+
error "'branches_yaml' parameter must be specified"
8+
}
9+
10+
def additionalBranches = []
11+
12+
def branches = readYaml(text: params.branches_yaml) + additionalBranches
13+
14+
library 'kibana-pipeline-library'
15+
kibanaLibrary.load()
16+
17+
withGithubCredentials {
18+
branches.each { branch ->
19+
if (branch == '6.8') {
20+
// skip 6.8, it is tracked but we don't need snapshots for it and haven't backported
21+
// the baseline capture scripts to it.
22+
return;
23+
}
24+
25+
stage(branch) {
26+
def commits = getCommits(branch, MAXIMUM_COMMITS_TO_CHECK, MAXIMUM_COMMITS_TO_BUILD)
27+
28+
commits.take(MAXIMUM_COMMITS_TO_BUILD).each { commit ->
29+
catchErrors {
30+
githubCommitStatus.create(commit, 'pending', 'Baseline started.', 'kibana-ci-baseline')
31+
32+
build(
33+
propagate: false,
34+
wait: false,
35+
job: 'elastic+kibana+baseline-capture',
36+
parameters: [
37+
string(name: 'branch_specifier', value: branch),
38+
string(name: 'commit', value: commit),
39+
]
40+
)
41+
}
42+
}
43+
}
44+
}
45+
}
46+
47+
def getCommits(String branch, maximumCommitsToCheck, maximumCommitsToBuild) {
48+
print "Getting latest commits for ${branch}..."
49+
def commits = githubApi.get("repos/elastic/kibana/commits?sha=${branch}").take(maximumCommitsToCheck).collect { it.sha }
50+
def commitsToBuild = []
51+
52+
for (commit in commits) {
53+
print "Getting statuses for ${commit}"
54+
def status = githubApi.get("repos/elastic/kibana/statuses/${commit}").find { it.context == 'kibana-ci-baseline' }
55+
print "Commit '${commit}' already built? ${status ? 'Yes' : 'No'}"
56+
57+
if (!status) {
58+
commitsToBuild << commit
59+
} else {
60+
// Stop at the first commit we find that's already been triggered
61+
break
62+
}
63+
64+
if (commitsToBuild.size() >= maximumCommitsToBuild) {
65+
break
66+
}
67+
}
68+
69+
return commitsToBuild.reverse() // We want the builds to trigger oldest-to-newest
70+
}

.ci/Jenkinsfile_coverage

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/bin/groovy
2+
3+
library 'kibana-pipeline-library'
4+
kibanaLibrary.load() // load from the Jenkins instance
5+
6+
kibanaPipeline(timeoutMinutes: 240) {
7+
catchErrors {
8+
def timestamp = new Date(currentBuild.startTimeInMillis).format("yyyy-MM-dd'T'HH:mm:ss'Z'", TimeZone.getTimeZone("UTC"))
9+
withEnv([
10+
"TIME_STAMP=${timestamp}",
11+
'CODE_COVERAGE=1', // Enables coverage. Needed for multiple ci scripts, such as remote.ts, test/scripts/*.sh, schema.js, etc.
12+
]) {
13+
workers.base(name: 'coverage-worker', size: 'l', ramDisk: false, bootstrapped: false) {
14+
catchError {
15+
kibanaCoverage.runTests()
16+
kibanaTeamAssign.load('team_assignment', "### Upload Team Assignment JSON")
17+
handleIngestion(TIME_STAMP)
18+
}
19+
handleFail()
20+
}
21+
}
22+
kibanaPipeline.sendMail()
23+
}
24+
}
25+
26+
def handleIngestion(timestamp) {
27+
def previousSha = handlePreviousSha()
28+
kibanaPipeline.downloadCoverageArtifacts()
29+
kibanaCoverage.prokLinks("### Process HTML Links")
30+
kibanaCoverage.collectVcsInfo("### Collect VCS Info")
31+
kibanaCoverage.generateReports("### Merge coverage reports")
32+
kibanaCoverage.uploadCombinedReports()
33+
kibanaCoverage.ingest(env.JOB_NAME, BUILD_NUMBER, BUILD_URL, timestamp, previousSha, '### Ingest && Upload')
34+
kibanaCoverage.uploadCoverageStaticSite(timestamp)
35+
}
36+
37+
def handlePreviousSha() {
38+
def previous = kibanaCoverage.downloadPrevious('### Download OLD Previous')
39+
kibanaCoverage.uploadPrevious('### Upload NEW Previous')
40+
return previous
41+
}
42+
43+
def handleFail() {
44+
def buildStatus = buildUtils.getBuildStatus()
45+
if(params.NOTIFY_ON_FAILURE && buildStatus != 'SUCCESS' && buildStatus != 'ABORTED' && buildStatus != 'UNSTABLE') {
46+
slackNotifications.sendFailedBuild(
47+
channel: '#kibana-qa',
48+
username: 'Kibana QA'
49+
)
50+
}
51+
}
52+

.ci/Jenkinsfile_flaky

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
#!/bin/groovy
2+
3+
library 'kibana-pipeline-library'
4+
kibanaLibrary.load()
5+
6+
def CI_GROUP_PARAM = params.CI_GROUP
7+
8+
// Looks like 'oss:ciGroup:1', 'oss:firefoxSmoke', or 'all:serverMocha'
9+
def JOB_PARTS = CI_GROUP_PARAM.split(':')
10+
def IS_XPACK = JOB_PARTS[0] == 'xpack'
11+
def JOB = JOB_PARTS[1]
12+
def NEED_BUILD = JOB != 'serverMocha'
13+
def CI_GROUP = JOB_PARTS.size() > 2 ? JOB_PARTS[2] : ''
14+
def EXECUTIONS = params.NUMBER_EXECUTIONS.toInteger()
15+
def AGENT_COUNT = getAgentCount(EXECUTIONS)
16+
17+
def worker = getWorkerFromParams(IS_XPACK, JOB, CI_GROUP)
18+
19+
def workerFailures = []
20+
21+
currentBuild.displayName += trunc(" ${params.GITHUB_OWNER}:${params.branch_specifier}", 24)
22+
currentBuild.description = "${params.CI_GROUP}<br />Agents: ${AGENT_COUNT}<br />Executions: ${params.NUMBER_EXECUTIONS}"
23+
24+
kibanaPipeline(timeoutMinutes: 180) {
25+
def agents = [:]
26+
for(def agentNumber = 1; agentNumber <= AGENT_COUNT; agentNumber++) {
27+
def agentNumberInside = agentNumber
28+
def agentExecutions = floor(EXECUTIONS/AGENT_COUNT) + (agentNumber <= EXECUTIONS%AGENT_COUNT ? 1 : 0)
29+
agents["agent-${agentNumber}"] = {
30+
catchErrors {
31+
print "Agent ${agentNumberInside} - ${agentExecutions} executions"
32+
33+
workers.functional('flaky-test-runner', {
34+
if (NEED_BUILD) {
35+
if (!IS_XPACK) {
36+
kibanaPipeline.buildOss()
37+
if (CI_GROUP == '1') {
38+
runbld("./test/scripts/jenkins_build_kbn_sample_panel_action.sh", "Build kbn tp sample panel action for ciGroup1")
39+
}
40+
} else {
41+
kibanaPipeline.buildXpack()
42+
}
43+
}
44+
}, getWorkerMap(agentNumberInside, agentExecutions, worker, workerFailures))()
45+
}
46+
}
47+
}
48+
49+
parallel(agents)
50+
51+
currentBuild.description += ", Failures: ${workerFailures.size()}"
52+
53+
if (workerFailures.size() > 0) {
54+
print "There were ${workerFailures.size()} test suite failures."
55+
print "The executions that failed were:"
56+
print workerFailures.join("\n")
57+
print "Please check 'Test Result' and 'Pipeline Steps' pages for more info"
58+
}
59+
}
60+
61+
def getWorkerFromParams(isXpack, job, ciGroup) {
62+
if (!isXpack) {
63+
if (job == 'serverMocha') {
64+
return kibanaPipeline.functionalTestProcess('serverMocha', {
65+
kibanaPipeline.bash(
66+
"""
67+
source src/dev/ci_setup/setup_env.sh
68+
node scripts/mocha
69+
""",
70+
"run `node scripts/mocha`"
71+
)
72+
})
73+
} else if (job == 'accessibility') {
74+
return kibanaPipeline.functionalTestProcess('kibana-accessibility', './test/scripts/jenkins_accessibility.sh')
75+
} else if (job == 'firefoxSmoke') {
76+
return kibanaPipeline.functionalTestProcess('firefoxSmoke', './test/scripts/jenkins_firefox_smoke.sh')
77+
} else if(job == 'visualRegression') {
78+
return kibanaPipeline.functionalTestProcess('visualRegression', './test/scripts/jenkins_visual_regression.sh')
79+
} else {
80+
return kibanaPipeline.ossCiGroupProcess(ciGroup)
81+
}
82+
}
83+
84+
if (job == 'accessibility') {
85+
return kibanaPipeline.functionalTestProcess('xpack-accessibility', './test/scripts/jenkins_xpack_accessibility.sh')
86+
} else if (job == 'firefoxSmoke') {
87+
return kibanaPipeline.functionalTestProcess('xpack-firefoxSmoke', './test/scripts/jenkins_xpack_firefox_smoke.sh')
88+
} else if(job == 'visualRegression') {
89+
return kibanaPipeline.functionalTestProcess('xpack-visualRegression', './test/scripts/jenkins_xpack_visual_regression.sh')
90+
} else {
91+
return kibanaPipeline.xpackCiGroupProcess(ciGroup)
92+
}
93+
}
94+
95+
def getWorkerMap(agentNumber, numberOfExecutions, worker, workerFailures, maxWorkerProcesses = 12) {
96+
def workerMap = [:]
97+
def numberOfWorkers = Math.min(numberOfExecutions, maxWorkerProcesses)
98+
99+
for(def i = 1; i <= numberOfWorkers; i++) {
100+
def workerExecutions = floor(numberOfExecutions/numberOfWorkers + (i <= numberOfExecutions%numberOfWorkers ? 1 : 0))
101+
102+
workerMap["agent-${agentNumber}-worker-${i}"] = { workerNumber ->
103+
for(def j = 0; j < workerExecutions; j++) {
104+
print "Execute agent-${agentNumber} worker-${workerNumber}: ${j}"
105+
withEnv([
106+
"REMOVE_KIBANA_INSTALL_DIR=1",
107+
]) {
108+
catchErrors {
109+
try {
110+
worker(workerNumber)
111+
} catch (ex) {
112+
workerFailures << "agent-${agentNumber} worker-${workerNumber}-${j}"
113+
throw ex
114+
}
115+
}
116+
}
117+
}
118+
}
119+
}
120+
121+
return workerMap
122+
}
123+
124+
def getAgentCount(executions) {
125+
// Increase agent count every 24 worker processess, up to 3 agents maximum
126+
return Math.min(3, 1 + floor(executions/24))
127+
}
128+
129+
def trunc(str, length) {
130+
if (str.size() >= length) {
131+
return str.take(length) + "..."
132+
}
133+
134+
return str;
135+
}
136+
137+
// All of the real rounding/truncating methods are sandboxed
138+
def floor(num) {
139+
return num
140+
.toString()
141+
.split('\\.')[0]
142+
.toInteger()
143+
}

0 commit comments

Comments
 (0)