Skip to content

Commit 4c80726

Browse files
authored
Use bigger CI machine for docs repo (#2840)
* 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). * Set default machine type
1 parent ab39cfc commit 4c80726

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-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: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,15 @@ function retry {
2222
return 0
2323
}
2424

25+
export BUILD_PR_MACHINE_TYPE="n2-standard-4"
26+
2527
# Secrets must be redacted
2628
# https://buildkite.com/docs/pipelines/managing-log-output#redacted-environment-variables
2729
if [[ "$BUILDKITE_PIPELINE_SLUG" == "docs-build-pr" ]];then
2830
export GITHUB_TOKEN=$(retry 5 vault kv get -field=value secret/ci/elastic-docs/docs_preview_cleaner)
31+
32+
if [[ ${GITHUB_PR_BASE_REPO:="unset"} == "docs" ]]; then
33+
# Docs PR require a full rebuild - so let's boost the builds so they don't take 2 hours
34+
export BUILD_PR_MACHINE_TYPE="n2-highcpu-32"
35+
fi
2936
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)