From 3533868a414f91f4fff9fcda690a7deed6bfeda7 Mon Sep 17 00:00:00 2001 From: Codex Date: Sat, 20 Jun 2026 00:02:08 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=94=A8=20YAML=20=E9=85=8D=E7=BD=AE=20?= =?UTF-8?q?HWLAB=20runtime=20store=20pool?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/hwlab-node-lanes.yaml | 3 +++ scripts/src/hwlab-node-impl.ts | 6 ++++++ scripts/src/hwlab-node-lanes.ts | 22 ++++++++++++++++++++++ 3 files changed, 31 insertions(+) diff --git a/config/hwlab-node-lanes.yaml b/config/hwlab-node-lanes.yaml index 6e33ea0f..193524f3 100644 --- a/config/hwlab-node-lanes.yaml +++ b/config/hwlab-node-lanes.yaml @@ -139,6 +139,9 @@ lanes: path: deploy/gitops/node/d601/runtime-v03 namespace: hwlab-v03 renderDir: runtime-v03 + runtimeStore: + postgres: + poolMax: 20 tektonDir: tekton-v03 argoApplicationFile: application-v03.yaml registryPrefix: 127.0.0.1:5000/hwlab diff --git a/scripts/src/hwlab-node-impl.ts b/scripts/src/hwlab-node-impl.ts index 38f32cbe..7955d427 100644 --- a/scripts/src/hwlab-node-impl.ts +++ b/scripts/src/hwlab-node-impl.ts @@ -429,6 +429,7 @@ function nodeRuntimeExpected(spec: HwlabRuntimeLaneSpec): Record&2; exit 43; fi", @@ -3974,6 +3976,7 @@ function renderNodeRuntimeControlPlaneLocal(spec: HwlabRuntimeLaneSpec, sourceCo " observability: overlay.observability,", " envRecipe: { ...(lane.envRecipe || {}), downloadStack },", "};", + "if (overlay.runtimeStore !== undefined) doc.lanes[overlay.lane].runtimeStore = overlay.runtimeStore;", "fs.writeFileSync(path, YAML.stringify(doc));", "NODE", "if [ -f scripts/gitops-render.mjs ]; then render_script=scripts/gitops-render.mjs; else echo 'render script missing: scripts/gitops-render.mjs' >&2; exit 43; fi", @@ -4120,6 +4123,7 @@ function nodeRuntimePipelinePostprocessScript(): string[] { " publicWebUrl: overlay.publicWebUrl,", " publicApiUrl: overlay.publicApiUrl,", " externalPostgres: overlay.externalPostgres,", + " runtimeStore: overlay.runtimeStore,", " observability: overlay.observability,", " runtimeImageRewrites: overlay.runtimeImageRewrites,", " dockerProxyHttp: overlay.dockerProxyHttp,", @@ -4168,6 +4172,7 @@ function nodeRuntimePipelinePostprocessScript(): string[] { " observability: overlay.observability,", " envRecipe: { ...envRecipe, downloadStack },", "};", + "if (overlay.runtimeStore !== undefined) doc.lanes[overlay.lane].runtimeStore = overlay.runtimeStore;", "fs.writeFileSync(file, YAML.stringify(doc));", "console.error(JSON.stringify({ event: 'unidesk-deploy-yaml-overlay', ok: true, lane: overlay.lane, httpProxy: overlay.dockerProxyHttp, noProxyCount: overlay.dockerNoProxyList.length }));", "NODE_UNIDESK_DEPLOY_YAML_OVERLAY`;", @@ -4967,6 +4972,7 @@ function nodeRuntimeRenderOverlay(spec: HwlabRuntimeLaneSpec): Record): HwlabLa buildkit: buildkitConfig(raw.buildkit, `lanes.${id}.buildkit`), bootstrapAdmin: bootstrapAdminConfig(raw.bootstrapAdmin, `lanes.${id}.bootstrapAdmin`), externalPostgres: externalPostgresConfig(raw.externalPostgres, `lanes.${id}.externalPostgres`), + runtimeStore: runtimeStoreConfig(raw.runtimeStore, `lanes.${id}.runtimeStore`), publicExposure: publicExposureConfig(raw.publicExposure, `lanes.${id}.publicExposure`), observability: observabilityConfig(raw.observability, `lanes.${id}.observability`), runtimeImageRewrites: runtimeImageRewritesConfig(raw.runtimeImageRewrites, `lanes.${id}.runtimeImageRewrites`), @@ -493,6 +504,7 @@ function laneTargetConfig(id: HwlabRuntimeLane, nodeId: string, baseRaw: Record< buildkit: mergeOptionalRecord(baseRaw.buildkit, targetRaw.buildkit), bootstrapAdmin: mergeOptionalRecord(baseRaw.bootstrapAdmin, targetRaw.bootstrapAdmin), externalPostgres: mergeOptionalRecord(baseRaw.externalPostgres, targetRaw.externalPostgres), + runtimeStore: mergeOptionalRecord(baseRaw.runtimeStore, targetRaw.runtimeStore), publicExposure: mergeOptionalRecord(baseRaw.publicExposure, targetRaw.publicExposure), observability: mergeOptionalRecord(baseRaw.observability, targetRaw.observability), }; @@ -569,6 +581,15 @@ function externalPostgresConfig(value: unknown, path: string): HwlabRuntimeExter }; } +function runtimeStoreConfig(value: unknown, path: string): HwlabRuntimeStoreSpec | undefined { + if (value === undefined) return undefined; + const raw = asRecord(value, path); + const postgres = raw.postgres === undefined ? undefined : asRecord(raw.postgres, `${path}.postgres`); + return { + ...(postgres === undefined ? {} : { postgres: { poolMax: numberField(postgres, "poolMax", `${path}.postgres`) } }), + }; +} + function publicExposureProxyConfig(value: unknown, path: string): HwlabRuntimePublicExposureFrpcProxySpec { const raw = asRecord(value, path); return { @@ -823,6 +844,7 @@ function buildRuntimeLaneSpec(config: HwlabLaneConfig): HwlabRuntimeLaneSpec { ...(config.buildkit === undefined ? {} : { buildkit: config.buildkit }), ...(config.bootstrapAdmin === undefined ? {} : { bootstrapAdmin: config.bootstrapAdmin }), ...(config.externalPostgres === undefined ? {} : { externalPostgres: config.externalPostgres }), + ...(config.runtimeStore === undefined ? {} : { runtimeStore: config.runtimeStore }), publicExposure: config.publicExposure, observability: config.observability, runtimeImageRewrites: config.runtimeImageRewrites,