[7.17] Clean up pipelines (#187490)

## Summary
Removes unused pipelines, and their related scripts: 
 - package_testing.yml
 - demo_env.yml

Updates a pipeline to the new buildkite agent targeting format:
 - performance/daily.yml (missed backport after migration)
This commit is contained in:
Alex Szabo 2024-07-08 14:25:52 +02:00 committed by GitHub
parent 2fd50f395a
commit dfe26f4b7e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 16 additions and 303 deletions

View file

@ -1,27 +0,0 @@
steps:
- command: .buildkite/scripts/steps/package_testing/build.sh
label: Build Packages
agents:
queue: c2-16
timeout_in_minutes: 60
if: "build.env('KIBANA_BUILD_ID') == null || build.env('KIBANA_BUILD_ID') == ''"
- wait
- command: TEST_PACKAGE=deb .buildkite/scripts/steps/package_testing/test.sh
label: Package testing for deb
agents:
queue: n2-4-virt
timeout_in_minutes: 60
- command: TEST_PACKAGE=rpm .buildkite/scripts/steps/package_testing/test.sh
label: Package testing for rpm
agents:
queue: n2-4-virt
timeout_in_minutes: 60
- command: TEST_PACKAGE=docker .buildkite/scripts/steps/package_testing/test.sh
label: Package testing for docker
agents:
queue: n2-4-virt
timeout_in_minutes: 60

View file

@ -11,20 +11,29 @@ steps:
- label: ':male-mechanic::skin-tone-2: Pre-Build'
command: .buildkite/scripts/lifecycle/pre_build.sh
agents:
queue: kibana-default
image: family/kibana-ubuntu-2004
imageProject: elastic-images-prod
provider: gcp
machineType: n2-standard-2
- wait
- label: ':factory_worker: Build Kibana Distribution and Plugins'
command: .buildkite/scripts/steps/build_kibana.sh
agents:
queue: c2-16
image: family/kibana-ubuntu-2004
imageProject: elastic-images-prod
provider: gcp
machineType: c2-standard-16
key: build
- label: ':muscle: Performance Tests with Playwright config'
command: .buildkite/scripts/steps/functional/performance_playwright.sh
agents:
queue: c2-16
image: family/kibana-ubuntu-2004
imageProject: elastic-images-prod
provider: gcp
machineType: c2-standard-16
depends_on: build
- wait: ~
@ -33,4 +42,7 @@ steps:
- label: ':male_superhero::skin-tone-2: Post-Build'
command: .buildkite/scripts/lifecycle/post_build.sh
agents:
queue: kibana-default
image: family/kibana-ubuntu-2004
imageProject: elastic-images-prod
provider: gcp
machineType: n2-standard-2

View file

@ -1,12 +0,0 @@
steps:
- command: .buildkite/scripts/steps/demo_env/es_and_init.sh
label: Initialize Environment and Deploy ES
timeout_in_minutes: 10
agents:
queue: kibana-default
- command: .buildkite/scripts/steps/demo_env/kibana.sh
label: Build and Deploy Kibana
agents:
queue: c2-8
timeout_in_minutes: 60

View file

@ -1,4 +0,0 @@
ARG BASE_IMAGE
FROM ${BASE_IMAGE}
COPY ./* /var/lib/example_plugins
RUN find /var/lib/example_plugins/ -type f -name '*.zip' | xargs -I % /usr/share/kibana/bin/kibana-plugin install 'file://%'

View file

@ -1,8 +0,0 @@
#!/usr/bin/env bash
set -euo pipefail
echo '--- Auth and set up kubectl'
gcloud container clusters get-credentials demo-env --region us-central1 --project elastic-kibana-184716
kubectl config use-context gke_elastic-kibana-184716_us-central1_demo-env

View file

@ -1,9 +0,0 @@
#!/usr/bin/env bash
set -euo pipefail
DEPLOYMENT_VERSION=$(jq -r .version package.json)
export DEPLOYMENT_VERSION
export DEPLOYMENT_MINOR_VERSION="${DEPLOYMENT_VERSION%.*}"
export DEPLOYMENT_NAME="kb-${DEPLOYMENT_MINOR_VERSION/./-}"

View file

@ -1,39 +0,0 @@
#!/usr/bin/env bash
set -euo pipefail
source "$(dirname "${0}")/config.sh"
"$(dirname "${0}")/auth.sh"
echo '--- Import and publish Elasticsearch image'
mkdir -p target
export ES_IMAGE="gcr.io/elastic-kibana-184716/demo/elasticsearch:$DEPLOYMENT_NAME-$(git rev-parse HEAD)"
DOCKER_EXPORT_URL=$(curl https://storage.googleapis.com/kibana-ci-es-snapshots-daily/$DEPLOYMENT_VERSION/manifest-latest-verified.json | jq -r '.archives | .[] | select(.platform=="docker") | .url')
curl "$DOCKER_EXPORT_URL" > target/elasticsearch-docker.tar.gz
docker load < target/elasticsearch-docker.tar.gz
docker tag "docker.elastic.co/elasticsearch/elasticsearch:$DEPLOYMENT_VERSION-SNAPSHOT" "$ES_IMAGE"
docker push "$ES_IMAGE"
echo '--- Prepare yaml'
TEMPLATE=$(envsubst < "$(dirname "${0}")/es_and_init.yml")
echo "$TEMPLATE"
cat << EOF | buildkite-agent annotate --style "info" --context demo-env-info
The demo environment can be accessed here, once Kibana and ES are running:
https://demo.kibana.dev/$DEPLOYMENT_MINOR_VERSION
Logs, etc can be found here:
https://console.cloud.google.com/kubernetes/workload?project=elastic-kibana-184716&pageState=(%22savedViews%22:(%22n%22:%5B%22${DEPLOYMENT_NAME}%22%5D,%22c%22:%5B%22gke%2Fus-central1%2Fdemo-env%22%5D))
EOF
echo '--- Deploy yaml'
echo "$TEMPLATE" | kubectl apply -f -

View file

@ -1,63 +0,0 @@
kind: Namespace
apiVersion: v1
metadata:
name: $DEPLOYMENT_NAME
labels:
name: $DEPLOYMENT_NAME
---
apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
name: $DEPLOYMENT_NAME
namespace: $DEPLOYMENT_NAME
spec:
version: $DEPLOYMENT_VERSION
image: $ES_IMAGE
nodeSets:
- name: default
count: 1
config:
node.store.allow_mmap: false
xpack.security.authc:
anonymous:
roles: viewer
authz_exception: true
podTemplate:
spec:
containers:
- name: elasticsearch
env:
- name: ES_JAVA_OPTS
value: -Xms2g -Xmx2g
resources:
requests:
memory: 4Gi
cpu: 2
limits:
memory: 4Gi
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: $DEPLOYMENT_NAME
namespace: $DEPLOYMENT_NAME
annotations:
kubernetes.io/ingress.class: 'nginx'
cert-manager.io/cluster-issuer: 'letsencrypt-prod'
nginx.ingress.kubernetes.io/rewrite-target: /$2
spec:
tls:
- hosts:
- demo.kibana.dev
secretName: tls-certificate
rules:
- host: demo.kibana.dev
http:
paths:
- path: /$DEPLOYMENT_MINOR_VERSION(/|$)(.*)
pathType: ImplementationSpecific
backend:
service:
name: $DEPLOYMENT_NAME-kb-http
port:
number: 5601

View file

@ -1,30 +0,0 @@
#!/usr/bin/env bash
set -euo pipefail
.buildkite/scripts/bootstrap.sh
source "$(dirname "${0}")/config.sh"
export KIBANA_IMAGE="gcr.io/elastic-kibana-184716/demo/kibana:$DEPLOYMENT_NAME-$(git rev-parse HEAD)"
echo '--- Build Kibana'
node scripts/build --debug --docker-images --example-plugins --skip-docker-ubi
echo '--- Build Docker image with example plugins'
cd target/example_plugins
BUILT_IMAGE="docker.elastic.co/kibana/kibana:$DEPLOYMENT_VERSION-SNAPSHOT"
docker build --build-arg BASE_IMAGE="$BUILT_IMAGE" -t "$KIBANA_IMAGE" -f "$KIBANA_DIR/.buildkite/scripts/steps/demo_env/Dockerfile" .
docker push "$KIBANA_IMAGE"
cd -
"$(dirname "${0}")/auth.sh"
echo '--- Prepare yaml'
TEMPLATE=$(envsubst < "$(dirname "${0}")/kibana.yml")
echo "$TEMPLATE"
echo '--- Deploy yaml'
echo "$TEMPLATE" | kubectl apply -f -

View file

@ -1,39 +0,0 @@
apiVersion: kibana.k8s.elastic.co/v1
kind: Kibana
metadata:
name: $DEPLOYMENT_NAME
namespace: $DEPLOYMENT_NAME
spec:
version: $DEPLOYMENT_VERSION
image: $KIBANA_IMAGE
count: 1
elasticsearchRef:
name: $DEPLOYMENT_NAME
http:
tls:
selfSignedCertificate:
disabled: true
config:
server:
basePath: '/$DEPLOYMENT_MINOR_VERSION'
publicBaseUrl: 'https://demo.kibana.dev/$DEPLOYMENT_MINOR_VERSION'
xpack.security.authc.providers:
basic.basic1:
order: 0
anonymous.anonymous1:
order: 1
credentials: 'elasticsearch_anonymous_user'
podTemplate:
spec:
containers:
- name: kibana
env:
- name: NODE_OPTIONS
value: '--max-old-space-size=2048'
resources:
requests:
memory: 1Gi
cpu: 0.5
limits:
memory: 2.5Gi
cpu: 2

View file

@ -1,13 +0,0 @@
#!/usr/bin/env bash
set -euo pipefail
.buildkite/scripts/bootstrap.sh
node scripts/build --all-platforms --debug
DOCKER_FILE="kibana-$KIBANA_PKG_VERSION-SNAPSHOT-docker-image.tar.gz"
cd target
buildkite-agent artifact upload "./$DOCKER_FILE;./*.deb;./*.rpm"
cd ..

View file

@ -1,55 +0,0 @@
#!/usr/bin/env bash
set -euo pipefail
.buildkite/scripts/bootstrap.sh
echo "--- Package Testing for $TEST_PACKAGE"
mkdir -p target
cd target
if [[ "$TEST_PACKAGE" == "deb" ]]; then
buildkite-agent artifact download 'kibana-*-amd64.deb' . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}"
KIBANA_IP_ADDRESS="192.168.56.5"
elif [[ "$TEST_PACKAGE" == "rpm" ]]; then
buildkite-agent artifact download 'kibana-*-x86_64.rpm' . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}"
KIBANA_IP_ADDRESS="192.168.56.6"
elif [[ "$TEST_PACKAGE" == "docker" ]]; then
buildkite-agent artifact download "kibana-$KIBANA_PKG_VERSION*-docker-image.tar.gz" . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}"
KIBANA_IP_ADDRESS="192.168.56.7"
fi
cd ..
export VAGRANT_CWD=$PWD/test/package
vagrant up "$TEST_PACKAGE" --no-provision
node scripts/es snapshot \
-E network.bind_host=127.0.0.1,192.168.56.1 \
-E discovery.type=single-node \
--license=trial &
while ! timeout 1 bash -c "echo > /dev/tcp/localhost/9200"; do sleep 30; done
function echoKibanaLogs {
if [[ "$TEST_PACKAGE" == "deb" ]] || [[ "$TEST_PACKAGE" == "rpm" ]]; then
echo "--- /var/log/kibana/kibana.log "
vagrant ssh $TEST_PACKAGE -t -c 'sudo cat /var/log/kibana/kibana.log'
echo "--- Journal "
vagrant ssh $TEST_PACKAGE -t -c 'sudo journalctl -u kibana.service --no-pager'
elif [[ "$TEST_PACKAGE" == "docker" ]]; then
echo '--- Docker logs'
vagrant ssh $TEST_PACKAGE -t -c 'sudo docker logs kibana'
fi
}
trap "echoKibanaLogs" EXIT
vagrant provision "$TEST_PACKAGE"
export TEST_BROWSER_HEADLESS=1
export TEST_KIBANA_URL="http://elastic:changeme@$KIBANA_IP_ADDRESS:5601"
export TEST_ES_URL=http://elastic:changeme@192.168.56.1:9200
cd x-pack
echo "--- FTR - Reporting"
node scripts/functional_test_runner.js --config test/functional/config.js --include-tag=smoke --quiet