mirror of
https://github.com/elastic/logstash.git
synced 2025-06-28 17:53:28 -04:00
Health api minor followups (#16533)
* Utilize default agent for Health API CI. Call python scripts from directly CI step. * Change BK agent to support both Java and python. Install pip manually and send env vars to subprocess.
This commit is contained in:
parent
7f7af057f0
commit
4037adfc4a
5 changed files with 34 additions and 18 deletions
|
@ -1,17 +1,20 @@
|
||||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json
|
# yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json
|
||||||
|
|
||||||
agents:
|
agents:
|
||||||
image: "docker.elastic.co/ci-agent-images/platform-ingest/buildkite-agent-logstash-ci"
|
provider: gcp
|
||||||
cpu: "2"
|
imageProject: elastic-images-prod
|
||||||
memory: "4Gi"
|
image: family/platform-ingest-logstash-ubuntu-2204
|
||||||
ephemeralStorage: "64Gi"
|
machineType: "n2-standard-4"
|
||||||
|
diskSizeGb: 64
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# todo: add a step for 8.latest when Health Report MVP is landed
|
- group: ":logstash: Health API integration tests"
|
||||||
- label: ":logstash: Health Report Integration tests on main branch."
|
key: "testing-phase"
|
||||||
command: |
|
steps:
|
||||||
source .buildkite/scripts/common/vm-agent.sh
|
- label: "main branch"
|
||||||
./.buildkite/scripts/health-report-tests/main.sh
|
key: "integ-tests-on-main-branch"
|
||||||
retry:
|
command:
|
||||||
automatic:
|
- .buildkite/scripts/health-report-tests/main.sh
|
||||||
- limit: 3
|
retry:
|
||||||
|
automatic:
|
||||||
|
- limit: 3
|
|
@ -63,7 +63,7 @@ class Bootstrap:
|
||||||
f"Failed to install {plugin_path}")
|
f"Failed to install {plugin_path}")
|
||||||
|
|
||||||
def build_logstash(self):
|
def build_logstash(self):
|
||||||
print(f"Building Logstash.")
|
print(f"Building Logstash...")
|
||||||
util.run_or_raise_error(
|
util.run_or_raise_error(
|
||||||
["./gradlew", "clean", "bootstrap", "assemble", "installDefaultGems"],
|
["./gradlew", "clean", "bootstrap", "assemble", "installDefaultGems"],
|
||||||
"Failed to build Logstash")
|
"Failed to build Logstash")
|
||||||
|
|
|
@ -1,5 +1,17 @@
|
||||||
#!/usr/bin/env bash
|
#!/bin/bash
|
||||||
set -eo pipefail
|
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
export PATH="/opt/buildkite-agent/.rbenv/bin:/opt/buildkite-agent/.pyenv/bin:/opt/buildkite-agent/.java/bin:$PATH"
|
||||||
|
export JAVA_HOME="/opt/buildkite-agent/.java"
|
||||||
|
eval "$(rbenv init -)"
|
||||||
|
eval "$(pyenv init -)"
|
||||||
|
|
||||||
|
echo "--- Installing pip"
|
||||||
|
sudo apt-get install python3-pip -y
|
||||||
|
|
||||||
|
echo "--- Installing dependencies"
|
||||||
python3 -mpip install -r .buildkite/scripts/health-report-tests/requirements.txt
|
python3 -mpip install -r .buildkite/scripts/health-report-tests/requirements.txt
|
||||||
|
|
||||||
|
echo "--- Running tests"
|
||||||
python3 .buildkite/scripts/health-report-tests/main.py
|
python3 .buildkite/scripts/health-report-tests/main.py
|
|
@ -1,3 +1,4 @@
|
||||||
|
import os
|
||||||
import requests
|
import requests
|
||||||
import subprocess
|
import subprocess
|
||||||
from requests.adapters import HTTPAdapter, Retry
|
from requests.adapters import HTTPAdapter, Retry
|
||||||
|
@ -27,7 +28,7 @@ def run_or_raise_error(commands: list, error_message):
|
||||||
f"""
|
f"""
|
||||||
Executes the {list} commands and raises an {Exception} if opration fails.
|
Executes the {list} commands and raises an {Exception} if opration fails.
|
||||||
"""
|
"""
|
||||||
result = subprocess.run(commands, universal_newlines=True, stdout=subprocess.PIPE)
|
result = subprocess.run(commands, env=os.environ.copy(), universal_newlines=True, stdout=subprocess.PIPE)
|
||||||
if result.returncode != 0:
|
if result.returncode != 0:
|
||||||
full_error_message = (error_message + ", output: " + result.stdout.decode('utf-8')) \
|
full_error_message = (error_message + ", output: " + result.stdout.decode('utf-8')) \
|
||||||
if result.stdout else error_message
|
if result.stdout else error_message
|
||||||
|
|
|
@ -29,7 +29,7 @@ shared_examples_for 'the container is configured correctly' do |flavor|
|
||||||
|
|
||||||
it 'should be running an API server on port 9600' do
|
it 'should be running an API server on port 9600' do
|
||||||
wait_for_logstash(@container)
|
wait_for_logstash(@container)
|
||||||
expect(get_logstash_status(@container)).to eql 'green'
|
expect(get_logstash_status(@container)).not_to be_nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue