2017-04-17 19:30:31 -04:00
|
|
|
= Elasticsearch X-Pack
|
2015-07-14 06:49:02 -04:00
|
|
|
|
2017-04-17 19:30:31 -04:00
|
|
|
A set of Elastic's commercial plugins for Elasticsearch:
|
2015-07-14 06:49:02 -04:00
|
|
|
|
|
|
|
- License
|
2016-05-09 08:05:19 -04:00
|
|
|
- Security
|
2015-07-14 06:49:02 -04:00
|
|
|
- Watcher
|
2016-05-09 08:05:19 -04:00
|
|
|
- Monitoring
|
2017-02-20 06:16:56 -05:00
|
|
|
- Machine Learning
|
2017-04-17 19:30:31 -04:00
|
|
|
- Graph
|
2015-11-04 14:19:13 -05:00
|
|
|
|
2015-11-20 15:02:25 -05:00
|
|
|
= Setup
|
2017-04-17 19:30:31 -04:00
|
|
|
|
|
|
|
You must checkout `x-pack-elasticsearch` and `elasticsearch` with a specific directory structure. The
|
|
|
|
`elasticsearch` checkout will be used when building `x-pack-elasticsearch`. The structure is:
|
2016-12-20 13:43:32 -05:00
|
|
|
|
|
|
|
- /path/to/elastic/elasticsearch
|
2017-02-14 17:16:18 -05:00
|
|
|
- /path/to/elastic/elasticsearch-extra/x-pack-elasticsearch
|
2016-05-09 08:05:19 -04:00
|
|
|
|
2017-04-17 19:30:31 -04:00
|
|
|
== Vault Secret
|
|
|
|
|
|
|
|
The build requires a Vault Secret ID. You can use a GitHub token by following these steps:
|
|
|
|
|
|
|
|
1. Go to https://github.com/settings/tokens
|
|
|
|
2. Click *Generate new token*
|
|
|
|
3. Set permissions to `read:org`
|
|
|
|
4. Copy the token into `~/.elastic/github.token`
|
|
|
|
5. Set the token's file permissions to `600`
|
|
|
|
|
|
|
|
```
|
|
|
|
$ mkdir ~/.elastic
|
|
|
|
$ vi ~/.elastic/github.token
|
|
|
|
# Add your_token exactly as it is into the file and save it
|
|
|
|
$ chmod 600 ~/.elastic/github.token
|
|
|
|
```
|
|
|
|
|
|
|
|
If you do not create the token, then you will see something along the lines of this as the failure when trying to build X-Pack:
|
|
|
|
|
|
|
|
```
|
|
|
|
* What went wrong:
|
|
|
|
Missing ~/.elastic/github.token file or VAULT_SECRET_ID environment variable, needed to authenticate with vault for secrets
|
|
|
|
```
|
|
|
|
|
|
|
|
=== Offline Mode
|
|
|
|
|
|
|
|
When running the build in offline mode (`--offline`), it will not required to have the vault secret setup.
|
|
|
|
|
2017-02-20 06:16:56 -05:00
|
|
|
== Native Code
|
|
|
|
|
|
|
|
**This is mandatory as tests depend on it**
|
|
|
|
|
|
|
|
Machine Learning requires platform specific binaries, build from https://github.com/elastic/machine-learning-cpp via CI servers.
|
|
|
|
|
2018-02-01 21:37:01 -05:00
|
|
|
The native artifacts are stored in S3. To retrieve them infra's team Vault service is utilized, which
|
|
|
|
requires a github token. Please setup a github token as documented:
|
2017-02-20 06:16:56 -05:00
|
|
|
|
|
|
|
https://github.com/elastic/infra/blob/master/docs/vault.md#github-auth
|
|
|
|
|
2018-02-01 21:37:01 -05:00
|
|
|
The github token has to be put into ~/.elastic/github.token, while the file rights must be set to 0600.
|
2017-02-20 06:16:56 -05:00
|
|
|
|
2016-05-09 08:05:19 -04:00
|
|
|
= Build
|
|
|
|
|
|
|
|
- Run unit tests:
|
|
|
|
+
|
|
|
|
[source, txt]
|
|
|
|
-----
|
|
|
|
gradle clean test
|
|
|
|
-----
|
|
|
|
|
|
|
|
- Run all tests:
|
|
|
|
+
|
|
|
|
[source, txt]
|
|
|
|
-----
|
|
|
|
gradle clean check
|
|
|
|
-----
|
|
|
|
|
|
|
|
- Run integration tests:
|
|
|
|
+
|
|
|
|
[source, txt]
|
|
|
|
-----
|
|
|
|
gradle clean integTest
|
|
|
|
-----
|
|
|
|
|
2017-04-17 19:30:31 -04:00
|
|
|
- Package X-Pack (without running tests)
|
2016-05-09 08:05:19 -04:00
|
|
|
+
|
|
|
|
[source, txt]
|
|
|
|
-----
|
|
|
|
gradle clean assemble
|
|
|
|
-----
|
|
|
|
|
2017-04-17 19:30:31 -04:00
|
|
|
- Install X-Pack (without running tests)
|
2016-05-09 08:05:19 -04:00
|
|
|
+
|
|
|
|
[source, txt]
|
|
|
|
-----
|
|
|
|
gradle clean install
|
|
|
|
-----
|
2017-06-13 17:36:35 -04:00
|
|
|
|
|
|
|
= Building documentation
|
|
|
|
|
2018-02-01 21:37:01 -05:00
|
|
|
The source files in this repository can be included in either the X-Pack
|
|
|
|
Reference or the Elasticsearch Reference.
|
2017-06-13 17:36:35 -04:00
|
|
|
|
2018-02-01 21:37:01 -05:00
|
|
|
NOTE: In 5.4 and later, the Elasticsearch Reference includes X-Pack-specific
|
|
|
|
content that is pulled from this repo.
|
2017-06-13 17:36:35 -04:00
|
|
|
|
2018-02-01 21:37:01 -05:00
|
|
|
To build the Elasticsearch Reference on your local machine, use the `docbldes`
|
|
|
|
or `docbldesx` build commands defined in
|
|
|
|
https://github.com/elastic/docs/blob/master/doc_build_aliases.sh
|
2017-08-15 19:47:24 -04:00
|
|
|
|
2017-06-13 17:36:35 -04:00
|
|
|
== Adding Images
|
|
|
|
|
2018-02-01 21:37:01 -05:00
|
|
|
When you include an image in the documentation, specify the path relative to the
|
|
|
|
location of the asciidoc file. By convention, we put images in an `images`
|
|
|
|
subdirectory.
|
2017-06-13 17:36:35 -04:00
|
|
|
|
|
|
|
For example to insert `watcher-ui-edit-watch.png` in `watcher/limitations.asciidoc`:
|
|
|
|
|
2018-02-01 21:37:01 -05:00
|
|
|
. Add an `images` subdirectory to the watcher directory if it doesn't already exist.
|
2017-06-13 17:55:45 -04:00
|
|
|
. In `limitations.asciidoc` specify:
|
|
|
|
+
|
|
|
|
[source, txt]
|
|
|
|
-----
|
2017-06-13 17:36:35 -04:00
|
|
|
image::images/watcher-ui-edit-watch.png["Editing a watch"]
|
2017-06-13 17:55:45 -04:00
|
|
|
-----
|
2018-02-01 21:37:01 -05:00
|
|
|
|
|
|
|
Please note that image names and anchor IDs must be unique within the book, so
|
|
|
|
do not use generic identifiers.
|