Skip to content

Commit 05c61f0

Browse files
committed
Use bigger CI machine for docs repo
We always do a full rebuild on `elastic/docs` which takes up to 2 hours with the standard n1-standard-4 CI machine. This PR introduces an optimization only for builds on elastic/docs to use n2-standard-32 to drop the build time to about 1 hour. For any other builds, we'll use n2-standard-4 and tolerate the <20 min build time for docs given the price difference (10x cheaper).
1 parent ab39cfc commit 05c61f0

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

.buildkite/build_pr_pipeline.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ steps:
1111
agents:
1212
provider: "gcp"
1313
image: family/docs-ubuntu-2204
14+
machineType: ${BUILD_PR_MACHINE_TYPE}
1415
- key: "teardown"
1516
label: "teardown"
1617
command: |

.buildkite/hooks/pre-command

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,10 @@ function retry {
2626
# https://buildkite.com/docs/pipelines/managing-log-output#redacted-environment-variables
2727
if [[ "$BUILDKITE_PIPELINE_SLUG" == "docs-build-pr" ]];then
2828
export GITHUB_TOKEN=$(retry 5 vault kv get -field=value secret/ci/elastic-docs/docs_preview_cleaner)
29+
if [[ ${GITHUB_PR_BASE_REPO:="unset"} == "docs" ]]; then
30+
# Docs PR require a full rebuilt - so let's boost the builds so they don't take 2 hours
31+
export BUILD_PR_MACHINE_TYPE="n2-highcpu-32"
32+
else
33+
export BUILD_PR_MACHINE_TYPE="n2-standard-4"
34+
fi
2935
fi

.buildkite/scripts/build_pr.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ else
6565
# books for PRs to the docs repo, for now.
6666
# When https://github.com/elastic/docs/issues/1823 is fixed, this
6767
# should be removed and the original behavior restored.
68-
rebuild_opt=" --rebuild"
68+
rebuild_opt=" --rebuild --procs 16"
6969
fi
7070

7171

0 commit comments

Comments
 (0)