diff --git a/.buildkite/ci.mjs b/.buildkite/ci.mjs index df9e7d2f5b5425..a089cd2020f67c 100644 --- a/.buildkite/ci.mjs +++ b/.buildkite/ci.mjs @@ -212,9 +212,10 @@ function getPipeline(options) { /** * @param {"v1" | "v2"} version * @param {Platform} platform + * @param {string} [instanceType] * @returns {Agent} */ - const getEmphemeralAgent = (version, platform) => { + const getEmphemeralAgent = (version, platform, instanceType) => { const { os, arch, abi, distro, release } = platform; if (version === "v1") { return { @@ -238,6 +239,7 @@ function getPipeline(options) { distro, release, "image-name": image, + "instance-type": instanceType, }; }; @@ -248,7 +250,8 @@ function getPipeline(options) { const getBuildAgent = target => { const { os, arch, abi } = target; if (abi === "musl") { - return getEmphemeralAgent("v2", target); + const instanceType = arch === "aarch64" ? "c8g.8xlarge" : "c7i.8xlarge"; + return getEmphemeralAgent("v2", target, instanceType); } return { queue: `build-${os}`, @@ -263,9 +266,10 @@ function getPipeline(options) { * @returns {Agent} */ const getZigAgent = target => { - const { abi } = target; + const { abi, arch } = target; if (abi === "musl") { - return getEmphemeralAgent("v2", target); + const instanceType = arch === "aarch64" ? "c8g.large" : "c7i.large"; + return getEmphemeralAgent("v2", target, instanceType); } return { queue: "build-zig", @@ -279,7 +283,8 @@ function getPipeline(options) { const getTestAgent = platform => { const { os, arch, release, abi } = platform; if (abi === "musl") { - return getEmphemeralAgent("v2", platform); + const instanceType = arch === "aarch64" ? "t4g.large" : "t3.large"; + return getEmphemeralAgent("v2", platform, instanceType); } if (os === "darwin") { return { diff --git a/scripts/agent.mjs b/scripts/agent.mjs index bf163de4c578eb..1e8a0e0c74dfe1 100755 --- a/scripts/agent.mjs +++ b/scripts/agent.mjs @@ -151,21 +151,29 @@ export async function doAgent(action) { "token": token || "xxx", "shell": shell, "job-log-path": logsPath, - "git-mirrors-path": join(cachePath, "git"), "build-path": join(homePath, "builds"), "hooks-path": join(homePath, "hooks"), "plugins-path": join(homePath, "plugins"), "experiment": "normalised-upload-paths,resolve-commit-after-checkout,agent-api", }; + let ephemeral; if (cloud) { const jobId = await getCloudMetadataTag("buildkite:job-uuid"); if (jobId) { options["acquire-job"] = jobId; flags.push("disconnect-after-job"); + ephemeral = true; } } + if (ephemeral) { + options["git-clone-flags"] = "-v --depth=1"; + options["git-fetch-flags"] = "-v --prune --depth=1"; + } else { + options["git-mirrors-path"] = join(cachePath, "git"); + } + const tags = { "os": getOs(), "arch": getArch(),