Commit graph

151 commits

Author SHA1 Message Date
Pere Urbon-Bayes
3981a2bdbc add an rspec shim to complement the old bin/logstash rspec way of running specs in logstash
simplify the rspec shim codebase

add bin/rspec to the exclude list for packaging

removed leftover

Fixes #3047
2015-04-20 15:47:47 +00:00
Colin Surprenant
9ddae56019 bin/bundle shim
use  instead for $:

exclude bin/bundle from packages

added comment
2015-04-20 17:14:27 +02:00
Pere Urbon-Bayes
6799918149 adapt the lib.sh file to the use case proposed LS_JAVA_OPTS add to defualts while JAVA_OPTS override
updated the packaged to enable JAVA_OPTS to override the defaults

ammended JAVA_OPTS being exported

ammend warning wording

ammend the last commit

fix wording again

Fixes #2942
2015-04-17 13:49:21 +00:00
Pere Urbon-Bayes
12576548c4 make the LS_JAVA_OPTS environment variable available to the client side, so the user is not force to use the default ones and they can rewrite it
remove stale code

cleanup the bash conditions for when a variable is defined or not

make sure LS_JAVA_OPTS override JAVA_OPTS when need

ammend unused var

rollback to previous use case of appending vars to JAVA_OPTS in the case of having LS_JAVA_OPTS

Fixes #2942
2015-04-17 13:49:20 +00:00
Aaron Mildenstein
945e184e67 First pass at cleaning out logstash web
All internal references, flags, kibana, vendor, everything must go!

If it referenced kibana or logstash-web, it is deprecated, and removed!

Operators are standing by...

Fixes #2661
2015-02-20 22:53:19 +00:00
Pier-Hugues Pellerin
202784281b plugins/bundler refactor
squashed 113 commits by @ph, @colinsurprenant, @jordansissel, @purbon, @jsvd

cleaning the environment.rb

initial work

remove multiples polyglot

force to load rubygems

notice

point to one config

update lock

bootstrap will package the standard application until we have the plugin manager on top of the gemfile

add the gem path to find bundler

fixing dependencies

add gemfiles and bundle

comment platform requiremments in the gemfile

Set `Gem.paths = ...` to the GEM_HOME

Without this, `bin/logstash` will error:

    LoadError: no such file to load -- bundler
         require at org/jruby/RubyKernel.java:1071
         require at C:/Users/jls/Documents/GitHub/logstash/vendor/jruby/lib/ruby/shared/rubygems/core_ext/kernel_require
.rb:55
         set_gem_paths! at C:/Users/jls/Documents/GitHub/logstash/lib/logstash/environment.rb:64
         (root) at C:\Users\jls\Documents\GitHub\logstash\lib\logstash\runner.rb:8

Patch JRuby's jar_installer.rb with a newer version

jar-dependencies is shipped by default with JRuby. However, the version
it ships with has a bug, and despite upgrading jar-dependencies to
0.1.7, which has the fix, JRuby continues to load the "shipped" version
which has a bug.

This patch will patch JRuby by copying in our own jar_installer.rb from
jar-dependencies master, This patching occurs while unpacking JRuby just
after `vendor:jruby`.

The jar_installer.rb is MIT-licensed and no changes were made.

Add `test:plugins` to test all installed plugins

Tell rspec to do the wildcards instead of trying to make the shell do it.

This fixes test runs on Windows (which doesn't do wildcards like this).
The solution was to tell RSpec to look for all files matching a certain path pattern
within the GEM_HOME.

do not run bundle install twice for test:plugins

Gemfile manipulation classes

Gemfile now in root

install POC with new Gemfile classes

specs for the Gemfile classes

header, some bug fixes

spec header

WIP pluginmanager refactor

generated format

updated .lock

unused file

removed --proxy option

fail elegantly

initial support for update

refactor invoke_bundler, debug output

removed old .lock file

no plugin Gemfile

use clamp error handling

reenable list, some cleanups

support for more finders

refactored using new finders

refactor using is_installed_plugin? and some cleanups

verify valid plugin and update all now only update plugins not all gems

support multiple plugins argument, --force option to bypass validation

list only explicitly installed plugins by default, --all option to include dependencies

support multiple plugins argument

renamed all_installed_plugins to all_installed_plugins_gem_specs and return specs, added comments

remove then

update_gem bug, comments

moved gems as development dependencies

updated .lock file

support for :without

--development option, better output feedback, cleanups

abort when no plugins

cosmetic

param fix, cleanups

removed deprecated .lock files

remove deprecated bundler_install_command and struggling with set_gem_paths

refactored all bundler stuff into LogStash::Bundler

rakelib refactor

refactored bundler code

Bundler.real_fuckin_reset

real_fuckin_reset is now reset_settings, removed unnecessary resetings, cleanups

duplicate plugins requirements merging

cleanups

added vendor:rake, cleanups

broke test tasks into 2 steps, first invoke install then test

rake task name fix

proper error exit code

Freezing the jar-dependencies, ruby-maven, tools

set gem paths on error

renamed TEST_PLUGINS to CORE_PLUGINS, added comments

replace test by core, cleanups

DRYied test tasks

missing gemspec

fixed output

correct image build for artifacts

removed deprecated Gemfiles

fix update with multiple plugins arguments

fix update with multiple plugins arguments

remove deprecated code

implicit begin, explicit block

spec for LogStash::Bundler

remove explit require of rubygems

renamed Environment.set_gem_paths! to bundler_setup!

rename Dsl to DSL

respect to_s contract and return empty string not nil

rename DSL.parse gemfile argument to gemfile_content

better error message

renamed --force to --[no-]verify

refactored exit error handling

use explicit array items in iterators

fix --development switch validation, cleaned bundler_options hash init

renamed is_xxx? methods to xxx?

use direct method call on collection

removed double negative, typo

move maven tools monkey patch into maven_tools_patch.rb

renamed build-image to prepare

fix forgotten argument name change

namespace cleanups

spec files glob pattern

cleanup

cleanup

cleanup

Fix the file-dependencies version to 0.1.5 to fix path issues on windows

monkeypatch Rubygems to silence ffi warning

list all plugin gems by default, new options

adding rake task to get faster feedback loop on windows

refactor bat scripts

Use an unreleased filedependencies gem and skip installing drupal

bump file-dependencies

use the released gem of file-dependencies

Add a set of scripts that simplify:   * The necessary setup for the CI test to be executed.   * The actuall CI test execution, having a different scripts for each     different workflow. This makes the test execution simpler and standard, so changes in internal task don't need big changes in the CI config. It also documents and makes easy for developers to run the tests.

Fixes #2640

refactored test to not depend on STDOUT

create a .rspec file to pass some options used while the code is in the testing environment

add coveralls and simplecov as a development dependencies so we can run coverage tests

remove unnecessary .bundle directory from the artifact

In a release, the .bundle/config has a BUNDLE_PATH setting that can
interfere by misleading the plugin manager into not seeing the
vendor/bundle path.

Fixes #2647

Fixes #2475
2015-02-20 17:31:44 +00:00
Jordan Sissel
231e687b00 Add bin/plugin.bat which just invokes bin/logstash plugin ...
Fixes #2287

Fixes #2451
2015-01-28 00:02:51 +00:00
Pere Urbon-Bayes
1470518c40 Make sure the vendorized jruby only have 1.9 libs, so no extra space is used. Also make sure the jruby is run in 1.9 mode.
Fixes #2285
2015-01-05 15:50:17 +00:00
wiibaa
4ff479294c allow implicit agent using directly a flag in cli
Fixes #1296
2014-12-23 12:43:20 +00:00
wiibaa
516cc36e1a Update for windows to execute rake bootstrap and bin\logstash.bat
Fixes #2085
2014-12-22 21:46:26 +00:00
Suyog Rao
5315cecd7b Use exec instead of sourcing
Fixes #2017
2014-11-05 02:45:36 +00:00
Suyog Rao
160430561b Fixed usage comments
Fixes #2017
2014-11-05 02:45:36 +00:00
Suyog Rao
b27646e03d Wrapper for bin/logstash plugin Closes #1969
Fixes #2017
2014-11-05 02:45:36 +00:00
Jordan Sissel
d4ce452a7e 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:58 +00:00
Colin Surprenant
daf22ed1e7 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:09:40 -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