Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dev_docs] How to build a kibana distributable tutorial #99827

Merged
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
93 changes: 93 additions & 0 deletions dev_docs/tutorials/building_a_kibana_distributable.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
---
id: kibDevTutorialBuildingDistributable
slug: /kibana-dev-docs/tutorial/building-distributable
title: Building a Kibana distributable
summary: Learn how to build a Kibana distributable
date: 2021-05-10
tags: ['kibana', 'onboarding', 'dev', 'tutorials', 'build', 'distributable']
---

On the course of that tutorial it will be possible to learn more about how we can create a Kibana distributable
as well as handle its different main configurations.

At any given point, you can get CLI help running the following command:

```bash
yarn build --help
```

## Prerequisites

For the general aspects of the build we only require you to use one of the following operating systems:
mistic marked this conversation as resolved.
Show resolved Hide resolved

- Linux
- macOS

In case you want to build OS Packages there are other things to have in mind. Packages are built using fpm, dpkg, rpm, and Docker.
Please make sure you have those dependencies installed using:

```bash
apt-get install ruby ruby-dev rpm dpkg build-essential
gem install fpm -v 1.5.0
```

For Docker, the installation instructions can be found at [Install Docker Engine](https://docs.docker.com/engine/install/).
jbudz marked this conversation as resolved.
Show resolved Hide resolved

> NOTE: OS Packages building has only been tested on Linux and may not be fully supported on any other platform.


## Create a simple Kibana distributable

In a great majority of the use cases where we need to build a Kibana distributable, we can live with a simple version of it.
mistic marked this conversation as resolved.
Show resolved Hide resolved
That version is quicker, easier to achieve easy and building OS Packages will be excluded.

We can do it by simply running:

```bash
yarn build --skip-os-packages
```

Note that we used `--skip-os-packages` which will skip the OS packages build.

> In case you are testing something and running that same command a couple of times, `--skip-node-download` can be used
to speed up the process by a little.

At the end of the process a Kibana distributable was created in a `target` folder created relative to your repository checkout.
The folder will look like the following:

![Target Folder Outlook With a Kibana Distributable](../assets/target_folder_with_simple_kibana_distributable.png)

## Controlling the log levels

By default, when building the distributable, the `debug` log level will be used across all the steps.
That default setting should give us a good amount of information about the tasks being done.

To turn it off you can run the build along `--no-debug` flag. At that point that information will no longer be printed out.

For a longer and verbose logging than `debug` there is other option that can be passed along the build command which is `--verbose`.

## Create a Kibana distributable and build OS Packages

If you are running a Linux OS there is also the option to create a Kibana distributable including the build of specific OS packages
like rpm, deb or docker.

As far as all the above mentioned prerequisites have been followed, you can just run:

```bash
yarn build
```

At the end you will get a Kibana distributable including a docker image and both an rpm and a deb package.

To specify a package to build you can add rpm, deb or docker-images as an argument:

```bash
yarn build --deb
yarn build --rpm
yarn build --docker-images
```

Again the distributable packages can be found in a `target` folder created relative to the repository after the build completes.
It will look something like:

![Target Folder Outlook With a Kibana Distributable And OS Packages](../assets/target_folder_with_a_kibana_distributable_and_os_packages.png)