Commit graph

360 commits

Author SHA1 Message Date
Andrea Selva
3eaff3612d
Fix acceptance test when run artifact:all (#12975)
This commit avoid to check for existence of jar files to decide if run or not Gradle assemble,
basically because the outputs of assemble task are not only jars but also others files, for example plugin-aliases.yml.
In this way the decision to execute or not is left the Gradle logic.
2021-06-10 10:31:39 +02:00
Andrea Selva
8e62e8a01c
Fix dependency on plugin_alias.yml during rake artifacts:all (#12962)
The module LogStash::PluginManager requires the file `lib/pluginmanager/plugin_aliases.yml` is created,
which happend during the Gradle's 'copyPluginAlias' executed as part of Rake's 'bootstrap'.
2021-06-04 12:37:56 +02:00
Rob Bavey
a935261eeb
Add logstash-integration-elastic_enterprise_search to plugins-metadata.json (#12925)
* Add logstash-integration-elastic_enterprise_search to plugins-metadata.json
* Remove old elastic_app_search plugin and set integration as default
* Add license information for workplace search gem
2021-05-25 17:37:39 -04:00
Karol Bucek
cc615da80c
Build: avoid leaking memory from generate_plugins_version (#12763) 2021-03-24 17:58:14 +01:00
kaisecheng
54b370ea48
Geoip database service (#12675)
geoip database service in xpack
dependency update and license note

Fixed: #12560
2021-02-18 14:18:28 +01:00
Rob Bavey
5ee83e8cc7
Fix docker image metadata (#12447)
This commit fixes two issues with the docker metadata:

Removes non-OCI compliant freeform metadata labels
Uses a consistent build date for all the docker images and dockerfiles

Additionally, this commit adds a `build_docker_ubi8` rake task to enable
`ci/docker_acceptance_tests.sh` to run with no options to build all
docker images for the architecture.
2020-11-18 12:29:37 -05:00
andsel
c9309675a9 Bundle JDK (AdoptOpenJDK 11) in Logstash artifacts (ARM64)
Changed Linux creation artifacts (tar.gz/deb/rpm) to include the ARM JDK.
Extracted common parts of artifact.rake into functions to be shared between ARM and Intel bundling tasks
2020-09-30 00:24:13 -07: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
Rob Bavey
1c675aa74b Add UBI8 docker image to artifacts
This commit adds the rake docker_ubi8 rake task, and associated
changes to the docker template and makefiles.

This commit also refactors the acceptance tests to extract xpack tests
into a helper class to allow the same tests to be used in both 'full'
and 'ubi8' docker image tests
2020-08-20 07:35:49 -07:00
Rob Bavey
2d1e6d968f
Introduce integration tests for docker images (#12135)
* Introduce integration tests for docker

This commit adds integration tests for the Logstash docker images. Previous
integration tests were removed in https://github.com/elastic/logstash/pull/10693,
due to the tests being non functional.

The commit adds image and container tests. The image tests check the contents and the
metadata of the image; the container tests check the logstash process, and includes tests
ensuring that logstash runs, and is configurable.

This test also adds a ci script to allow the tests to be run on jenkins, and to split the
running of these tests up based on the image type and includes updates to the rake tasks to
support this.
2020-07-31 14:34:40 -04:00
Joao Duarte
34f7151411 remove uses of JSON.load in favor or JSON.parse
JSON.load allows the creation of complex objects, and should not
be given untrusted input. This commit changes the only three uses
of JSON.load in the codebase, which aren't user facing or present
in bundled product, so not really an attact vector.
2020-06-12 07:48:05 -07:00
João Duarte
7df8a660ef
Drop dependency:bundler task (#12017)
This is already accomplished by the gradle task "installBundler".

Also make bundler 2 install more generic to not be stuck with 2.1.4
2020-06-12 14:25:15 +01:00
João Duarte
d8b50deff3
update bundler to 2.x (#11994) 2020-06-12 10:17:02 +01:00
João Duarte
e9c9865f40
Add apache and elastic license headers to source code files (#11673)
* add license header to ruby and java files
* add license header to erb and rake files
* add license headers to gradle files
2020-03-11 11:53:38 +00:00
Rob Bavey
5c4d35343a Removes UBI7 docker code
Removal of code (#11335) to generate UBI7 based docker images, as this is not
being used for now

Fixes #11489
2020-01-14 14:04:54 +00:00
Rob Bavey
a6369bce50 Replace references to JDBC plugins with integration plugins
Fixes #11406
2020-01-10 19:07:54 +00:00
Joao Duarte
e48e06d31a setup jruby and bundler/rake before artifact rake tasks
Fixes #11392
2019-12-04 19:36:24 +00:00
Rob Bavey
830e49a159 Add UBI based docker images
This commit adds support for images based on UBI7 base image

Closes #11265

Fixes #11335
2019-12-03 13:51:49 +00:00
Joao Duarte
d65f78728b stop installing rake and json on every bootstrap
Fixes #11102
2019-12-02 14:59:43 +00:00
Ry Biesemeyer
4c8370b329 Integration plugin docs support (#11315)
* docgen: no-op refactor bringing plugin types list out of regexp

* docgen: add integration plugins for plugin discovery
2019-11-19 09:30:05 +00:00
Ry Biesemeyer
f6fa136b84 plugins: replace kafka input/output with integration
Fixes #11218
2019-10-16 01:46:49 +00:00
Ry Biesemeyer
984ecf6a9f plugins: replace rabbitmq input/output with integration
Fixes #11218
2019-10-16 01:46:49 +00:00
Ry Biesemeyer
8f471e3f68 add tasks for generating config parsers
Fixes #11195
2019-10-15 16:54:48 +00:00
Joao Duarte
a3e7e9f315 handling missing gems during generatePluginsVersion
Fixes #11207
2019-10-10 13:28:17 +00:00
João Duarte
15fb30823f
Cleanup gradle tasks and dependency installation (#10942)
- have `bootstrap` task do as little as possible: install gems in Gemfile.template that don't belong to groups
- have test tasks depend on the `installTestGems` task instead of `bootstrap`
- logstash es output is now a dependency because of license checking
- fix out of memory problem in SharedHelpers.trap

Also use release lockfile during installDefaultGems

The release lockfile is only copied to Gemfile.lock if
it doesn't exist. During the `installDefaultGems` task other
plugin installation tasks already occurred, generating a lock file.

This commit removes it before running the plugin installation.
2019-07-12 09:11:07 +01:00
Colin Surprenant
0c8585796d
logstash-input-twitter as a default plugin (#10934) 2019-07-11 13:01:25 -04:00
Karen Metts
35d91ccbde Add java example plugins to skiplist
Fixes #10921
2019-06-28 16:15:15 +00:00
Joao Duarte
e8d553addf remove gcs output from skip list
Fixes #10919
2019-06-27 11:17:22 +00:00
Rob Bavey
b8dd1ac64c Add Logstash JMS input to the list of default plugins
Fixes #10865
2019-06-17 18:50:21 +00:00
Joao Duarte
f22b835ab6 name rpm/deb oss packages as logstash-oss
Fixes #10833
2019-05-29 14:25:21 +00:00
Joao Duarte
c54f451c1e fix plugin doc version generation with default plugins
now that default plugins are read only from the json metadata file and
not from the lock file, the plugin version manifesto needs to be adapted
so the status of "default" plugin is read from the json file.

Fixes #10824
2019-05-27 19:43:46 +00:00
Joao Duarte
64732b81ca allow skipping docker artifacts during artifact:all
Fixes #10823
2019-05-27 13:57:07 +00:00
Joao Duarte
75725e1a51 generate tarballs for docker images
Fixes #10819
2019-05-24 15:09:26 +00:00
Joao Duarte
088ece441a
rake task to generate dockerfile
* dont include docker tasks in artifact:all
* don't rebuild tar/zip if source hasn't changed
* allow SKIP_PREPARE to avoid tar creation if no modifications
* don't need a tarball to generate the dockerfile
* remove docker tests as they weren't working anymore

This commit adds a task to produce all necessary files to generate a docker image.

```
% RELEASE=1 rake artifact:dockerfile
....
Dockerfile created in /tmp/elastic/logstash/build/docker
% tree /tmp/elastic/logstash/build/docker
/tmp/elastic/logstash/build/docker
├── Dockerfile
├── bin
│   └── docker-entrypoint
├── config
│   ├── log4j2.properties
│   ├── logstash-full.yml
│   └── pipelines.yml
├── env2yaml
│   └── env2yaml
└── pipeline
    └── default.conf
% docker build --rm .
.....
Step 19/20 : LABEL org.label-schema.schema-version="1.0"   org.label-schema.vendor="Elastic"   org.label-schema.name="logstash"   org.label-schema.version="7.0.0"   org.label-schema.url="https://www.elastic.co/products/logstash"   org.label-schema.vcs-url="https://github.com/elastic/logstash" license="Elastic License"
 ---> Using cache
 ---> f622d7555220
Step 20/20 : ENTRYPOINT ["/usr/local/bin/docker-entrypoint"]
 ---> Using cache
 ---> b6feba7f4934
Successfully built b6feba7f4934
```

This task works only for releases (not snapshots).

This commit also adds a few tweaks to the artifacts building:

Using `SKIP_PREPARE=1` in `rake artifact:tar` or `rake artifact:tar_oss` will make a check to not rebuild the tarball if there are no code modifications.

These two changes are made since docker image build is new and we want to keep it out of artifact:all for a while. And if we're running these separately, we want to ensure the tarball built is used in the docker image (versus building a new one for each `rake artifact:tar` )

This means that, to generate all artifacts including docker images and dockerfile, it's necessary to run:

```
RELEASE=1 rake artifact:all
SKIP_PREPARE=1 RELEASE=1 rake artifact:docker
SKIP_PREPARE=1 RELEASE=1 rake artifact:docker_oss
RELEASE=1 rake artifact:dockerfile
```
2019-04-22 22:53:40 +01:00
Joao Duarte
2a40099718 updated bundler to 1.17.3
Fixes #10685
2019-04-12 21:07:54 +00:00
Joao Duarte
28afe59c23 disable docker img generation on artifact:all
Fixes #10647
2019-04-04 15:19:26 +00:00
João Duarte
dc5db673ee
build docker images from logstash repo (#10603)
introduces two rake tasks: `rake artifact:docker_oss` and `rake artifact:docker`, which will create the docker images of the OSS and non OSS packages. These tasks depend on the tar artifacts being built.

Also `rake artifact:all` has been modified to also call these two tasks.

most code was moved from https://github.com/elastic/logstash-docker/
2019-04-04 11:27:06 +01:00
Joao Duarte
0e115d31a6 cleanup many rakelib tasks that aren't used anymore
* simplify the plugins-metadata.json file
* sort and update the plugin list in the rakelib/plugins-metadata.json
* remove dependency on twitter input for testing
* sorted Gemfile.template (grouped by group)
* remove default plugins from Gemfile.template

Fixes #10509
2019-03-15 16:26:58 +00:00
Joao Duarte
2910faa57f fix building of deb and rpm
fpm requires json 1.x but the artifact rake tasks
will activate the default gem json 2

This PR ensures json 1 is activated early and is present right after
jruby is bootstrapped.

Also downgrades fpm to 1.3 as 1.11.0 wasn't building correctly

Downgrades .ruby-version to a version we have available in CI

Fixes #10396
2019-02-06 09:39:55 +00:00
Ry Biesemeyer
583ec6b625
Java 11 support (#10279)
* bump jruby to 9.2

* don't rely on logstash-base docker image

* work around webmock ruby 2.5 support

* ensure data folder exists in docker

* change fixnum and bignum to integer

* FileUtils.rmdir to rm_rf

this is because from 2.3 to 2.5 FileUtils.rmdir will throw an exception
if the directory isn't empty. On 2.3 the operation will just not delete
the directory silently.

* bump jruby to 9.2.5.0 and fix test

* make rake default task since prepare pack needs it

* Resolve compiler warnings (#10247)

There are 3 types of compiler warnings that are either resolved or suppressed:

1. Rawtypes: In JRuby 9.2, `RubyArray` is a generic, so references throughout
   our codebase to the now "raw" type trigger warnings. In most cases we cannot
   actually resolve the issue, since the JRuby-provided methods for creating
   `RubyArray`s still return the raw type, so these have been suppressed.

2. Deprecations:
   - `RubyString#intern19()` -> `RubyString#intern()`
   - `RubyString#downcase19(ThreadContext)` -> `RubyString#downcase(ThreadContext)`
   - `NativeException`: remove import & reference directly; suppress usage
     warnings
   - `RaiseException()`: migrate to equivalent non-deprecated methods wherever
     possible; in some cases where we are using this in conjunction with the
     also-deprecated `NativeException` to preserve java stacktraces, there
     seems to be no non-deprecated path forward, so these cases have been
     suppressed.

3. Redundant Casts
   - Resolved

* JRuby 9.2 bundler shenanigans (#10266)

* Revert "Revert "remove forced dependency on old bundler (#9395)""

This reverts commit bef984143d.

* plugin management: update internal bundler to 1.17.x APIs

* deps: update dev dependency webmock to version compatible with JRuby 9.2

* spec: update Pack fixture to include manticore version that doesn't conflict

* build: update gradle to version that has Java 11 support

* java11: resolve or suppress deprecation warnings

* Remove superfluous flag opting into ParNew GC implementation

When opting into CMS garbage collector with `XX:+UseConcMarkSweepGC`, the
young generation collector ParNew has been the default since Java 8, making
the `XX:+UseParNew` flag redundant; the flag was removed in Java 9, and
should no longer be specified to work with modern Javas.

https://bugs.openjdk.java.net/browse/JDK-8006478
https://openjdk.java.net/jeps/214

* spec: set thread name to example description for easier debugging

* spec: prevent errors in testing specs by checking against skip list before using

* no-op: remove use of `HashMap#computeIfAbsent` on single-threaded code

> This method will, on a best-effort basis, throw a `ConcurrentModificationException`
> if it is detected that the mapping function modifies this map during computation.
>
> -- https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/HashMap.html#computeIfAbsent(K,java.util.function.Function)

* qa: by default, run integration against Elastic Stack 6.5.x

To support development on Logstash on top of Java 11, default to testing
against an Elastic Stack that is capable of running on Java 11.

* qa: ignore deprecation warnings when comparing offline pack output

* qa: add Java 9+ support to ChildProcess dev dependency

this can safely be removed when the childprocess gem supports Java9+
https://github.com/enkessler/childprocess/pull/141

* qa: allow connections to localhost in webmock

* bump jrjackson version

* fix filebeat integration tests

* spec: ensure license compliance spec runs first

The license compliance spec that validates the licenses of bundled
plugins appears to not be compatible with the hooks that we inject
into bundler for plugin management, and will fail in obscure ways
when run after those hooks have been added. Since those hooks are
not necessary for validating licenses, the easiest solution was to
ensure that those specs run first, before the VM has been poluted.

Since the gradle/junit/rspec bridge that is currently in place
runs all specs in the same JVM, we also need to make sure that the
rspec "world" is reset before a run, to ensure that it doesn't
retain spec definitions from previous runs.

Also updates the rake invocation, although I'm not sure it is used
any more.
2019-02-04 16:36:11 -08:00
Joao Duarte
ccfa770939 add lockfile bump and release notes draft tools
Fixes #10265
2019-01-08 15:35:16 +00:00
Joao Duarte
c58409e0bc abort plugin bump script if base version not found
Fixes #10254
2019-01-07 11:54:19 +00:00
Rob Bavey
97e7e5026f Add version qualifier to package version
Fixes #10231
2018-12-20 17:22:36 +00:00
João Duarte
e0638e25a9 add http and memcached filters to default set of plugins (#10213) 2018-12-18 14:47:17 +00:00
Karen Metts
9165ec5a10 Remove codec-cloudtrail from skiplist
Fixes #10190
2018-12-03 19:06:22 +00:00
João Duarte
bef984143d
Revert "remove forced dependency on old bundler (#9395)"
This reverts commit ab20b40e47.

Due to failing tests like https://logstash-ci.elastic.co/job/elastic+logstash+master+multijob--ruby-unit-tests/86/
2018-12-03 13:49:54 +00:00
João Duarte
ab20b40e47
remove forced dependency on old bundler (#9395)
* update bundler to 1.17.1

This commit required some tweaking of how we setup Bundler
due to changes in reset behaviour, an internal variable name change,
and the Bundler::Settings api changing.
2018-11-30 09:25:24 +00:00
Joao Duarte
d6a2299997 skip prerelease gems on plugin version bump rake task
Fixes #10170
2018-11-26 21:25:21 +00:00
Joao Duarte
1ed4f018a1 rename appsearch to elastic_app_search
Fixes #10130
2018-11-08 16:37:16 +00:00
Guy Boertje
1f7a369993
Add VERSION_QUALIFIER support for use by release manager (#10117)
* Add VERSION_QUALIFIER support for use by release manager

* Make the gem build processes aware of the version qualifier

* Try debugging xpack ci test failure.

* Try to use the artifacts-api.elastic.co api for ES download.

* It builds/tests locally now.

* add some comments explaining the artifacts-api and the version string

* cahnges requested in review.

Fixes #9956
2018-11-07 22:39:52 +00:00