Commit graph

240 commits

Author SHA1 Message Date
Suyog Rao
a3493eae37 Fixed usage comments
Fixes #2017
2014-11-05 02:45:34 +00:00
Suyog Rao
db60396732 Wrapper for bin/logstash plugin Closes #1969
Fixes #2017
2014-11-05 02:45:34 +00:00
Jordan Sissel
920a9e9362 Refactor build tooling to use Ruby
The new way to build is using 'rake' and not 'make'.

For some some attempt at compatibility, any 'make' invocation will
invoke rake. `make foo` will invoke `rake foo`.

This is for #1640

Major changes:
* rake is used instead of make. This allows us to more easily improve,
  debug, and test the build tooling.
* The build process can be bootstrapped from any Ruby that has
  Rake available. Bootstrapping rake is automatic will download JRuby and
  re-execute itself under JRuby.
* rpm and deb packages no longer list any java as dependencies. This
  is the result of user discomfort and discussions which concluded
  that there is no good way to "depend" on Java via rpm or deb.

Internal changes:
* Vendoring paths are project-based. Each vendor directory is now
  specific as vendor/<project>/... For example, JRuby is dumped into
  vendor/jruby/...

Other changes:

* We don't use jruby-complete anymore. We now use bin/jruby as the entry point.
  This improves the startup time of Logstash on my laptop by approximately
  1.5 seconds (~25% speedup of startup time). Testing `bin/logstash
  version` speed; 5 runs each:

  * Before patch: 7.27 7.55 7.26 7.42 7.47
  * After patch: 5.54 5.97 5.67 5.58 5.54

Smaller changes:
- removed 'env' subcommand
- Remove 'deps' subcommand. Replaced by 'rake vendor:all'
- Add gem_home method for this platform's GEM_HOME
- .travis.yml removed because we haven't used Travis in a long time.
- bin/logstash exits nonzero with a useful message if JRuby can't be found.

Notes:

Invoke bundler via system() call instead of Bundler::CLI.
After some discussion in #bundler on freenode (very helpful!) on how
to do what we need to do with bundler, I was encouraged to not use the
bundler api from ruby, so system() it is.

Patch slightly modified to fit the new model of packaging (ruby instead
of shell invocation), but original author is obazoud in #1008.

Richard Pijnenburg helped with some of the code and was lovely in
helping test it.

Fixes #1640
2014-10-22 17:04:55 +00:00
Colin Surprenant
0d3df38cb9 logstash boot sequence cleanup & drip support fix
deprecated USE_JRUBY environment var
added USE_RUBY and USE_DRIP environment vars
centralized gem path handling in LogStash::Environment

use consistent discovery strategy
2014-07-13 20:02:42 -04:00
Colin Surprenant
649814b391 leftover 2014-05-03 11:45:34 -04:00
Colin Surprenant
a2373502c3 removed dependency on bash 2014-05-02 21:46:50 -04:00
Colin Surprenant
fff8fae97b refactor commands and arguments processing to allow spaces in paths 2014-04-29 17:48:46 -04:00
Jordan Sissel
c4712971ca Permit relative path or $PATH searches for the java command.
This fixes the following broken in #1189:

    % bin/logstash
    => Could not find any executable java binary. Please install java in your PATH or set JAVA_HOME.
2014-04-16 12:35:35 -07:00
Jordan Sissel
2fd8b119e5 Merge pull request #1189 from machad/master
Fix setup_java so $JAVA_HOME can be used.
2014-04-16 08:26:14 -07:00
Marc Chadwick
843797405c Handle $JAVACMD properly while still respecting $JAVA_HOME 2014-04-02 07:45:49 -04:00
lr1980
0f4aa184f0 correct copy destination to $basedir 2014-03-24 13:04:15 +01:00
Marc Chadwick
5187857b4f Fix setup_java so $JAVA_HOME can be used. 2014-03-20 12:37:00 -04:00
Jordan Sissel
83ab14983a Actually clear GEM_PATH
This helps ensure we provide only our own gem directory for rubygems.

