-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Bundler: freeze lockfile on run, and "normalize" platform on plugin changes #13015
Conversation
c07d595
to
ff036c6
Compare
bb6829c
to
b932c7b
Compare
b4420b9
to
97063eb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First pass:
Two things aren't clear to me:
- What is the new
--dev
flag that we are adding to the logstash process, and when does it need to be set? I see that it effectively causes bundler to not freeze the lockfile, but I don't understand when it needs to get set and why. I suspect that a more descriptive flag or an environment variable may be a more discoverable path forward, and that we should also document this as a part of the "how to develop Logstash" tutorials. - We moved around a lot of
silence_root_warning
bits, removing a default from ourinvoke!
, explicitly passing it toinvoke!
in a lot of places, and using its effective value to set anENV
variable that presumably the underlying bundler uses. Can you explain why we did what we did?
lib/bootstrap/bundler.rb
Outdated
def specific_platform | ||
::Gem.platforms.find {|plat| plat.is_a?(::Gem::Platform) && plat.os=='java' && !plat.cpu.nil?} | ||
end | ||
|
||
def genericize_platform | ||
output = LogStash::Bundler.invoke!({:add_platform => 'java', :silence_root_warning => true}) | ||
remove_platform_options = {:remove_platform => specific_platform.to_s, :silence_root_warning => true} unless specific_platform.nil? | ||
output << LogStash::Bundler.invoke!(remove_platform_options) unless remove_platform_options.nil? | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While not possible directly with our tooling as-is, it is possible to end up with a Gemfile.lock
with more than one specific platform. Since we effectively have a zero-or-more situation, I would prefer to iterate over an enumberable.
def specific_platform | |
::Gem.platforms.find {|plat| plat.is_a?(::Gem::Platform) && plat.os=='java' && !plat.cpu.nil?} | |
end | |
def genericize_platform | |
output = LogStash::Bundler.invoke!({:add_platform => 'java', :silence_root_warning => true}) | |
remove_platform_options = {:remove_platform => specific_platform.to_s, :silence_root_warning => true} unless specific_platform.nil? | |
output << LogStash::Bundler.invoke!(remove_platform_options) unless remove_platform_options.nil? | |
end | |
def specific_platforms | |
::Gem.platforms.select {|plat| plat.is_a?(::Gem::Platform) && plat.os=='java' && !plat.cpu.nil?} | |
end | |
def genericize_platform | |
output = LogStash::Bundler.invoke!({:add_platform => 'java', :silence_root_warning => true}) | |
specific_platform.each do |platform_to_remove| | |
output << LogStash::Bundler.invoke!({:remove_platform => platform_to_remove.to_s, :silence_root_warning => true}) | |
end | |
end |
@yauuie Having the concept of a I to'ed and fro'ed on the The
As far as using the
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will give more thought to the --dev
flag. I worry that a short flag that is very easy to type will lend itself to becoming overloaded or divorced from its original intent.
In my mind it is a rare feature that doesn't need to be frequently typed, and would benefit from having a longer, more-descriptive name. Maybe --enable-local-plugin-development
? When this flag is not enabled, and a user tries to use a local path
-defined plugin, can we reliably detect this and suggest adding the flag?
lib/bootstrap/bundler.rb
Outdated
@@ -91,7 +91,7 @@ def setup!(options = {}) | |||
# @option options [Array] :without Exclude gems that are part of the specified named group (default: [:development]) | |||
# @return [String, Exception] the installation captured output and any raised exception or nil if none | |||
def invoke!(options = {}) | |||
options = {:max_tries => 10, :clean => false, :install => false, :update => false, :local => false, | |||
options = {:silence_root_warning => false, :max_tries => 10, :clean => false, :install => false, :update => false, :local => false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is where your diff effectively removes the default value, since our options
becomes the result of merging the given options onto the hard-coded hash.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤦🏼 this doesn't remove a default. How did I read it that way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed the variable, so it is set across the board anyway - I don't think there is a place that seeing the bundler error would be useful or actionable for users, so I'm not sure what value not silencing it would bring
35958a2
to
fd4d669
Compare
jenkins test this please |
de845c2
to
8ac6138
Compare
@yaauie Ready for another round, I think |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The bundler changes look great.
I've left a couple comments about reducing repetition in specs by using a helper method, and noted a lack of clarity in changes to the QA matrix and supporting code.
lib/bootstrap/bundler.rb
Outdated
# to update plugins when logstash is run as a service | ||
# Note: Using an `ENV` here, as ::Bundler.settings.set_local(:silence_root_warning, true) | ||
# does not work (set_global *does*, but that seems too drastic a change) | ||
ENV["BUNDLE_SILENCE_ROOT_WARNING"] = "true" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Truly a nitpick, since we exit the process before doing anything else that will be affected by this, but it may be good to clean up after ourselves so we don't pollute the ENV for longer than we need to.
def with_env(modifications)
backup_env = ENV.to_hash
ENV.replace(backup_env.merge(modifications))
yield
ensure
ENV.replace(backup_env)
end
Which would allow us to do:
with_env("BUNDLE_SILENCE_ROOT_WARNING" => "true") do
if !debug?
# Will deal with transient network errors
execute_bundler_with_retry(options)
else
options[:verbose] = true
execute_bundler(options)
end
end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I like that. Not a fan of unintended side effects. Even if it's not a problem now, its the kind of subtle thing that can bite later
@@ -93,6 +93,11 @@ def inject(gemfile_path, lockfile_path, dependencies) | |||
|
|||
builder.eval_gemfile("bundler file", gemfile.generate()) | |||
definition = builder.to_definition(lockfile_path, {}) | |||
# Remove the specific platform, and leave the generic platform | |||
LogStash::Bundler.specific_platforms.each do |specific_platform| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 is there a reason we don't just invoke LogStash::Bundler::genericise_platform
here? Is it possible that only removing the specific platforms and not adding a generic platform could leave us with no platforms?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This particular code path is only used during the offline pack installation, and doesn't call out to the command-line bundler and the invoke!
method that the genericize_platform
uses. However, I have made a change here to call the specific_platforms
filter on the platforms returned from definition.platforms
, rather than making a call to Gem::platforms
logstash-core/locales/en.yml
Outdated
Allow Gemfile to be manipulated directly to facilitate simpler local plugin development. | ||
This is an advanced setting, intended only for use by logstash developers, and should | ||
not be used in production. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is included in command-line --help
output that doesn't play nicely with wrapping, we should reformat to keep the individual lines short (<40char).
Allow Gemfile to be manipulated directly to facilitate simpler local plugin development. | |
This is an advanced setting, intended only for use by logstash developers, and should | |
not be used in production. | |
Allow Gemfile to be manipulated directly | |
to facilitate simpler local plugin | |
development. | |
This is an advanced setting, intended | |
only for use by Logstash developers, | |
and should not be used in production. |
private static final String MUTATED_GEMFILE_ERROR = "Logstash was unable to start due to an unexpected Gemfile change.\n" + | ||
"If you are a user, this is a bug.\n" + | ||
"If you are a logstash developer, please try restarting logstash with the " + | ||
"`--enable-local-plugin-development` flag set."; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏼 for useful only-when-needed guidance
logstash.start_service | ||
Stud.try(40.times, RSpec::Expectations::ExpectationNotMetError) do | ||
expect(logstash).to be_running | ||
end | ||
logstash.stop_service |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here, we are adding a secondary validation that Logstash can start up after performing the primary task successfully.
Since we are doing it repeatedly, I think we should break this out into a helper method.
@@ -33,23 +33,39 @@ | |||
|
|||
before do | |||
logstash.run_command_in_path("bin/logstash-plugin install --no-verify --version #{previous_version} #{plugin_name}") | |||
logstash.run_command_in_path("bin/logstash-plugin list") | |||
# Logstash won't update when we have a pinned version in the gemfile so we remove them |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this comment appears to go with a line that was moved.
It is not clear to me why we need to do a gemfile replacement to un-pin, and whether that is supposed to affect the result of the have_installed
validation that is now occurring before the un-pinning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've moved the comment around.
It's a pretty hacky test. We install a named, older version of the test plugin, and do a have_installed
check to ensure the pre-condition that the plugin has installs as expected. The sed
ugliness that is done on the Gemfile is to remove the pin - bin/logstash-plugin update
will not upgrade pinned plugins (in this case a plugin that has been installed at a specific version). Whether that is desired behaviour, or whether it is something we should allow to be bypassed via a --force
option is a valid question
qa/config/platforms.json
Outdated
@@ -6,12 +6,8 @@ | |||
"centos-7": { "box": "elastic/centos-7-x86_64", "type": "redhat" }, | |||
"oel-6": { "box": "elastic/oraclelinux-6-x86_64", "type": "redhat" }, | |||
"oel-7": { "box": "elastic/oraclelinux-7-x86_64", "type": "redhat" }, | |||
"fedora-28": { "box": "elastic/fedora-28-x86_64", "type": "redhat", "experimental": true }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are these changes to drop old platforms in scope? If so, I'd like to know why. I would assume that we would merely include later versions, instead of dropping these entirely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They're not. I'll reinstate them, and bring the removal up in a separate PR, or at least spark a discussion as to whether we want to keep them - they're not run in CI right now, and I was trying to figure it if it was the cause behind test failures. (Actually hashicorp/vagrant#12265 is the cause)
Adding @karenzone for doc update review |
4c0a135
to
f73021a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm largely comfortable merging as-is. This is wide-ranging, but sensible and merely a side-effect of us hooking bundler in such a way.
I have left a few nitpicks and also have a question about needing to ensure that a generic java is in the platform list inside the "logstash injector" when we are removing the specific javas.
qa/acceptance/spec/spec_helper.rb
Outdated
Stud.try(40.times, RSpec::Expectations::ExpectationNotMetError) do | ||
yield | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This certainly works for all of the specs you have introduced in this PR, but it may prove to be a mismatch when we introduce other specs that check other things with the running service.
It may be helpful to only yield once when we know that logstash is actually running. I know this double-checks in the cases of our current use, but it also ensures that we don't retry other expectations 40x in this helper.
Stud.try(40.times, RSpec::Expectations::ExpectationNotMetError) do | |
yield | |
end | |
Stud.try(40.times, RSpec::Expectations::ExpectationNotMetError) do | |
expect(logstash).to be_running | |
end | |
yield |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your suggestion didn't quite work - expect(logstash).to be_running
doesn't work when a specific jdk_path
is used, but I've added the equivalent to the helper method
Co-authored-by: Ry Biesemeyer <[email protected]>
Co-authored-by: Ry Biesemeyer <[email protected]>
@yaauie Ready for another round, integration tests running at https://logstash-ci.elastic.co/job/elastic+logstash+master+multijob-acceptance/284/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Thanks for sticking through all the bonus review cycles ❤️
…malize" platform on plugin changes Backport PR #13015 to 7.15 branch. Original Message: This PR enables the upgrade of bundler to the latest version. Prior to this PR, the ability to do so was blocked by bundler.setup in versions of bundler > `2.23` making runtime changes to `Gemfile.lock` (unless the lock file was `frozen`) based on the specific platform the application was being run on, overriding any platforms (including generic `java` platform) set during build time. This was in conflict with changes made in #12782, which prevented the logstash user writing to files in `/usr/share/logstash`. This PR will freeze the lockfile when logstash is run, and unfreeze it when manipulating plugins (install, update, remove, install from offline pack) to allow new plugins to be added. While unfrozen, changes are also made to ensure that the platform list remains as the generic `java` platform, and not changed to the specific platform for the runtime JVM. This PR also introduces a new runtime flag, `--enable-local-plugin-development`. This flag is intended for use by Logstash developers only, and enables a mode of operation where a Gemfile can be manipulated, eg ``` gem "logstash-integration-kafka", :path => '/users/developer/code/plugins/logstash-integration-kafka' ``` to facilitate quick and simple plugin testing. This PR also sets the `silence_root_warning` flag to avoid bundler printing out alarming looking warning messages when `sudo` is used. This warning message was concerning for users - it would be printed out during normal operation of `bin/logstash-plugin install/update/remove` when run under `sudo`, which is the expected mode of operation when logstash is installed to run as a service via rpm/deb packages. This PR also updates the vagrant based integration tests to ensure that Logstash still runs after plugin update/install/remove operations, fixes up some regular expressions that would cause test failures, and removes some dead code from tests. * Updated Bundler to latest version * Ensured that `Gemfile.lock` are appropriately frozen * Added new developer-only flag to facilitate local plugin development to allow unfrozen lockfile in a development environment (cherry picked from commit 4707cb)
…d "normalize" platform on plugin changes Backport PR elastic#13015 to 7.x branch. Original Message: This PR enables the upgrade of bundler to the latest version. Prior to this PR, the ability to do so was blocked by bundler.setup in versions of bundler > `2.23` making runtime changes to `Gemfile.lock` (unless the lock file was `frozen`) based on the specific platform the application was being run on, overriding any platforms (including generic `java` platform) set during build time. This was in conflict with changes made in elastic#12782, which prevented the logstash user writing to files in `/usr/share/logstash`. This PR will freeze the lockfile when logstash is run, and unfreeze it when manipulating plugins (install, update, remove, install from offline pack) to allow new plugins to be added. While unfrozen, changes are also made to ensure that the platform list remains as the generic `java` platform, and not changed to the specific platform for the runtime JVM. This PR also introduces a new runtime flag, `--enable-local-plugin-development`. This flag is intended for use by Logstash developers only, and enables a mode of operation where a Gemfile can be manipulated, eg ``` gem "logstash-integration-kafka", :path => '/users/developer/code/plugins/logstash-integration-kafka' ``` to facilitate quick and simple plugin testing. This PR also sets the `silence_root_warning` flag to avoid bundler printing out alarming looking warning messages when `sudo` is used. This warning message was concerning for users - it would be printed out during normal operation of `bin/logstash-plugin install/update/remove` when run under `sudo`, which is the expected mode of operation when logstash is installed to run as a service via rpm/deb packages. This PR also updates the vagrant based integration tests to ensure that Logstash still runs after plugin update/install/remove operations, fixes up some regular expressions that would cause test failures, and removes some dead code from tests. * Updated Bundler to latest version * Ensured that `Gemfile.lock` are appropriately frozen * Added new developer-only flag to facilitate local plugin development to allow unfrozen lockfile in a development environment (cherry picked from commit 4707cb)
…d "normalize" platform on plugin changes Backport PR elastic#13015 to 7.x branch. Original Message: This PR enables the upgrade of bundler to the latest version. Prior to this PR, the ability to do so was blocked by bundler.setup in versions of bundler > `2.23` making runtime changes to `Gemfile.lock` (unless the lock file was `frozen`) based on the specific platform the application was being run on, overriding any platforms (including generic `java` platform) set during build time. This was in conflict with changes made in elastic#12782, which prevented the logstash user writing to files in `/usr/share/logstash`. This PR will freeze the lockfile when logstash is run, and unfreeze it when manipulating plugins (install, update, remove, install from offline pack) to allow new plugins to be added. While unfrozen, changes are also made to ensure that the platform list remains as the generic `java` platform, and not changed to the specific platform for the runtime JVM. This PR also introduces a new runtime flag, `--enable-local-plugin-development`. This flag is intended for use by Logstash developers only, and enables a mode of operation where a Gemfile can be manipulated, eg ``` gem "logstash-integration-kafka", :path => '/users/developer/code/plugins/logstash-integration-kafka' ``` to facilitate quick and simple plugin testing. This PR also sets the `silence_root_warning` flag to avoid bundler printing out alarming looking warning messages when `sudo` is used. This warning message was concerning for users - it would be printed out during normal operation of `bin/logstash-plugin install/update/remove` when run under `sudo`, which is the expected mode of operation when logstash is installed to run as a service via rpm/deb packages. This PR also updates the vagrant based integration tests to ensure that Logstash still runs after plugin update/install/remove operations, fixes up some regular expressions that would cause test failures, and removes some dead code from tests. * Updated Bundler to latest version * Ensured that `Gemfile.lock` are appropriately frozen * Added new developer-only flag to facilitate local plugin development to allow unfrozen lockfile in a development environment (cherry picked from commit 4707cb)
…nd "normalize" platform on plugin changes Backport PR elastic#13015 to 7.15 branch. Original Message: This PR enables the upgrade of bundler to the latest version. Prior to this PR, the ability to do so was blocked by bundler.setup in versions of bundler > `2.23` making runtime changes to `Gemfile.lock` (unless the lock file was `frozen`) based on the specific platform the application was being run on, overriding any platforms (including generic `java` platform) set during build time. This was in conflict with changes made in elastic#12782, which prevented the logstash user writing to files in `/usr/share/logstash`. This PR will freeze the lockfile when logstash is run, and unfreeze it when manipulating plugins (install, update, remove, install from offline pack) to allow new plugins to be added. While unfrozen, changes are also made to ensure that the platform list remains as the generic `java` platform, and not changed to the specific platform for the runtime JVM. This PR also introduces a new runtime flag, `--enable-local-plugin-development`. This flag is intended for use by Logstash developers only, and enables a mode of operation where a Gemfile can be manipulated, eg ``` gem "logstash-integration-kafka", :path => '/users/developer/code/plugins/logstash-integration-kafka' ``` to facilitate quick and simple plugin testing. This PR also sets the `silence_root_warning` flag to avoid bundler printing out alarming looking warning messages when `sudo` is used. This warning message was concerning for users - it would be printed out during normal operation of `bin/logstash-plugin install/update/remove` when run under `sudo`, which is the expected mode of operation when logstash is installed to run as a service via rpm/deb packages. This PR also updates the vagrant based integration tests to ensure that Logstash still runs after plugin update/install/remove operations, fixes up some regular expressions that would cause test failures, and removes some dead code from tests. * Updated Bundler to latest version * Ensured that `Gemfile.lock` are appropriately frozen * Added new developer-only flag to facilitate local plugin development to allow unfrozen lockfile in a development environment (cherry picked from commit 4707cb)
#13141) * Backport PR #13015 to 7.15: Bundler: freeze lockfile on run, and "normalize" platform on plugin changes Backport PR #13015 to 7.15 branch. Original Message: This PR enables the upgrade of bundler to the latest version. Prior to this PR, the ability to do so was blocked by bundler.setup in versions of bundler > `2.23` making runtime changes to `Gemfile.lock` (unless the lock file was `frozen`) based on the specific platform the application was being run on, overriding any platforms (including generic `java` platform) set during build time. This was in conflict with changes made in #12782, which prevented the logstash user writing to files in `/usr/share/logstash`. This PR will freeze the lockfile when logstash is run, and unfreeze it when manipulating plugins (install, update, remove, install from offline pack) to allow new plugins to be added. While unfrozen, changes are also made to ensure that the platform list remains as the generic `java` platform, and not changed to the specific platform for the runtime JVM. This PR also introduces a new runtime flag, `--enable-local-plugin-development`. This flag is intended for use by Logstash developers only, and enables a mode of operation where a Gemfile can be manipulated, eg ``` gem "logstash-integration-kafka", :path => '/users/developer/code/plugins/logstash-integration-kafka' ``` to facilitate quick and simple plugin testing. This PR also sets the `silence_root_warning` flag to avoid bundler printing out alarming looking warning messages when `sudo` is used. This warning message was concerning for users - it would be printed out during normal operation of `bin/logstash-plugin install/update/remove` when run under `sudo`, which is the expected mode of operation when logstash is installed to run as a service via rpm/deb packages. This PR also updates the vagrant based integration tests to ensure that Logstash still runs after plugin update/install/remove operations, fixes up some regular expressions that would cause test failures, and removes some dead code from tests. * Updated Bundler to latest version * Ensured that `Gemfile.lock` are appropriately frozen * Added new developer-only flag to facilitate local plugin development to allow unfrozen lockfile in a development environment (cherry picked from commit 4707cb) * Remove code pinning bundler to `~> 1.17` Also updates lockfile to update `BUNDLED WITH` to latest
#13140) * Backport PR #13015 to 7.x: Bundler: freeze lockfile on run, and "normalize" platform on plugin changes Backport PR #13015 to 7.x branch. Original Message: This PR enables the upgrade of bundler to the latest version. Prior to this PR, the ability to do so was blocked by bundler.setup in versions of bundler > `2.23` making runtime changes to `Gemfile.lock` (unless the lock file was `frozen`) based on the specific platform the application was being run on, overriding any platforms (including generic `java` platform) set during build time. This was in conflict with changes made in #12782, which prevented the logstash user writing to files in `/usr/share/logstash`. This PR will freeze the lockfile when logstash is run, and unfreeze it when manipulating plugins (install, update, remove, install from offline pack) to allow new plugins to be added. While unfrozen, changes are also made to ensure that the platform list remains as the generic `java` platform, and not changed to the specific platform for the runtime JVM. This PR also introduces a new runtime flag, `--enable-local-plugin-development`. This flag is intended for use by Logstash developers only, and enables a mode of operation where a Gemfile can be manipulated, eg ``` gem "logstash-integration-kafka", :path => '/users/developer/code/plugins/logstash-integration-kafka' ``` to facilitate quick and simple plugin testing. This PR also sets the `silence_root_warning` flag to avoid bundler printing out alarming looking warning messages when `sudo` is used. This warning message was concerning for users - it would be printed out during normal operation of `bin/logstash-plugin install/update/remove` when run under `sudo`, which is the expected mode of operation when logstash is installed to run as a service via rpm/deb packages. This PR also updates the vagrant based integration tests to ensure that Logstash still runs after plugin update/install/remove operations, fixes up some regular expressions that would cause test failures, and removes some dead code from tests. * Updated Bundler to latest version * Ensured that `Gemfile.lock` are appropriately frozen * Added new developer-only flag to facilitate local plugin development to allow unfrozen lockfile in a development environment (cherry picked from commit 4707cb) * Remove code pinning bundler to ~> 1.17
* master: Update releases list (elastic#13149) Bundler: freeze lockfile on run, and "normalize" platform on plugin changes (elastic#13015) Doc: Move shared region tags for breaking changes to 8.0.0 content (elastic#13131) Update Snakeyaml version to 1.29 (elastic#13129) Doc: Add breaking changes to breaking changes page (elastic#13130) Added faraday-* and ruby2_keywords notices to licences list (elastic#13126) Release notes draft for 8.0.0-alpha1 (elastic#13098) valid variable expansion for the batch files (elastic#12912) Doc: Enhance and expand DLQ docs (elastic#12959) Update releases list with 7.13.4 (elastic#13088) Doc:Fix typo and adjust keystore text (elastic#12779) doc: add pipeline.ecs_compatibility docs (elastic#12421) ecs_compatibility: revert breaking change; keep `disabled` as default for 8.0.0 (elastic#13080) Doc: Add kafka schema registry setting to troubleshooting (elastic#13073) [Test] Fix Unix acceptance tests (elastic#13071) Move retrieval of Stack version from Gradle's configuration to execution (elastic#13042) Update releases list with 6.8.17 and 7.13.3 (elastic#13041) Docs: keep elastic_app_search output meta-data (elastic#13048) Fix LS benchmarking tool to work with releases >= 7.10.0 (elastic#13052) Revert "Change Gradle's :logstash-integration-tests:integrationTests task to depends on copyES (elastic#12847)" (elastic#13045)
How can I fix this? https://discuss.elastic.co/t/fatal-error-after-updating-to-7-16-1/291959 |
@maltewhiite I've also encountered this problem. I'm using the logstash official docker and I was adding gems to the Gemfile manually which triggers the error. The tricky part was to run the embedded |
@MarcoMartins86 - Thanks a lot!! Could you explain what happens here?
|
Finally, the whole thing is just to give you the root path for the gem dir |
This PR enables the upgrade of bundler to the latest version.
Prior to this PR, the ability to do so was blocked by bundler.setup in versions of bundler >
2.23
making runtime changes toGemfile.lock
(unless the lock file wasfrozen
) based on the specific platform the application was being run on, overriding any platforms (including genericjava
platform) set during build time. This was in conflict with changes made in #12782, which prevented the logstash user writing to files in/usr/share/logstash
.This PR will freeze the lockfile when logstash is run, and unfreeze it when manipulating plugins (install, update, remove, install from offline pack) to allow new plugins to be added. While unfrozen, changes are also made to ensure that the platform list remains as the generic
java
platform, and not changed to the specific platform for the runtime JVM.This PR also introduces a new runtime flag,
--enable-local-plugin-development
. This flag is intended for use by Logstash developers only, and enables a mode of operation where a Gemfile can be manipulated, egto facilitate quick and simple plugin testing.
This PR also sets the
silence_root_warning
flag to avoid bundler printing out alarming looking warning messages whensudo
is used. This warning message was concerning for users - it would be printed out during normal operation ofbin/logstash-plugin install/update/remove
when run undersudo
, which is the expected mode of operation when logstash is installed to run as a service via rpm/deb packages.This PR also updates the vagrant based integration tests to ensure that Logstash still runs after plugin update/install/remove operations, fixes up some regular expressions that would cause test failures, and removes some dead code from tests.
Release notes
Gemfile.lock
are appropriately frozenChecklist
Author's Checklist
How to test this PR locally
The vagrant tests have been updated to include these tests for debian and rpm across multiple flavours of those distributions:
https://logstash-ci.elastic.co/job/elastic+logstash+master+multijob-acceptance/278/
Related issues
Relates: #12958, #12910, #12818.