Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion .buildkite/pipelines/artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ steps:
imageProject: elastic-images-prod
provider: gcp
machineType: c2-standard-16
diskSizeGb: 150
diskSizeGb: 160
timeout_in_minutes: 120
retry:
automatic:
Expand Down Expand Up @@ -135,6 +135,32 @@ steps:
- exit_status: '*'
limit: 1

- command: KIBANA_MEMORY_SIZE=8192 .buildkite/scripts/steps/artifacts/cloud.sh
label: 'Cloud Deployment - 8GB Kibana Node'
soft_fail:
- exit_status: 255
- exit_status: -1
agents:
image: family/kibana-ubuntu-2404
imageProject: elastic-images-prod
provider: gcp
machineType: n2-standard-2
timeout_in_minutes: 60
if: "build.env('RELEASE_BUILD') == null || build.env('RELEASE_BUILD') == '' || build.env('RELEASE_BUILD') == 'false'"
retry:
automatic:
# Timeout and graceful shutdown | ecctl deployment create falure
- exit_status: 255
limit: 0

# Timeout and forced shutdown
- exit_status: '-1'
limit: 0

# Test failures
- exit_status: '*'
limit: 1

- wait

- command: .buildkite/scripts/steps/artifacts/publish.sh
Expand Down
22 changes: 20 additions & 2 deletions .buildkite/scripts/steps/artifacts/cloud.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@ if [[ "${DRY_RUN:-}" =~ ^(true|1)$ ]]; then
exit 0
fi

KIBANA_MEMORY_SIZE=${KIBANA_MEMORY_SIZE:-2048}
case "$KIBANA_MEMORY_SIZE" in
1024|2048|4096|8192)
echo "--- Kibana node memory size: ${KIBANA_MEMORY_SIZE}MB"
;;
*)
echo "Error: KIBANA_MEMORY_SIZE must be one of: 1024, 2048, 4096, 8192. Got: $KIBANA_MEMORY_SIZE"
exit 1
;;
esac

echo "--- Push docker image"
mkdir -p target

Expand All @@ -32,7 +43,13 @@ else
fi

echo "--- Create deployment"
CLOUD_DEPLOYMENT_NAME="kibana-artifacts-$TAG"
BASE_DEPLOYMENT_NAME="kibana-artifacts"

if [[ $KIBANA_MEMORY_SIZE -ne 2048 ]]; then
CLOUD_DEPLOYMENT_NAME="$BASE_DEPLOYMENT_NAME-${KIBANA_MEMORY_SIZE}mb-$TAG"
else
CLOUD_DEPLOYMENT_NAME="$BASE_DEPLOYMENT_NAME-$TAG"
fi

LOGS=$(mktemp --suffix ".json")
DEPLOYMENT_SPEC=$(mktemp --suffix ".json")
Expand All @@ -43,7 +60,8 @@ jq '
.resources.kibana[0].plan.kibana.version = "'$FULL_VERSION'" |
.resources.elasticsearch[0].plan.elasticsearch.version = "'$FULL_VERSION'" |
.resources.enterprise_search[0].plan.enterprise_search.version = "'$FULL_VERSION'" |
.resources.integrations_server[0].plan.integrations_server.version = "'$FULL_VERSION'"
.resources.integrations_server[0].plan.integrations_server.version = "'$FULL_VERSION'" |
.resources.kibana[0].plan.cluster_topology[0].size.value = '$KIBANA_MEMORY_SIZE'
' .buildkite/scripts/steps/cloud/deploy.json > "$DEPLOYMENT_SPEC"

function shutdown {
Expand Down
14 changes: 13 additions & 1 deletion .buildkite/scripts/steps/cloud/build_and_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@ export KBN_NP_PLUGINS_BUILT=true
VERSION="$(jq -r '.version' package.json)-SNAPSHOT"
ECCTL_LOGS=$(mktemp --suffix ".json")

KIBANA_MEMORY_SIZE=${KIBANA_MEMORY_SIZE:-2048}
case "$KIBANA_MEMORY_SIZE" in
1024|2048|4096|8192)
echo "--- Kibana node memory size: ${KIBANA_MEMORY_SIZE}MB"
;;
*)
echo "Error: KIBANA_MEMORY_SIZE must be one of: 1024, 2048, 4096, 8192. Got: $KIBANA_MEMORY_SIZE"
exit 1
;;
esac

echo "--- Download Kibana Distribution"

mkdir -p ./target
Expand Down Expand Up @@ -77,7 +88,8 @@ if [ -z "${CLOUD_DEPLOYMENT_ID}" ] || [ "${CLOUD_DEPLOYMENT_ID}" = 'null' ]; the
.resources.kibana[0].plan.kibana.version = "'$VERSION'" |
.resources.elasticsearch[0].plan.elasticsearch.version = "'$VERSION'" |
.resources.enterprise_search[0].plan.enterprise_search.version = "'$VERSION'" |
.resources.integrations_server[0].plan.integrations_server.version = "'$VERSION'"
.resources.integrations_server[0].plan.integrations_server.version = "'$VERSION'" |
.resources.kibana[0].plan.cluster_topology[0].size.value = '$KIBANA_MEMORY_SIZE'
' .buildkite/scripts/steps/cloud/deploy.json > /tmp/deploy.json

echo "Creating deployment..."
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/scripts/steps/cloud/deploy.json
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@
"instance_configuration_id": "gcp.kibana.n2.68x32x45",
"zone_count": 1,
"size": {
"value": 2048,
"value": null,
"resource": "memory"
}
}
Expand Down