fix: pass no-cache mode to ci benchmark

This commit is contained in:
Codex
2026-06-26 11:40:37 +00:00
parent 4b52f511ef
commit a376ce5d9d
3 changed files with 11 additions and 3 deletions
+9 -1
View File
@@ -688,6 +688,10 @@ function ciBuildBenchmarkCatalogPath(profile: CiBuildBenchmarkProfileSpec, pipel
return profile.catalogPathTemplate.replace(/\{profile\}/gu, profile.profile).replace(/\{pipelineRun\}/gu, pipelineRun);
}
function ciBuildBenchmarkBuildCacheMode(profile: CiBuildBenchmarkProfileSpec): "disabled" | "registry" {
return profile.cachePolicy.forbidBuildkitCache ? "disabled" : "registry";
}
function ciBuildBenchmarkDefinitionSummary(runtime: HwlabRuntimeLaneSpec, target: ControlPlaneTargetSpec, profile: CiBuildBenchmarkProfileSpec): Record<string, unknown> {
return {
targetId: target.id,
@@ -705,6 +709,7 @@ function ciBuildBenchmarkDefinitionSummary(runtime: HwlabRuntimeLaneSpec, target
baseImage: runtime.baseImage,
services: runtime.serviceIds,
imageTagMode: profile.imageTagMode,
buildCacheMode: ciBuildBenchmarkBuildCacheMode(profile),
cachePolicy: profile.cachePolicy,
requiredTimings: profile.requiredTimings,
failureFamilies: profile.failureFamilies,
@@ -742,6 +747,7 @@ function ciBuildBenchmarkPipelineRunManifest(
"hwlab.pikastech.local/download-profile": runtime.downloadProfileId,
"unidesk.ai/issue": "pikasTech/unidesk#1010",
"unidesk.ai/cache-policy": JSON.stringify(profile.cachePolicy),
"unidesk.ai/build-cache-mode": ciBuildBenchmarkBuildCacheMode(profile),
"unidesk.ai/catalog-path": catalogPath,
"unidesk.ai/runtime-lane-config-ref": profile.runtimeLaneConfigRef,
"unidesk.ai/required-timings": profile.requiredTimings.join(","),
@@ -772,6 +778,7 @@ function ciBuildBenchmarkPipelineRunManifest(
{ name: "registry-prefix", value: runtime.registryPrefix },
{ name: "services", value: runtime.serviceIds.join(",") },
{ name: "base-image", value: runtime.baseImage },
{ name: "build-cache-mode", value: ciBuildBenchmarkBuildCacheMode(profile) },
],
workspaces: [
{ name: "source", volumeClaimTemplate: { spec: { accessModes: ["ReadWriteOnce"], resources: { requests: { storage: "8Gi" } } } } },
@@ -811,6 +818,7 @@ function renderCiBuildBenchmarkResult(result: Record<string, unknown>): Rendered
["pipeline", renderCell(benchmark.pipeline)],
["catalogPath", renderCell(start.catalogPath ?? plan.catalogPath ?? pipelineRun.catalogPath)],
["services", String((Array.isArray(benchmark.services) ? benchmark.services : []).length)],
["buildCacheMode", renderCell(benchmark.buildCacheMode)],
["cachePolicy", JSON.stringify(benchmark.cachePolicy ?? {})],
["requiredTimings", Array.isArray(benchmark.requiredTimings) ? benchmark.requiredTimings.join(",") : "-"],
]),
@@ -3444,7 +3452,7 @@ function ciBuildBenchmarkPolicyOk(job: Record<string, unknown>, cachePolicy: CiB
function ciBuildBenchmarkLogHasBuildkitCache(job: Record<string, unknown>): boolean {
const logTail = typeof job.logTail === "string" ? job.logTail : "";
return /buildkitCacheRef|--import-cache|--export-cache|writing cache image manifest/iu.test(logTail);
return /"buildkitCacheRef"\s*:\s*"[^"]+"|--import-cache|--export-cache|writing cache image manifest/iu.test(logTail);
}
function ciBuildBenchmarkLogHasReuse(job: Record<string, unknown>): boolean {