Commit graph

280 commits

Author SHA1 Message Date
Joao Duarte
e826e03689 name rpm/deb oss packages as logstash-oss
Fixes #10833
2019-05-29 14:25:21 +00:00
Joao Duarte
c221eb13b0 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
3393982422
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:58:04 +01:00
Joao Duarte
91691e871b
updated bundler to 1.17.3 2019-04-12 22:27:51 +01:00
João Duarte
03fbc85e0c
Update patch plugin versions in gemfile lock (#10678) (#10678) 2019-04-12 15:32:32 +01:00
Joao Duarte
0fb0d75b4d disable docker img generation on artifact:all
Fixes #10647
2019-04-04 15:19:26 +00:00
João Duarte
7bbcc4527b
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:50 +01:00
Joao Duarte
85d0926244 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
Joao Duarte
7e1ffd3d35
add snmp input to default plugins 2018-10-24 13:17:10 +01:00
Joao Duarte
dc41033545 add appsearch output to default plugin list
Fixes #10062
2018-10-24 12:14:00 +00:00
João Duarte
df6eac4df4 Update bump_plugin_versions.rake
Fixes #9967
2018-09-11 13:22:14 +00:00
Joao Duarte
6947ebde97 add rake task to bump plugin versions
Fixes #9967
2018-09-11 13:22:14 +00:00
Joao Duarte
f8af1762c5 create gradle task to generate plugin version manifesto
Fixes #9889
2018-08-10 16:45:16 +00:00
Joao Duarte
96b83b67b9 remove generate notice file rake task
Fixes #9887
2018-08-10 12:39:33 +00:00
Colin Surprenant
e716f2eafc
docs index file renamed to docs/index.asciidoc (#9852) 2018-07-23 15:18:50 -04:00
Jake Landis
e22457252f Introduction of the Azure module (experimental)
This module leverages the Azure Event Hub to read events from the activity log and sql diagnostics.  Please note this module is considered experimental till otherwise noted.

This change also introduces logstash-input-azure_event_hubs as a default plugin

Fixes #9729
2018-07-02 16:34:49 +00:00
Armin
f8860884fa JRUBY: install custom JRuby tar.gz
Fixes #9731
2018-06-14 12:28:39 +00:00
Tudor Golubenco
500271be39 Add sample configuration file
This adds a simple Logstash config sample that works as a standard
Beats -> Logstash -> Elasticsearch starting point.

It's being deployed in packages, typically under /etc/logstash/logstash-sample.conf

This also adds a Dockerfile that can be used to build the artifacts.

Fixes #9588
2018-05-17 19:58:35 +00:00
Shaunak Kashyap
f4603f95c1
Update version in OSS-only artifacts as well (#9425)
Updates README artifact links regex to update version in OSS-only artifact links as well
2018-04-30 12:01:22 -07:00
Jenkins CI
93cad10da1 Migrate x-pack-logstash source to logstash 2018-04-24 10:46:15 -05:00
Dan Hermann
d6e730f9b6 Unify logging properties across distributions.
Fixes #9006, #8499.

Fixes #9076
2018-03-29 18:55:27 +00:00
Andrew Cholakian
2ab6cbd3ce Add OSS variants of artifact rake tasks
These will omit the x-pack folder once it is merged in

Fixes #9223
2018-03-09 18:36:31 +00:00
Jake Landis
acaeb45cb1 Add pipelines.yml to RPM/DEB configured files to avoid overwrite on updrade.
Fixes #9129

Fixes #9130
2018-02-09 21:58:50 +00:00
Armin
42a7da2bcd BUILD: Remove invocations in rake tasks
Fixes #9032
2018-01-26 21:11:11 +00:00
Guy Boertje
33b151707a
add jdbc_static (#8933)
* add jdbc_static

* sort logstash-* gems and add jdbc_static to plugins-metadata.json
2018-01-15 17:26:37 +00:00
Jake Landis
058c9a6c47 Secret Store: Ability to set and use secret data from an encrypted data store.
Fixes #8657

Part 1: API and JavaKeyStore implementation (#8657)

Introduces the API to read/write/delete sensitive data from a secure store and includes a Java KeyStore implementation. Note - this commit does NOT integrate with the Logstash configuration or settings.

Part 2: Secret Store: SecretStoreFactory, SecureConfig, Obfuscation and X-JVM support (#8659)

*  Secret Store: SecretStoreFactory, SecureConfig, Obfuscation and X-JVM support

* Introduce a SecretStoreFactory to allow runtime definition of SecretStore implementation.
* Introduce a SecureConfig to allow simple configuration of different SecretStore implementaiton.
* Introduce random default password plus obfuscation. Best attempt at security through obscurity.
* Corrections / better support for x-JVM modification.

Part 3: Secret Store: SecretStore, SecretStoreFactory, JavaKeystore - refacactor (#8745)

* Adds more CRUD like operations for SecretStore API
* SecretStoreFactory Mirror API's CRUD operations
* Adds 'exists' to API to allow command line warning 'Overwrite ?'
* Minor readabiliy

Part 4: Integrate secret store with Logstash core (#8905)

This change introduces the command line tooling and hooks needed to allow Logstash to use the secret store. This change hooks into the same logic that the does the environment variable substitution. The commnad line mirrors the Elasticsearch command line, and is implemented primarily in Java.

Part 5: Hardening and test fixes (this PR)

Fixes #8935
2018-01-13 01:22:53 +00:00
Jordan Sissel
e120906673 Use multiple pipelines feature by default in RPM and Debian packages.
This change keeps the previous behavior but implements it using multiple
pipelines (pipelines.yml) instead of with `path.config`.

* The default pipeline name is still "main"
* Default config path is still /etc/logstash/conf.d/*.conf

Other small changes included:
* Specify fpm workdir. Otherwise rpmbuild is given an empty value for
  its temporary directory. It's unclear if this is a bug in fpm or in my
  environment, but I like the change anyway to put fpm's build activity
  in the build directory.
* DRY's up the common files going in /etc/logstash for both rpm and deb
  packages.

For #8893

Fixes #8894
2018-01-10 19:04:38 +00:00
Armin
543b7221bd JAVA EntryPoint
* Created `org.logstash.Logstash` as entrypoint
* Safely handle `Ruby` runtime (which sadly is still a singleton, moving away from that will require a few iterations on top of this)
* Adjusted `bat` and `sh` entry point wrappers
* Verified manually that performance is unchanged (i.e. all Java opts are still loaded properly)
* Flattened `.jar` path to make it a little less bothersome to build the `-cp` string
* Retained ability to load jars from Ruby via the global `$LS_JARS_LOADED` variable hack, to keep plugin specs that load LS as a `.gem` functional (like e.g. the ITs in LS itself)
* No need for the gem jars magic anymore, the downloading and moving into place of jars is now all handled by Gradle

Fixes #8161
2018-01-03 19:13:28 +00:00
Armin
b1cf959a83 fix z_rubycheck.rb
Fixes #8896
2017-12-29 18:21:38 +00:00
Jake Landis
5c5619ff4e Minor: remove rake test:core-fail-fast
Fixes #8742

Fixes #8763
2017-11-29 19:48:00 +00:00
Andrew Cholakian
6dd9bff657 Bump minitar version for security fix even though we aren't vulnerable
Fixes #8714
2017-11-22 20:22:38 +00:00
Rob Bavey
9e7868774f Split shared doc version update into separate rake task
The stack version constant in index-shared1.asciidoc should not be
updated during a version bump, as this impacts the current version
of the doc on elastic.co. Instead, create a separate rake task
to bump the version.

See #8637 for details of this happening

Fixes #8648
2017-11-14 14:10:21 +00:00
Armin
c8d704c93e TESTS: Improve Gradle Test Configuration
* `clean` actually cleans all dynamically created files, in particular it now properly cleans the generated Gemfile so
that changes to the Gemfile.template reflect in a rerun of `bundler`
* `rubyTests` and `test` are now one-off and will automatically bootstrap JRuby and Gems required by the tests if necessary
* Fixed Readme to document the now much simpler test targets
* All rake tasks remain unchanged and still work exactly as they did before

Fixes #8583
2017-11-06 18:34:47 +00:00
infcurious@gmail.com
01f72067d1 Update set_plugic_api task to use latest update_version_file
Fixes #8496
2017-11-01 13:23:19 +00:00
infcurious@gmail.com
d3bffc7482 Use old_version & new_version naming for readability
Fixes #8496
2017-11-01 13:23:19 +00:00
infcurious@gmail.com
01f4dd87dd Expand rake version:set to update README & index-shared1.asciidoc
Fixes #8496
2017-11-01 13:23:19 +00:00
Armin
f069eac40c BUILD: Execute RSPEC from JUnit
Fixes #8517
2017-10-26 19:57:54 +00:00
Armin
c5fa78c7fa #8280 remove simplecov
Fixes #8536
2017-10-26 12:15:12 +00:00