-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Add distribution package formats & service definitions #3212
Conversation
My plan is to squash this into a single commit once review has completed and before merging. If you don't want me to do that, let me know. |
71def52
to
109704e
Compare
I attempted to rebase onto master, but something wild changed in how grunt tasks are defined, and I'm rather lost now. |
No worries, on the rebase stuff, but seems there's still some style issues. Can you jshint before pushing? |
I've fixed all the jshint errors except these:
Code in 59d439b makes the createPackages funciton now only receive the computed artifact prefix |
Something about |
I'm going to write an after-install script to create the Kibana user on package installation. Where should it go? |
On second thought, I may just add user creation as a feature to fpm. |
Hah, I actually thought fpm already had user creation. That would be a solid feature |
@rashidkpc +1, I'm going to add user creation to fpm and will update this PR once that's ready. |
Awesome, looking forward to it. I also referred #3334 to this ticket. It makes sense to have startup scripts outside of the packaged distribution and we should definitely share code. |
* Can add a user to a system * Can remove a user from a system Currently only Linux is targeted, but we can support others. I'd love to not reinvent what puppet/chef/etc already have, here, but the scenario is targeting packaging, and in packaging (rpm, deb, osxpkg, etc), the only real programming facility available is /bin/sh. If I were to depend on `puppet apply`, I'd surely be drowning in complaints that people don't want to require puppet just to use pleaserun. I hate computers. This work is targeting elastic/kibana#3212
Hmm, rebase gone awry? |
#1811 is labeled for 4.2.0, this one for 4.1.0. Which is it? |
@rashidkpc yeah, I think I had a rebase go very poorly. I'll work on it :P |
I started over (I did some very bad git rebasing and ended up in Oz. There were witches and lollypop guildfolk. It was scary). Still have to do the user creation, but at present (for users wishing to test and give feedback), the rpm and deb packages include sysv init scripts. Some work left to do, but this is progress. |
The goal is to be resistant to common execution failures where arguments may have spaces or odd characters that could be interepreted by the shell (which child_process.exec() runs).
This task will generate service definitions that will help run Kibana on different platforms. At this time, the following service platforms are supported: sysv init, upstart, launchd, systemd. The files are generated by the `pleaserun` program and are written to build/dist/services/[platform]/...
This uses fpm to create rpm, deb, and osx package files for Kibana. For rpm and deb, sysv init scripts are included from the `create_services` task.
@jordansissel I haven't created any dashboards, it's the whole new integrated webserver thing that makes it complex for me as kibana 3 was setup with nginx |
64bit packages are now available. Documentation will be published soon, but for now, here's how: Debian-derived systems:
On RPM-based systems:
Put the following in /etc/yum.repos.d/kibana.repo:
Then run:
Let me know if you have trouble. |
I just tested the Debian package and it's working perfectly. |
Thanks @jordansissel |
Hello @jordansissel! I've just tried to install provided debian package and found that kibana-repo:
pkgrepo.managed:
- humanname: Kibana Repository
- name: deb http://packages.elastic.co/kibana/4.1/debian stable main
- dist: stable
- file: /etc/apt/sources.list.d/kibana.list
- key_url: https://packages.elastic.co/GPG-KEY-elasticsearch
kibana:
pkg.installed:
- require_in:
- service: kibana
service.running:
- enable: True I'm using |
I've just tried to use your instructions on the fresh virtual machine and found the way I've got reported behavior: if I remove kibana package, remove |
[edited post] Tried the CentOS version (installed on a RHEL 7 box). Works so far.
|
Tested on CentOS 6.6. All worked well, but erasing the package left the directory structure in /opt behind. I'm not sure if this is intended. Thanks Jordan. |
The Debian package seems to work fine, thanks! I would appreciate a systemd unit file though(mostly because of issues with init.d scripts and config management tools), should be easy to add since it is already available. |
Thanks @jordansissel for providing the rpm repo info. Will this information be added to the download information at https://www.elastic.co/downloads/kibana soon? Also, the latest rpm in kibana4.1 repo is kibana-4.1.1-1.x86_64.rpm, whereas kibana 4.1.2 has been available from the main download page since Sep 8th. Can we expect the repo to be maintained for future versions? |
Yes it will be added soon. |
@jordansissel Please can you define "soon"? 😉 |
Agree with MikeN123, I would appreciate a systemd unit file, rather than an init.d script, for exactly the same reasons. |
cough kibana 4.2 cough 😉 |
4.2 requires es2.0, CentOS 7 has only approved es1.6.3 in yum. They don't make it easy. |
for 4.2 rpms, apply #5306 and the new command seems to be |
@jordansissel fpm fails to pick up the symlinks in build dir grunt clean build
rm -Rf build/kibana-$version-linux-x64
tar xzf target/kibana-$version-linux-x64.tar.gz -C build
grunt _build:pleaseRun _build:osPackages |
Is the 4.2 package available yet? I cant find it. We should add a repo link on the website like logstash and elasticsearch have. |
The same question for Kibana 4.3 and the real plans to implement repositories for goodness' sake. |
What is going on with this? Why are there no 4.2 or 4.3 packages available? |
$ sudo port install gnutar $ gem install pleaserun fpm $ npm install $ node_modules/.bin/grunt build $ rm -Rf build/kibana-4.3.0-linux-x64 $ tar xzf target/kibana-4.3.0-linux-x64.tar.gz -C build $ node_modules/.bin/grunt _build:pleaseRun _build:osPackages See elastic#3212 (comment)
Any movement on this? |
+bump |
1 similar comment
+bump |
(just to note some progress: Kibana 4.4.0 RPM was released yesterday) |
I wish they'd put something on https://www.elastic.co/downloads/kibana for On Wed, Feb 3, 2016 at 7:52 AM, Maciej Anczura [email protected]
|
Binary packages for Kibana are available via repositories as described in https://www.elastic.co/guide/en/kibana/current/setup.html#install, but it will be good to publish direct urls for RPM/DEB in docs and in https://www.elastic.co/downloads/kibana too. |
This is work to solve #1811
This PR adds a new grunt task
create_services
. This task generates service definitions for launchd (osx), upstart (centos 6, ubuntu), systemd (fedora, centos 7), and sysv init (lsb 3.1-flavored, almost all other linuxes).Additionally, the
create_packages
task was extended to create.rpm
and.deb
files for both 32bit and 64bit linux targets. It also adds a.pkg
for OSX users.Additionally,
grunt build
will runcreate_services
before packaging and and rpm, deb, and osx packages all include service definitions for running Kibana. The OSX package ships with a launchd configuration and the Linux packages (rpm, deb) ship with a sysv init script.The majority of the functionality is provided by fpm for packaging and by pleaserun for generating service definitions. These projects are implemented in Ruby (I think pleaserun requires Ruby 2.0.0 or newer).
Work still needing to be done:
kibana
user during package installationkibana
userIt is my intention that this solves nearly all the packaging needs for #1811.
I have littered the code with some TODO items I'd like guidance on, as well. I've never used the bluebird Promise library, so let me know if there's any style/correctness problems! :)