You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In dev mode, {kib} by default runs behind a proxy which adds a random path component to its URL.
5
+
6
+
You can set this explicitly using `server.basePath` in <<settings>>.
7
+
8
+
Use the server.rewriteBasePath setting to tell {kib} if it should remove the basePath from requests it receives, and to prevent a deprecation warning at startup. This setting cannot end in a slash (/).
9
+
10
+
If you want to turn off the basepath when in development mode, start {kib} with the `--no-basepath` flag
Copy file name to clipboardexpand all lines: docs/developer/advanced/development-es-snapshots.asciidoc
+11-11
Original file line number
Diff line number
Diff line change
@@ -1,21 +1,21 @@
1
1
[[development-es-snapshots]]
2
2
=== Daily Elasticsearch Snapshots
3
3
4
-
For local development and CI, Kibana, by default, uses Elasticsearch snapshots that are built daily when running tasks that require Elasticsearch (e.g. functional tests).
4
+
For local development and CI, {kib}, by default, uses Elasticsearch snapshots that are built daily when running tasks that require Elasticsearch (e.g. functional tests).
5
5
6
6
A snapshot is just a group of tarballs, one for each supported distribution/architecture/os of Elasticsearch, and a JSON-based manifest file containing metadata about the distributions.
7
7
8
8
https://ci.kibana.dev/es-snapshots[A dashboard] is available that shows the current status and compatibility of the latest Elasticsearch snapshots.
9
9
10
10
==== Process Overview
11
11
12
-
1. Elasticsearch snapshots are built for each current tracked branch of Kibana.
12
+
1. Elasticsearch snapshots are built for each current tracked branch of {kib}.
13
13
2. Each snapshot is uploaded to a public Google Cloud Storage bucket, `kibana-ci-es-snapshots-daily`.
14
14
** At this point, the snapshot is not automatically used in CI or local development. It needs to be tested/verified first.
15
-
3. Each snapshot is tested with the latest commit of the corresponding Kibana branch, using the full CI suite.
15
+
3. Each snapshot is tested with the latest commit of the corresponding {kib} branch, using the full CI suite.
16
16
4. After CI
17
17
** If the snapshot passes, it is promoted and automatically used in CI and local development.
18
-
** If the snapshot fails, the issue must be investigated and resolved. A new incompatibility may exist between Elasticsearch and Kibana.
18
+
** If the snapshot fails, the issue must be investigated and resolved. A new incompatibility may exist between Elasticsearch and {kib}.
Currently, there is not a way to run your pull request with the latest unverified snapshot without a code change. You can, however, do it with a small code change.
41
41
42
-
1. Edit `Jenkinsfile` in the root of the Kibana repo
42
+
1. Edit `Jenkinsfile` in the root of the {kib} repo
43
43
2. Add `env.KBN_ES_SNAPSHOT_USE_UNVERIFIED = 'true'` at the top of the file.
44
44
3. Commit the change
45
45
@@ -75,13 +75,13 @@ The file structure for this bucket looks like this:
75
75
76
76
==== How snapshots are built, tested, and promoted
77
77
78
-
Each day, a https://kibana-ci.elastic.co/job/elasticsearch+snapshots+trigger/[Jenkins job] runs that triggers Elasticsearch builds for each currently tracked branch/version. This job is automatically updated with the correct branches whenever we release new versions of Kibana.
78
+
Each day, a https://kibana-ci.elastic.co/job/elasticsearch+snapshots+trigger/[Jenkins job] runs that triggers Elasticsearch builds for each currently tracked branch/version. This job is automatically updated with the correct branches whenever we release new versions of {kib}.
79
79
80
80
===== Build
81
81
82
82
https://kibana-ci.elastic.co/job/elasticsearch+snapshots+build/[This Jenkins job] builds the Elasticsearch snapshots and uploads them to GCS.
83
83
84
-
The Jenkins job pipeline definition is https://github.com/elastic/kibana/blob/master/.ci/es-snapshots/Jenkinsfile_build_es[in the kibana repo].
84
+
The Jenkins job pipeline definition is https://github.com/elastic/kibana/blob/master/.ci/es-snapshots/Jenkinsfile_build_es[in the {kib} repo].
85
85
86
86
1. Checkout Elasticsearch repo for the given branch/version.
87
87
2. Run `./gradlew -p distribution/archives assemble --parallel` to create all of the Elasticsearch distributions.
@@ -91,15 +91,15 @@ The Jenkins job pipeline definition is https://github.com/elastic/kibana/blob/ma
91
91
** e.g. `<version>/archives/<unique id>`
92
92
6. Replace `<version>/manifest-latest.json` in GCS with this newest manifest.
93
93
** This allows the `KBN_ES_SNAPSHOT_USE_UNVERIFIED` flag to work.
94
-
7. Trigger the verification job, to run the full Kibana CI test suite with this snapshot.
94
+
7. Trigger the verification job, to run the full {kib} CI test suite with this snapshot.
95
95
96
96
===== Verification and Promotion
97
97
98
-
https://kibana-ci.elastic.co/job/elasticsearch+snapshots+verify/[This Jenkins job] tests the latest Elasticsearch snapshot with the full Kibana CI pipeline, and promotes if it there are no test failures.
98
+
https://kibana-ci.elastic.co/job/elasticsearch+snapshots+verify/[This Jenkins job] tests the latest Elasticsearch snapshot with the full {kib} CI pipeline, and promotes if it there are no test failures.
99
99
100
-
The Jenkins job pipeline definition is https://github.com/elastic/kibana/blob/master/.ci/es-snapshots/Jenkinsfile_verify_es[in the kibana repo].
100
+
The Jenkins job pipeline definition is https://github.com/elastic/kibana/blob/master/.ci/es-snapshots/Jenkinsfile_verify_es[in the {kib} repo].
101
101
102
-
1. Checkout Kibana and set up CI environment as normal.
102
+
1. Checkout {kib} and set up CI environment as normal.
103
103
2. Set the `ES_SNAPSHOT_MANIFEST` env var to point to the latest snapshot manifest.
104
104
3. Run CI (functional tests, integration tests, etc).
There are many ways to run Elasticsearch while you are developing.
5
+
6
+
[float]
7
+
8
+
==== By snapshot
9
+
10
+
This will run a snapshot of elasticsearch that is usually built nightly. Read more about <<development-es-snapshots>>.
11
+
12
+
[source,bash]
13
+
----
14
+
yarn es snapshot
15
+
----
16
+
17
+
See all available options, like how to specify a specific license, with the `--help` flag.
18
+
19
+
[source,bash]
20
+
----
21
+
yarn es snapshot --help
22
+
----
23
+
24
+
`trial` will give you access to all capabilities.
25
+
26
+
**Keeping data between snapshots**
27
+
28
+
If you want to keep the data inside your Elasticsearch between usages of this command, you should use the following command, to keep your data folder outside the downloaded snapshot folder:
29
+
30
+
[source,bash]
31
+
----
32
+
yarn es snapshot -E path.data=../data
33
+
----
34
+
35
+
==== By source
36
+
37
+
If you have the Elasticsearch repo checked out locally and wish to run against that, use `source`. By default, it will reference an elasticsearch checkout which is a sibling to the {kib} directory named elasticsearch. If you wish to use a checkout in another location you can provide that by supplying --source-path
38
+
39
+
[source,bash]
40
+
----
41
+
yarn es source
42
+
----
43
+
44
+
==== From an archive
45
+
46
+
Use this if you already have a distributable. For released versions, one can be obtained on the Elasticsearch downloads page.
47
+
48
+
[source,bash]
49
+
----
50
+
yarn es archive <full_path_to_archive>
51
+
----
52
+
53
+
Each of these will run Elasticsearch with a basic license. Additional options are available, pass --help for more information.
54
+
55
+
==== From a remote host
56
+
57
+
You can save some system resources, and the effort of generating sample data, if you have a remote Elasticsearch cluster to connect to. (Elasticians: you do! Check with your team about where to find credentials)
58
+
59
+
You'll need to create a kibana.dev.yml (<<customize-kibana-yml>>) and add the following to it:
60
+
61
+
[source,bash]
62
+
----
63
+
elasticsearch.hosts:
64
+
- {{ url }}
65
+
elasticsearch.username: {{ username }}
66
+
elasticsearch.password: {{ password }}
67
+
elasticsearch.ssl.verificationMode: none
68
+
----
69
+
70
+
If many other users will be interacting with your remote cluster, you'll want to add the following to avoid causing conflicts:
`Add Data` in the {kib} Home application contains tutorials for setting up data flows in the Elastic stack.
5
+
6
+
Each tutorial contains three sets of instructions:
7
+
8
+
* `On Premise.` Set up a data flow when both {kib} and Elasticsearch are running on premise.
9
+
* `On Premise Elastic Cloud.` Set up a data flow when {kib} is running on premise and Elasticsearch is running on Elastic Cloud.
10
+
* `Elastic Cloud.` Set up a data flow when both {kib} and Elasticsearch are running on Elastic Cloud.
11
+
12
+
[float]
13
+
==== Creating a new tutorial
14
+
1. Create a new directory in the link:https://github.com/elastic/kibana/tree/master/src/plugins/home/server/tutorials[tutorials directory].
15
+
2. In the new directory, create a file called `index.ts` that exports a function.
16
+
The function must return a function object that conforms to the `TutorialSchema` interface link:{kib-repo}tree/{branch}/src/plugins/home/server/services/tutorials/lib/tutorial_schema.ts[tutorial schema].
17
+
3. Register the tutorial in link:{kib-repo}tree/{branch}/src/plugins/home/server/tutorials/register.ts[register.ts] by adding it to the `builtInTutorials`.
18
+
// TODO update path once assets are migrated
19
+
4. Add image assets to the link:{kib-repo}tree/{branch}/src/legacy/core_plugins/kibana/public/home/tutorial_resources[tutorial_resources directory].
20
+
5. Run {kib} locally to preview the tutorial.
21
+
6. Create a PR and go through the review process to get the changes approved.
22
+
23
+
If you are creating a new plugin and the tutorial is only related to that plugin, you can also place the `TutorialSchema` object into your plugin folder. Add `home` to the `requiredPlugins` list in your `kibana.json` file.
24
+
Then register the tutorial object by calling `home.tutorials.registerTutorial(tutorialObject)` in the `setup` lifecycle of your server plugin.
25
+
26
+
[float]
27
+
===== Variables
28
+
String values can contain variables that are substituted when rendered. Variables are specified by `{}`.
29
+
For example: `{config.docs.version}` is rendered as `6.2` when running the tutorial in {kib} 6.2.
{kib} developer services and apis are in a state of constant development. We cannot provide backwards compatibility at this time due to the high rate of change.
7
+
==============================================
8
+
9
+
Our developer services are changing all the time. One of the best ways to discover and learn about them is to read the available
10
+
READMEs from all the plugins inside our {kib-repo}tree/{branch}/src/plugins[open source plugins folder] and our
A few services also automatically generate api documentation which can be browsed inside the {kib-repo}tree/{branch}/docs/development[docs/development section of our repo]
0 commit comments