-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Add supported-versions and update docker-compose for logstash module #29440
Add supported-versions and update docker-compose for logstash module #29440
Conversation
This pull request does not have a backport label. Could you fix it @matschaffer? 🙏
NOTE: |
Ah.... there's no 8.1.0 but there should be a 8.1.0-SNAPSHOT. Is there any established pattern for how these versions should be set? |
@@ -2,22 +2,22 @@ version: '2.3' | |||
|
|||
services: | |||
logstash: | |||
image: docker.elastic.co/integrations-ci/beats-logstash:${LOGSTASH_VERSION:-7.12.0}-1 | |||
image: docker.elastic.co/integrations-ci/beats-logstash:${LOGSTASH_VERSION:-8.1.0}-1 |
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.
As this is the module collecting stats, I wonder if the tests should really be against a snapshot / unreleased version or rather a released version?
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.
Can anyone confirm if this image definitely even exists? https://container-library.elastic.co/r/integrations-ci/beats-logstash gives me a 404 even when signed in via elastic okta.
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.
I think this is built from the local Dockerfile: https://github.com/elastic/beats/blob/master/metricbeat/module/logstash/_meta/Dockerfile See the path to _meta here: https://github.com/elastic/beats/blob/master/metricbeat/module/logstash/docker-compose.yml#L7
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.
Ah, I see. I guess the image
line just gives it a local name then. Never used both build & image in the same file I don't think.
With -SNAPSHOT |
I expect In case the decision is made for the |
+1 for using the SNAPSHOT pinned hash approach. As Nicolas mentioned, this is the only way we can ensure the Beats project is not affected directly by breaking changes from the upstream but using PRs that get updated when a new SNAPSHOT is published. Those PRs are tagged with https://github.com/elastic/beats/pulls?q=is%3Apr+is%3Aopen+label%3Abuild-monitoring The automation relies on https://github.com/elastic/beats/blob/master/.ci/bump-stack-version.sh so if LogStash is needed, can you please add the required sed/commands to update those files accordingly? For the record, On the other hand, I've no clue about the docker registry : |
Thanks @v1v and happy new year! Picking this back up. I'd say the It doesn't look like the script makes any changes to What's still not clear to me is in what testing cycle |
Each module is tested as part of the integration and system tests. For the setup the above mentioned docker-compose file is used. This is tested on each PR or if by now we have some checks in place to see which files are modified, it will be run each time that the logstash module files are modified. But I think it is run on each PR currently. |
For context, these modules are tested with released versions of the stack, recently we added a step to the release process to update the versions in If we want to follow the same approach as for the other stack monitoring modules, we should update the internal release script to update also the logstash files. If we want to use tagged snapshots, we can go in the direction of updating |
Pinging @elastic/stack-monitoring (Stack monitoring) |
Pinging @elastic/integrations (Team:Integrations) |
Is this still necessary, @ruflin / @matschaffer ? I am reading through this ticket's comments and I don't follow what this change is in regards to. If it's not currently mergeable with a review from the Beats team, can we have a short meeting to chat about this so Mat and I can better understand what the request is? |
Yeah, I still haven't wrapped my head around how these files are used. Figured I'd come around to it after 8.0 is stablized. |
Jaime and I have provided quite a few details on how this is used and where. What bits are missing or not clear. Happy to chat on a meeting if needed but async works too. If we go for testing a stable release, this is very easy and quick to approve. If we go for a snapshot release which can make the full beats build unstable, we need to have more discussion. What version the integrations should test against is a decision your team @jasonrhodes should drive, happy to assist during the decision. |
Ok yeah, I think this is another casualty of the gaps between ownership. I'll schedule a meeting so we can attempt to get on the same page. |
@robbavey / @elastic/logstash can you take a look here and let me know if you have any input? I'm not sure if your team is aware of these tests at all, but I want to make sure we don't do something you didn't expect here. |
@v1v I think I hit a snag here and will need to know more about what calls bump-stack-version.sh I'm fairly certain what we actually want is for metricbeat 8.x to be able to monitor (cc @robbavey and @jsoriano to confirm this guess). But it looks like the 7.16 snapshot updates go straight to the https://github.com/elastic/beats/pull/30106/files branch. For 8.x to test against 7.x, we'll need something that will run against the master branch when new releases of logstash 7.x are produced. |
We could also merge this PR as is since at least we've got the basic pattern going. It appears all the pytests are skipped anyway. We at least get some basic coverage from the golang tests, but they only support one version. |
Go tests in the logstash module do use compose, here for example.
Umm, if I remember correctly it is the other way around, go tests leave the service containers running, pytests remove them on teardown (here). Could it be that you run golang tests first and then the python ones? Maybe this way the scenario for the golang tests was still running. It may happen that compose mixes up the scenarios when go and python tests are run without the supported versions file (because they share the same compose configuration and compose project name). Maybe if you were adding the supported versions file you saw things behave differently, with supported versions each version is started (and stopped) as a different compose project. Regarding the update to
+1 to this, next thing would probably be to fix the tests, before further automation to update the versions. |
@@ -0,0 +1,3 @@ | |||
variants: | |||
- LOGSTASH_VERSION: 8.1.0-aa69d697-SNAPSHOT | |||
- LOGSTASH_VERSION: 7.17.0-fd761817-SNAPSHOT |
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.
Consider including some released version too, to ensure compatibility with older versions, and to have a reference to compare with if upgrading a snapshot makes the test fail.
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.
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.
The special case here are the snapshot versions, so I think we should have something like the bump stack versions approach.
The non-snapshot versions can be maintained manually, as done for the rest of modules, when we find some particularity in an specific version, or when we consider that we don't need testing for an specific versions anymore.
@@ -10,6 +10,7 @@ | |||
import urllib.request | |||
|
|||
|
|||
@metricbeat.parameterized_with_supported_versions | |||
class Test(metricbeat.BaseTest): |
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.
Maybe we can skip the whole class till tests are fixed, otherwise this is probably going to be starting the containers for nothing in the CI pipelines.
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.
yeah, makes sense to me
Makese the pytest output clearer ('s' for skip, not '.' for pass). And might avoid launching extra containers for no reason.
This avoids container launches.
@@ -20,8 +22,6 @@ def test_node(self): | |||
""" | |||
logstash node metricset test | |||
""" | |||
unittest.skip('Skipping this test to check documented fields. We will unskip once we know which fields can be deleted') |
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.
Note that these tests (and the class) already have a top-level skip, so just removing the redundant lines here (especially since if we use this approach the test looks like a pass).
- LOGSTASH_VERSION: 8.1.0-aa69d697-SNAPSHOT | ||
- LOGSTASH_VERSION: 8.0.0-rc2 | ||
- LOGSTASH_VERSION: 7.17.1-aa300c4a-SNAPSHOT | ||
- LOGSTASH_VERSION: 7.17.0 |
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.
I like to see that we test multiple variants. Lets make sure we do the same for the other stack modules.
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.
Cool. That's the plan I laid out in #30146
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.
👍 thanks for taking care of this @matschaffer! Waiting for the follow up fixing the skipped tests 🙂
@jsoriano are you able to merge this? I get "The base branch restricts merging to authorized users. " on this end |
Or @ruflin perhaps? Guessing we might need to add @elastic/infra-monitoring-ui (or at least @elastic/stack-monitoring ) to the beats repo with write access. |
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.
Apologies for the late review - was out the back end of last week. LGTM
Merged, and backporting this to 8.1 and 8.0 branches. |
…29440) (#30269) Updates logstash module tests to run on more recent and multiple logstash versions. Completely skip logstash python tests to avoid running compose scenarios for skipped tests. (cherry picked from commit 478a5ce) Co-authored-by: Mat Schaffer <[email protected]>
…se for logstash module (#30268) Updates logstash module tests to run on more recent and multiple logstash versions. Completely skip logstash python tests to avoid running compose scenarios for skipped tests. (cherry picked from commit 478a5ce) It's just a _little_ odd to have 8.1 being tested by metricbeat 8.0. But I think this will help keep backports easier. In theory it could also help ensure 8.0 metricbeat updates don't break support for 8.1 logstash monitoring. Though such changes are probably unlikely. Co-authored-by: Mat Schaffer <[email protected]>
What does this PR do?
Updates logstash module tests to run on more recent and multiple logstash versions.
Why is it important?
The version embedded in docker-compose was very old (7.12)
Checklist
I have made corresponding changes to the documentationI have made corresponding change to the default configuration filesI have added an entry inCHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.How to test this PR locally
Related issues
Fixes: #30202