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 #20400 to 7.x: New agent structure (symlinks) #20960

Merged
merged 5 commits into from
Sep 22, 2020

Conversation

michalpristas
Copy link
Contributor

@michalpristas michalpristas commented Sep 3, 2020

Cherry-pick of PR #21002: Support for UPGRADE_ACTION
Cherry-pick of PR #20986 which fixes DEB packages
Cherry-pick of PR #20400 to 7.x branch. Original message:

What does this PR do?

Different approach to #20307
Working with symlinks turned out to be a bit tricky due to how OSes handles Working Directory and executable names.
Windows on top of that requires that service name which is used to be registered is in Abs form and it needs to match the one used to reguiter the service (hence the magic with os.Args[0] replacements in the code, os.Args[0] is used in lib as a service name)

Due to the approach of determining WD when running a binary using a symlink paths.yml is either on the symlink level (windows) or on executable level (darwin and linux).
These will get regenerated during future Upgrade/Rollback.

Why is it important?

For future upgrade work

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.

Same as with previous PR this is tested on linux/darwin and windws (service and direct run)
image

[Ingest Manager] New agent structure (symlinks) (elastic#20400)
@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 Sep 3, 2020
Copy link
Contributor

@blakerouse blakerouse left a comment

Choose a reason for hiding this comment

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

Backport looks good.

@elasticmachine
Copy link
Collaborator

elasticmachine commented Sep 3, 2020

💔 Tests Failed

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Pull request #20960 updated]

  • Start Time: 2020-09-22T12:39:07.573+0000

  • Duration: 80 min 0 sec

Test stats 🧪

Test Results
Failed 1
Passed 20247
Skipped 1862
Total 22110

Test errors

Expand to view the tests failures

  • Name: Build and Test / Filebeat oss / test_default_settings – filebeat.tests.system.test_autodiscover.TestAutodiscover

    • Age: 1
    • Duration: 90.005
    • Error Details: Failed: Timeout >90.0s

Steps errors

Expand to view the steps failures

  • Name: Mage build test
    • Description: mage build test

    • Duration: 33 min 45 sec

    • Start Time: 2020-09-22T13:04:16.740+0000

    • log

Log output

Expand to view the last 100 lines of log output

[2020-09-22T13:58:37.188Z] + rm source.tgz
[2020-09-22T13:58:37.208Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats
[2020-09-22T13:58:37.239Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Lint
[2020-09-22T13:58:37.364Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Winlogbeat-oss
[2020-09-22T13:58:37.484Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Elastic-Agent-x-pack
[2020-09-22T13:58:37.601Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Auditbeat-crosscompile
[2020-09-22T13:58:37.731Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Elastic-Agent-Mac-OS-X
[2020-09-22T13:58:37.883Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Generators-Metricbeat-Linux
[2020-09-22T13:58:38.012Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/dockerlogbeat
[2020-09-22T13:58:38.162Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Journalbeat
[2020-09-22T13:58:38.280Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Functionbeat-x-pack
[2020-09-22T13:58:38.405Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Filebeat-x-pack-Mac-OS-X
[2020-09-22T13:58:38.525Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Auditbeat-oss-Mac-OS-X
[2020-09-22T13:58:38.646Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Packetbeat-Linux
[2020-09-22T13:58:38.771Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Auditbeat-x-pack-Mac-OS-X
[2020-09-22T13:58:38.890Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Elastic-Agent-x-pack-Windows
[2020-09-22T13:58:38.999Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Filebeat-Mac-OS-X
[2020-09-22T13:58:39.111Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Metricbeat-OSS-Unit-tests
[2020-09-22T13:58:39.231Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Heartbeat-Windows
[2020-09-22T13:58:39.352Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Generators-Metricbeat-Mac-OS-X
[2020-09-22T13:58:39.478Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Heartbeat-oss
[2020-09-22T13:58:39.620Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Auditbeat-x-pack-Windows
[2020-09-22T13:58:39.727Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Auditbeat-oss-Windows
[2020-09-22T13:58:39.827Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Heartbeat-Mac-OS-X
[2020-09-22T13:58:39.928Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Metricbeat-crosscompile
[2020-09-22T13:58:40.056Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Auditbeat-x-pack
[2020-09-22T13:58:40.170Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Functionbeat-Mac-OS-X-x-pack
[2020-09-22T13:58:40.297Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Winlogbeat-Windows-x-pack
[2020-09-22T13:58:40.444Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Packetbeat-Mac-OS-X
[2020-09-22T13:58:40.545Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Metricbeat-x-pack-Mac-OS-X
[2020-09-22T13:58:40.656Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Auditbeat-oss-Linux
[2020-09-22T13:58:40.768Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Packetbeat-Windows
[2020-09-22T13:58:40.877Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Libbeat-x-pack
[2020-09-22T13:58:40.993Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Functionbeat-Windows
[2020-09-22T13:58:41.098Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Filebeat-Windows
[2020-09-22T13:58:41.209Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Winlogbeat-Windows
[2020-09-22T13:58:41.343Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Filebeat-x-pack-Windows
[2020-09-22T13:58:41.453Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Generators-Beat-Mac-OS-X
[2020-09-22T13:58:41.575Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Metricbeat-Mac-OS-X
[2020-09-22T13:58:41.703Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Metricbeat-x-pack-Windows
[2020-09-22T13:58:41.824Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Metricbeat-Windows
[2020-09-22T13:58:41.943Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Generators-Beat-Linux
[2020-09-22T13:58:42.101Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Metricbeat-OSS-Go-Integration-tests
[2020-09-22T13:58:42.270Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Filebeat-oss
[2020-09-22T13:58:42.412Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Metricbeat-OSS-Python-Integration-tests
[2020-09-22T13:58:42.552Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Filebeat-x-pack
[2020-09-22T13:58:42.684Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Libbeat-oss
[2020-09-22T13:58:42.854Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Libbeat-crosscompile
[2020-09-22T13:58:43.019Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Libbeat-stress-tests
[2020-09-22T13:58:43.166Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Metricbeat-x-pack
[2020-09-22T13:58:43.792Z] + cat
[2020-09-22T13:58:43.792Z] + /usr/local/bin/runbld ./runbld-script --job-name elastic+beats+pull-request
[2020-09-22T13:58:43.792Z] Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
[2020-09-22T13:58:50.450Z] runbld>>> runbld started
[2020-09-22T13:58:50.450Z] runbld>>> 1.6.12/f45d832f2ba0aa2722ab4ec1fda8ad140f027f8b
[2020-09-22T13:58:51.852Z] runbld>>> The following profiles matched the job 'elastic+beats+pull-request' in order of occurrence in the config (last value wins).
[2020-09-22T13:58:51.852Z] runbld>>> Matches in the system config:
[2020-09-22T13:58:51.852Z] runbld>>> - Matched ^elastic\+beats
[2020-09-22T13:58:51.852Z] runbld>>> - Matched ^elastic\+beats\+pull-request
[2020-09-22T13:58:53.244Z] runbld>>> Debug logging enabled.
[2020-09-22T13:58:53.244Z] runbld>>> Storing result
[2020-09-22T13:58:53.244Z] runbld>>> Store result: created {:total 2, :successful 2, :failed 0} 1
[2020-09-22T13:58:53.244Z] runbld>>> BUILD: https://c150076387b5421f9154dfbf536e5c60.us-west1.gcp.cloud.es.io:9243/build-1597739501209/t/20200922135852-21A5D52D
[2020-09-22T13:58:53.244Z] runbld>>> Adding system facts.
[2020-09-22T13:58:54.641Z] runbld>>> Adding vcs info for the latest commit:  a0018b7eeeb1c11ca0fa86731c12b81a57a091c8
[2020-09-22T13:58:54.641Z] runbld>>> >>>>>>>>>>>> SCRIPT EXECUTION BEGIN >>>>>>>>>>>>
[2020-09-22T13:58:54.641Z] runbld>>> Adding /usr/lib/jvm/java-8-openjdk-amd64/bin to the path.
[2020-09-22T13:58:54.641Z] Processing JUnit reports with runbld...
[2020-09-22T13:58:54.641Z] + echo 'Processing JUnit reports with runbld...'
[2020-09-22T13:58:54.905Z] runbld>>> <<<<<<<<<<<< SCRIPT EXECUTION END <<<<<<<<<<<<
[2020-09-22T13:58:54.905Z] runbld>>> DURATION: 16ms
[2020-09-22T13:58:54.905Z] runbld>>> STDOUT: 40 bytes
[2020-09-22T13:58:54.905Z] runbld>>> STDERR: 49 bytes
[2020-09-22T13:58:54.905Z] runbld>>> WRAPPED PROCESS: SUCCESS (0)
[2020-09-22T13:58:54.905Z] runbld>>> Searching for build metadata in /var/lib/jenkins/workspace/Beats_beats_PR-20960
[2020-09-22T13:58:55.853Z] runbld>>> Storing build metadata: 
[2020-09-22T13:58:55.853Z] runbld>>> Adding test report.
[2020-09-22T13:58:55.854Z] runbld>>> Searching for junit test output files with the pattern: TEST-.*\.xml$ in: /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats
[2020-09-22T13:58:56.800Z] runbld>>> Found 140 test output files
[2020-09-22T13:58:57.377Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-activemq.xml
[2020-09-22T13:58:57.377Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-openmetrics.xml
[2020-09-22T13:58:57.377Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-istio.xml
[2020-09-22T13:58:57.377Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-iis.xml
[2020-09-22T13:58:57.378Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-tomcat.xml
[2020-09-22T13:58:58.776Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Metricbeat-OSS-Go-Integration-tests/metricbeat/build/TEST-go-integration-graphite.xml
[2020-09-22T13:58:58.776Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-20960/src/github.com/elastic/beats/Metricbeat-OSS-Go-Integration-tests/metricbeat/build/TEST-go-integration-windows.xml
[2020-09-22T13:59:00.697Z] runbld>>> Test output logs contained: Errors: 0 Failures: 1 Tests: 21955 Skipped: 1578
[2020-09-22T13:59:00.697Z] runbld>>> Storing result
[2020-09-22T13:59:00.697Z] runbld>>> FAILURES: 1
[2020-09-22T13:59:00.960Z] runbld>>> Store result: updated {:total 2, :successful 2, :failed 0} 2
[2020-09-22T13:59:00.960Z] runbld>>> BUILD: https://c150076387b5421f9154dfbf536e5c60.us-west1.gcp.cloud.es.io:9243/build-1597739501209/t/20200922135852-21A5D52D
[2020-09-22T13:59:01.221Z] runbld>>> Email notification disabled by environment variable.
[2020-09-22T13:59:01.221Z] runbld>>> Slack notification disabled by environment variable.
[2020-09-22T13:59:06.749Z] Running on Jenkins in /var/lib/jenkins/workspace/Beats_beats_PR-20960
[2020-09-22T13:59:06.877Z] [INFO] getVaultSecret: Getting secrets
[2020-09-22T13:59:06.973Z] Masking supported pattern matches of $VAULT_ADDR or $VAULT_ROLE_ID or $VAULT_SECRET_ID
[2020-09-22T13:59:07.832Z] + chmod 755 generate-build-data.sh
[2020-09-22T13:59:07.832Z] + ./generate-build-data.sh https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-20960/ https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-20960/runs/3 FAILURE 4799992
[2020-09-22T13:59:07.832Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-20960/runs/3/steps/?limit=10000 -o steps-info.json
[2020-09-22T13:59:11.060Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-20960/runs/3/tests/?status=FAILED -o tests-errors.json

@michalpristas
Copy link
Contributor Author

Cherry picking #20986 for rpm/deb fixes

@michalpristas michalpristas merged commit 98e2505 into elastic:7.x Sep 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants