diff --git a/.buildkite/pipelines/artifacts.yml b/.buildkite/pipelines/artifacts.yml index 7aacd8ad84d07..62b54b86a7c9b 100644 --- a/.buildkite/pipelines/artifacts.yml +++ b/.buildkite/pipelines/artifacts.yml @@ -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 diff --git a/.buildkite/scripts/steps/artifacts/cloud.sh b/.buildkite/scripts/steps/artifacts/cloud.sh old mode 100644 new mode 100755 index a9995013ec157..337065798fbed --- a/.buildkite/scripts/steps/artifacts/cloud.sh +++ b/.buildkite/scripts/steps/artifacts/cloud.sh @@ -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 @@ -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") @@ -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 { diff --git a/.buildkite/scripts/steps/cloud/build_and_deploy.sh b/.buildkite/scripts/steps/cloud/build_and_deploy.sh index 6b9dc143d8230..20a04d34f6441 100755 --- a/.buildkite/scripts/steps/cloud/build_and_deploy.sh +++ b/.buildkite/scripts/steps/cloud/build_and_deploy.sh @@ -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 @@ -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..." diff --git a/.buildkite/scripts/steps/cloud/deploy.json b/.buildkite/scripts/steps/cloud/deploy.json index 33ce6b752ad9d..19954f5a2de6b 100644 --- a/.buildkite/scripts/steps/cloud/deploy.json +++ b/.buildkite/scripts/steps/cloud/deploy.json @@ -198,7 +198,7 @@ "instance_configuration_id": "gcp.kibana.n2.68x32x45", "zone_count": 1, "size": { - "value": 2048, + "value": null, "resource": "memory" } }