Commit graph

361 commits

Author SHA1 Message Date
github-actions[bot]
32e7a25a15
use gnu tar compatible minitar to generate tar artifact (#16432) (#16434)
Using VERSION_QUALIFIER when building the tarball distribution will fail since Ruby's TarWriter implements the older POSIX88 version of tar and paths will be longer than 100 characters.

For the long paths being used in Logstash's plugins, mainly due to nested folders from jar-dependencies, we need the tarball to follow either the 2001 ustar format or gnu tar, which is implemented by the minitar gem.

(cherry picked from commit 69f0fa54ca)

Co-authored-by: João Duarte <jsvd@users.noreply.github.com>
2024-09-09 11:35:21 +01:00
João Duarte
121b1c9632
update jruby to 9.4.8.0 (#16278)
https://www.jruby.org/2024/07/02/jruby-9-4-8-0.html

> Fixed a bug in the bytecode JIT causing patterns to execute incorrect branches. #8283, #8284
> jruby-openssl is updated to 0.15.0, with updated Bouncy Castle libraries to avoid CVEs in older versions.
> uri is updated to 0.12.2, mitigating CVE
> net-ftp is updated to 0.3.7 with restored functionality on JRuby.

Exhaustive test suite: https://buildkite.com/elastic/logstash-exhaustive-tests-pipeline/builds/580
2024-07-02 19:57:55 +01:00
João Duarte
1484614405
Wolfi-based image flavor (#16189)
* Add wolfi as an option to the build process
* Add docker acceptance tests for the wolfi image
* Change how tests are done on the java process, due to "ps -C" not being available on wolfi

replaces and closes https://github.com/elastic/logstash/pull/16116

Co-authored-by: Andres Rodriguez <andreserl@gmail.com>
2024-06-17 15:48:02 +01:00
Edmo Vamerlatti Costa
d0606ff098
Bundle logstash-integration-snmp and remove input-snmp and input-snmptrap as default (#16180)
This commit bundled the logstash-integration-snmp plugin and removed logstash-input-snmp and logstash-input-snmptrap (#16180)
2024-06-03 10:44:26 +02:00
Karen Metts
e2acb4d6bd
Add incomplete integration plugins to metadata.json as skip (#16174) 2024-05-31 11:44:58 -04:00
Karen Metts
73fb21b4ac
Update plugins-metadata.json (#16137) 2024-05-17 10:17:20 -04:00
João Duarte
96e4838e43
Fix exclusion of old ruby-maven-libs 3.3.9 jars (#16032) 2024-03-27 14:40:03 +00:00
João Duarte
59bd376360
upgrade ruby-maven-libs to 3.8.9 (#15894)
Given that JRuby comes with ruby-maven-libs 3.3.9 this commit upgrades the gem to 3.8.9 and ensures files from 3.3.9 are not included in the distribution.
2024-03-18 14:30:13 +01:00
Mashhur
dec53ba325
Imap plugin is no anymore default plugin. (#15425) 2024-03-08 07:25:46 -08:00
Mashhur
3c9db658bc
Package elastic_integration plugin. (#15769)
* Exclude plugins feature in OSS distributions.

* Set elastic_integration plugin default.

* Remove non-OSS plugins after installing default plugins.

* Testing local can't find gem bundler (= 2.3.26) issue.

* Include extract non-OSS plugins logic indocker build operations.

* Only default plugins can be excluded from OSS distros.

* Simplification: instead conditional check, use intersection to make OSS exlucluded plugin list.

* Gem and specification files still stay after removing the plugin. This change removes the stayed files.

* Rename oss-exclude to skip-oss to align namings with other params.

* Make intersection method simpler.

* [Test] Temporary excluding elastic integration plugin from default plugin list.

* Sets elastic_integration plugin default back. When removing locally installed gems, Gem::Specification doesn't recognize the gem. We have Bundle::setup in the removal logic but it is causing an issue when we re-use the bundle.

* Test the build order, remove plugin from cache logic seems invalid since we don't pack the cache.
2024-02-14 07:10:42 -08:00
kaisecheng
4e6815b1ea
add openssl to ubi image (#15929)
Logstash on ECK requires openssl command to build TLS keystore.
This commit adds `microdnf install -y openssl` to ensure the command exists in ubi image.
2024-02-09 18:40:02 +00:00
Mashhur
73c87a4151
Add elastic_integration plugin to the plugin meta list. (#15692)
* Add elastic_integration plugin non-default plugin. This will be enough to pick up it the doc generations.
2024-01-04 09:39:55 -08:00
Mashhur
7ed8d37630
Bundle plugin. (#15359) 2023-10-02 21:36:05 -07:00
Rob Bavey
fe1b1ed1da
Remove DepProxy patch, as Bundler::DepProxy is removed in Bundler 2.4.0 (#15269) 2023-08-21 15:54:01 -04:00
Andres Rodriguez
cf67cb1377
Rubocop: Enable most SpaceInside cops (#15201)
Enabled:
* SpaceInsideArrayLiteralBrackets
* SpaceInsideParens
* SpaceInsidePercentLiteralDelimiters
* SpaceInsideStringInterpolation
* Add enforced style for SpaceInsideStringInterpolation

Enabled without offenses:
* SpaceInsideArrayPercentLiteral
* Layout/SpaceInsideRangeLiteral
* Layout/SpaceInsideReferenceBrackets
2023-07-20 09:49:46 -04:00
Andres Rodriguez
2165d43e1a
Rubocop: Enable SpaceBefore cops (#15197)
Enables the following cops:

 * Layout/SpaceBeforeBlockBraces
 * Layout/SpaceBeforeBrackets
 * Layout/SpaceBeforeComma
 * Layout/SpaceBeforeComment
 * Layout/SpaceBeforeFirstArg
 * Layout/SpaceBeforeSemicolon
2023-07-18 22:32:17 -04:00
Andres Rodriguez
4255a8fd1c
Rubocop: Enable SpaceAround cops (#15196)
* Enable SpaceARoundBlockParameters
* Enable SpaceAroundEqualsInParameterDefault
* Enable SpaceAroundKeyword
* Enable SpaceAroundOperators
* Enable SpaceBeforeBlockBraces, which yields no changes
2023-07-18 21:11:57 -04:00
Andres Rodriguez
acd87a69e7
Rubocop: Enable various EmptyLine cops (#15194)
Disabled:
 * EmptyLineAfterGuardClause
 * EmptyLineAfterMultilineCondition
 * EmptyLinesAroundAccessModifier

Enabled:
 * Layout/EmptyLineAfterMagicComment
 * Layout/EmptyLineBetweenDefs
 * Layout/EmptyLines
 * Layout/EmptyLinesAroundArguments
 * Layout/EmptyLinesAroundAttributeAccessor
 * Layout/EmptyLinesAroundBeginBody
 * Layout/EmptyLinesAroundBlockBody
 * Layout/EmptyLinesAroundExceptionHandlingKeywords
 * Layout/EmptyLinesAroundMethodBody
 * Layout/EmptyLinesAroundModuleBody
2023-07-18 16:49:16 -04:00
Andres Rodriguez
1d558c35d0
Fix instances of deprecated class methods (#15183)
Replace ::File.exists? for ::File.exist?
2023-07-17 11:32:46 -04:00
Andres Rodriguez
cb19d4e88a
Add rake lint task to correct custom cods
Add a rake task that allows users to correct all the instances of a specific cop.
2023-07-14 16:48:53 -04:00
Andres Rodriguez
b63ffea472
Enable SpaceAfterColon, SpaceAfterComma, SpaceAfterSemicolon (#15180)
Enable SpaceAfterColon, SpaceAfterComma, SpaceAfterSemicolon and fix occurrences.
2023-07-14 16:46:35 -04:00
Andres Rodriguez
5e34aacc6e
Enable trailing whitespace formating (#15174)
* Enable Layout/TrailingWhitespace cop formation
* Remove Trailing Whitespaces
2023-07-14 13:22:02 -04:00
Andres Rodriguez
6154a69c15
Add basic ruby linter (#15168)
Adds rubocop as a linter for ruby.:
 - Adds .rubocop.yml which defines specific config on top of default
 - Adds Gradle task 'lint' task
 - Adds 'lint:report' rake task to report Lint Cops.
 - Adds 'lint:format' rake task to automatically format the code.
2023-07-13 17:18:10 -04:00
Andres Rodriguez
0092a82a93
Bundle ESF forwarder (#15126) 2023-07-10 18:10:52 -04:00
João Duarte
98c3d30ca8
Remove custom bundler (#15066)
* reintroduce bundler patches for bundler < 2.4
2023-06-29 08:59:54 +02:00
João Duarte
0df07d3f11
Reintroduce bundler 2.4 (#14995)
* Revert "Revert "Unpin bundler to allow 2.4 (#14894)" (#14942)"

This reverts commit 5e3038a3d3.

* prevent bundler 2.4 from blowing up memory during ./gradlew generatePluginsVersion

for some reason, instances of Bundler::Dsl are retained in
org.jruby.MetaClass. Each Bundler::Dsl will retain Bundler::SourceList
which is > 150MB. This commit sets the internal state of each Dsl's
source list so the large objects can be collected.

The proper fix would be to either reuse a single Dsl object or fix the
code upstream to avoid having Dsl objects retained by org.jruby.MetaClass.

* skip input cloudwatch during generatePluginsVersion

the new bundler 2.4's resolution algorithm seems to struggle in certain
situations, like resolving combination of "logstash-input-cloudwatch" and
"logstash-integration-aws".

Until the issue is solved let's skip it.
2023-04-12 10:11:07 +01:00
Andres Rodriguez
2f57453822
Revert partial change in c99a7b2f4 that broke packaging builds (#14955)
Fixed: #14941
2023-03-09 22:19:45 +00:00
kaisecheng
c99a7b2f46
Add env LOG_STYLE to control the log behavior (#14949)
This commit adds environment variable LOG_STYLE to control log behavior of docker container
`console` - this is the default to output to standout
`file` - log to disk.

Fixed: #14941
2023-03-08 23:25:33 +00:00
Mashhur
3875a24cda
Skip dependency Gemfile.lock during the artifact creation. (#14899)
* Skip dependency Gemfile.lock during the artifact creation. This will help vulnerability scanners not to confuse while scanning.

* Apply suggestions from code review

Add to exclude `Gemfile`, apply pattern to include shared gems as well.
2023-02-13 19:55:43 +05:00
João Duarte
fb8cfb2f1d
set rpm_digest to sha256 instead of default md5 (#14864)
this allows FIPS enabled Operating Systems to validate the RPM package
2023-02-02 15:37:57 +00:00
Andrea Selva
720996fa7c
Cover all #system invokation with exit code checking, eventually failing the execution of Rake task (#14782)
Covers all invocations of system Ruby method inside artifcts.rake script to check the exit status and eventually raise an exception.
2022-11-30 16:02:27 +01:00
Andres Rodriguez
86a18e6e3f
Exclude jruby's bundler from artifacts (#14667)
Exclude Jruby's bundler and rake from the built artifacts. The artifacts don't need to ship with such dependencies. Also, Logstash will bundle its own bundler for plugin management but it is not the one shipped with jruby.

Co-authored-by: João Duarte <jsvd@users.noreply.github.com>
2022-10-18 11:13:02 -04:00
Andrea Selva
89c45d6d80
Change deb/rpm specification to describe as replacement of noarch old Logstash packages (#14346) 2022-09-06 18:56:33 +02:00
Rob Bavey
cd60c6522a
Update tests to allow integration tests to use the bundled JDK (#14432)
* Adds tasks to add bundled JDK to tar file used to run integration tests
* Uses `RUNTIME_JAVA_HOME` environment variable to control whether bundled JDK or
  alternative is to be used
* Updates logstash service helper to respect value of `RUNTIME_JAVA_HOME`

* Requires updates to jenkins repo to set `RUNTIME_JAVA_HOME` correctly only for
  integration tests that expect to use a custom version of Java, such as the JDK
  matrix tests.
2022-08-16 09:03:52 -04:00
João Duarte
ae4a64d9ae
introduce logstash-integration-aws (#14369)
The logstash-integration-aws plugin replaces the underlying individual plugins related to AWS.

This commit also updates the necessary files around license checking.
2022-07-26 10:50:58 +01:00
Rob Bavey
422dfa7a26
Add darwin to aarch64 builds (#13425) 2022-07-22 15:55:17 -04:00
kaisecheng
dfb109843d
Support ironbank docker build (#14298)
This commit adds a rake task `rake artifact:dockerfile_ironbank` to generate ironbank docker build context for automatic release.
The output can be found in build/logstash-ironbank-$VERSION-docker-build-context.tar.gz

Co-authored-by: Rob Bavey <rob.bavey@elastic.co>
2022-06-28 10:29:55 +01:00
Rob Bavey
4a2268a43f
Update jruby version to 9.3.4.0 (#14114)
This commit updates the version of jruby used in Logstash to `9.3.4.0`.

* Updates the references of `jruby` from `9.2.20.1` to `9.3.4.0`
* Updates references/locations of ruby from `2.5.0` to `2.6.0`
* Updates java imports including `org.logstash.util` to be quoted
  * Without quoting the name of the import, the following error is observed in tests:
  * `java.lang.NoClassDefFoundError: org/logstash/Util (wrong name: org/logstash/util)`
  * Maybe an instance of https://github.com/jruby/jruby/issues/4861
* Adds a monkey patch to `require` to resolve compatibility issue between latest `jruby` and `polyglot` gem 
  * The addition of https://github.com/jruby/jruby/pull/7145 to disallow circular
causes, will throw when `polyglot` is thrown into the mix, and stop logstash from
starting and building - any gems that use an exception to determine whether or not
to load the native gem, will trigger the code added in that commit.
  * This commit adds a monkey patch of `require` to rollback the circular cause exception
back to the original cause.
* Removes the use of the deprecated `JavaClass`
* Adds additional `require time` in `generate_build_metadata`
* Rewrites a test helper to avoid potentially calling `~>` on `FalseClass`


Co-authored-by: Joao Duarte <jsvduarte@gmail.com>
Co-authored-by: João Duarte <jsvd@users.noreply.github.com>
2022-05-19 10:29:59 -04:00
Andres Rodriguez
c5ede67fc3
Removal of sys-v init.d scripts (#13922)
Removes the installation of sys-v init.d scripts from .deb and .rpms.

All supported operating systems use systemd as the init system, as such, it is no longer necessary to continue to ship Sys-v Init.d scripts.
2022-03-30 11:26:56 -04:00
João Duarte
1195b38422
fix default argument handling in rake artifact task (#13904)
Ruby allows methods to have default values in arguments if they're not
passed. However if a nil is passed then the default value isn't used.

The artifact:archives tasks were passing nil values to the exclusion
argument, causing all files to be included in the package.

This commit cleans the naming of the path lists and ensures the default
exclusion list is always used.
2022-03-18 10:46:20 +00: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
Andres Rodriguez
38fbe5aa0f
Remove pleaserun (via bin/system-install) usage (#12415)
This change removes the usage of 'pleaserun', which
was leveraged create the init.d scripts or systemd units.

Now, we ship init.d scripts and systemd units to make
the maintenance easier and following the lead of the
other Elastic projects.

Fixes: #10519, Fixes: #12439, Fixes: #8253
2022-03-10 12:11:41 -05:00
João Duarte
edfbabf2fc
speed up artifact file listing (#13862)
currently the artifact tasks compute the file listing from a list of
include regexes and exclude regexes. However this is done by hand,
taking each include regex and running it through each exclude regex.

This is quite slow as we add more exclude regexes. This PR changes to
totally relying on Rake::FileList, by feeding it the include and exclude
lists. This speeds up file listing from 150 seconds to 1 second.
2022-03-07 18:18:07 +00:00
Ry Biesemeyer
0369ba208d
artifacts: omit openssl_pkcs8_pure specs from built artifacts (#13715)
* artifacts: omit openssl_pkcs8_pure specs from built artifacts

* Exclude _all_ top-level spec and test directories from built artifacts

Co-authored-by: João Duarte <jsvd@users.noreply.github.com>

Co-authored-by: João Duarte <jsvd@users.noreply.github.com>
2022-03-04 10:55:31 -08:00
Karol Bucek
c3d2f5750f
Build: avoid doing a redundant bundle install (#13820) 2022-03-01 15:52:26 +01:00
Karol Bucek
e1da2d651d
Build: update .lock.release with rake version:set (#13477) 2022-01-20 06:49:06 +01:00
Ry Biesemeyer
5992e5713f
artifacts: exclude unused rubyzip test files from distributions (#13431) 2021-11-29 08:41:32 -08:00
Karol Bucek
09c3bf744e
Docs: keep elastic_app_search output meta-data (#13048) 2021-07-07 07:05:00 +02:00
kaisecheng
5a209ba830
Add geoip database metrics to /node/stats API (#13004)
This PR adds geoip database status, last update timestamp, download stats counter to Node Stats API
2021-06-23 17:35:15 +02:00
João Duarte
7390b64a93
update fpm to allow pkg creation on jdk11+jruby 9.2 (#13005)
* fpm to 1.13.0 which allows building packages with java 11 + jruby 9.2
* childprocess to 4.x + remove monkey patches
* clamp to 1.x to unlock fpm 1.13.0
2021-06-21 14:39:27 +01:00