Helps improve LOGSTASH-1918. Before this patch, my local ruby install
was accidentally providing 'rack' so I never noticed this problem.
2014-03-12 14:00:23 -07:00
Jordan Sissel
28c67bdcdc Add 'env' command
This aims to let developers run arbitrary commands with the logstash
environment setup (env vars for RUBYLIB, GEM_HOME, etc)
2014-02-27 15:51:19 -08:00
Richard Pijnenburg
375ca210ac Merge pull request #1103 from fayep/pkgbuilding
Add tarball based packages. Fix environment passing in bin/logstash.
2014-02-25 18:41:00 +00:00
Aaron Mildenstein
74b8e99712 I yield. Going with unset CDPATH. May the odd user this affects forgive me now. 2014-02-24 17:41:28 -06:00
Aaron Mildenstein
bdfe096e47 Remove path from pwd 2014-02-24 17:33:50 -06:00
Aaron Mildenstein
455cb03fa6 Fix for LOGSTASH-1920 2014-02-24 17:26:43 -06:00
Lance O'Connor
040ae9f6a2 Plugin script failed because it was trying to gzip -dc ${TARGETDIR}${FILENAME},
This was missing a / between the directory and the filename, so it was trying to
uncompress: /opt/logstash/logstash-1.4.0.beta1/vendor/logstashlogstash-contrib-1.4.0.beta1.tar.gz

Changed to uncompress ${TARGET}, which is defined as: ${TARGETDIR}/${FILENAME}
2014-02-24 23:11:06 +00:00
Faye Salwin
3537c6b847 Tarball packages. Homogenized init. Common defaults. 2014-02-24 14:21:01 -08:00
Lance O'Connor
b730a7f95d remove the exec fixing JIRA issue 1931 2014-02-24 17:58:09 +00:00
Aaron Mildenstein
3f7a83f351 Added plugin (only for contrib right now) installation script
Updated docs.
2014-02-12 18:20:41 -06:00
Jordan Sissel
9eeb701cc6 Merge pull request #989 from GregMefford/patch-2
Fix `bin\logstash.bat deps` on Windows
2014-02-03 15:59:56 -08:00
Jordan Sissel
f1183164ce Merge pull request #941 from buckett/jruby-dev
Correctly set RUBYLIB for JRuby.
2014-01-28 10:09:44 -08:00
Greg Mefford
21f6e95f21 Fix bin\logstash.bat deps on Windows and add coaching for common bootstrapping problems. 2014-01-27 22:00:13 -05:00
Jordan Sissel
3a4ce75c51 - Set RUBYLIB, GEM_HOME, GEM_PATH for running under windows
- Also pass CLI arguments appropriately
2014-01-20 11:46:43 -08:00
Jordan Sissel
3106a1eb20 Add first attempt at a logstash.bat for windows 2014-01-20 10:45:35 -08:00
Matthew Buckett
55f8488695 Correctly set RUBYLIB for JRuby. 2014-01-15 14:28:53 +00:00
Jordan Sissel
b15852521b Add support for drip.
Drip allows for faster startup time by pre-starting JVMs and keeping a
pool of them around for use on-demand. More details here:
https://github.com/flatland/drip

Tested with this config:

* 'input { generator { count => 1 } } output { null { } }'

Without drip:

    % time bin/logstash -e '...'
    13.19s user 2.94s system 170% cpu 9.458 total

With drip (install drip, then set 'JAVACMD=drip' in env):

    % time JAVACMD=drip bin/logstash -e '...'
    0.03s user 0.46s system 6% cpu 7.008 total

2.5 seconds faster (27% faster)
2014-01-03 21:30:49 -08:00
Jordan Sissel
45c7c5ca48 - remove stacksize setting; use the default 2013-12-10 17:32:44 -08:00
Jordan Sissel
b43600f823 Factor out functions into bin/logstash.lib.sh to keep bin/logstash a bit
cleaner.
2013-12-07 17:18:03 -08:00
Jordan Sissel
bd8caf9874 Use bundler.
'bundle install' when already installed should be faster than the
previous gembag. More importantly, it is also more accurate in terms of
dependencies.

Bonus points that we can do 'clean' which will purge any unknown gems
and keep our gems directory nice and tidy.

The main purpose is to speed up repetitive build invocations. Bundler's
dependency resolver is better than that of the previous gembag.rb, and
its 'clean' feature lets bundler manage the gems listing - even between
builds. This lets not have to 'rm -rf vendor' between builds on jenkins
to ensure quality testing :)

Other changes:
- Hide the Gemfile and Gemfile.lock in the 'tools' directory. This
  should hopefully prevent users from accidentally updating these files
  and thus avoiding merge conflicts later.
- Minor patch to use RbConfig::CONFIG['ruby_version'] instead of
  RUBY_VERSION. Confusing, I know. The former is the 'ruby abi' version,
  it seems, and the latter is the actual ruby implementation version.
  Example, on MRI 1.9.3, the former is 1.9.1 and latter is 1.9.3. On
  JRuby, the former is 1.9 and latter is 1.9.3. COMPUTERS. HELP.
2013-12-02 23:59:19 -08:00
Jordan Sissel
d0da38edc8 - add java flags to help improve startup time for interactive/human logstash
sessions
2013-11-15 16:26:22 -08:00
Jordan Sissel
3af5297925 - make the bin helpers simply wrap bin/logstash 2013-11-15 15:07:10 -08:00
Jordan Sissel
bfbdf9b9df Refactor to work from a git clone or from a tarball release.
This makes the default program 'agent' such that 'bin/logstash -f
something.conf' runs the agent.
2013-11-15 15:06:26 -08:00
Jordan Sissel
72f79a5f94 - generate VERSION based on some local state (logstash's declared
version, git revision if any, 'modified' flag if local modifications are
included)
- add tarball build targets
2013-11-15 14:23:47 -08:00
Aaron Mildenstein
733b2bbdb6 Update JRuby auto-installer in bin/logstash to use JRuby 1.7.5 2013-10-15 14:23:16 -05:00
Jordan Sissel
eabfbbf859 Fix syntax 2013-08-31 11:54:12 -07:00
Jordan Sissel
1012c0176e - add 'deps' command only to bin/logstash for downloading any
necessary dependencies.
2013-08-31 11:05:29 -07:00
Paul Czarkowski
3b0e66ec58 jruby version to match what's in Makefile
`Makefile` calls for `jruby` version `1.7.4`,  fixing `bin/logstash` to use the same version.
2013-06-24 09:26:48 -05:00
Jordan Sissel
95ba70d9b9 Detect ruby engine 2013-06-04 13:29:13 -07:00
Jordan Sissel
ffc030092a - make RUBYVER tunable for ruby 2.0, not that it works well yet. 2013-04-24 22:10:18 -07:00
Jordan Sissel
a9a191d620 - don't emit gem list 2013-04-23 23:44:34 -07:00
Jordan Sissel
24564c95fc - prep for rbx/mri support 2013-04-23 14:56:36 -07:00
Jordan Sissel
eab226455f jruby 1.7.3 2013-04-08 12:18:28 -07:00
Jordan Sissel
0ab564e4a3 - Add note of redis 2.6 requirement for new batch_count input setting
- Have bin/logstash fetch jruby if ruby is not found.

- note redis 2.6 requirement for new batch_count on redis input

- randomize batch size

- only build-jruby if it's not there. This avoids the 'make: Nothing to
be done for ...' message
2013-03-20 12:09:07 -07:00
Jordan Sissel
c33b9d100c - Force jruby if USE_JRUBY is set 2013-03-19 13:13:15 -07:00
Jordan Sissel
98863a67c0 - fall back to jruby if no local ruby is found 2013-03-19 12:45:38 -07:00
Jordan Sissel
eb79f504fb Fix execution when /home/jls/projects/logstash is not the root of the git repo. 2013-01-14 22:37:19 +00:00
Jordan Sissel
f0473afe3e make bin/logstash a shell script now that we don't use bundler 2012-11-06 18:01:07 -08:00