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 #20804 to 7.x: [Elastic Agent] Add initial composable providers #20828

Merged
merged 1 commit into from
Aug 27, 2020

Conversation

blakerouse
Copy link
Contributor

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

What does this PR do?

Adds the initial context providers agent, env, host, and local. Adds the initial dynamic provider local_dynamic.

Adds composable.Controller that manages the state of the providers and calls the VarsCallback when the current state has been re-computed.

Why is it important?

To support the overall goal of #20781

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

* Add initial composable providers.

* Add controller.

* Cleanup more code, add deep copying of mappings.

(cherry picked from commit 2053297)
@elasticmachine
Copy link
Collaborator

Pinging @elastic/ingest-management (Team:Ingest Management)

@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Aug 27, 2020
@blakerouse blakerouse self-assigned this Aug 27, 2020
@elasticmachine
Copy link
Collaborator

💔 Tests Failed

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Pull request #20828 opened]

  • Start Time: 2020-08-27T14:55:26.222+0000

  • Duration: 123 min 8 sec

Test stats 🧪

Test Results
Failed 2
Passed 1575
Skipped 3
Total 1580

Test errors

Expand to view the tests failures

  • Name: Build and Test / Elastic Agent x-pack / TestConfigurableService – operation

    • Age: 1
    • Duration: 1.64
    • Error Details: Failed
  • Name: Build and Test / Elastic Agent Mac OS X / TestConfigurableService – operation

    • Age: 1
    • Duration: 0
    • Error Details: Failed

Steps errors

Expand to view the steps failures

  • Name: Mage build test

    • Description: mage build test

    • Duration: 2 min 56 sec

    • Start Time: 2020-08-27T15:21:41.493+0000

    • log

  • Name: Mage build unitTest

    • Description: mage build unitTest

    • Duration: 91 min 28 sec

    • Start Time: 2020-08-27T15:25:58.325+0000

    • log

  • Name: Recursively delete the current directory from the workspace

    • Description: script returned exit code 1

    • Duration: 0 min 11 sec

    • Start Time: 2020-08-27T16:57:34.372+0000

    • log

Log output

Expand to view the last 100 lines of log output

[2020-08-27T16:57:27.202Z]  OS/Arch:           darwin/amd64
[2020-08-27T16:57:27.202Z]  Experimental:      false
[2020-08-27T16:57:27.202Z] Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
[2020-08-27T16:57:27.202Z] It requires Docker daemon to be installed and running
[2020-08-27T16:57:28.177Z] + python .ci/scripts/pre_archive_test.py
[2020-08-27T16:57:28.656Z] Copy ./x-pack/elastic-agent/build into build/x-pack/elastic-agent/build
[2020-08-27T16:57:28.865Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20828/src/github.com/elastic/beats/build
[2020-08-27T16:57:28.984Z] Recording test results
[2020-08-27T16:57:29.304Z] Stashed 1 file(s)
[2020-08-27T16:57:29.379Z] Archiving artifacts
[2020-08-27T16:57:30.479Z] + python .ci/scripts/search_system_tests.py
[2020-08-27T16:57:30.723Z] [INFO] system-tests=''. If no empty then let's create a tarball
[2020-08-27T16:57:32.193Z] Post stage
[2020-08-27T16:57:32.210Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20828/src/github.com/elastic/beats
[2020-08-27T16:57:33.155Z] Starting "default"...
[2020-08-27T16:57:33.155Z] Machine "default" is already running.
[2020-08-27T16:57:33.633Z] Client:
[2020-08-27T16:57:33.633Z]  Version:           18.06.1-ce
[2020-08-27T16:57:33.633Z]  API version:       1.38
[2020-08-27T16:57:33.633Z]  Go version:        go1.10.3
[2020-08-27T16:57:33.633Z]  Git commit:        e68fc7a
[2020-08-27T16:57:33.633Z]  Built:             Tue Aug 21 17:21:31 2018
[2020-08-27T16:57:33.633Z]  OS/Arch:           darwin/amd64
[2020-08-27T16:57:33.633Z]  Experimental:      false
[2020-08-27T16:57:33.633Z] 
[2020-08-27T16:57:33.633Z] Server: Docker Engine - Community
[2020-08-27T16:57:33.633Z]  Engine:
[2020-08-27T16:57:33.633Z]   Version:          19.03.5
[2020-08-27T16:57:33.633Z]   API version:      1.40 (minimum version 1.12)
[2020-08-27T16:57:33.633Z]   Go version:       go1.12.12
[2020-08-27T16:57:33.633Z]   Git commit:       633a0ea838
[2020-08-27T16:57:33.633Z]   Built:            Wed Nov 13 07:28:45 2019
[2020-08-27T16:57:33.633Z]   OS/Arch:          linux/amd64
[2020-08-27T16:57:33.633Z]   Experimental:     false
[2020-08-27T16:57:33.633Z]  containerd:
[2020-08-27T16:57:33.633Z]   Version:          v1.2.10
[2020-08-27T16:57:33.633Z]   GitCommit:        b34a5c8af56e510852c35414db4c1f4fa6172339
[2020-08-27T16:57:33.633Z]  runc:
[2020-08-27T16:57:33.633Z]   Version:          1.0.0-rc8+dev
[2020-08-27T16:57:33.633Z]   GitCommit:        3e425f80a8c931f88e6d94a8c831b9d5aa481657
[2020-08-27T16:57:33.633Z]  docker-init:
[2020-08-27T16:57:33.633Z]   Version:          0.18.0
[2020-08-27T16:57:33.633Z]   GitCommit:        fec3683
[2020-08-27T16:57:45.066Z] Failed in branch Elastic Agent Mac OS X
[2020-08-27T16:57:54.797Z] [INFO] unstashV2: JOB_GCS_BUCKET is set. bucket param got precedency instead.
[2020-08-27T16:57:54.839Z] [INFO] unstashV2: JOB_GCS_CREDENTIALS is set. credentialsId param got precedency instead.
[2020-08-27T16:57:54.944Z] [Google Cloud Storage Plugin] Found 1 files to download from pattern: gs://beats-ci-temp/Beats/beats/PR-20828-1/source/source.tgz
[2020-08-27T16:57:54.963Z] [Google Cloud Storage Plugin] Downloading: Beats/beats/PR-20828-1/source/source.tgz to local path: /var/lib/jenkins/workspace/Beats_beats_PR-20828/source.tgz
[2020-08-27T16:58:02.692Z] + tar --version
[2020-08-27T16:58:03.005Z] + tar -xpf source.tgz
[2020-08-27T16:58:13.334Z] + rm source.tgz
[2020-08-27T16:58:13.357Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20828/src/github.com/elastic/beats
[2020-08-27T16:58:13.404Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20828/src/github.com/elastic/beats/Lint
[2020-08-27T16:58:13.643Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20828/src/github.com/elastic/beats/Elastic-Agent-x-pack
[2020-08-27T16:58:13.814Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20828/src/github.com/elastic/beats/Elastic-Agent-x-pack-Windows
[2020-08-27T16:58:13.972Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20828/src/github.com/elastic/beats/Elastic-Agent-Mac-OS-X
[2020-08-27T16:58:14.493Z] + cat
[2020-08-27T16:58:14.493Z] + /usr/local/bin/runbld ./runbld-script --job-name elastic+beats+pull-request
[2020-08-27T16:58:14.493Z] Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
[2020-08-27T16:58:19.769Z] runbld>>> runbld started
[2020-08-27T16:58:19.769Z] runbld>>> 1.6.12/f45d832f2ba0aa2722ab4ec1fda8ad140f027f8b
[2020-08-27T16:58:21.680Z] runbld>>> The following profiles matched the job 'elastic+beats+pull-request' in order of occurrence in the config (last value wins).
[2020-08-27T16:58:21.680Z] runbld>>> Matches in the system config:
[2020-08-27T16:58:21.680Z] runbld>>> - Matched ^elastic\+beats
[2020-08-27T16:58:21.680Z] runbld>>> - Matched ^elastic\+beats\+pull-request
[2020-08-27T16:58:22.615Z] runbld>>> Debug logging enabled.
[2020-08-27T16:58:22.615Z] runbld>>> Storing result
[2020-08-27T16:58:22.874Z] runbld>>> Store result: created {:total 2, :successful 2, :failed 0} 1
[2020-08-27T16:58:22.874Z] runbld>>> BUILD: https://c150076387b5421f9154dfbf536e5c60.us-west1.gcp.cloud.es.io:9243/build-1597739501209/t/20200827165822-D64FF5B7
[2020-08-27T16:58:22.874Z] runbld>>> Adding system facts.
[2020-08-27T16:58:23.811Z] runbld>>> Adding vcs info for the latest commit:  1f4b2fe57cf7003b55f2b3fb958891e35bec8fb2
[2020-08-27T16:58:23.811Z] runbld>>> >>>>>>>>>>>> SCRIPT EXECUTION BEGIN >>>>>>>>>>>>
[2020-08-27T16:58:23.811Z] runbld>>> Adding /usr/lib/jvm/java-8-openjdk-amd64/bin to the path.
[2020-08-27T16:58:23.811Z] Processing JUnit reports with runbld...
[2020-08-27T16:58:23.811Z] + echo 'Processing JUnit reports with runbld...'
[2020-08-27T16:58:24.070Z] runbld>>> <<<<<<<<<<<< SCRIPT EXECUTION END <<<<<<<<<<<<
[2020-08-27T16:58:24.071Z] runbld>>> DURATION: 44ms
[2020-08-27T16:58:24.071Z] runbld>>> STDOUT: 40 bytes
[2020-08-27T16:58:24.071Z] runbld>>> STDERR: 49 bytes
[2020-08-27T16:58:24.071Z] runbld>>> WRAPPED PROCESS: SUCCESS (0)
[2020-08-27T16:58:24.071Z] runbld>>> Searching for build metadata in /var/lib/jenkins/workspace/Beats_beats_PR-20828
[2020-08-27T16:58:25.008Z] runbld>>> Storing build metadata: 
[2020-08-27T16:58:25.008Z] runbld>>> Adding test report.
[2020-08-27T16:58:25.008Z] runbld>>> Searching for junit test output files with the pattern: TEST-.*\.xml$ in: /var/lib/jenkins/workspace/Beats_beats_PR-20828/src/github.com/elastic/beats
[2020-08-27T16:58:25.952Z] runbld>>> Found 3 test output files
[2020-08-27T16:58:26.214Z] runbld>>> Test output logs contained: Errors: 0 Failures: 2 Tests: 1580 Skipped: 0
[2020-08-27T16:58:26.473Z] runbld>>> Storing result
[2020-08-27T16:58:26.473Z] runbld>>> FAILURES: 2
[2020-08-27T16:58:27.041Z] runbld>>> Store result: updated {:total 2, :successful 2, :failed 0} 2
[2020-08-27T16:58:27.041Z] runbld>>> BUILD: https://c150076387b5421f9154dfbf536e5c60.us-west1.gcp.cloud.es.io:9243/build-1597739501209/t/20200827165822-D64FF5B7
[2020-08-27T16:58:27.300Z] runbld>>> Email notification disabled by environment variable.
[2020-08-27T16:58:27.300Z] runbld>>> Slack notification disabled by environment variable.
[2020-08-27T16:58:33.126Z] Running on Jenkins in /var/lib/jenkins/workspace/Beats_beats_PR-20828
[2020-08-27T16:58:33.295Z] [INFO] getVaultSecret: Getting secrets
[2020-08-27T16:58:33.370Z] Masking supported pattern matches of $VAULT_ADDR or $VAULT_ROLE_ID or $VAULT_SECRET_ID
[2020-08-27T16:58:34.438Z] + chmod 755 generate-build-data.sh
[2020-08-27T16:58:34.438Z] + ./generate-build-data.sh https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-20828/ https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-20828/runs/1 FAILURE 7387946
[2020-08-27T16:58:34.438Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-20828/runs/1/steps/?limit=10000 -o steps-info.json
[2020-08-27T16:58:35.349Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-20828/runs/1/tests/?status=FAILED -o tests-errors.json
[2020-08-27T16:58:35.349Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-20828/runs/1/log/ -o pipeline-log.txt

Copy link
Contributor

@ph ph left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

backport LGTM

Copy link
Contributor

@ph ph left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

backport LGTM

@blakerouse blakerouse merged commit 62b0871 into elastic:7.x Aug 27, 2020
@blakerouse blakerouse deleted the backport_20804_7.x branch August 27, 2020 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants