Commit graph

24 commits

Author SHA1 Message Date
Andrea Selva
6bbe0700da
Retrive JVM_VERSION from Logstash's home directory (#14797)
Updates bootscripts common part to retrieve the JVM_VERSION file from the Logstash home directory
2023-01-12 13:56:51 +01:00
Rob Bavey
59c5374849
Fix windows scripts to also pull settings from JvmOptionsParser (#14355)
* Fix windows scripts to also pull settings from JvmOptionsParser

Prior to this commit, the windows version of the keystore and plugin scripts
diverged from the bash version of these scripts, as they did not pick up Jvm Options
from the JvmOptionsParser, leading to certain mandatory settings not being picked up,
breaking compatibility with Windows on certain versions of the JDK. This PR ensures
that these scripts also use the JvmOptionsParser.

This does not resolve the issue described in #14176, which will be looked at in a future
PR

Relates: #14354

* Add goto :eof as per code review suggestion
2022-07-18 09:03:40 -04:00
Andrea Selva
fbcbb7084f
Print bundled jdk's version in launch scripts when LS_JAVA_HOME is provided (#13880)
Extracts the bundled JDK's version into a one-line text file which could easily read and print from bash/batch scripts.
Updates Logstash's bash/batch launcher scripts to print the bundled JDK version when warn the user about his override.

Updates the rake script used to create Logstash artifacts (rakelib/artifacts.rake) to include JDK related stuff only if packages that requires it.
2022-03-18 08:59:30 +01:00
Andrea Selva
a8bd90c22d
Quotes java executable path in case it contains spaces (#13881)
Updates all Windows batch scripts used as CLI tools to quotes the %JAVACMD% to avoid path problems when the path contains spaces.
2022-03-14 18:17:38 +01:00
Andrea Selva
0084492494
Fix Logstash cli tools to use the selected JDK under Windows (#13839)
Some Logstash tools invokes directly the JRuby intepreter. The interpreter uses the JVM pointed by two environment variables:
- JAVACMD
- JAVA_HOME\bin\java.exe

The setup.bat script exported the selected JVM under the env var named JAVA, which isn't recognized by vendored jruby.
This commit fixes it renaming to JAVACMD.
2022-03-07 15:05:52 +01:00
Andrea Selva
d51afe54d5
Removed JAVA_HOME using only LS_JAVA_HOME (#13214)
Removes the usage of JAVA_HOME completely which is not anymore used for JDK path resolution.

Updated all the Logstash launching scripts to use only LS_JAVA_HOME as environment variable to
determine the JDK to use to launch Logstash. JAVA_HOME is abandoned for this job.
2021-09-15 09:29:07 +02:00
Andrea Selva
3ffdb99119
Deprecate JAVA_HOME preferring LS_JAVA_HOME (#13207)
Adds print of deprecation notices on stdout when Logstash is starting with JAVA_HOME instead of LS_JAVA_HOME
2021-09-08 11:06:53 +02:00
Andrea Selva
979ea21c5e
Introduce LS_JAVA_HOME environment variable (#13204)
This commit modifies the launch scripts to take care of the LS_JAVA_HOME giving precedence over the JAVA_HOME, which is still used it the first is not found.
2021-09-06 10:22:51 +02:00
Rob Bavey
5c7d5ac8c0 Bundle JDK (AdoptOpenJDK 11) in Logstash artifacts (x86_64)
Create new artifacts with bundled JDK for the supported platforms on x86_64. Download JDK packages from AdoptOpenJDK site, the selected version is loaded from `versions.yml`.
Changed also the launch scripts to give precedence to JAVA_HOME, then fallback on bundled JDK if present, as last resource go to the system Java.

New artifacts produced with bundled JDK are:
- tar.gz with JDK for Linux and Darwin
- zip file for Windows
- dep and rpm
- Docker image

All artifacts without JDK are now postfixed with '-no-jdk' while the ones with JDK included has the architecture extension.

Covered with tests the touched parts

Co-authored-by: Rob Bavey <robbavey@users.noreply.github.com>
2020-09-23 08:18:31 -07:00
Colin Surprenant
67c12393ac correctly handle paths with spaces 2018-01-11 13:28:15 -05:00
Colin Surprenant
e9a8812317 reword windows launch script
fixes

fix jvm.options parsing

windows compatible URI
2017-09-14 16:24:34 -04:00
Bernd
ec87eb7642 removed unreachable code (#5215) 2017-05-19 11:32:24 -07:00
manni19682
933c936917 Search java executable in %PATH%
Fixes #6860
2017-03-31 14:00:41 -04:00
Gérald QUINTANA
2bb69743e6 Fix Heap Dump Path on Windows
Fixes #6336
2016-12-01 23:20:38 -05:00
Bernd
65b1f991b0 Support ( in path and actually set JAVA_OPTS
The current logic for printing %JAVA_HOME% inside if ( ) block failes if the path contains a `(` which is the case for 32bit java (`C:\Program Files (x86)\java\jdk`)

The current logic for appending to JAVA_OPTS does not work as it will be expanded while interpreting the else block. Use goto instead.

Fixes #5214
2016-05-06 16:52:36 +00:00
Stefan Scherer
a91bf9c40b Use JAVA_EXE as variable for symlink
Signed-off-by: Stefan Scherer <scherer_stefan@icloud.com>

Fixes #4913
2016-04-21 19:46:05 +00:00
Stefan Scherer
25386c488c Show JAVA_HOME retrieved from symlink
Signed-off-by: Stefan Scherer <scherer_stefan@icloud.com>

Fixes #4913
2016-04-21 19:46:04 +00:00
Stefan Scherer
4830399de0 Retrieve JAVA_HOME from windows symlink
Signed-off-by: Stefan Scherer <scherer_stefan@icloud.com>

Fixes #4913
2016-04-21 19:46:04 +00:00
Todd Bowles
62ab6f0e40 Improved the way in which JAVA_OPTS and LS_JAVA_OPTS work on windows by making it consistent with the way in which they are handled in Linux
Fixes #4758
2016-03-11 20:27:29 +00:00
Suyog Rao
ba88ff7d78 Uncomment heapdump location
Fixes #4205
2015-11-17 15:53:41 +00:00
Suyog Rao
d124558d79 Fix heapdump path for Windows
Fixes #4205
2015-11-17 15:53:41 +00:00
Pier-Hugues Pellerin
1045ec8602 Change how we set the max heap size
This PR change the name of the variable to set to change the maximum
heap size on window to `LS_HEAP_SIZE` this replace the LS_MIN_MEM and
LS_MAX_MEM option.

Also We change the default size of the heap from 500m to 1g

Fixes #4085
2015-10-30 19:50:51 +00:00
Manus Freedom
456c726890 Fix path with space
Fixes #3372
2015-06-10 06:15:52 +00:00
Pier-Hugues Pellerin
9e7d6204a5 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:43 +00:00