Skip to content
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

Cherry-pick #19158 to 7.x: Initialize input v2 API #19656

Merged
merged 2 commits into from
Jul 7, 2020

Conversation

urso
Copy link

@urso urso commented Jul 3, 2020

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

  • Refactoring

What does this PR do?

This change adds the package filebeat/input/v2. It introduces the
interfaces for the v2 input API only. The integration with filebat,
actual InputManagers and input implementations will follow.

This is the first PR introducing the new API. The current state of the full implementation can be seen here and sample inputs based on the new API.

The full list of changes will include:

This PR only introduces the v2 API interfaces.

Why is it important?

Init API for new style filebeat inputs.

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
Collaborator

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
Collaborator

elasticmachine commented Jul 3, 2020

❕ Build Aborted

Either there was a build timeout or someone aborted the build.'}

Pipeline View Test View Changes Artifacts

Expand to view the summary

Build stats

  • Build Cause: [Pull request #19656 updated]

  • Start Time: 2020-07-06T22:17:36.173+0000

  • Duration: 123 min 58 sec

Test stats 🧪

Test Results
Failed 1
Passed 8953
Skipped 1575
Total 10529

Test errors

Expand to view the tests failures

  • Name: Build and Test / Filebeat Mac OS X / test_clean_removed_with_clean_inactive – test_registrar.Test
    • Age: 1
    • Duration: 1.047
    • Error Details:
      -------------------- >> begin captured stdout << ---------------------
      registry size: 2
      registry size after remove: 2

--------------------- >> end captured stdout << ----------------------

Steps errors

Expand to view the steps failures

  • Name: Mage build unitTest

    • Description: mage build unitTest

    • Duration: 8 min 11 sec

    • Start Time: 2020-07-06T22:52:46.647+0000

    • log

  • Name: Recursively delete the current directory from the workspace

    • Description: script returned exit code 1

    • Duration: 0 min 14 sec

    • Start Time: 2020-07-06T23:03:48.208+0000

    • log

  • Name: Make -C libbeat testsuite

    • Description: make -C libbeat testsuite

    • Duration: 6 min 40 sec

    • Start Time: 2020-07-06T22:40:40.228+0000

    • log

  • Name: Install docker-compose 1.21.0

    • Description: .ci/scripts/install-docker-compose.sh

    • Duration: 1 min 33 sec

    • Start Time: 2020-07-06T22:40:02.171+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-06T22:41:00.324+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:03:01.743+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:53:43.998+0000

    • log

Log output

Expand to view the last 100 lines of log output

[2020-07-07T00:19:29.518Z] + FILE=winlogbeat/build/coverage/full.cov
[2020-07-07T00:19:29.518Z] + [ -f winlogbeat/build/coverage/full.cov ]
[2020-07-07T00:19:29.518Z] + FILE=journalbeat/build/coverage/full.cov
[2020-07-07T00:19:29.518Z] + [ -f journalbeat/build/coverage/full.cov ]
[2020-07-07T00:19:30.710Z] Failed in branch Filebeat oss
[2020-07-07T00:20:07.833Z] Body did not finish within grace period; terminating with extreme prejudice
[2020-07-07T00:20:08.018Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats
[2020-07-07T00:20:08.332Z] + find . -type f -name TEST*.xml -path */build/* -delete
[2020-07-07T00:20:08.344Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats/Lint
[2020-07-07T00:20:08.428Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats/Winlogbeat-oss
[2020-07-07T00:20:08.502Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats/Elastic-Agent-x-pack
[2020-07-07T00:20:08.577Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats/Auditbeat-crosscompile
[2020-07-07T00:20:08.656Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats/Dockerlogbeat
[2020-07-07T00:20:08.733Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats/Journalbeat-oss
[2020-07-07T00:20:08.807Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats/Generators-Metricbeat-Linux
[2020-07-07T00:20:08.927Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats/Functionbeat-x-pack
[2020-07-07T00:20:09.000Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats/Libbeat-oss
[2020-07-07T00:20:09.073Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats/Elastic-Agent-x-pack-Windows
[2020-07-07T00:20:09.151Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats/Metricbeat-OSS-Unit-tests
[2020-07-07T00:20:09.223Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats/Auditbeat-oss-Windows
[2020-07-07T00:20:09.298Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats/Metricbeat-crosscompile
[2020-07-07T00:20:09.375Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats/Auditbeat-x-pack
[2020-07-07T00:20:09.449Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats/Winlogbeat-Windows-x-pack
[2020-07-07T00:20:09.522Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats/Heartbeat-oss
[2020-07-07T00:20:09.596Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats/Libbeat-x-pack
[2020-07-07T00:20:09.676Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats/Auditbeat-x-pack-Windows
[2020-07-07T00:20:09.748Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats/Elastic-Agent-Mac-OS-X
[2020-07-07T00:20:09.822Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats/Filebeat-x-pack-Windows
[2020-07-07T00:20:09.900Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats/Filebeat-Windows
[2020-07-07T00:20:09.973Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats/Auditbeat-oss-Linux
[2020-07-07T00:20:10.045Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats/Auditbeat-oss-Mac-OS-X
[2020-07-07T00:20:10.118Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats/Metricbeat-x-pack-Windows
[2020-07-07T00:20:10.190Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats/Metricbeat-Windows
[2020-07-07T00:20:10.264Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats/Packetbeat-oss
[2020-07-07T00:20:10.336Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats/Winlogbeat-Windows
[2020-07-07T00:20:10.409Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats/Filebeat-x-pack-Mac-OS-X
[2020-07-07T00:20:10.483Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats/Filebeat-Mac-OS-X
[2020-07-07T00:20:10.555Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats/Metricbeat-Mac-OS-X
[2020-07-07T00:20:10.628Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats/Generators-Beat-Linux
[2020-07-07T00:20:10.701Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats/Metricbeat-x-pack-Mac-OS-X
[2020-07-07T00:20:10.774Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats/Auditbeat-x-pack-Mac-OS-X
[2020-07-07T00:20:10.846Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats/Metricbeat-Python-integration-tests
[2020-07-07T00:20:10.920Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats/Functionbeat-Mac-OS-X-x-pack
[2020-07-07T00:20:10.992Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats/Heartbeat-Mac-OS-X
[2020-07-07T00:20:11.065Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats/Functionbeat-Windows
[2020-07-07T00:20:11.138Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats/Metricbeat-OSS-Integration-tests
[2020-07-07T00:20:11.213Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats/Heartbeat-Windows
[2020-07-07T00:20:11.286Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats/Metricbeat-x-pack
[2020-07-07T00:20:11.361Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats/Generators-Metricbeat-Mac-OS-X
[2020-07-07T00:20:11.434Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats/Generators-Beat-Mac-OS-X
[2020-07-07T00:20:11.507Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats/Filebeat-x-pack
[2020-07-07T00:20:11.580Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats/Filebeat-oss
[2020-07-07T00:20:11.939Z] + cat
[2020-07-07T00:20:11.939Z] + /usr/local/bin/runbld ./runbld-script
[2020-07-07T00:20:11.939Z] Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
[2020-07-07T00:20:18.532Z] runbld>>> runbld started
[2020-07-07T00:20:18.532Z] runbld>>> 1.6.12/f45d832f2ba0aa2722ab4ec1fda8ad140f027f8b
[2020-07-07T00:20:19.920Z] runbld>>> The following profiles matched the job 'Beats/beats-beats-mbp/PR-19656' in order of occurrence in the config (last value wins).
[2020-07-07T00:20:20.863Z] runbld>>> Debug logging enabled.
[2020-07-07T00:20:21.124Z] runbld>>> Storing result
[2020-07-07T00:20:21.124Z] runbld>>> Store result: created {:total 2, :successful 2, :failed 0} 1
[2020-07-07T00:20:21.124Z] runbld>>> BUILD: https://c150076387b5421f9154dfbf536e5c60.us-west1.gcp.cloud.es.io:9243/build-1587637540455/t/20200707002020-ACC046D5
[2020-07-07T00:20:21.124Z] runbld>>> Adding system facts.
[2020-07-07T00:20:22.066Z] runbld>>> Adding vcs info for the latest commit:  fc38f09e33b3dab7e4f5ecf5ab9dcef944a7b2fc
[2020-07-07T00:20:22.067Z] runbld>>> >>>>>>>>>>>> SCRIPT EXECUTION BEGIN >>>>>>>>>>>>
[2020-07-07T00:20:22.067Z] runbld>>> Adding /usr/lib/jvm/java-8-openjdk-amd64/bin to the path.
[2020-07-07T00:20:22.067Z] Processing JUnit reports with runbld...
[2020-07-07T00:20:22.067Z] + echo 'Processing JUnit reports with runbld...'
[2020-07-07T00:20:22.638Z] runbld>>> <<<<<<<<<<<< SCRIPT EXECUTION END <<<<<<<<<<<<
[2020-07-07T00:20:22.638Z] runbld>>> DURATION: 25ms
[2020-07-07T00:20:22.638Z] runbld>>> STDOUT: 40 bytes
[2020-07-07T00:20:22.638Z] runbld>>> STDERR: 49 bytes
[2020-07-07T00:20:22.638Z] runbld>>> WRAPPED PROCESS: SUCCESS (0)
[2020-07-07T00:20:22.638Z] runbld>>> Searching for build metadata in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats
[2020-07-07T00:20:23.588Z] runbld>>> Storing build metadata: 
[2020-07-07T00:20:23.588Z] runbld>>> Adding test report.
[2020-07-07T00:20:23.588Z] runbld>>> Searching for junit test output files with the pattern: TEST-.*\.xml$ in: /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats
[2020-07-07T00:20:24.159Z] runbld>>> Found 112 test output files
[2020-07-07T00:20:24.732Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-istio.xml
[2020-07-07T00:20:24.732Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-tomcat.xml
[2020-07-07T00:20:24.732Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-iis.xml
[2020-07-07T00:20:24.732Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-openmetrics.xml
[2020-07-07T00:20:24.732Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-activemq.xml
[2020-07-07T00:20:26.128Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats/Metricbeat-OSS-Integration-tests/metricbeat/build/TEST-go-integration-graphite.xml
[2020-07-07T00:20:26.128Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656/src/github.com/elastic/beats/Metricbeat-OSS-Integration-tests/metricbeat/build/TEST-go-integration-windows.xml
[2020-07-07T00:20:26.389Z] runbld>>> Test output logs contained: Errors: 0 Failures: 1 Tests: 10379 Skipped: 1338
[2020-07-07T00:20:26.649Z] runbld>>> Storing result
[2020-07-07T00:20:26.649Z] runbld>>> FAILURES: 1
[2020-07-07T00:20:26.910Z] runbld>>> Store result: updated {:total 2, :successful 2, :failed 0} 2
[2020-07-07T00:20:26.910Z] runbld>>> BUILD: https://c150076387b5421f9154dfbf536e5c60.us-west1.gcp.cloud.es.io:9243/build-1587637540455/t/20200707002020-ACC046D5
[2020-07-07T00:20:27.171Z] runbld>>> Email notification disabled by environment variable.
[2020-07-07T00:20:27.171Z] runbld>>> Slack notification disabled by environment variable.
[2020-07-07T00:20:33.085Z] Running on Jenkins in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19656
[2020-07-07T00:20:33.308Z] [INFO] getVaultSecret: Getting secrets
[2020-07-07T00:20:33.369Z] Masking supported pattern matches of $VAULT_ADDR or $VAULT_ROLE_ID or $VAULT_SECRET_ID
[2020-07-07T00:20:34.121Z] + chmod 755 generate-build-data.sh
[2020-07-07T00:20:34.121Z] + ./generate-build-data.sh https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats-beats-mbp/PR-19656/ https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats-beats-mbp/PR-19656/runs/3 ABORTED 7377687
[2020-07-07T00:20:34.121Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats-beats-mbp/PR-19656/runs/3/steps/?limit=10000 -o steps-info.json
[2020-07-07T00:20:36.604Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats-beats-mbp/PR-19656/runs/3/tests/?status=FAILED -o tests-errors.json
[2020-07-07T00:20:36.854Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats-beats-mbp/PR-19656/runs/3/log/ -o pipeline-log.txt

@kvch
Copy link
Contributor

kvch commented Jul 6, 2020

make check seems to be failing.

Steffen Siering added 2 commits July 7, 2020 00:15
This change adds the package filebeat/input/v2. It introduces the
interfaces for the v2 input API only. The integration with filebat,
actual InputManagers and input implementations will follow.

This is the first PR introducing the new API. The current state of the full implementation can be seen [here](https://github.com/urso/beats/tree/fb-input-v2-combined/filebeat/input/v2) and [sample inputs based on the new API](https://github.com/urso/beats/tree/fb-input-v2-combined/filebeat/features/input).

The full list of changes will include:
- Introduce v2 API interfaces
- Introduce [compatibility layer](https://github.com/urso/beats/tree/fb-input-v2-combined/filebeat/input/v2/compat) to integrate API with existing functionality
- Introduce helpers for writing [stateless](https://github.com/urso/beats/blob/fb-input-v2-combined/filebeat/input/v2/input-stateless/stateless.go) inputs.
- Introduce helpers for writing [inputs that store a state](https://github.com/urso/beats/tree/fb-input-v2-combined/filebeat/input/v2/input-cursor) between restarts.
- Integrate new API with [existing inputs and modules](https://github.com/urso/beats/blob/fb-input-v2-combined/filebeat/beater/filebeat.go#L301) in filebeat.

This PR only introduces the v2 API interfaces.

(cherry picked from commit 27e28c8)
@urso urso merged commit 3279b0b into elastic:7.x Jul 7, 2020
@urso urso deleted the backport_19158_7.x branch July 7, 2020 11:54
@zube zube bot removed the [zube]: Done label Oct 13, 2020
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants