Skip to content

Cherry-pick #17655 to 7.x: Start to split filebeat/channel up#19654

Merged
urso merged 1 commit intoelastic:7.xfrom
urso:backport_17655_7.x
Jul 7, 2020
Merged

Cherry-pick #17655 to 7.x: Start to split filebeat/channel up#19654
urso merged 1 commit intoelastic:7.xfrom
urso:backport_17655_7.x

Conversation

@urso
Copy link
Copy Markdown

@urso urso commented Jul 3, 2020

Cherry-pick of PR #17655 to 7.x branch. Original message:

  • Refactoring

What does this PR do?

The Factory in filebeat/channel package wraps the publisher pipeline, in order to add some shutdown propagation support, but also to modify the beat.ClientConfig when an input is configured. The channel.Connector reads and applies common settings for all inputs, configures Guaranteed sending, and hooks up a global counter with each beat.Client, in order to track live events.

This change reduces the responsibilities of the factory, by splitting them up. A package libbeat/publisher/pipetool is introduced to provide helper functions for modifying a beat.Pipeline before and after Connect. This centers support for more functionality on the beat.PipelineConnector and beat.Client interfaces, instead of incompatible types wrapping the pipeline.

The Factory in filebeat/channel will not modify the input configuration or the beat.Client anymore. It is only required to add shutdown signaling to the pipeline (which we will remove in the future as well). The filebeat/channel provides a helper function for decorating a cfgfile.RunnerFactory, such that common configurations are still applied as before. Again, by centering around a small set of common interfaces, reduce the effort to integrate future input refactorings.

All in all, the filebeat/channel factory still provides the same functionality as before (for now), but splits the different functionalities into 3 separate interfaces.

Why is it important?

Support ease of integration of new input API, based on RunnerFactory only.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
    - [ ] I have made corresponding changes to the documentation
    - [ ] I have made corresponding change to the default configuration files
    - [ ] I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Related issues

@urso urso added [zube]: In Review backport Team:Services (Deprecated) Label for the former Integrations-Services team labels Jul 3, 2020
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jul 3, 2020
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/integrations-services (Team:Services)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jul 3, 2020
@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Jul 3, 2020

💔 Build Failed

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [urso commented: jenkins run the tests please]

  • Start Time: 2020-07-06T22:37:05.389+0000

  • Duration: 122 min 17 sec

Test stats 🧪

Test Results
Failed 0
Passed 8918
Skipped 1575
Total 10493

Steps errors

Expand to view the steps failures

  • Name: Make -C libbeat testsuite

    • Description: make -C libbeat testsuite

    • Duration: 6 min 7 sec

    • Start Time: 2020-07-06T23:01:24.562+0000

    • log

  • Name: Report to Codecov

    • Description: curl -sSLo codecov https://codecov.io/bash for i in auditbeat filebeat heartbeat libbeat metricbeat packetbeat winlogbeat journalbeat do FILE="${i}/build/coverage/full.cov" if [ -f "${FILE}" ]; then bash codecov -f "${FILE}" fi done

    • Duration: 2 min 22 sec

    • Start Time: 2020-07-06T23:52:38.074+0000

    • log

  • Name: Report to Codecov

    • Description: curl -sSLo codecov https://codecov.io/bash for i in auditbeat filebeat heartbeat libbeat metricbeat packetbeat winlogbeat journalbeat do FILE="${i}/build/coverage/full.cov" if [ -f "${FILE}" ]; then bash codecov -f "${FILE}" fi done

    • Duration: 2 min 22 sec

    • Start Time: 2020-07-06T23:57:28.345+0000

    • log

  • Name: Report to Codecov

    • Description: curl -sSLo codecov https://codecov.io/bash for i in auditbeat filebeat heartbeat libbeat metricbeat packetbeat winlogbeat journalbeat do FILE="${i}/build/coverage/full.cov" if [ -f "${FILE}" ]; then bash codecov -f "${FILE}" fi done

    • Duration: 1 min 27 sec

    • Start Time: 2020-07-06T23:49:40.856+0000

    • log

  • Name: Report to Codecov

    • Description: curl -sSLo codecov https://codecov.io/bash for i in auditbeat filebeat heartbeat libbeat metricbeat packetbeat winlogbeat journalbeat do FILE="${i}/build/coverage/full.cov" if [ -f "${FILE}" ]; then bash codecov -f "${FILE}" fi done

    • Duration: 1 min 27 sec

    • Start Time: 2020-07-06T23:51:08.139+0000

    • log

Log output

Expand to view the last 100 lines of log output

[2020-07-07T00:38:54.753Z] + [ -f packetbeat/build/coverage/full.cov ]
[2020-07-07T00:38:54.753Z] + FILE=winlogbeat/build/coverage/full.cov
[2020-07-07T00:38:54.753Z] + [ -f winlogbeat/build/coverage/full.cov ]
[2020-07-07T00:38:54.753Z] + FILE=journalbeat/build/coverage/full.cov
[2020-07-07T00:38:54.753Z] + [ -f journalbeat/build/coverage/full.cov ]
[2020-07-07T00:38:55.822Z] Failed in branch Filebeat x-pack
[2020-07-07T00:38:55.949Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats
[2020-07-07T00:38:56.269Z] + find . -type f -name TEST*.xml -path */build/* -delete
[2020-07-07T00:38:56.283Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats/Lint
[2020-07-07T00:38:56.372Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats/Winlogbeat-oss
[2020-07-07T00:38:56.448Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats/Elastic-Agent-x-pack
[2020-07-07T00:38:56.520Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats/Auditbeat-crosscompile
[2020-07-07T00:38:56.592Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats/Dockerlogbeat
[2020-07-07T00:38:56.663Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats/Journalbeat-oss
[2020-07-07T00:38:56.735Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats/Functionbeat-x-pack
[2020-07-07T00:38:56.806Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats/Generators-Metricbeat-Linux
[2020-07-07T00:38:56.880Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats/Elastic-Agent-x-pack-Windows
[2020-07-07T00:38:56.952Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats/Libbeat-oss
[2020-07-07T00:38:57.023Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats/Metricbeat-OSS-Unit-tests
[2020-07-07T00:38:57.095Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats/Metricbeat-crosscompile
[2020-07-07T00:38:57.168Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats/Auditbeat-oss-Windows
[2020-07-07T00:38:57.249Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats/Winlogbeat-Windows-x-pack
[2020-07-07T00:38:57.331Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats/Auditbeat-x-pack-Windows
[2020-07-07T00:38:57.414Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats/Heartbeat-oss
[2020-07-07T00:38:57.488Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats/Auditbeat-x-pack
[2020-07-07T00:38:57.559Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats/Libbeat-x-pack
[2020-07-07T00:38:57.630Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats/Filebeat-x-pack-Windows
[2020-07-07T00:38:57.706Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats/Filebeat-Windows
[2020-07-07T00:38:57.787Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats/Auditbeat-oss-Linux
[2020-07-07T00:38:57.863Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats/Metricbeat-x-pack-Windows
[2020-07-07T00:38:57.936Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats/Packetbeat-oss
[2020-07-07T00:38:58.008Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats/Winlogbeat-Windows
[2020-07-07T00:38:58.081Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats/Metricbeat-Windows
[2020-07-07T00:38:58.154Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats/Generators-Beat-Linux
[2020-07-07T00:38:58.226Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats/Elastic-Agent-Mac-OS-X
[2020-07-07T00:38:58.303Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats/Metricbeat-Python-integration-tests
[2020-07-07T00:38:58.375Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats/Filebeat-x-pack-Mac-OS-X
[2020-07-07T00:38:58.447Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats/Filebeat-Mac-OS-X
[2020-07-07T00:38:58.520Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats/Auditbeat-oss-Mac-OS-X
[2020-07-07T00:38:58.591Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats/Auditbeat-x-pack-Mac-OS-X
[2020-07-07T00:38:58.662Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats/Metricbeat-x-pack-Mac-OS-X
[2020-07-07T00:38:58.736Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats/Functionbeat-Mac-OS-X-x-pack
[2020-07-07T00:38:58.808Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats/Metricbeat-Mac-OS-X
[2020-07-07T00:38:58.880Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats/Metricbeat-OSS-Integration-tests
[2020-07-07T00:38:58.955Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats/Heartbeat-Mac-OS-X
[2020-07-07T00:38:59.030Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats/Generators-Metricbeat-Mac-OS-X
[2020-07-07T00:38:59.108Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats/Metricbeat-x-pack
[2020-07-07T00:38:59.182Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats/Generators-Beat-Mac-OS-X
[2020-07-07T00:38:59.255Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats/Functionbeat-Windows
[2020-07-07T00:38:59.327Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats/Heartbeat-Windows
[2020-07-07T00:38:59.407Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats/Filebeat-oss
[2020-07-07T00:38:59.487Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats/Filebeat-x-pack
[2020-07-07T00:38:59.855Z] + cat
[2020-07-07T00:38:59.855Z] + /usr/local/bin/runbld ./runbld-script
[2020-07-07T00:38:59.855Z] Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
[2020-07-07T00:39:08.023Z] runbld>>> runbld started
[2020-07-07T00:39:08.023Z] runbld>>> 1.6.12/f45d832f2ba0aa2722ab4ec1fda8ad140f027f8b
[2020-07-07T00:39:08.969Z] runbld>>> The following profiles matched the job 'Beats/beats-beats-mbp/PR-19654' in order of occurrence in the config (last value wins).
[2020-07-07T00:39:10.361Z] runbld>>> Debug logging enabled.
[2020-07-07T00:39:10.361Z] runbld>>> Storing result
[2020-07-07T00:39:10.361Z] runbld>>> Store result: created {:total 2, :successful 2, :failed 0} 1
[2020-07-07T00:39:10.361Z] runbld>>> BUILD: https://c150076387b5421f9154dfbf536e5c60.us-west1.gcp.cloud.es.io:9243/build-1587637540455/t/20200707003910-E182F1B1
[2020-07-07T00:39:10.361Z] runbld>>> Adding system facts.
[2020-07-07T00:39:11.755Z] runbld>>> Adding vcs info for the latest commit:  740dca7dae71c6deae218a6fb3b523aa059384b5
[2020-07-07T00:39:11.755Z] runbld>>> >>>>>>>>>>>> SCRIPT EXECUTION BEGIN >>>>>>>>>>>>
[2020-07-07T00:39:11.755Z] runbld>>> Adding /usr/lib/jvm/java-8-openjdk-amd64/bin to the path.
[2020-07-07T00:39:11.755Z] Processing JUnit reports with runbld...
[2020-07-07T00:39:11.755Z] + echo 'Processing JUnit reports with runbld...'
[2020-07-07T00:39:12.019Z] runbld>>> <<<<<<<<<<<< SCRIPT EXECUTION END <<<<<<<<<<<<
[2020-07-07T00:39:12.019Z] runbld>>> DURATION: 16ms
[2020-07-07T00:39:12.019Z] runbld>>> STDOUT: 40 bytes
[2020-07-07T00:39:12.019Z] runbld>>> STDERR: 49 bytes
[2020-07-07T00:39:12.019Z] runbld>>> WRAPPED PROCESS: SUCCESS (0)
[2020-07-07T00:39:12.019Z] runbld>>> Searching for build metadata in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats
[2020-07-07T00:39:12.966Z] runbld>>> Storing build metadata: 
[2020-07-07T00:39:12.966Z] runbld>>> Adding test report.
[2020-07-07T00:39:12.966Z] runbld>>> Searching for junit test output files with the pattern: TEST-.*\.xml$ in: /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats
[2020-07-07T00:39:13.914Z] runbld>>> Found 112 test output files
[2020-07-07T00:39:14.178Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-istio.xml
[2020-07-07T00:39:14.178Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-tomcat.xml
[2020-07-07T00:39:14.178Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-iis.xml
[2020-07-07T00:39:14.178Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-openmetrics.xml
[2020-07-07T00:39:14.178Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-activemq.xml
[2020-07-07T00:39:15.569Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats/Metricbeat-OSS-Integration-tests/metricbeat/build/TEST-go-integration-graphite.xml
[2020-07-07T00:39:15.832Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654/src/github.com/elastic/beats/Metricbeat-OSS-Integration-tests/metricbeat/build/TEST-go-integration-windows.xml
[2020-07-07T00:39:15.832Z] runbld>>> Test output logs contained: Errors: 0 Failures: 0 Tests: 10343 Skipped: 1338
[2020-07-07T00:39:16.095Z] runbld>>> Storing result
[2020-07-07T00:39:16.095Z] runbld>>> FAILURES: 0
[2020-07-07T00:39:16.357Z] runbld>>> Store result: updated {:total 2, :successful 2, :failed 0} 2
[2020-07-07T00:39:16.357Z] runbld>>> BUILD: https://c150076387b5421f9154dfbf536e5c60.us-west1.gcp.cloud.es.io:9243/build-1587637540455/t/20200707003910-E182F1B1
[2020-07-07T00:39:16.357Z] runbld>>> Email notification disabled by environment variable.
[2020-07-07T00:39:16.357Z] runbld>>> Slack notification disabled by environment variable.
[2020-07-07T00:39:22.184Z] Running on Jenkins in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19654
[2020-07-07T00:39:22.290Z] [INFO] getVaultSecret: Getting secrets
[2020-07-07T00:39:22.353Z] Masking supported pattern matches of $VAULT_ADDR or $VAULT_ROLE_ID or $VAULT_SECRET_ID
[2020-07-07T00:39:23.102Z] + chmod 755 generate-build-data.sh
[2020-07-07T00:39:23.102Z] + ./generate-build-data.sh https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats-beats-mbp/PR-19654/ https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats-beats-mbp/PR-19654/runs/4 FAILURE 7337452
[2020-07-07T00:39:23.102Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats-beats-mbp/PR-19654/runs/4/steps/?limit=10000 -o steps-info.json
[2020-07-07T00:39:24.965Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats-beats-mbp/PR-19654/runs/4/tests/?status=FAILED -o tests-errors.json
[2020-07-07T00:39:25.215Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats-beats-mbp/PR-19654/runs/4/log/ -o pipeline-log.txt

@kvch
Copy link
Copy Markdown
Contributor

kvch commented Jul 6, 2020

jenkins run tests

@urso
Copy link
Copy Markdown
Author

urso commented Jul 6, 2020

jenkins run the tests please

1 similar comment
@urso
Copy link
Copy Markdown
Author

urso commented Jul 6, 2020

jenkins run the tests please

@urso urso merged commit 63fe814 into elastic:7.x Jul 7, 2020
@urso urso deleted the backport_17655_7.x branch July 7, 2020 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport Team:Services (Deprecated) Label for the former Integrations-Services team [zube]: Done

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants