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

[Health API E2E] Align on agent python version and avoid pip install. #16704

Merged
merged 2 commits into from
Nov 20, 2024

Conversation

mashhurs
Copy link
Contributor

@mashhurs mashhurs commented Nov 20, 2024

Release notes

[rn:skip]

What does this PR do?

Fixes the CI hang caused by installing pip. This change aligns on python installed on BK agent.
Health API E2E run: https://buildkite.com/elastic/logstash-health-report-tests-pipeline/builds/99

Why is it important/What is the impact to the user?

No impact.

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 (and/or docker env variables)
  • [ ] I have added tests that prove my fix is effective or that my feature works

Author's Checklist

  • [ ]

How to test this PR locally

  • It cannot be tested locally since it is an agent specific.

Related issues

Use cases

Screenshots

Logs

buildkite-agent@mst-logstash-ubuntu-2204:~/logstash$ ./gradlew clean bootstrap assemble installDefaultGems
Downloading https://services.gradle.org/distributions/gradle-8.7-bin.zip
............10%.............20%.............30%.............40%............50%.............60%.............70%.............80%.............90%............100%

Welcome to Gradle 8.7!

Here are the highlights of this release:
 - Compiling and testing with Java 22
 - Cacheable Groovy script compilation
 - New methods in lazy collection properties

For more details see https://docs.gradle.org/8.7/release-notes.html

To honour the JVM settings for this build a single-use Daemon process will be forked. For more on this, please refer to https://docs.gradle.org/8.7/userguide/gradle_daemon.html#sec:disabling_the_daemon in the Gradle documentation.
Daemon will be stopped at the end of the build 

> Task :downloadJRuby
Download https://repo1.maven.org/maven2/org/jruby/jruby-dist/9.4.9.0/jruby-dist-9.4.9.0-bin.tar.gz

> Task :logstash-core:compileJava
Note: Processing Log4j annotations
Note: Annotations processed
Note: Processing Log4j annotations
Note: No elements to process

> Task :installDefaultGems
Skipping bundler install...
Building logstash-core using gradle
./gradlew assemble
[plugin:install-default] Installing default plugins
Installing logstash-codec-avro, logstash-codec-cef, logstash-codec-collectd, logstash-codec-dots, logstash-codec-edn, logstash-codec-edn_lines, logstash-codec-es_bulk, logstash-codec-fluent, logstash-codec-graphite, logstash-codec-json, logstash-codec-json_lines, logstash-codec-line, logstash-codec-msgpack, logstash-codec-multiline, logstash-codec-netflow, logstash-codec-plain, logstash-codec-rubydebug, logstash-filter-aggregate, logstash-filter-anonymize, logstash-filter-cidr, logstash-filter-clone, logstash-filter-csv, logstash-filter-date, logstash-filter-de_dot, logstash-filter-dissect, logstash-filter-dns, logstash-filter-drop, logstash-filter-elastic_integration, logstash-filter-elasticsearch, logstash-filter-fingerprint, logstash-filter-geoip, logstash-filter-grok, logstash-filter-http, logstash-filter-json, logstash-filter-kv, logstash-filter-memcached, logstash-filter-metrics, logstash-filter-mutate, logstash-filter-prune, logstash-filter-ruby, logstash-filter-sleep, logstash-filter-split, logstash-filter-syslog_pri, logstash-filter-throttle, logstash-filter-translate, logstash-filter-truncate, logstash-filter-urldecode, logstash-filter-useragent, logstash-filter-uuid, logstash-filter-xml, logstash-input-azure_event_hubs, logstash-input-beats, logstash-input-couchdb_changes, logstash-input-dead_letter_queue, logstash-input-elasticsearch, logstash-input-exec, logstash-input-file, logstash-input-ganglia, logstash-input-gelf, logstash-input-generator, logstash-input-graphite, logstash-input-heartbeat, logstash-input-http, logstash-input-http_poller, logstash-input-jms, logstash-input-pipe, logstash-input-redis, logstash-input-stdin, logstash-input-syslog, logstash-input-tcp, logstash-input-twitter, logstash-input-udp, logstash-input-unix, logstash-integration-elastic_enterprise_search, logstash-input-elastic_serverless_forwarder, logstash-integration-jdbc, logstash-integration-kafka, logstash-integration-logstash, logstash-integration-rabbitmq, logstash-integration-snmp, logstash-integration-aws, logstash-output-csv, logstash-output-elasticsearch, logstash-output-email, logstash-output-file, logstash-output-graphite, logstash-output-http, logstash-output-lumberjack, logstash-output-nagios, logstash-output-null, logstash-output-pipe, logstash-output-redis, logstash-output-stdout, logstash-output-tcp, logstash-output-udp, logstash-output-webhdfs
Error Errno::ENOENT, retrying 1/10
No such file or directory - /opt/buildkite-agent/.m2/repository/org/snakeyaml/snakeyaml-engine/2.7/snakeyaml-engine-2.7.jar -- module org.snakeyaml.engine.v2
Installation successful

BUILD SUCCESSFUL in 2m 57s
43 actionable tasks: 35 executed, 8 up-to-date
buildkite-agent@mst-logstash-ubuntu-2204:~/logstash$ python3 .buildkite/scripts/health-report-tests/main.py
Starting Logstash Health Report Integration test.
LS_BRANCH is not specified, using main branch.
Building Logstash...
Note: Processing Log4j annotations
Note: Annotations processed
Note: Processing Log4j annotations
Note: No elements to process
./gradlew assemble
Error Errno::ENOENT, retrying 1/10
No such file or directory - /opt/buildkite-agent/.m2/repository/org/snakeyaml/snakeyaml-engine/2.7/snakeyaml-engine-2.7.jar -- module org.snakeyaml.engine.v2
Logstash has successfully built.
logstash-integration-failure_injector successfully installed.
Validating /opt/buildkite-agent/logstash/.buildkite/scripts/health-report-tests/tests/abnormal-termination.yaml scenario file.
Validation succeeded.
Validating /opt/buildkite-agent/logstash/.buildkite/scripts/health-report-tests/tests/multipipeline.yaml scenario file.
Validation succeeded.
Validating /opt/buildkite-agent/logstash/.buildkite/scripts/health-report-tests/tests/normal-termination.yaml scenario file.
Validation succeeded.
Validating /opt/buildkite-agent/logstash/.buildkite/scripts/health-report-tests/tests/backpressure-5m.yaml scenario file.
Validation succeeded.
Validating /opt/buildkite-agent/logstash/.buildkite/scripts/health-report-tests/tests/slow-start.yaml scenario file.
Validation succeeded.
Validating /opt/buildkite-agent/logstash/.buildkite/scripts/health-report-tests/tests/backpressure-1m.yaml scenario file.
Validation succeeded.
Testing `Abnormally terminated pipeline` scenario.
Logstash is running with PID: 3533.
Test requires to wait for `5` seconds.
Scenario `Abnormally terminated pipeline` expectaion meets the health report stats.
Logstash stopped.
Testing `Multi pipeline` scenario.
Logstash is running with PID: 3628.
Test requires to wait for `10` seconds.
Scenario `Multi pipeline` expectaion meets the health report stats.
Logstash stopped.
Testing `Successfully terminated pipeline` scenario.
Logstash is running with PID: 3733.
Test requires to wait for `5` seconds.
Scenario `Successfully terminated pipeline` expectaion meets the health report stats.
Logstash stopped.
Testing `Backpressured in 5min pipeline` scenario.
Logstash is running with PID: 3819.
Test requires to wait for `310` seconds.
Differences found in 'expectation' section between YAML content and stats:
Difference: {'status': {'expected': 'red', 'got': 'yellow'}}
Difference: {'symptom': {'expected': '1 indicator is unhealthy (`pipelines`)', 'got': '1 indicator is concerning (`pipelines`)'}}
Difference: {'status': {'expected': 'red', 'got': 'yellow'}}
Difference: {'symptom': {'expected': '1 indicator is unhealthy (`backpressure-5m-pp`)', 'got': '1 indicator is concerning (`backpressure-5m-pp`)'}}
Difference: {'status': {'expected': 'red', 'got': 'yellow'}}
Difference: {'symptom': {'expected': 'The pipeline is unhealthy; 1 area is impacted and 1 diagnosis is available', 'got': 'The pipeline is concerning; 1 area is impacted and 1 diagnosis is available'}}
Difference: {'diagnosis': {'expected': [{'id': 'logstash:health:pipeline:flow:worker_utilization:diagnosis:5m-blocked', 'cause': 'pipeline workers have been completely blocked for at least five minutes', 'action': 'address bottleneck or add resources'}], 'got': [{'id': 'logstash:health:pipeline:flow:worker_utilization:diagnosis:5m-nearly-blocked', 'cause': 'pipeline workers have been nearly blocked for at least five minutes', 'action': 'address bottleneck or add resources', 'help_url': 'https://www.elastic.co/guide/en/logstash/master/health-report-pipeline-flow-worker-utilization.html#nearly-blocked-5m'}]}}
Differences found in 'expectation' section between YAML content and stats:
Difference: {'status': {'expected': 'red', 'got': 'yellow'}}
Difference: {'symptom': {'expected': '1 indicator is unhealthy (`pipelines`)', 'got': '1 indicator is concerning (`pipelines`)'}}
Difference: {'status': {'expected': 'red', 'got': 'yellow'}}
Difference: {'symptom': {'expected': '1 indicator is unhealthy (`backpressure-5m-pp`)', 'got': '1 indicator is concerning (`backpressure-5m-pp`)'}}
Difference: {'status': {'expected': 'red', 'got': 'yellow'}}
Difference: {'symptom': {'expected': 'The pipeline is unhealthy; 1 area is impacted and 1 diagnosis is available', 'got': 'The pipeline is concerning; 1 area is impacted and 1 diagnosis is available'}}
Difference: {'diagnosis': {'expected': [{'id': 'logstash:health:pipeline:flow:worker_utilization:diagnosis:5m-blocked', 'cause': 'pipeline workers have been completely blocked for at least five minutes', 'action': 'address bottleneck or add resources'}], 'got': [{'id': 'logstash:health:pipeline:flow:worker_utilization:diagnosis:5m-nearly-blocked', 'cause': 'pipeline workers have been nearly blocked for at least five minutes', 'action': 'address bottleneck or add resources', 'help_url': 'https://www.elastic.co/guide/en/logstash/master/health-report-pipeline-flow-worker-utilization.html#nearly-blocked-5m'}]}}
Differences found in 'expectation' section between YAML content and stats:
Difference: {'status': {'expected': 'red', 'got': 'yellow'}}
Difference: {'symptom': {'expected': '1 indicator is unhealthy (`pipelines`)', 'got': '1 indicator is concerning (`pipelines`)'}}
Difference: {'status': {'expected': 'red', 'got': 'yellow'}}
Difference: {'symptom': {'expected': '1 indicator is unhealthy (`backpressure-5m-pp`)', 'got': '1 indicator is concerning (`backpressure-5m-pp`)'}}
Difference: {'status': {'expected': 'red', 'got': 'yellow'}}
Difference: {'symptom': {'expected': 'The pipeline is unhealthy; 1 area is impacted and 1 diagnosis is available', 'got': 'The pipeline is concerning; 1 area is impacted and 1 diagnosis is available'}}
Difference: {'diagnosis': {'expected': [{'id': 'logstash:health:pipeline:flow:worker_utilization:diagnosis:5m-blocked', 'cause': 'pipeline workers have been completely blocked for at least five minutes', 'action': 'address bottleneck or add resources'}], 'got': [{'id': 'logstash:health:pipeline:flow:worker_utilization:diagnosis:5m-nearly-blocked', 'cause': 'pipeline workers have been nearly blocked for at least five minutes', 'action': 'address bottleneck or add resources', 'help_url': 'https://www.elastic.co/guide/en/logstash/master/health-report-pipeline-flow-worker-utilization.html#nearly-blocked-5m'}]}}
Differences found in 'expectation' section between YAML content and stats:
Difference: {'status': {'expected': 'red', 'got': 'yellow'}}
Difference: {'symptom': {'expected': '1 indicator is unhealthy (`pipelines`)', 'got': '1 indicator is concerning (`pipelines`)'}}
Difference: {'status': {'expected': 'red', 'got': 'yellow'}}
Difference: {'symptom': {'expected': '1 indicator is unhealthy (`backpressure-5m-pp`)', 'got': '1 indicator is concerning (`backpressure-5m-pp`)'}}
Difference: {'status': {'expected': 'red', 'got': 'yellow'}}
Difference: {'symptom': {'expected': 'The pipeline is unhealthy; 1 area is impacted and 1 diagnosis is available', 'got': 'The pipeline is concerning; 1 area is impacted and 1 diagnosis is available'}}
Difference: {'diagnosis': {'expected': [{'id': 'logstash:health:pipeline:flow:worker_utilization:diagnosis:5m-blocked', 'cause': 'pipeline workers have been completely blocked for at least five minutes', 'action': 'address bottleneck or add resources'}], 'got': [{'id': 'logstash:health:pipeline:flow:worker_utilization:diagnosis:5m-nearly-blocked', 'cause': 'pipeline workers have been nearly blocked for at least five minutes', 'action': 'address bottleneck or add resources', 'help_url': 'https://www.elastic.co/guide/en/logstash/master/health-report-pipeline-flow-worker-utilization.html#nearly-blocked-5m'}]}}
Scenario `Backpressured in 5min pipeline` expectaion meets the health report stats.
Logstash didn't stop in 1min, sending SIGTERM signal.
Testing `Slow start pipeline` scenario.
Logstash is running with PID: 3958.
Test requires to wait for `0` seconds.
Scenario `Slow start pipeline` expectaion meets the health report stats.
Logstash stopped.
Testing `Backpressured in 1min pipeline` scenario.
Logstash is running with PID: 4049.
Test requires to wait for `70` seconds.
Scenario `Backpressured in 1min pipeline` expectaion meets the health report stats.
Logstash stopped.
buildkite-agent@mst-logstash-ubuntu-2204:~/logstash$ 

…is commit aligns on agent python version which has a default pip installed.
@mashhurs mashhurs marked this pull request as ready for review November 20, 2024 17:42
Copy link
Member

@donoghuc donoghuc left a comment

Choose a reason for hiding this comment

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

Other than the suggestion, this looks good. Pip comes with python 3.4 and later, no need to try to install an extra package in this step. https://docs.python.org/3/whatsnew/3.4.html#pep-453-explicit-bootstrapping-of-pip-in-python-installations

Improve readability.

Co-authored-by: Cas Donoghue <[email protected]>
@mashhurs mashhurs merged commit 15b2034 into elastic:main Nov 20, 2024
3 of 4 checks passed
@mashhurs mashhurs deleted the health-api-e2e-avoid-pip-install branch November 20, 2024 18:26
Copy link

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants