-
Notifications
You must be signed in to change notification settings - Fork 100
Add better support for file rotation #192
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
Merged
+2,417
−946
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
7622fc7
Add better support for file rotation
257577f
Move common_restat for watched and active to one iteration
60ab865
Ensure single file `path` option is ok, reverts earlier change in thi…
fb48cc5
Improve and expand our use of FFI on Windows
f0720e1
jnr and ffi interop, yay
f25c2b1
put self back in
fb4ae28
use fieldId label
2c846d3
handle rotations better.
f2b8555
fixes for rebase from master
fe96100
Abstract Stat part 1
d127aa0
Abstract Stat part 2
58a2518
Finally have (all) the kinks worked out
124e318
Try to fix travis failures.
05498b4
Try to fix travis failures 2
487c641
Try fix travis 3
167eecf
Try fix travis 4
6c82057
Try fix travis 5
168f451
Try fix travis 6
87b4e8d
Remove io based stat reliance. travis jruby 1.7.27 should pass now.
ab409ed
Some windows fixes
a176a35
more windows fixes
62dccf8
windows changes 2
8504125
rename rspec run tag in ci/build.sh
6e36c89
move one trace logging line
ff3bb5a
add first run discovery methods
ac62656
fix regression on files seen after inital run, travis 2 use docker.
257687e
add execute permissions
ee0855b
fix path ordering travis failures
a86893e
fix jar loading so it works for tests and when installed in LS
242bad3
reorder the jar require statements
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,16 @@ | ||
--- | ||
sudo: false | ||
language: ruby | ||
cache: bundler | ||
sudo: required | ||
services: docker | ||
addons: | ||
apt: | ||
packages: | ||
- docker-ce | ||
matrix: | ||
include: | ||
- rvm: jruby-9.1.13.0 | ||
env: LOGSTASH_BRANCH=master | ||
- rvm: jruby-9.1.13.0 | ||
env: LOGSTASH_BRANCH=6.x | ||
- rvm: jruby-9.1.13.0 | ||
env: LOGSTASH_BRANCH=6.0 | ||
- rvm: jruby-1.7.27 | ||
env: LOGSTASH_BRANCH=5.6 | ||
- env: ELASTIC_STACK_VERSION=5.6.10 | ||
- env: ELASTIC_STACK_VERSION=6.3.0 | ||
- env: ELASTIC_STACK_VERSION=6.4.0-SNAPSHOT | ||
- env: ELASTIC_STACK_VERSION=7.0.0-alpha1-SNAPSHOT | ||
fast_finish: true | ||
install: true | ||
script: ci/build.sh | ||
jdk: oraclejdk8 | ||
install: ci/unit/docker-setup.sh | ||
script: ci/unit/docker-run.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.0.0 | ||
1.0.1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
ARG ELASTIC_STACK_VERSION | ||
FROM docker.elastic.co/logstash/logstash:$ELASTIC_STACK_VERSION | ||
WORKDIR /usr/share/logstash/logstash-core | ||
RUN cp versions-gem-copy.yml ../logstash-core-plugin-api/versions-gem-copy.yml | ||
COPY --chown=logstash:logstash . /usr/share/plugins/this | ||
WORKDIR /usr/share/plugins/this | ||
ENV PATH=/usr/share/logstash/vendor/jruby/bin:${PATH} | ||
ENV LOGSTASH_SOURCE 1 | ||
RUN jruby -S gem install bundler | ||
RUN jruby -S bundle install --jobs=3 --retry=3 | ||
RUN jruby -S bundle exec rake vendor | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
version: '3' | ||
|
||
# run tests: docker-compose -f ci/unit/docker-compose.yml up --build --force-recreate | ||
# only set up: docker-compose -f ci/unit/docker-compose.yml up --build --no-start --force-recreate | ||
# start manually: docker-compose -f ci/unit/docker-compose.yml run logstash | ||
services: | ||
logstash: | ||
build: | ||
context: ../../ | ||
dockerfile: ci/unit/Dockerfile | ||
args: | ||
- ELASTIC_STACK_VERSION=$ELASTIC_STACK_VERSION | ||
command: /usr/share/plugins/this/ci/unit/run.sh | ||
environment: | ||
LS_JAVA_OPTS: "-Xmx256m -Xms256m" | ||
OSS: "true" | ||
tty: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
# This is intended to be run the plugin's root directory. `ci/unit/docker-test.sh` | ||
# Ensure you have Docker installed locally and set the ELASTIC_STACK_VERSION environment variable. | ||
set -e | ||
|
||
docker-compose -f ci/unit/docker-compose.yml run logstash |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
|
||
# This is intended to be run the plugin's root directory. `ci/unit/docker-test.sh` | ||
# Ensure you have Docker installed locally and set the ELASTIC_STACK_VERSION environment variable. | ||
set -e | ||
|
||
if [ "$ELASTIC_STACK_VERSION" ]; then | ||
echo "Testing against version: $ELASTIC_STACK_VERSION" | ||
|
||
if [[ "$ELASTIC_STACK_VERSION" = *"-SNAPSHOT" ]]; then | ||
cd /tmp | ||
wget https://snapshots.elastic.co/docker/logstash-"$ELASTIC_STACK_VERSION".tar.gz | ||
tar xfvz logstash-"$ELASTIC_STACK_VERSION".tar.gz repositories | ||
echo "Loading docker image: " | ||
cat repositories | ||
docker load < logstash-"$ELASTIC_STACK_VERSION".tar.gz | ||
rm logstash-"$ELASTIC_STACK_VERSION".tar.gz | ||
cd - | ||
fi | ||
|
||
if [ -f Gemfile.lock ]; then | ||
rm Gemfile.lock | ||
fi | ||
|
||
docker-compose -f ci/unit/docker-compose.yml down | ||
docker-compose -f ci/unit/docker-compose.yml up --no-start --build --force-recreate logstash | ||
else | ||
echo "Please set the ELASTIC_STACK_VERSION environment variable" | ||
echo "For example: export ELASTIC_STACK_VERSION=6.2.4" | ||
exit 1 | ||
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
|
||
# This is intended to be run inside the docker container as the command of the docker-compose. | ||
set -ex | ||
|
||
bundle exec rspec -fd --pattern spec/**/*_spec.rb,spec/**/*_specs.rb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
shouldn't we be using Gradle ? also why is this needed here?
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 copied from @jsvd work after the jruby S3 bucket went AWOL on the weekend.
Behind the scenes it does use gradle so I suppose we could run gradle here.
I don't want to touch it now, it works, we can circle back after confirming with Joao about this. It is a pattern we need to apply to all (most) plugins - probably scripted.
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.
ok I see.
I just created elastic/logstash/issues/9823 - we can move that discussion over there (or open a specific issue about it and link it there)