diff --git a/deploy/artifact-catalog.v02.json b/deploy/artifact-catalog.v02.json index d45ff377..2d17b004 100644 --- a/deploy/artifact-catalog.v02.json +++ b/deploy/artifact-catalog.v02.json @@ -5,7 +5,7 @@ "profile": "v02", "namespace": "hwlab-v02", "endpoint": "https://hwlab.74-48-78-17.nip.io", - "commitId": "53cac4fec5e88473ffa8e227f36240c4310c73b5", + "commitId": "554269ef997aaa7df64053072f8bfc732febecd6", "artifactState": "published", "publish": { "registryPrefix": "127.0.0.1:5000/hwlab", @@ -14,7 +14,7 @@ "publishedAt": null, "ciPublished": true, "registryVerified": true, - "provenance": "g14-ci-artifact:hwlab-v02-ci-poll-53cac4fec5e8-collect", + "provenance": "g14-ci-artifact:hwlab-v02-ci-poll-554269ef997a-collect", "note": "Digest fields were copied from a successful DEV artifact publish report for this source commit." }, "allowedProfiles": [ @@ -48,7 +48,7 @@ "environmentInputHash": null, "codeInputHash": null, "bootRepo": null, - "bootCommit": "53cac4fec5e88473ffa8e227f36240c4310c73b5", + "bootCommit": "554269ef997aaa7df64053072f8bfc732febecd6", "bootSh": null, "bootEnvEvidence": null, "dockerfileHash": "01404b65f1bc82b4ef400e06d122ffaf072407f1dc67fb822903288ef679344d", @@ -57,7 +57,7 @@ "buildArgsHash": "445d32282d642d5089290ffe5f621ccea3206cf1d9f11b24091f82a4434cbcd5", "ciAffected": false, "ciReason": [ - "gitops-only-no-image-build" + "component-inputs-unchanged" ], "reuse": { "status": "ready", @@ -118,7 +118,7 @@ "buildArgsHash": "39effb18af665e5e286cca9f84ef2a30f577ad11c9acca098589b7ee37f6950c", "ciAffected": false, "ciReason": [ - "gitops-only-no-image-build" + "component-inputs-unchanged" ], "reuse": { "status": "ready", @@ -179,7 +179,7 @@ "buildArgsHash": "b5d08683bafc16e4109e11553a1ff0a765c991d0471fda24b52973382fba87c3", "ciAffected": false, "ciReason": [ - "gitops-only-no-image-build" + "component-inputs-unchanged" ], "reuse": { "status": "ready", @@ -217,7 +217,7 @@ "environmentInputHash": null, "codeInputHash": null, "bootRepo": null, - "bootCommit": "53cac4fec5e88473ffa8e227f36240c4310c73b5", + "bootCommit": "554269ef997aaa7df64053072f8bfc732febecd6", "bootSh": null, "bootEnvEvidence": null, "dockerfileHash": "01404b65f1bc82b4ef400e06d122ffaf072407f1dc67fb822903288ef679344d", @@ -226,7 +226,7 @@ "buildArgsHash": "3fed509f00ba3448138a999f51dad3d38b822bb4a5c152011e3e57526972fd41", "ciAffected": false, "ciReason": [ - "gitops-only-no-image-build" + "component-inputs-unchanged" ], "reuse": { "status": "ready", @@ -264,7 +264,7 @@ "environmentInputHash": null, "codeInputHash": null, "bootRepo": null, - "bootCommit": "53cac4fec5e88473ffa8e227f36240c4310c73b5", + "bootCommit": "554269ef997aaa7df64053072f8bfc732febecd6", "bootSh": null, "bootEnvEvidence": null, "dockerfileHash": "01404b65f1bc82b4ef400e06d122ffaf072407f1dc67fb822903288ef679344d", @@ -273,7 +273,7 @@ "buildArgsHash": "8ff027eecc22049f7a368c9d01ccdcff523b860538d1c284d01068a67395f8e7", "ciAffected": false, "ciReason": [ - "gitops-only-no-image-build" + "component-inputs-unchanged" ], "reuse": { "status": "ready", @@ -311,7 +311,7 @@ "environmentInputHash": null, "codeInputHash": null, "bootRepo": null, - "bootCommit": "53cac4fec5e88473ffa8e227f36240c4310c73b5", + "bootCommit": "554269ef997aaa7df64053072f8bfc732febecd6", "bootSh": null, "bootEnvEvidence": null, "dockerfileHash": "01404b65f1bc82b4ef400e06d122ffaf072407f1dc67fb822903288ef679344d", @@ -320,7 +320,7 @@ "buildArgsHash": "d5e50a18e70c6a8b4896e527fa07b5dd2c85458ed9ef512c1d46775ef4e40a10", "ciAffected": false, "ciReason": [ - "gitops-only-no-image-build" + "component-inputs-unchanged" ], "reuse": { "status": "ready", diff --git a/deploy/gitops/g14/runtime-v02/deepseek-proxy.yaml b/deploy/gitops/g14/runtime-v02/deepseek-proxy.yaml index 5c2b4a04..e8fd44ca 100644 --- a/deploy/gitops/g14/runtime-v02/deepseek-proxy.yaml +++ b/deploy/gitops/g14/runtime-v02/deepseek-proxy.yaml @@ -14,7 +14,7 @@ "hwlab.pikastech.local/environment": "v02", "hwlab.pikastech.local/gitops-target": "v02", "hwlab.pikastech.local/service-id": "hwlab-deepseek-proxy", - "hwlab.pikastech.local/source-commit": "53cac4fec5e88473ffa8e227f36240c4310c73b5", + "hwlab.pikastech.local/source-commit": "554269ef997aaa7df64053072f8bfc732febecd6", "hwlab.pikastech.local/monitoring": "enabled" } }, @@ -34,7 +34,7 @@ "hwlab.pikastech.local/environment": "v02", "hwlab.pikastech.local/gitops-target": "v02", "hwlab.pikastech.local/service-id": "hwlab-deepseek-proxy", - "hwlab.pikastech.local/source-commit": "53cac4fec5e88473ffa8e227f36240c4310c73b5", + "hwlab.pikastech.local/source-commit": "554269ef997aaa7df64053072f8bfc732febecd6", "hwlab.pikastech.local/monitoring": "enabled" }, "annotations": { @@ -44,7 +44,7 @@ "hwlab.pikastech.local/bridge-source-commit": "869746374be36a7aeac7443de8c72a377240ca2d", "hwlab.pikastech.local/bridge-image-tag": "869746374be36a7aeac7443de8c72a377240ca2d", "hwlab.pikastech.local/bridge-image": "127.0.0.1:5000/hwlab/hwlab-cloud-api@sha256:687276c4a7fbc7665cd473b4e937e99cee6eb133207c4ac43da76b373ba1c264", - "hwlab.pikastech.local/metrics-sidecar-sha256": "aa34ddaae23b169603dd290f5d39b3760b951341d67585412883a8b64f1aef85" + "hwlab.pikastech.local/metrics-sidecar-sha256": "95f5c8cb1419a94e8038509211100dbd1cc15c245655026df8c3027bf9f97a04" } }, "spec": { @@ -72,7 +72,7 @@ "hwlab.pikastech.local/bridge-source-commit": "869746374be36a7aeac7443de8c72a377240ca2d", "hwlab.pikastech.local/bridge-image-tag": "869746374be36a7aeac7443de8c72a377240ca2d", "hwlab.pikastech.local/bridge-image": "127.0.0.1:5000/hwlab/hwlab-cloud-api@sha256:687276c4a7fbc7665cd473b4e937e99cee6eb133207c4ac43da76b373ba1c264", - "hwlab.pikastech.local/metrics-sidecar-sha256": "aa34ddaae23b169603dd290f5d39b3760b951341d67585412883a8b64f1aef85" + "hwlab.pikastech.local/metrics-sidecar-sha256": "95f5c8cb1419a94e8038509211100dbd1cc15c245655026df8c3027bf9f97a04" } }, "spec": { @@ -315,7 +315,7 @@ "hwlab.pikastech.local/environment": "v02", "hwlab.pikastech.local/gitops-target": "v02", "hwlab.pikastech.local/service-id": "hwlab-deepseek-proxy", - "hwlab.pikastech.local/source-commit": "53cac4fec5e88473ffa8e227f36240c4310c73b5", + "hwlab.pikastech.local/source-commit": "554269ef997aaa7df64053072f8bfc732febecd6", "hwlab.pikastech.local/monitoring": "enabled" } }, diff --git a/deploy/gitops/g14/runtime-v02/g14-frpc.yaml b/deploy/gitops/g14/runtime-v02/g14-frpc.yaml index 9daf1ddb..f58898b3 100644 --- a/deploy/gitops/g14/runtime-v02/g14-frpc.yaml +++ b/deploy/gitops/g14/runtime-v02/g14-frpc.yaml @@ -14,7 +14,7 @@ "hwlab.pikastech.local/environment": "v02", "hwlab.pikastech.local/gitops-target": "v02", "hwlab.pikastech.local/profile": "v02", - "hwlab.pikastech.local/source-commit": "53cac4fec5e88473ffa8e227f36240c4310c73b5" + "hwlab.pikastech.local/source-commit": "554269ef997aaa7df64053072f8bfc732febecd6" } }, "data": { @@ -33,7 +33,7 @@ "hwlab.pikastech.local/environment": "v02", "hwlab.pikastech.local/gitops-target": "v02", "hwlab.pikastech.local/profile": "v02", - "hwlab.pikastech.local/source-commit": "53cac4fec5e88473ffa8e227f36240c4310c73b5" + "hwlab.pikastech.local/source-commit": "554269ef997aaa7df64053072f8bfc732febecd6" } }, "spec": { diff --git a/deploy/gitops/g14/runtime-v02/health-contract.yaml b/deploy/gitops/g14/runtime-v02/health-contract.yaml index 19ecafc3..8c88e63b 100644 --- a/deploy/gitops/g14/runtime-v02/health-contract.yaml +++ b/deploy/gitops/g14/runtime-v02/health-contract.yaml @@ -8,7 +8,7 @@ "app.kubernetes.io/name": "hwlab-v02-health-contract", "hwlab.pikastech.local/profile": "v02", "hwlab.pikastech.local/gitops-target": "v02", - "hwlab.pikastech.local/source-commit": "53cac4fec5e88473ffa8e227f36240c4310c73b5", + "hwlab.pikastech.local/source-commit": "554269ef997aaa7df64053072f8bfc732febecd6", "hwlab.pikastech.local/environment": "v02" }, "annotations": { diff --git a/deploy/gitops/g14/runtime-v02/namespace.yaml b/deploy/gitops/g14/runtime-v02/namespace.yaml index 4097e8e6..113e4542 100644 --- a/deploy/gitops/g14/runtime-v02/namespace.yaml +++ b/deploy/gitops/g14/runtime-v02/namespace.yaml @@ -7,7 +7,7 @@ "app.kubernetes.io/part-of": "hwlab", "hwlab.pikastech.local/profile": "v02", "hwlab.pikastech.local/gitops-target": "v02", - "hwlab.pikastech.local/source-commit": "53cac4fec5e88473ffa8e227f36240c4310c73b5", + "hwlab.pikastech.local/source-commit": "554269ef997aaa7df64053072f8bfc732febecd6", "hwlab.pikastech.local/environment": "v02" }, "annotations": { diff --git a/deploy/gitops/g14/runtime-v02/observability.yaml b/deploy/gitops/g14/runtime-v02/observability.yaml index c0210f93..979b71b9 100644 --- a/deploy/gitops/g14/runtime-v02/observability.yaml +++ b/deploy/gitops/g14/runtime-v02/observability.yaml @@ -10,7 +10,7 @@ "namespace": "hwlab-v02", "labels": { "hwlab.pikastech.local/gitops-target": "v02", - "hwlab.pikastech.local/source-commit": "53cac4fec5e88473ffa8e227f36240c4310c73b5", + "hwlab.pikastech.local/source-commit": "554269ef997aaa7df64053072f8bfc732febecd6", "hwlab.pikastech.local/environment": "v02", "hwlab.pikastech.local/profile": "v02", "app.kubernetes.io/part-of": "hwlab", @@ -21,7 +21,7 @@ } }, "data": { - "metrics-sidecar.mjs": "import { createServer } from \"node:http\";\nimport { realpathSync } from \"node:fs\";\nimport { pathToFileURL } from \"node:url\";\n\nconst DEFAULT_PORT = 9100;\nconst DEFAULT_TARGET_TIMEOUT_MS = 2000;\nconst startedAtMs = Date.now();\n\nexport function sanitizeLabelValue(value, fallback = \"unknown\") {\n const text = String(value ?? \"\").trim();\n const sanitized = text.replace(/[^A-Za-z0-9_.:-]/gu, \"_\").slice(0, 120);\n return sanitized || fallback;\n}\n\nexport function escapeLabelValue(value) {\n return String(value ?? \"\").replace(/\\\\/gu, \"\\\\\\\\\").replace(/\\n/gu, \"\\\\n\").replace(/\"/gu, \"\\\\\\\"\");\n}\n\nfunction metricLabels(env) {\n const service = sanitizeLabelValue(env.HWLAB_METRICS_SERVICE_ID || env.HWLAB_SERVICE_ID);\n const namespace = sanitizeLabelValue(env.HWLAB_METRICS_NAMESPACE || env.POD_NAMESPACE || \"hwlab-v02\");\n const gitopsTarget = sanitizeLabelValue(env.HWLAB_METRICS_GITOPS_TARGET || env.HWLAB_GITOPS_TARGET || \"v02\");\n return `service=\"${escapeLabelValue(service)}\",namespace=\"${escapeLabelValue(namespace)}\",gitops_target=\"${escapeLabelValue(gitopsTarget)}\"`;\n}\n\nexport async function probeTarget({ targetUrl, timeoutMs = DEFAULT_TARGET_TIMEOUT_MS, fetchImpl = globalThis.fetch } = {}) {\n const configured = typeof targetUrl === \"string\" && targetUrl.trim().length > 0;\n if (!configured || typeof fetchImpl !== \"function\") {\n return { configured: false, success: false, statusCode: 0, durationSeconds: 0 };\n }\n const controller = new AbortController();\n const started = Date.now();\n const timeout = setTimeout(() => controller.abort(), timeoutMs);\n try {\n const response = await fetchImpl(targetUrl, { signal: controller.signal });\n return {\n configured: true,\n success: response.ok,\n statusCode: response.status || 0,\n durationSeconds: (Date.now() - started) / 1000\n };\n } catch {\n return { configured: true, success: false, statusCode: 0, durationSeconds: (Date.now() - started) / 1000 };\n } finally {\n clearTimeout(timeout);\n }\n}\n\nexport function buildMetricsText({ env = process.env, probe = null, now = Date.now() } = {}) {\n const labels = metricLabels(env);\n const uptimeSeconds = Math.max(0, (now - startedAtMs) / 1000);\n const healthProbe = probe ?? { configured: false, success: false, statusCode: 0, durationSeconds: 0 };\n return [\n \"# HELP hwlab_service_up HWLAB metrics sidecar availability.\",\n \"# TYPE hwlab_service_up gauge\",\n `hwlab_service_up{${labels}} 1`,\n \"# HELP hwlab_service_info Static HWLAB service metrics identity without high-cardinality request identifiers.\",\n \"# TYPE hwlab_service_info gauge\",\n `hwlab_service_info{${labels}} 1`,\n \"# HELP hwlab_service_process_uptime_seconds Metrics sidecar process uptime in seconds.\",\n \"# TYPE hwlab_service_process_uptime_seconds gauge\",\n `hwlab_service_process_uptime_seconds{${labels}} ${uptimeSeconds.toFixed(3)}`,\n \"# HELP hwlab_service_health_probe_configured Whether the sidecar has a cluster-local health probe target.\",\n \"# TYPE hwlab_service_health_probe_configured gauge\",\n `hwlab_service_health_probe_configured{${labels}} ${healthProbe.configured ? 1 : 0}`,\n \"# HELP hwlab_service_health_probe_success Whether the most recent cluster-local health probe succeeded.\",\n \"# TYPE hwlab_service_health_probe_success gauge\",\n `hwlab_service_health_probe_success{${labels}} ${healthProbe.success ? 1 : 0}`,\n \"# HELP hwlab_service_health_probe_status_code Most recent cluster-local health probe HTTP status code, or 0 when unavailable.\",\n \"# TYPE hwlab_service_health_probe_status_code gauge\",\n `hwlab_service_health_probe_status_code{${labels}} ${Number.isInteger(healthProbe.statusCode) ? healthProbe.statusCode : 0}`,\n \"# HELP hwlab_service_health_probe_duration_seconds Most recent cluster-local health probe duration in seconds.\",\n \"# TYPE hwlab_service_health_probe_duration_seconds gauge\",\n `hwlab_service_health_probe_duration_seconds{${labels}} ${Number(healthProbe.durationSeconds || 0).toFixed(3)}`,\n \"\"\n ].join(\"\\n\");\n}\n\nfunction sendJson(response, statusCode, body) {\n const payload = JSON.stringify(body) + \"\\n\";\n response.writeHead(statusCode, {\n \"content-type\": \"application/json; charset=utf-8\",\n \"content-length\": Buffer.byteLength(payload)\n });\n response.end(payload);\n}\n\nexport function createMetricsSidecarServer({ env = process.env, fetchImpl = globalThis.fetch } = {}) {\n return createServer(async (request, response) => {\n const url = new URL(request.url || \"/\", \"http://hwlab-metrics.local\");\n if (request.method === \"GET\" && (url.pathname === \"/health\" || url.pathname === \"/health/live\")) {\n sendJson(response, 200, {\n serviceId: sanitizeLabelValue(env.HWLAB_METRICS_SERVICE_ID || env.HWLAB_SERVICE_ID),\n status: \"ok\",\n metricsPath: \"/metrics\"\n });\n return;\n }\n if (request.method === \"GET\" && url.pathname === \"/metrics\") {\n const timeoutMs = Number.parseInt(env.HWLAB_METRICS_TARGET_TIMEOUT_MS || \"\", 10) || DEFAULT_TARGET_TIMEOUT_MS;\n const probe = await probeTarget({ targetUrl: env.HWLAB_METRICS_TARGET_URL, timeoutMs, fetchImpl });\n const payload = buildMetricsText({ env, probe });\n response.writeHead(200, {\n \"content-type\": \"text/plain; version=0.0.4; charset=utf-8\",\n \"content-length\": Buffer.byteLength(payload)\n });\n response.end(payload);\n return;\n }\n sendJson(response, 404, { error: \"not_found\", path: url.pathname });\n });\n}\n\nexport function startMetricsSidecar({ env = process.env } = {}) {\n const port = Number.parseInt(env.HWLAB_METRICS_PORT || env.PORT || \"\", 10) || DEFAULT_PORT;\n const server = createMetricsSidecarServer({ env });\n server.listen(port, \"0.0.0.0\", () => {\n process.stdout.write(JSON.stringify({ serviceId: env.HWLAB_METRICS_SERVICE_ID || \"hwlab-unknown\", status: \"metrics-listening\", port }) + \"\\n\");\n });\n return server;\n}\n\nexport function isMainModule({ moduleUrl = import.meta.url, argvPath = process.argv[1], realpath = realpathSync } = {}) {\n if (!argvPath) return false;\n if (moduleUrl === pathToFileURL(argvPath).href) return true;\n try {\n return moduleUrl === pathToFileURL(realpath(argvPath)).href;\n } catch {\n return false;\n }\n}\n\nif (isMainModule()) {\n startMetricsSidecar();\n}\n" + "metrics-sidecar.mjs": "import { createServer, request as httpRequest } from \"node:http\";\nimport { request as httpsRequest } from \"node:https\";\nimport { realpathSync } from \"node:fs\";\nimport { pathToFileURL } from \"node:url\";\n\nconst DEFAULT_PORT = 9100;\nconst DEFAULT_TARGET_TIMEOUT_MS = 2000;\nconst startedAtMs = Date.now();\n\nexport function sanitizeLabelValue(value, fallback = \"unknown\") {\n const text = String(value ?? \"\").trim();\n const sanitized = text.replace(/[^A-Za-z0-9_.:-]/gu, \"_\").slice(0, 120);\n return sanitized || fallback;\n}\n\nexport function escapeLabelValue(value) {\n return String(value ?? \"\").replace(/\\\\/gu, \"\\\\\\\\\").replace(/\\n/gu, \"\\\\n\").replace(/\"/gu, \"\\\\\\\"\");\n}\n\nfunction metricLabels(env) {\n const service = sanitizeLabelValue(env.HWLAB_METRICS_SERVICE_ID || env.HWLAB_SERVICE_ID);\n const namespace = sanitizeLabelValue(env.HWLAB_METRICS_NAMESPACE || env.POD_NAMESPACE || \"hwlab-v02\");\n const gitopsTarget = sanitizeLabelValue(env.HWLAB_METRICS_GITOPS_TARGET || env.HWLAB_GITOPS_TARGET || \"v02\");\n return `service=\"${escapeLabelValue(service)}\",namespace=\"${escapeLabelValue(namespace)}\",gitops_target=\"${escapeLabelValue(gitopsTarget)}\"`;\n}\n\nexport function requestTarget({ targetUrl, timeoutMs = DEFAULT_TARGET_TIMEOUT_MS } = {}) {\n const configured = typeof targetUrl === \"string\" && targetUrl.trim().length > 0;\n if (!configured) return Promise.resolve({ configured: false, success: false, statusCode: 0, durationSeconds: 0 });\n\n let url;\n try {\n url = new URL(targetUrl);\n } catch {\n return Promise.resolve({ configured: true, success: false, statusCode: 0, durationSeconds: 0 });\n }\n\n const requestImpl = url.protocol === \"https:\" ? httpsRequest : url.protocol === \"http:\" ? httpRequest : null;\n if (!requestImpl) return Promise.resolve({ configured: true, success: false, statusCode: 0, durationSeconds: 0 });\n\n const started = Date.now();\n return new Promise((resolve) => {\n const finish = (result) => resolve({\n configured: true,\n success: false,\n statusCode: 0,\n durationSeconds: (Date.now() - started) / 1000,\n ...result\n });\n const request = requestImpl(url, { method: \"GET\", timeout: timeoutMs }, (response) => {\n response.resume();\n response.on(\"end\", () => finish({ success: Boolean(response.statusCode && response.statusCode >= 200 && response.statusCode < 300), statusCode: response.statusCode || 0 }));\n });\n request.on(\"timeout\", () => request.destroy());\n request.on(\"error\", () => finish({}));\n request.end();\n });\n}\n\nexport async function probeTarget({ targetUrl, timeoutMs = DEFAULT_TARGET_TIMEOUT_MS, probeImpl = requestTarget } = {}) {\n const configured = typeof targetUrl === \"string\" && targetUrl.trim().length > 0;\n if (!configured || typeof probeImpl !== \"function\") {\n return { configured: false, success: false, statusCode: 0, durationSeconds: 0 };\n }\n try {\n return await probeImpl({ targetUrl, timeoutMs });\n } catch {\n const started = Date.now();\n return { configured: true, success: false, statusCode: 0, durationSeconds: (Date.now() - started) / 1000 };\n }\n}\n\nexport function buildMetricsText({ env = process.env, probe = null, now = Date.now() } = {}) {\n const labels = metricLabels(env);\n const uptimeSeconds = Math.max(0, (now - startedAtMs) / 1000);\n const healthProbe = probe ?? { configured: false, success: false, statusCode: 0, durationSeconds: 0 };\n return [\n \"# HELP hwlab_service_up HWLAB metrics sidecar availability.\",\n \"# TYPE hwlab_service_up gauge\",\n `hwlab_service_up{${labels}} 1`,\n \"# HELP hwlab_service_info Static HWLAB service metrics identity without high-cardinality request identifiers.\",\n \"# TYPE hwlab_service_info gauge\",\n `hwlab_service_info{${labels}} 1`,\n \"# HELP hwlab_service_process_uptime_seconds Metrics sidecar process uptime in seconds.\",\n \"# TYPE hwlab_service_process_uptime_seconds gauge\",\n `hwlab_service_process_uptime_seconds{${labels}} ${uptimeSeconds.toFixed(3)}`,\n \"# HELP hwlab_service_health_probe_configured Whether the sidecar has a cluster-local health probe target.\",\n \"# TYPE hwlab_service_health_probe_configured gauge\",\n `hwlab_service_health_probe_configured{${labels}} ${healthProbe.configured ? 1 : 0}`,\n \"# HELP hwlab_service_health_probe_success Whether the most recent cluster-local health probe succeeded.\",\n \"# TYPE hwlab_service_health_probe_success gauge\",\n `hwlab_service_health_probe_success{${labels}} ${healthProbe.success ? 1 : 0}`,\n \"# HELP hwlab_service_health_probe_status_code Most recent cluster-local health probe HTTP status code, or 0 when unavailable.\",\n \"# TYPE hwlab_service_health_probe_status_code gauge\",\n `hwlab_service_health_probe_status_code{${labels}} ${Number.isInteger(healthProbe.statusCode) ? healthProbe.statusCode : 0}`,\n \"# HELP hwlab_service_health_probe_duration_seconds Most recent cluster-local health probe duration in seconds.\",\n \"# TYPE hwlab_service_health_probe_duration_seconds gauge\",\n `hwlab_service_health_probe_duration_seconds{${labels}} ${Number(healthProbe.durationSeconds || 0).toFixed(3)}`,\n \"\"\n ].join(\"\\n\");\n}\n\nfunction sendJson(response, statusCode, body) {\n const payload = JSON.stringify(body) + \"\\n\";\n response.writeHead(statusCode, {\n \"content-type\": \"application/json; charset=utf-8\",\n \"content-length\": Buffer.byteLength(payload)\n });\n response.end(payload);\n}\n\nexport function createMetricsSidecarServer({ env = process.env, probeImpl = requestTarget } = {}) {\n return createServer(async (request, response) => {\n const url = new URL(request.url || \"/\", \"http://hwlab-metrics.local\");\n if (request.method === \"GET\" && (url.pathname === \"/health\" || url.pathname === \"/health/live\")) {\n sendJson(response, 200, {\n serviceId: sanitizeLabelValue(env.HWLAB_METRICS_SERVICE_ID || env.HWLAB_SERVICE_ID),\n status: \"ok\",\n metricsPath: \"/metrics\"\n });\n return;\n }\n if (request.method === \"GET\" && url.pathname === \"/metrics\") {\n const timeoutMs = Number.parseInt(env.HWLAB_METRICS_TARGET_TIMEOUT_MS || \"\", 10) || DEFAULT_TARGET_TIMEOUT_MS;\n const probe = await probeTarget({ targetUrl: env.HWLAB_METRICS_TARGET_URL, timeoutMs, probeImpl });\n const payload = buildMetricsText({ env, probe });\n response.writeHead(200, {\n \"content-type\": \"text/plain; version=0.0.4; charset=utf-8\",\n \"content-length\": Buffer.byteLength(payload)\n });\n response.end(payload);\n return;\n }\n sendJson(response, 404, { error: \"not_found\", path: url.pathname });\n });\n}\n\nexport function startMetricsSidecar({ env = process.env } = {}) {\n const port = Number.parseInt(env.HWLAB_METRICS_PORT || env.PORT || \"\", 10) || DEFAULT_PORT;\n const server = createMetricsSidecarServer({ env });\n server.listen(port, \"0.0.0.0\", () => {\n process.stdout.write(JSON.stringify({ serviceId: env.HWLAB_METRICS_SERVICE_ID || \"hwlab-unknown\", status: \"metrics-listening\", port }) + \"\\n\");\n });\n return server;\n}\n\nexport function isMainModule({ moduleUrl = import.meta.url, argvPath = process.argv[1], realpath = realpathSync } = {}) {\n if (!argvPath) return false;\n if (moduleUrl === pathToFileURL(argvPath).href) return true;\n try {\n return moduleUrl === pathToFileURL(realpath(argvPath)).href;\n } catch {\n return false;\n }\n}\n\nif (isMainModule()) {\n startMetricsSidecar();\n}\n" } }, { @@ -32,7 +32,7 @@ "namespace": "hwlab-v02", "labels": { "hwlab.pikastech.local/gitops-target": "v02", - "hwlab.pikastech.local/source-commit": "53cac4fec5e88473ffa8e227f36240c4310c73b5", + "hwlab.pikastech.local/source-commit": "554269ef997aaa7df64053072f8bfc732febecd6", "hwlab.pikastech.local/environment": "v02", "hwlab.pikastech.local/profile": "v02", "app.kubernetes.io/part-of": "hwlab", @@ -78,7 +78,7 @@ "namespace": "hwlab-v02", "labels": { "hwlab.pikastech.local/gitops-target": "v02", - "hwlab.pikastech.local/source-commit": "53cac4fec5e88473ffa8e227f36240c4310c73b5", + "hwlab.pikastech.local/source-commit": "554269ef997aaa7df64053072f8bfc732febecd6", "hwlab.pikastech.local/environment": "v02", "hwlab.pikastech.local/profile": "v02", "app.kubernetes.io/part-of": "hwlab", @@ -124,7 +124,7 @@ "namespace": "hwlab-v02", "labels": { "hwlab.pikastech.local/gitops-target": "v02", - "hwlab.pikastech.local/source-commit": "53cac4fec5e88473ffa8e227f36240c4310c73b5", + "hwlab.pikastech.local/source-commit": "554269ef997aaa7df64053072f8bfc732febecd6", "hwlab.pikastech.local/environment": "v02", "hwlab.pikastech.local/profile": "v02", "app.kubernetes.io/part-of": "hwlab", @@ -170,7 +170,7 @@ "namespace": "hwlab-v02", "labels": { "hwlab.pikastech.local/gitops-target": "v02", - "hwlab.pikastech.local/source-commit": "53cac4fec5e88473ffa8e227f36240c4310c73b5", + "hwlab.pikastech.local/source-commit": "554269ef997aaa7df64053072f8bfc732febecd6", "hwlab.pikastech.local/environment": "v02", "hwlab.pikastech.local/profile": "v02", "app.kubernetes.io/part-of": "hwlab", @@ -216,7 +216,7 @@ "namespace": "hwlab-v02", "labels": { "hwlab.pikastech.local/gitops-target": "v02", - "hwlab.pikastech.local/source-commit": "53cac4fec5e88473ffa8e227f36240c4310c73b5", + "hwlab.pikastech.local/source-commit": "554269ef997aaa7df64053072f8bfc732febecd6", "hwlab.pikastech.local/environment": "v02", "hwlab.pikastech.local/profile": "v02", "app.kubernetes.io/part-of": "hwlab", @@ -262,7 +262,7 @@ "namespace": "hwlab-v02", "labels": { "hwlab.pikastech.local/gitops-target": "v02", - "hwlab.pikastech.local/source-commit": "53cac4fec5e88473ffa8e227f36240c4310c73b5", + "hwlab.pikastech.local/source-commit": "554269ef997aaa7df64053072f8bfc732febecd6", "hwlab.pikastech.local/environment": "v02", "hwlab.pikastech.local/profile": "v02", "app.kubernetes.io/part-of": "hwlab", @@ -308,7 +308,7 @@ "namespace": "hwlab-v02", "labels": { "hwlab.pikastech.local/gitops-target": "v02", - "hwlab.pikastech.local/source-commit": "53cac4fec5e88473ffa8e227f36240c4310c73b5", + "hwlab.pikastech.local/source-commit": "554269ef997aaa7df64053072f8bfc732febecd6", "hwlab.pikastech.local/environment": "v02", "hwlab.pikastech.local/profile": "v02", "app.kubernetes.io/part-of": "hwlab", diff --git a/deploy/gitops/g14/runtime-v02/postgres.yaml b/deploy/gitops/g14/runtime-v02/postgres.yaml index d5f18b62..b9d0757a 100644 --- a/deploy/gitops/g14/runtime-v02/postgres.yaml +++ b/deploy/gitops/g14/runtime-v02/postgres.yaml @@ -14,7 +14,7 @@ "hwlab.pikastech.local/environment": "v02", "hwlab.pikastech.local/gitops-target": "v02", "hwlab.pikastech.local/profile": "v02", - "hwlab.pikastech.local/source-commit": "53cac4fec5e88473ffa8e227f36240c4310c73b5" + "hwlab.pikastech.local/source-commit": "554269ef997aaa7df64053072f8bfc732febecd6" } }, "data": { @@ -33,7 +33,7 @@ "hwlab.pikastech.local/environment": "v02", "hwlab.pikastech.local/gitops-target": "v02", "hwlab.pikastech.local/profile": "v02", - "hwlab.pikastech.local/source-commit": "53cac4fec5e88473ffa8e227f36240c4310c73b5" + "hwlab.pikastech.local/source-commit": "554269ef997aaa7df64053072f8bfc732febecd6" } }, "spec": { @@ -62,7 +62,7 @@ "hwlab.pikastech.local/environment": "v02", "hwlab.pikastech.local/gitops-target": "v02", "hwlab.pikastech.local/profile": "v02", - "hwlab.pikastech.local/source-commit": "53cac4fec5e88473ffa8e227f36240c4310c73b5" + "hwlab.pikastech.local/source-commit": "554269ef997aaa7df64053072f8bfc732febecd6" } }, "spec": { diff --git a/deploy/gitops/g14/runtime-v02/services.yaml b/deploy/gitops/g14/runtime-v02/services.yaml index 8b9f4116..775f0d3b 100644 --- a/deploy/gitops/g14/runtime-v02/services.yaml +++ b/deploy/gitops/g14/runtime-v02/services.yaml @@ -12,7 +12,7 @@ "app.kubernetes.io/name": "hwlab-cloud-api", "hwlab.pikastech.local/service-id": "hwlab-cloud-api", "hwlab.pikastech.local/gitops-target": "v02", - "hwlab.pikastech.local/source-commit": "53cac4fec5e88473ffa8e227f36240c4310c73b5", + "hwlab.pikastech.local/source-commit": "554269ef997aaa7df64053072f8bfc732febecd6", "hwlab.pikastech.local/environment": "v02", "hwlab.pikastech.local/profile": "v02", "hwlab.pikastech.local/monitoring": "enabled" @@ -50,7 +50,7 @@ "app.kubernetes.io/name": "hwlab-cloud-web", "hwlab.pikastech.local/service-id": "hwlab-cloud-web", "hwlab.pikastech.local/gitops-target": "v02", - "hwlab.pikastech.local/source-commit": "53cac4fec5e88473ffa8e227f36240c4310c73b5", + "hwlab.pikastech.local/source-commit": "554269ef997aaa7df64053072f8bfc732febecd6", "hwlab.pikastech.local/environment": "v02", "hwlab.pikastech.local/profile": "v02", "hwlab.pikastech.local/monitoring": "enabled" @@ -89,7 +89,7 @@ "hwlab.pikastech.local/service-id": "hwlab-gateway", "hwlab.pikastech.local/activation": "manual", "hwlab.pikastech.local/gitops-target": "v02", - "hwlab.pikastech.local/source-commit": "53cac4fec5e88473ffa8e227f36240c4310c73b5", + "hwlab.pikastech.local/source-commit": "554269ef997aaa7df64053072f8bfc732febecd6", "hwlab.pikastech.local/environment": "v02", "hwlab.pikastech.local/profile": "v02" }, @@ -121,7 +121,7 @@ "app.kubernetes.io/name": "hwlab-agent-skills", "hwlab.pikastech.local/service-id": "hwlab-agent-skills", "hwlab.pikastech.local/gitops-target": "v02", - "hwlab.pikastech.local/source-commit": "53cac4fec5e88473ffa8e227f36240c4310c73b5", + "hwlab.pikastech.local/source-commit": "554269ef997aaa7df64053072f8bfc732febecd6", "hwlab.pikastech.local/environment": "v02", "hwlab.pikastech.local/profile": "v02", "hwlab.pikastech.local/monitoring": "enabled" @@ -159,7 +159,7 @@ "app.kubernetes.io/name": "hwlab-device-pod", "hwlab.pikastech.local/service-id": "hwlab-device-pod", "hwlab.pikastech.local/gitops-target": "v02", - "hwlab.pikastech.local/source-commit": "53cac4fec5e88473ffa8e227f36240c4310c73b5", + "hwlab.pikastech.local/source-commit": "554269ef997aaa7df64053072f8bfc732febecd6", "hwlab.pikastech.local/environment": "v02", "hwlab.pikastech.local/profile": "v02", "hwlab.pikastech.local/monitoring": "enabled" @@ -197,7 +197,7 @@ "app.kubernetes.io/name": "hwlab-edge-proxy", "hwlab.pikastech.local/service-id": "hwlab-edge-proxy", "hwlab.pikastech.local/gitops-target": "v02", - "hwlab.pikastech.local/source-commit": "53cac4fec5e88473ffa8e227f36240c4310c73b5", + "hwlab.pikastech.local/source-commit": "554269ef997aaa7df64053072f8bfc732febecd6", "hwlab.pikastech.local/environment": "v02", "hwlab.pikastech.local/profile": "v02", "hwlab.pikastech.local/monitoring": "enabled" diff --git a/deploy/gitops/g14/runtime-v02/workloads.yaml b/deploy/gitops/g14/runtime-v02/workloads.yaml index 599ca74c..d8f0dd95 100644 --- a/deploy/gitops/g14/runtime-v02/workloads.yaml +++ b/deploy/gitops/g14/runtime-v02/workloads.yaml @@ -13,14 +13,14 @@ "hwlab.pikastech.local/environment": "v02", "hwlab.pikastech.local/profile": "v02", "hwlab.pikastech.local/gitops-target": "v02", - "hwlab.pikastech.local/source-commit": "53cac4fec5e88473ffa8e227f36240c4310c73b5", + "hwlab.pikastech.local/source-commit": "554269ef997aaa7df64053072f8bfc732febecd6", "unidesk.ai/g14-staging": "false" }, "name": "hwlab-user-skills", "namespace": "hwlab-v02", "annotations": { "hwlab.pikastech.local/gitops-note": "HWLAB v0.2 GitOps target.", - "hwlab.pikastech.local/source-commit": "53cac4fec5e88473ffa8e227f36240c4310c73b5" + "hwlab.pikastech.local/source-commit": "554269ef997aaa7df64053072f8bfc732febecd6" } }, "spec": { @@ -47,13 +47,13 @@ "hwlab.pikastech.local/environment": "v02", "hwlab.pikastech.local/profile": "v02", "hwlab.pikastech.local/gitops-target": "v02", - "hwlab.pikastech.local/source-commit": "53cac4fec5e88473ffa8e227f36240c4310c73b5", + "hwlab.pikastech.local/source-commit": "554269ef997aaa7df64053072f8bfc732febecd6", "unidesk.ai/g14-staging": "false", "hwlab.pikastech.local/monitoring": "enabled" }, "annotations": { "hwlab.pikastech.local/gitops-note": "HWLAB v0.2 GitOps target.", - "hwlab.pikastech.local/source-commit": "53cac4fec5e88473ffa8e227f36240c4310c73b5" + "hwlab.pikastech.local/source-commit": "554269ef997aaa7df64053072f8bfc732febecd6" } }, "spec": { @@ -83,7 +83,7 @@ "hwlab.pikastech.local/monitoring": "enabled" }, "annotations": { - "hwlab.pikastech.local/metrics-sidecar-sha256": "aa34ddaae23b169603dd290f5d39b3760b951341d67585412883a8b64f1aef85", + "hwlab.pikastech.local/metrics-sidecar-sha256": "95f5c8cb1419a94e8038509211100dbd1cc15c245655026df8c3027bf9f97a04", "hwlab.pikastech.local/source-commit": "869746374be36a7aeac7443de8c72a377240ca2d", "hwlab.pikastech.local/artifact-source-commit": "869746374be36a7aeac7443de8c72a377240ca2d", "hwlab.pikastech.local/rendered-by": "scripts/g14-gitops-render.mjs" @@ -318,7 +318,7 @@ }, { "name": "HWLAB_CODE_AGENT_AGENTRUN_SOURCE_COMMIT", - "value": "53cac4fec5e88473ffa8e227f36240c4310c73b5" + "value": "554269ef997aaa7df64053072f8bfc732febecd6" }, { "name": "UNIDESK_MAIN_SERVER_IP", @@ -580,7 +580,7 @@ }, { "name": "HWLAB_CODE_AGENT_AGENTRUN_SOURCE_COMMIT", - "value": "53cac4fec5e88473ffa8e227f36240c4310c73b5" + "value": "554269ef997aaa7df64053072f8bfc732febecd6" }, { "name": "UNIDESK_MAIN_SERVER_IP", @@ -706,13 +706,13 @@ "hwlab.pikastech.local/environment": "v02", "hwlab.pikastech.local/profile": "v02", "hwlab.pikastech.local/gitops-target": "v02", - "hwlab.pikastech.local/source-commit": "53cac4fec5e88473ffa8e227f36240c4310c73b5", + "hwlab.pikastech.local/source-commit": "554269ef997aaa7df64053072f8bfc732febecd6", "unidesk.ai/g14-staging": "false", "hwlab.pikastech.local/monitoring": "enabled" }, "annotations": { "hwlab.pikastech.local/gitops-note": "HWLAB v0.2 GitOps target.", - "hwlab.pikastech.local/source-commit": "53cac4fec5e88473ffa8e227f36240c4310c73b5" + "hwlab.pikastech.local/source-commit": "554269ef997aaa7df64053072f8bfc732febecd6" } }, "spec": { @@ -741,7 +741,7 @@ "hwlab.pikastech.local/boot-commit": "4baea168af28f090c8cf73f8a46620a5773ffd42" }, "annotations": { - "hwlab.pikastech.local/metrics-sidecar-sha256": "aa34ddaae23b169603dd290f5d39b3760b951341d67585412883a8b64f1aef85", + "hwlab.pikastech.local/metrics-sidecar-sha256": "95f5c8cb1419a94e8038509211100dbd1cc15c245655026df8c3027bf9f97a04", "hwlab.pikastech.local/source-commit": "4baea168af28f090c8cf73f8a46620a5773ffd42", "hwlab.pikastech.local/artifact-source-commit": "4baea168af28f090c8cf73f8a46620a5773ffd42", "hwlab.pikastech.local/rendered-by": "scripts/g14-gitops-render.mjs", @@ -955,13 +955,13 @@ "hwlab.pikastech.local/environment": "v02", "hwlab.pikastech.local/profile": "v02", "hwlab.pikastech.local/gitops-target": "v02", - "hwlab.pikastech.local/source-commit": "53cac4fec5e88473ffa8e227f36240c4310c73b5", + "hwlab.pikastech.local/source-commit": "554269ef997aaa7df64053072f8bfc732febecd6", "unidesk.ai/g14-staging": "false", "hwlab.pikastech.local/monitoring": "enabled" }, "annotations": { "hwlab.pikastech.local/gitops-note": "HWLAB v0.2 GitOps target.", - "hwlab.pikastech.local/source-commit": "53cac4fec5e88473ffa8e227f36240c4310c73b5" + "hwlab.pikastech.local/source-commit": "554269ef997aaa7df64053072f8bfc732febecd6" } }, "spec": { @@ -990,7 +990,7 @@ "hwlab.pikastech.local/boot-commit": "4baea168af28f090c8cf73f8a46620a5773ffd42" }, "annotations": { - "hwlab.pikastech.local/metrics-sidecar-sha256": "aa34ddaae23b169603dd290f5d39b3760b951341d67585412883a8b64f1aef85", + "hwlab.pikastech.local/metrics-sidecar-sha256": "95f5c8cb1419a94e8038509211100dbd1cc15c245655026df8c3027bf9f97a04", "hwlab.pikastech.local/source-commit": "4baea168af28f090c8cf73f8a46620a5773ffd42", "hwlab.pikastech.local/artifact-source-commit": "4baea168af28f090c8cf73f8a46620a5773ffd42", "hwlab.pikastech.local/rendered-by": "scripts/g14-gitops-render.mjs", @@ -1215,12 +1215,12 @@ "hwlab.pikastech.local/environment": "v02", "hwlab.pikastech.local/profile": "v02", "hwlab.pikastech.local/gitops-target": "v02", - "hwlab.pikastech.local/source-commit": "53cac4fec5e88473ffa8e227f36240c4310c73b5", + "hwlab.pikastech.local/source-commit": "554269ef997aaa7df64053072f8bfc732febecd6", "unidesk.ai/g14-staging": "false" }, "annotations": { "hwlab.pikastech.local/gitops-note": "HWLAB v0.2 GitOps target.", - "hwlab.pikastech.local/source-commit": "53cac4fec5e88473ffa8e227f36240c4310c73b5" + "hwlab.pikastech.local/source-commit": "554269ef997aaa7df64053072f8bfc732febecd6" } }, "spec": { @@ -1328,13 +1328,13 @@ "hwlab.pikastech.local/environment": "v02", "hwlab.pikastech.local/profile": "v02", "hwlab.pikastech.local/gitops-target": "v02", - "hwlab.pikastech.local/source-commit": "53cac4fec5e88473ffa8e227f36240c4310c73b5", + "hwlab.pikastech.local/source-commit": "554269ef997aaa7df64053072f8bfc732febecd6", "unidesk.ai/g14-staging": "false", "hwlab.pikastech.local/monitoring": "enabled" }, "annotations": { "hwlab.pikastech.local/gitops-note": "HWLAB v0.2 GitOps target.", - "hwlab.pikastech.local/source-commit": "53cac4fec5e88473ffa8e227f36240c4310c73b5" + "hwlab.pikastech.local/source-commit": "554269ef997aaa7df64053072f8bfc732febecd6" } }, "spec": { @@ -1361,7 +1361,7 @@ "hwlab.pikastech.local/monitoring": "enabled" }, "annotations": { - "hwlab.pikastech.local/metrics-sidecar-sha256": "aa34ddaae23b169603dd290f5d39b3760b951341d67585412883a8b64f1aef85", + "hwlab.pikastech.local/metrics-sidecar-sha256": "95f5c8cb1419a94e8038509211100dbd1cc15c245655026df8c3027bf9f97a04", "hwlab.pikastech.local/source-commit": "4baea168af28f090c8cf73f8a46620a5773ffd42", "hwlab.pikastech.local/artifact-source-commit": "4baea168af28f090c8cf73f8a46620a5773ffd42", "hwlab.pikastech.local/rendered-by": "scripts/g14-gitops-render.mjs" @@ -1528,13 +1528,13 @@ "hwlab.pikastech.local/environment": "v02", "hwlab.pikastech.local/profile": "v02", "hwlab.pikastech.local/gitops-target": "v02", - "hwlab.pikastech.local/source-commit": "53cac4fec5e88473ffa8e227f36240c4310c73b5", + "hwlab.pikastech.local/source-commit": "554269ef997aaa7df64053072f8bfc732febecd6", "unidesk.ai/g14-staging": "false", "hwlab.pikastech.local/monitoring": "enabled" }, "annotations": { "hwlab.pikastech.local/gitops-note": "HWLAB v0.2 GitOps target.", - "hwlab.pikastech.local/source-commit": "53cac4fec5e88473ffa8e227f36240c4310c73b5" + "hwlab.pikastech.local/source-commit": "554269ef997aaa7df64053072f8bfc732febecd6" } }, "spec": { @@ -1561,7 +1561,7 @@ "hwlab.pikastech.local/monitoring": "enabled" }, "annotations": { - "hwlab.pikastech.local/metrics-sidecar-sha256": "aa34ddaae23b169603dd290f5d39b3760b951341d67585412883a8b64f1aef85", + "hwlab.pikastech.local/metrics-sidecar-sha256": "95f5c8cb1419a94e8038509211100dbd1cc15c245655026df8c3027bf9f97a04", "hwlab.pikastech.local/source-commit": "4baea168af28f090c8cf73f8a46620a5773ffd42", "hwlab.pikastech.local/artifact-source-commit": "4baea168af28f090c8cf73f8a46620a5773ffd42", "hwlab.pikastech.local/rendered-by": "scripts/g14-gitops-render.mjs"