Skip to content

Commit

Permalink
Merge branch 'issue-48808-react-layouts' of github.com:simianhacker/k…
Browse files Browse the repository at this point in the history
…ibana into issue-48808-react-layouts
  • Loading branch information
simianhacker committed Oct 31, 2019
2 parents f725d8a + 4ebdfbd commit 506217d
Show file tree
Hide file tree
Showing 94 changed files with 1,620 additions and 818 deletions.
38 changes: 28 additions & 10 deletions .ci/Jenkinsfile_flaky
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,28 @@ def JOB_PARTS = params.CI_GROUP.split(':')
def IS_XPACK = JOB_PARTS[0] == 'xpack'
def JOB = JOB_PARTS[1]
def CI_GROUP = JOB_PARTS.size() > 2 ? JOB_PARTS[2] : ''
def EXECUTIONS = params.NUMBER_EXECUTIONS.toInteger()
def AGENT_COUNT = getAgentCount(EXECUTIONS)

def worker = getWorkerFromParams(IS_XPACK, JOB, CI_GROUP)

def workerFailures = []

currentBuild.displayName += trunc(" ${params.GITHUB_OWNER}:${params.branch_specifier}", 24)
currentBuild.description = "${params.CI_GROUP}<br />Executions: ${params.NUMBER_EXECUTIONS}"

// Note: If you increase agent count, it will execute NUMBER_EXECUTIONS per agent. It will not divide them up amongst the agents
// e.g. NUMBER_EXECUTIONS = 25, agentCount = 4 results in 100 total executions
def agentCount = 1
currentBuild.description = "${params.CI_GROUP}<br />Agents: ${AGENT_COUNT}<br />Executions: ${params.NUMBER_EXECUTIONS}"

stage("Kibana Pipeline") {
timeout(time: 180, unit: 'MINUTES') {
timestamps {
ansiColor('xterm') {
def agents = [:]
for(def agentNumber = 1; agentNumber <= agentCount; agentNumber++) {
for(def agentNumber = 1; agentNumber <= AGENT_COUNT; agentNumber++) {
def agentNumberInside = agentNumber
def agentExecutions = floor(EXECUTIONS/AGENT_COUNT) + (agentNumber <= EXECUTIONS%AGENT_COUNT ? 1 : 0)
agents["agent-${agentNumber}"] = {
catchError {
print "Agent ${agentNumberInside} - ${agentExecutions} executions"

kibanaPipeline.withWorkers('flaky-test-runner', {
if (!IS_XPACK) {
kibanaPipeline.buildOss()
Expand All @@ -37,7 +39,7 @@ stage("Kibana Pipeline") {
} else {
kibanaPipeline.buildXpack()
}
}, getWorkerMap(agentNumber, params.NUMBER_EXECUTIONS.toInteger(), worker, workerFailures))()
}, getWorkerMap(agentNumberInside, agentExecutions, worker, workerFailures))()
}
}
}
Expand Down Expand Up @@ -77,17 +79,20 @@ def getWorkerFromParams(isXpack, job, ciGroup) {
}
}

def getWorkerMap(agentNumber, numberOfExecutions, worker, workerFailures, maxWorkers = 14) {
def getWorkerMap(agentNumber, numberOfExecutions, worker, workerFailures, maxWorkerProcesses = 12) {
def workerMap = [:]
def numberOfWorkers = Math.min(numberOfExecutions, maxWorkers)
def numberOfWorkers = Math.min(numberOfExecutions, maxWorkerProcesses)

for(def i = 1; i <= numberOfWorkers; i++) {
def workerExecutions = numberOfExecutions/numberOfWorkers + (i <= numberOfExecutions%numberOfWorkers ? 1 : 0)

workerMap["agent-${agentNumber}-worker-${i}"] = { workerNumber ->
for(def j = 0; j < workerExecutions; j++) {
print "Execute agent-${agentNumber} worker-${workerNumber}: ${j}"
withEnv(["JOB=agent-${agentNumber}-worker-${workerNumber}-${j}"]) {
withEnv([
"JOB=agent-${agentNumber}-worker-${workerNumber}-${j}",
"REMOVE_KIBANA_INSTALL_DIR=1",
]) {
catchError {
try {
worker(workerNumber)
Expand All @@ -104,10 +109,23 @@ def getWorkerMap(agentNumber, numberOfExecutions, worker, workerFailures, maxWor
return workerMap
}

def getAgentCount(executions) {
// Increase agent count every 24 worker processess, up to 3 agents maximum
return Math.min(3, 1 + floor(executions/24))
}

def trunc(str, length) {
if (str.size() >= length) {
return str.take(length) + "..."
}

return str;
}

// All of the real rounding/truncating methods are sandboxed
def floor(num) {
return num
.toString()
.split('\\.')[0]
.toInteger()
}
4 changes: 2 additions & 2 deletions .ci/jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ JOB:
- kibana-ciGroup10
- kibana-ciGroup11
- kibana-ciGroup12
# - kibana-visualRegression
- kibana-visualRegression

# make sure all x-pack-ciGroups are listed in test/scripts/jenkins_xpack_ci_group.sh
- x-pack-firefoxSmoke
Expand All @@ -28,7 +28,7 @@ JOB:
- x-pack-ciGroup8
- x-pack-ciGroup9
- x-pack-ciGroup10
# - x-pack-visualRegression
- x-pack-visualRegression

# `~` is yaml for `null`
exclude: ~
4 changes: 2 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -362,10 +362,10 @@ module.exports = {
'!src/core/server/*.test.mocks.ts',

'src/plugins/**/public/**/*',
'!src/plugins/**/public/index*',
'!src/plugins/**/public/index.{js,ts,tsx}',

'src/plugins/**/server/**/*',
'!src/plugins/**/server/index*',
'!src/plugins/**/server/index.{js,ts,tsx}',
],
allowSameFolder: true,
},
Expand Down
6 changes: 3 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ stage("Kibana Pipeline") { // This stage is just here to help the BlueOcean UI a
'oss-ciGroup11': kibanaPipeline.getOssCiGroupWorker(11),
'oss-ciGroup12': kibanaPipeline.getOssCiGroupWorker(12),
'oss-firefoxSmoke': kibanaPipeline.getPostBuildWorker('firefoxSmoke', { runbld './test/scripts/jenkins_firefox_smoke.sh' }),
// 'oss-visualRegression': kibanaPipeline.getPostBuildWorker('visualRegression', { runbld './test/scripts/jenkins_visual_regression.sh' }),
'oss-visualRegression': kibanaPipeline.getPostBuildWorker('visualRegression', { runbld './test/scripts/jenkins_visual_regression.sh' }),
]),
'kibana-xpack-agent': kibanaPipeline.withWorkers('kibana-xpack-tests', { kibanaPipeline.buildXpack() }, [
'xpack-ciGroup1': kibanaPipeline.getXpackCiGroupWorker(1),
Expand All @@ -39,12 +39,12 @@ stage("Kibana Pipeline") { // This stage is just here to help the BlueOcean UI a
'xpack-ciGroup9': kibanaPipeline.getXpackCiGroupWorker(9),
'xpack-ciGroup10': kibanaPipeline.getXpackCiGroupWorker(10),
'xpack-firefoxSmoke': kibanaPipeline.getPostBuildWorker('xpack-firefoxSmoke', { runbld './test/scripts/jenkins_xpack_firefox_smoke.sh' }),
// 'xpack-visualRegression': kibanaPipeline.getPostBuildWorker('xpack-visualRegression', { runbld './test/scripts/jenkins_xpack_visual_regression.sh' }),
'xpack-visualRegression': kibanaPipeline.getPostBuildWorker('xpack-visualRegression', { runbld './test/scripts/jenkins_xpack_visual_regression.sh' }),
]),
])
}
kibanaPipeline.sendMail()
}
}
}
}
}
39 changes: 0 additions & 39 deletions docs/canvas/canvas-expressions.asciidoc

This file was deleted.

85 changes: 69 additions & 16 deletions docs/canvas/canvas-share-workpad.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,100 @@
[[workpad-share-options]]
== Share your workpad

When you are ready to share your workpad, create a PDF, or export your workpad.
When you've finished your workpad, you can share it outside of {kib}.

[float]
[[export-single-workpad]]
=== Export workpads

Create a JSON file of your workpad that you can export outside of {kib}.

. From your workpad, click the *Share workpad* icon in the upper left corner.

. Select *Download as JSON*.
+
[role="screenshot"]
image::images/canvas-export-workpad.png[Export single workpad]

Want to export multiple workpads? Go to the *Canvas workpads* view, select the workpads you want to export, then click *Export*.

[float]
[[create-workpad-pdf]]
=== Create a PDF

To view your workpad outside of Kibana, generate a PDF.
Create a PDF copy of your workpad that you can save and share outside of {kib}.

. If you are using a Gold or Platinum license, enable reporting in your `config/kibana.yml` file.

. From your workpad, click the *Share workpad* icon in the upper left corner, then select *PDF reports*.

. Click *Generate PDF*.
. Click *Generate PDF*.
+
[role="screenshot"]
image::images/canvas-generate-pdf.gif[Generate PDF]

[float]
[[export-workpad]]
=== Export your workpad
[[create-workpad-URL]]
=== Create a POST URL

Create a POST URL that you can use to automatically generate PDF reports using Watcher or a script.

For more information, refer to <<automating-report-generation, Automating report generation>>.

. If you are using a Gold or Platinum license, enable reporting in your `config/kibana.yml` file.

. From your workpad, click the *Share workpad* icon in the upper left corner, then select *PDF reports*.

To share your workpad with another author, export it as a JSON file.
. Click *Copy POST URL*.
+
[role="screenshot"]
image::images/canvas-create-URL.gif[Create POST URL]

[float]
[[export-single-workpad]]
==== Export a single workpad
[[add-workpad-website]]
=== Share the workpad on a website

. From your workpad, click the *Share workpad* icon in the upper left corner.
beta[] Download the workpad and share it on any website, then customize the workpad behavior to autoplay the pages or hide the toolbar.

. Select *Download as JSON*.
. If you are using a Gold or Platinum license, enable reporting in your `config/kibana.yml` file.

. From your workpad, click the *Share this workpad* icon in the upper left corner, then select *Share on a website*.

. On the *Share on a website* pane, follow the instructions.

. To customize the workpad behavior to autoplay the pages or hide the toolbar, use the inline parameters.
+
To make sure that your data remains secure, the data in the JSON file is not connected to {kib}. Canvas does not display elements that manipulate the data on the workpad.
+
[role="screenshot"]
image::images/canvas-export-workpad.png[Export single workpad]
image::images/canvas-embed_workpad.gif[Share the workpad on a website]
+
NOTE: Shareable workpads encode the current state of the workpad in a JSON file. When you make changes to the workpad, the changes do not appear in the shareable workpad on your website.

[float]
[[export-multiple-workpads]]
==== Export multiple workpads
[[change-the-workpad-settings]]
=== Change the shareable workpad settings

. Go to the *Canvas workpads* page.
After you've added the workpad to your website, you can change the autoplay and toolbar settings.

. Select the workpads you want to export
[float]
[[shareable-workpad-enable-autoplay]]
==== Change the autoplay settings

. Click *Export*.
. In the lower right corner of the shareable workpad, click the settings icon.

. Click *Auto Play*, then change the settings.
+
[role="screenshot"]
image::images/canvas_share_autoplay_480.gif[Autoplay settings]

[float]
[[hide-workpad-toolbar]]
==== Change the toolbar settings

. In the lower right corner, click the settings icon.

. Click *Toolbar*, then change the settings.
+
[role="screenshot"]
image::images/canvas_share_hidetoolbar_480.gif[Hide toolbar settings]
16 changes: 8 additions & 8 deletions docs/canvas/canvas-workpad.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ To create a workpad, you can:
[[blank-canvas-workpad]]
=== Start with a blank page

To use the background colors, images, and data of your choice, start with a blank workpad.
To use the background colors, images, and data of your choice, start with a blank workpad.

. Open *Canvas*.

. On the *Canvas workpads* page, click *Create workpad*.
. On the *Canvas workpads* view, click *Create workpad*.

. Add a *Name* to your workpad.

. In the *Width* and *Height* fields, specify the size.
. In the *Width* and *Height* fields, specify the size.

. Select the layout.
. Select the layout.
+
For example, click *720p* for a traditional presentation layout.

Expand All @@ -45,7 +45,7 @@ If you're unsure about where to start, you can use one of the preconfigured temp

. Open *Canvas*.

. On the *Canvas workpads* page, select *Templates*.
. On the *Canvas workpads* view, select *Templates*.

. Click the preconfigured template that you want to use.

Expand All @@ -59,19 +59,19 @@ When you want to use a workpad that someone else has already started, import the

. Open *Canvas*.

. On the *Canvas workpads* page, click and drag the file to the *Import workpad JSON file* field.
. On the *Canvas workpads* view, click and drag the file to the *Import workpad JSON file* field.

[float]
[[sample-data-workpad]]
=== Use a sample data workpad

Each of the sample data sets comes with a Canvas workpad that you can use for your own workpad inspiration.

. Add a {kibana-ref}/add-sample-data.html[sample data set].
. Add a {kibana-ref}/add-sample-data.html[sample data set].

. On the *Add Data to Kibana* page, click the *View data* dropdown list, then select *Canvas*.
+
Need some more workpad inspiration? Check out the link:https://www.elastic.co/blog/[Elastic Blog].
Need some more workpad inspiration? Check out the link:https://www.elastic.co/blog/[Elastic Blog].

[float]
[[apply-workpad-styles]]
Expand Down
Binary file added docs/images/canvas-create-URL.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/canvas-embed_workpad.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/canvas-export-workpad.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/canvas-generate-pdf.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/canvas_share_autoplay_480.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/canvas_share_hidetoolbar_480.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 3 additions & 5 deletions docs/user/canvas.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
[partintro]
--

Canvas is a data visualization and presentation tool that sits within Kibana. With Canvas, you can pull live data directly from Elasticsearch, and combine the data with colors, images, text, and your imagination to create dynamic, multi-page, pixel-perfect displays. If you are a little bit creative, a little bit technical, and a whole lot curious, then Canvas is for you.
Canvas is a data visualization and presentation tool that sits within Kibana. With Canvas, you can pull live data directly from Elasticsearch, and combine the data with colors, images, text, and your imagination to create dynamic, multi-page, pixel-perfect displays. If you are a little bit creative, a little bit technical, and a whole lot curious, then Canvas is for you.

With Canvas, you can:

* Create and personalize your work space with backgrounds, borders, colors, fonts, and more.
* Create and personalize your work space with backgrounds, borders, colors, fonts, and more.

* Customize your workpad with your own visualizations, such as images and text.

* Customize your data by pulling it directly from Elasticsearch.
* Customize your data by pulling it directly from Elasticsearch.

* Show off your data with charts, graphs, progress monitors, and more.

Expand All @@ -37,8 +37,6 @@ include::{kib-repo-dir}/canvas/canvas-present-workpad.asciidoc[]

include::{kib-repo-dir}/canvas/canvas-share-workpad.asciidoc[]

//include::{kib-repo-dir}/canvas/canvas-expressions.asciidoc[]

include::{kib-repo-dir}/canvas/canvas-function-reference.asciidoc[]

include::{kib-repo-dir}/canvas/canvas-tinymath-functions.asciidoc[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* eslint-disable */
Loading

0 comments on commit 506217d

Please sign in to comment.