mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 22:57:16 -04:00
correclty reset bundler, disabled multiple jobs, removed .done file stuff
Fixes #2203
This commit is contained in:
parent
c919e9143f
commit
23b614d42b
3 changed files with 34 additions and 21 deletions
|
@ -48,12 +48,12 @@ module LogStash
|
||||||
end
|
end
|
||||||
|
|
||||||
def bundler_install_command(gem_file, gem_path)
|
def bundler_install_command(gem_file, gem_path)
|
||||||
|
# for now avoid multiple jobs, ex.: --jobs 4
|
||||||
|
# it produces erratic exceptions and hangs (with Bundler 1.7.9)
|
||||||
[
|
[
|
||||||
"install",
|
"install",
|
||||||
"--gemfile=#{gem_file}",
|
"--gemfile=#{gem_file}",
|
||||||
"--clean",
|
|
||||||
"--without", "development",
|
"--without", "development",
|
||||||
"--jobs", "4",
|
|
||||||
"--path", gem_path,
|
"--path", gem_path,
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
|
|
|
@ -13,8 +13,22 @@ namespace "plugin" do
|
||||||
end # task "install"
|
end # task "install"
|
||||||
|
|
||||||
task "install-defaults" => [ "dependency:bundler" ] do
|
task "install-defaults" => [ "dependency:bundler" ] do
|
||||||
ENV["GEM_PATH"] = LogStash::Environment.logstash_gem_home
|
10.times do
|
||||||
Bundler::CLI.start(LogStash::Environment.bundler_install_command("tools/Gemfile.plugins", LogStash::Environment::BUNDLE_DIR))
|
begin
|
||||||
|
ENV["GEM_PATH"] = LogStash::Environment.logstash_gem_home
|
||||||
|
ENV["BUNDLE_PATH"] = LogStash::Environment.logstash_gem_home
|
||||||
|
ENV["BUNDLE_GEMFILE"] = "tools/Gemfile.plugins"
|
||||||
|
# Bundler::Retry.attempts = 0
|
||||||
|
Bundler.definition(true)
|
||||||
|
Bundler::CLI.start(LogStash::Environment.bundler_install_command("tools/Gemfile.plugins", LogStash::Environment::BUNDLE_DIR))
|
||||||
|
break
|
||||||
|
rescue => e
|
||||||
|
# for now catch all, looks like bundler now throws Bundler::InstallError, Errno::EBADF
|
||||||
|
puts(e.message)
|
||||||
|
puts("--> Retrying install-defaults upon exception=#{e.class}")
|
||||||
|
sleep(1)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# because --path creates a .bundle/config file and changes bundler path
|
# because --path creates a .bundle/config file and changes bundler path
|
||||||
# we need to remove this file so it doesn't influence following bundler calls
|
# we need to remove this file so it doesn't influence following bundler calls
|
||||||
|
|
|
@ -12,8 +12,6 @@ DOWNLOADS = {
|
||||||
"kafka" => { "version" => "0.8.1.1", "sha1" => "d73cc87fcb01c62fdad8171b7bb9468ac1156e75", "scala_version" => "2.9.2" },
|
"kafka" => { "version" => "0.8.1.1", "sha1" => "d73cc87fcb01c62fdad8171b7bb9468ac1156e75", "scala_version" => "2.9.2" },
|
||||||
}
|
}
|
||||||
|
|
||||||
DONEFILE = File.join(LogStash::Environment::LOGSTASH_HOME, ".install-done")
|
|
||||||
|
|
||||||
def vendor(*args)
|
def vendor(*args)
|
||||||
return File.join("vendor", *args)
|
return File.join("vendor", *args)
|
||||||
end
|
end
|
||||||
|
@ -204,11 +202,7 @@ namespace "vendor" do
|
||||||
#task "all" => "collectd"
|
#task "all" => "collectd"
|
||||||
|
|
||||||
namespace "force" do
|
namespace "force" do
|
||||||
task "delete_donefile" do
|
task "gems" => ["vendor:gems"]
|
||||||
File.delete(DONEFILE) if File.exist?(DONEFILE)
|
|
||||||
end
|
|
||||||
|
|
||||||
task "gems" => ["delete_donefile", "vendor:gems"]
|
|
||||||
end
|
end
|
||||||
|
|
||||||
task "gems" => [ "dependency:bundler" ] do
|
task "gems" => [ "dependency:bundler" ] do
|
||||||
|
@ -217,21 +211,26 @@ namespace "vendor" do
|
||||||
Rake::Task["dependency:rbx-stdlib"] if LogStash::Environment.ruby_engine == "rbx"
|
Rake::Task["dependency:rbx-stdlib"] if LogStash::Environment.ruby_engine == "rbx"
|
||||||
Rake::Task["dependency:stud"].invoke
|
Rake::Task["dependency:stud"].invoke
|
||||||
|
|
||||||
# Skip bundler if we've already done this recently.
|
10.times do
|
||||||
if File.file?(DONEFILE)
|
begin
|
||||||
age = (Time.now - File.lstat(DONEFILE).mtime)
|
ENV["GEM_PATH"] = LogStash::Environment.logstash_gem_home
|
||||||
# Skip if the donefile was last modified recently
|
ENV["BUNDLE_PATH"] = LogStash::Environment.logstash_gem_home
|
||||||
next if age < 300
|
ENV["BUNDLE_GEMFILE"] = "tools/Gemfile"
|
||||||
|
# Bundler::Retry.attempts = 0
|
||||||
|
Bundler.definition(true)
|
||||||
|
Bundler::CLI.start(LogStash::Environment.bundler_install_command("tools/Gemfile", LogStash::Environment::BUNDLE_DIR))
|
||||||
|
break
|
||||||
|
rescue => e
|
||||||
|
# for now catch all, looks like bundler now throws Bundler::InstallError, Errno::EBADF
|
||||||
|
puts(e.message)
|
||||||
|
puts("--> Retrying vendor:gems upon exception=#{e.class}")
|
||||||
|
sleep(1)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
ENV["GEM_PATH"] = LogStash::Environment.logstash_gem_home
|
|
||||||
Bundler::CLI.start(LogStash::Environment.bundler_install_command("tools/Gemfile", LogStash::Environment::BUNDLE_DIR))
|
|
||||||
|
|
||||||
# because --path creates a .bundle/config file and changes bundler path
|
# because --path creates a .bundle/config file and changes bundler path
|
||||||
# we need to remove this file so it doesn't influence following bundler calls
|
# we need to remove this file so it doesn't influence following bundler calls
|
||||||
FileUtils.rm_rf(::File.join(LogStash::Environment::LOGSTASH_HOME, "tools/.bundle"))
|
FileUtils.rm_rf(::File.join(LogStash::Environment::LOGSTASH_HOME, "tools/.bundle"))
|
||||||
|
|
||||||
File.write(DONEFILE, Time.now.to_s)
|
|
||||||
end # task gems
|
end # task gems
|
||||||
task "all" => "gems"
|
task "all" => "gems"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue