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

[CI] Optimise stash/unstash performance #18473

Merged
merged 14 commits into from
May 14, 2020

Conversation

v1v
Copy link
Member

@v1v v1v commented May 13, 2020

What does this PR do?

Stash and unstash with the Google storage plugin, this could help to have a more predictable time, since it does run in the workers rather than in the master.

Compress/uncompress is required as long as the Google storage plugin does not support multiple wildcards. Although I'd suggest to use a zip/tarball rather than uploading each of the 40k files....

Why is it important?

Speed up the overall build time when there are build peaks. There was an initial approach to tackle the performance issues in #17939.

Tasks

  • Benchmark the overall stash/unstash time
  • Run manual tests

Performance

Linux

What Average Peaks
Stash 1.30m. 12mnts
StashV2 1.40m (similar) (9x faster)
Unstash 5mnts. 40mnts
UnstashV2 35sec (~9x faster) (~50x faster)

image

image

Windows

What Average Peaks
Unstash. 7mnts. 40mnts
UnstashV2 1.40m (~3x faster) (~30x faster)

Issues

  • zip step does not compress the .git folder
  • jar command does not preserve permissions.

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label May 13, 2020
@v1v v1v self-assigned this May 13, 2020
@v1v v1v added automation and removed needs_team Indicates that the issue/PR needs a Team:* label labels May 13, 2020
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label May 13, 2020
@v1v v1v added ci enhancement Team:Automation Label for the Observability productivity team and removed automation needs_team Indicates that the issue/PR needs a Team:* label labels May 13, 2020
Jenkinsfile Show resolved Hide resolved
Jenkinsfile Outdated Show resolved Hide resolved
Jenkinsfile Outdated Show resolved Hide resolved
Jenkinsfile Outdated Show resolved Hide resolved
Jenkinsfile Outdated Show resolved Hide resolved
@elasticmachine
Copy link
Collaborator

elasticmachine commented May 13, 2020

💔 Tests Failed

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

Test stats 🧪

Test Results
Failed 1
Passed 7768
Skipped 1236
Total 9005

Test errors

Expand to view the tests failures

  • Name: Build and Test / Metricbeat OSS Unit tests / test_process – test_system.Test

    • Status: FAILED
    • Age: 1
    • Duration: 1.355
    • Error Details: False is not true : fd not found in any process events

Steps errors

Expand to view the steps failures

  • Name: Mage build unitTest

    • Description: mage build unitTest

    • Result: FAILURE

    • Duration: 9 min 8 sec

    • Start Time: 2020-05-14T15:26:12.512+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

    • Result: FAILURE

    • Duration: 2 min 24 sec

    • Start Time: 2020-05-14T15:34:04.834+0000

    • log

Log output

Expand to view the last 100 lines of log output

[2020-05-14T16:19:12.484Z] + [ -f libbeat/build/coverage/full.cov ]
[2020-05-14T16:19:12.484Z] + FILE=metricbeat/build/coverage/full.cov
[2020-05-14T16:19:12.484Z] + [ -f metricbeat/build/coverage/full.cov ]
[2020-05-14T16:19:12.484Z] + FILE=packetbeat/build/coverage/full.cov
[2020-05-14T16:19:12.484Z] + [ -f packetbeat/build/coverage/full.cov ]
[2020-05-14T16:19:12.484Z] + FILE=winlogbeat/build/coverage/full.cov
[2020-05-14T16:19:12.484Z] + [ -f winlogbeat/build/coverage/full.cov ]
[2020-05-14T16:19:12.484Z] + FILE=journalbeat/build/coverage/full.cov
[2020-05-14T16:19:12.484Z] + [ -f journalbeat/build/coverage/full.cov ]
[2020-05-14T16:19:13.621Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18473/src/github.com/elastic/beats
[2020-05-14T16:19:13.973Z] + find . -type f -name TEST*.xml -path */build/* -delete
[2020-05-14T16:19:13.993Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18473/src/github.com/elastic/beats/Lint
[2020-05-14T16:19:14.158Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18473/src/github.com/elastic/beats/Elastic-Agent-x-pack
[2020-05-14T16:19:14.305Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18473/src/github.com/elastic/beats/Winlogbeat-oss
[2020-05-14T16:19:14.430Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18473/src/github.com/elastic/beats/Dockerlogbeat
[2020-05-14T16:19:14.601Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18473/src/github.com/elastic/beats/Journalbeat-oss
[2020-05-14T16:19:14.753Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18473/src/github.com/elastic/beats/Generators-Metricbeat-Linux
[2020-05-14T16:19:14.875Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18473/src/github.com/elastic/beats/Functionbeat-x-pack
[2020-05-14T16:19:15.029Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18473/src/github.com/elastic/beats/Elastic-Agent-x-pack-Windows
[2020-05-14T16:19:15.151Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18473/src/github.com/elastic/beats/Elastic-Agent-Mac-OS-X
[2020-05-14T16:19:15.328Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18473/src/github.com/elastic/beats/Metricbeat-crosscompile
[2020-05-14T16:19:15.473Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18473/src/github.com/elastic/beats/Metricbeat-OSS-Unit-tests
[2020-05-14T16:19:15.601Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18473/src/github.com/elastic/beats/Heartbeat-oss
[2020-05-14T16:19:15.767Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18473/src/github.com/elastic/beats/Auditbeat-x-pack
[2020-05-14T16:19:15.943Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18473/src/github.com/elastic/beats/Libbeat-x-pack
[2020-05-14T16:19:16.102Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18473/src/github.com/elastic/beats/Winlogbeat-Windows-x-pack
[2020-05-14T16:19:16.218Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18473/src/github.com/elastic/beats/Filebeat-Windows
[2020-05-14T16:19:16.350Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18473/src/github.com/elastic/beats/Auditbeat-Linux
[2020-05-14T16:19:16.468Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18473/src/github.com/elastic/beats/Filebeat-Mac-OS-X
[2020-05-14T16:19:16.615Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18473/src/github.com/elastic/beats/Packetbeat-oss
[2020-05-14T16:19:16.752Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18473/src/github.com/elastic/beats/Auditbeat-crosscompile
[2020-05-14T16:19:16.948Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18473/src/github.com/elastic/beats/Metricbeat-Windows
[2020-05-14T16:19:17.105Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18473/src/github.com/elastic/beats/Filebeat-x-pack
[2020-05-14T16:19:17.240Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18473/src/github.com/elastic/beats/Winlogbeat-Windows
[2020-05-14T16:19:17.368Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18473/src/github.com/elastic/beats/Heartbeat-Mac-OS-X
[2020-05-14T16:19:17.486Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18473/src/github.com/elastic/beats/Generators-Beat-Linux
[2020-05-14T16:19:17.606Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18473/src/github.com/elastic/beats/Metricbeat-Mac-OS-X
[2020-05-14T16:19:17.731Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18473/src/github.com/elastic/beats/Auditbeat-Mac-OS-X
[2020-05-14T16:19:17.860Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18473/src/github.com/elastic/beats/Functionbeat-Mac-OS-X-x-pack
[2020-05-14T16:19:17.978Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18473/src/github.com/elastic/beats/Filebeat-oss
[2020-05-14T16:19:18.102Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18473/src/github.com/elastic/beats/Metricbeat-OSS-Integration-tests
[2020-05-14T16:19:18.223Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18473/src/github.com/elastic/beats/Metricbeat-Python-integration-tests
[2020-05-14T16:19:18.388Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18473/src/github.com/elastic/beats/Heartbeat-Windows
[2020-05-14T16:19:18.513Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18473/src/github.com/elastic/beats/Libbeat-oss
[2020-05-14T16:19:18.691Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18473/src/github.com/elastic/beats/Auditbeat-Windows
[2020-05-14T16:19:18.806Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18473/src/github.com/elastic/beats/Generators-Metricbeat-Mac-OS-X
[2020-05-14T16:19:18.924Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18473/src/github.com/elastic/beats/Libbeat-crosscompile
[2020-05-14T16:19:19.049Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18473/src/github.com/elastic/beats/Libbeat-stress-tests
[2020-05-14T16:19:19.161Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18473/src/github.com/elastic/beats/Functionbeat-Windows
[2020-05-14T16:19:19.289Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18473/src/github.com/elastic/beats/Generators-Beat-Mac-OS-X
[2020-05-14T16:19:19.404Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18473/src/github.com/elastic/beats/Metricbeat-x-pack
[2020-05-14T16:19:19.833Z] + cat
[2020-05-14T16:19:19.833Z] + /usr/local/bin/runbld ./runbld-script
[2020-05-14T16:19:19.833Z] Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
[2020-05-14T16:19:26.460Z] runbld>>> runbld started
[2020-05-14T16:19:26.460Z] runbld>>> 1.6.11/a66728ff8f4356963772e6e6d2069392fa06acbe
[2020-05-14T16:19:27.849Z] runbld>>> The following profiles matched the job 'Beats/beats-beats-mbp/PR-18473' in order of occurrence in the config (last value wins).
[2020-05-14T16:19:29.280Z] runbld>>> Debug logging enabled.
[2020-05-14T16:19:29.280Z] runbld>>> Storing result
[2020-05-14T16:19:29.280Z] runbld>>> Store result: created {:total 2, :successful 2, :failed 0} 1
[2020-05-14T16:19:29.280Z] runbld>>> BUILD: https://c150076387b5421f9154dfbf536e5c60.us-west1.gcp.cloud.es.io:9243/build-1587637540455/t/20200514161928-F244E06B
[2020-05-14T16:19:29.280Z] runbld>>> Adding system facts.
[2020-05-14T16:19:30.224Z] runbld>>> Adding vcs info for the latest commit:  d8289017be1ceb974bece3bc8543c491579266e0
[2020-05-14T16:19:30.224Z] runbld>>> >>>>>>>>>>>> SCRIPT EXECUTION BEGIN >>>>>>>>>>>>
[2020-05-14T16:19:30.224Z] runbld>>> Adding /usr/lib/jvm/java-8-openjdk-amd64/bin to the path.
[2020-05-14T16:19:30.224Z] + echo 'Processing JUnit reports with runbld...'
[2020-05-14T16:19:30.224Z] Processing JUnit reports with runbld...
[2020-05-14T16:19:30.487Z] runbld>>> <<<<<<<<<<<< SCRIPT EXECUTION END <<<<<<<<<<<<
[2020-05-14T16:19:30.749Z] runbld>>> DURATION: 13ms
[2020-05-14T16:19:30.749Z] runbld>>> STDOUT: 40 bytes
[2020-05-14T16:19:30.749Z] runbld>>> STDERR: 49 bytes
[2020-05-14T16:19:30.749Z] runbld>>> WRAPPED PROCESS: SUCCESS (0)
[2020-05-14T16:19:30.749Z] runbld>>> Searching for build metadata in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18473/src/github.com/elastic/beats
[2020-05-14T16:19:32.137Z] runbld>>> Storing build metadata: 
[2020-05-14T16:19:32.137Z] runbld>>> Adding test report.
[2020-05-14T16:19:32.137Z] runbld>>> Searching for junit test output files with the pattern: TEST-.*\.xml$ in: /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18473/src/github.com/elastic/beats
[2020-05-14T16:19:33.090Z] runbld>>> Found 103 test output files
[2020-05-14T16:19:33.664Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18473/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-openmetrics.xml
[2020-05-14T16:19:33.664Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18473/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-istio.xml
[2020-05-14T16:19:33.664Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18473/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-iis.xml
[2020-05-14T16:19:33.664Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18473/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-activemq.xml
[2020-05-14T16:19:33.664Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18473/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-tomcat.xml
[2020-05-14T16:19:33.664Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18473/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-cloudfoundry.xml
[2020-05-14T16:19:34.613Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18473/src/github.com/elastic/beats/Metricbeat-OSS-Integration-tests/metricbeat/build/TEST-go-integration-windows.xml
[2020-05-14T16:19:34.613Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18473/src/github.com/elastic/beats/Metricbeat-OSS-Integration-tests/metricbeat/build/TEST-go-integration-graphite.xml
[2020-05-14T16:19:34.873Z] runbld>>> Test output logs contained: Errors: 0 Failures: 1 Tests: 8855 Skipped: 1020
[2020-05-14T16:19:35.134Z] runbld>>> Storing result
[2020-05-14T16:19:35.134Z] runbld>>> FAILURES: 1
[2020-05-14T16:19:35.395Z] runbld>>> Store result: updated {:total 2, :successful 2, :failed 0} 2
[2020-05-14T16:19:35.395Z] runbld>>> BUILD: https://c150076387b5421f9154dfbf536e5c60.us-west1.gcp.cloud.es.io:9243/build-1587637540455/t/20200514161928-F244E06B
[2020-05-14T16:19:35.395Z] runbld>>> Email notification disabled by environment variable.
[2020-05-14T16:19:35.395Z] runbld>>> Slack notification disabled by environment variable.
[2020-05-14T16:19:41.992Z] Running on worker-395930 in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18473
[2020-05-14T16:19:42.114Z] [INFO] getVaultSecret: Getting secrets
[2020-05-14T16:19:42.165Z] Masking supported pattern matches of $VAULT_ADDR or $VAULT_ROLE_ID or $VAULT_SECRET_ID
[2020-05-14T16:19:44.245Z] + chmod 755 generate-build-data.sh
[2020-05-14T16:19:44.245Z] + ./generate-build-data.sh https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats-beats-mbp/PR-18473/ https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats-beats-mbp/PR-18473/runs/18 FAILURE 4886948
[2020-05-14T16:19:44.246Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats-beats-mbp/PR-18473/runs/18/steps/?limit=10000 -o steps-info.json
[2020-05-14T16:19:46.513Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats-beats-mbp/PR-18473/runs/18/tests/?status=FAILED -o tests-errors.json
[2020-05-14T16:19:47.216Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats-beats-mbp/PR-18473/runs/18/log/ -o pipeline-log.txt

@v1v v1v force-pushed the feature/ci-stash-optimisation branch from f671050 to 842fe7f Compare May 13, 2020 17:37
@v1v v1v force-pushed the feature/ci-stash-optimisation branch 2 times, most recently from 1a01539 to 161fc4f Compare May 13, 2020 18:33
Jenkinsfile Outdated Show resolved Hide resolved
Jenkinsfile Outdated Show resolved Hide resolved
@@ -1027,7 +1029,7 @@ def terraformCleanup(String stashName, String directory) {
stage("Remove cloud scenarios in ${directory}"){
withCloudTestEnv() {
withBeatsEnv(false) {
unstash "terraform-${stashName}"
unstash("terraform-${stashName}")
Copy link
Member Author

Choose a reason for hiding this comment

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

cosmetic change

@@ -1176,7 +1178,7 @@ def runbld() {
// Unstash the test reports
stashedTestReports.each { k, v ->
dir(k) {
unstash v
unstash(v)
Copy link
Member Author

Choose a reason for hiding this comment

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

cosmetic change

@v1v v1v marked this pull request as ready for review May 14, 2020 11:21
@v1v v1v merged commit ea8a649 into elastic:master May 14, 2020
v1v added a commit to v1v/beats that referenced this pull request May 14, 2020
v1v added a commit to v1v/beats that referenced this pull request May 14, 2020
v1v added a commit to v1v/beats that referenced this pull request May 15, 2020
…w-oss

* upstream/master: (27 commits)
  Disable host fields for "cloud", panw, cef modules (elastic#18223)
  [docs] Rename monitoring collection from legacy internal collection to legacy collection (elastic#18504)
  Introduce auto detection of format (elastic#18095)
  Add additional fields to address issue elastic#18465 for googlecloud audit log (elastic#18472)
  Fix libbeat import path in seccomp policy template (elastic#18418)
  Address Okta input issue elastic#18530 (elastic#18534)
  [Ingest Manager] Avoid Chown on windows (elastic#18512)
  Fix Cisco ASA/FTD msgs that use a host name as NAT address (elastic#18376)
  [CI] Optimise stash/unstash performance (elastic#18473)
  Libbeat: Remove global loggers from libbeat/metric and libbeat/cloudid (elastic#18500)
  Fix PANW bad mapping of client/source and server/dest packets and bytes (elastic#18525)
  Add a file lock to the data directory on startup to prevent multiple agents. (elastic#18483)
  Followup to 12606 (elastic#18316)
  changed input from syslog to tcp/udp due to unsupported RFC (elastic#18447)
  Improve ECS field mappings in Sysmon module. (elastic#18381)
  [Elastic Agent] Cleaner output of inspect command  (elastic#18405)
  [Elastic Agent] Pick up version from libbeat (elastic#18350)
  Update communitybeats.asciidoc (elastic#18470)
  [Metricbeat] Change visualization interval from 15m to >=15m (elastic#18466)
  docs: Fix typo in kerberos docs (elastic#18503)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci enhancement Team:Automation Label for the Observability productivity team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants