Skip to content

Commit

Permalink
Changes [build image]
Browse files Browse the repository at this point in the history
  • Loading branch information
Electroid committed Nov 14, 2024
1 parent 190b5bc commit 78a6e90
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
15 changes: 10 additions & 5 deletions .buildkite/ci.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -238,6 +239,7 @@ function getPipeline(options) {
distro,
release,
"image-name": image,
"instance-type": instanceType,
};
};

Expand All @@ -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}`,
Expand All @@ -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",
Expand All @@ -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 {
Expand Down
10 changes: 9 additions & 1 deletion scripts/agent.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit 78a6e90

Please sign in to comment.