Skip to content

Commit

Permalink
conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
michalpristas committed Aug 30, 2023
2 parents 146ec79 + a5c9d3a commit f8889e2
Show file tree
Hide file tree
Showing 125 changed files with 4,910 additions and 2,141 deletions.
2 changes: 1 addition & 1 deletion .buildkite/hooks/pre-exit
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if [ -n "$TEST_INTEG_AUTH_GCP_SERVICE_TOKEN_FILE" ]; then
fi
fi

unset GOOGLE_APPLICATION_GCP_SECRET API_KEY_TOKEN
source .buildkite/scripts/unset-secrets.sh

if command -v docker &>/dev/null; then
DOCKER_REGISTRY="docker.elastic.co"
Expand Down
36 changes: 36 additions & 0 deletions .buildkite/misc/gce-cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
version: "1.0"

accounts:
- name: "${ACCOUNT_PROJECT}"
driver: "gce"
options:
key: "${ACCOUNT_KEY}"
secret: "${ACCOUNT_SECRET}"
project: "${ACCOUNT_PROJECT}"

scanners:
- account_name: "${ACCOUNT_PROJECT}"
resources:
- type: "node"
regions:
- "us-central1"
filters:
- type: "<"
pointer: "/extra/creationTimestamp"
param: "${CREATION_DATE}"
converters:
param: "date"
value: "date"
- type: "="
pointer: "/extra/labels/project"
param: "elastic-agent"
- type: "regex"
pointer: "/name"
param: "^ogc(.*)"
- type: "!="
pointer: "/state"
param: "unknown"
- type: "!="
pointer: "/state"
param: "terminated"
13 changes: 13 additions & 0 deletions .buildkite/pipeline.elastic-agent-gce-cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json

# Removes stale GCE instances having matching labels, name prefixes and older than 24 hours
# See gce-cleanup.sh and .buildkite/misc/gce-cleanup.yml
env:
VAULT_PATH: "kv/ci-shared/observability-ingest/cloud/gcp"
DOCKER_REGISTRY: "docker.elastic.co"
steps:
- label: "GCE Cleanup"
key: "gce-cleanup"
command: ".buildkite/scripts/steps/gce-cleanup.sh"
agents:
provider: "gcp"
1 change: 1 addition & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ steps:
- "build/diagnostics/*"
agents:
provider: "gcp"
machineType: "n1-standard-8"
15 changes: 15 additions & 0 deletions .buildkite/scripts/steps/gce-cleanup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

set -euo pipefail

export ACCOUNT_KEY_SECRET=$(vault kv get -field=client_email $VAULT_PATH)
export ACCOUNT_SECRET=$(vault kv get -field=private_key $VAULT_PATH)
export ACCOUNT_PROJECT_SECRET=$(vault kv get -field=project_id $VAULT_PATH)
export CREATION_DATE=$(date -Is -d "24 hours ago")

docker run -v $(pwd)/.buildkite/misc/gce-cleanup.yml:/etc/cloud-reaper/config.yml \
-e ACCOUNT_SECRET="$ACCOUNT_SECRET" \
-e ACCOUNT_KEY="$ACCOUNT_KEY_SECRET" \
-e ACCOUNT_PROJECT=$ACCOUNT_PROJECT_SECRET \
-e CREATION_DATE=$CREATION_DATE \
${DOCKER_REGISTRY}/observability-ci/cloud-reaper:0.3.0 cloud-reaper --config /etc/cloud-reaper/config.yml destroy --confirm
10 changes: 8 additions & 2 deletions .buildkite/scripts/steps/integration_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@ TESTS_EXIT_STATUS=$?
set -e

# HTML report
go install github.com/alexec/junit2html@latest
junit2html < build/TEST-go-integration.xml > build/TEST-report.html
outputXML="build/TEST-go-integration.xml"

if [ -f "$outputXML" ]; then
go install github.com/alexec/junit2html@latest
junit2html < "$outputXML" > build/TEST-report.html
else
echo "Cannot generate HTML test report: $outputXML not found"
fi

exit $TESTS_EXIT_STATUS
9 changes: 9 additions & 0 deletions .buildkite/scripts/unset-secrets.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

set -euo pipefail
# Unset all variables ending with _SECRET or _TOKEN
for var in $(printenv | sed 's;=.*;;' | sort); do
if [[ "$var" == *_SECRET || "$var" == *_TOKEN ]]; then
unset "$var"
fi
done
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@

/deploy/kubernetes @elastic/obs-cloudnative-monitoring
/dev-tools/kubernetes @elastic/obs-cloudnative-monitoring
/internal/pkg/composable/providers/kubernetes @elastic/obs-cloudnative-monitoring
13 changes: 13 additions & 0 deletions .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -254,3 +254,16 @@ pull_request_rules:
labels:
- "backport"
title: "[{{ destination_branch }}](backport #{{ number }}) {{ title }}"
- name: backport patches to 8.10 branch
conditions:
- merged
- label=backport-v8.10.0
actions:
backport:
assignees:
- "{{ author }}"
branches:
- "8.10"
labels:
- "backport"
title: "[{{ destination_branch }}](backport #{{ number }}) {{ title }}"
Loading

0 comments on commit f8889e2

Please sign in to comment.