fix: 同步 NC01 PaC source artifact

This commit is contained in:
root
2026-07-11 08:29:35 +02:00
parent e76e4d2bcb
commit d2790974f3
4 changed files with 2304 additions and 21 deletions
+16 -13
View File
@@ -2,16 +2,21 @@ apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
generateName: hwlab-nc01-v03-ci-poll-
namespace: hwlab-ci
annotations:
pipelinesascode.tekton.dev/on-event: "[push]"
pipelinesascode.tekton.dev/on-target-branch: "[v0.3]"
pipelinesascode.tekton.dev/on-cel-expression: "event == 'push' && target_branch == 'v0.3' && node == 'NC01'"
pipelinesascode.tekton.dev/max-keep-runs: "8"
pipelinesascode.tekton.dev/pipeline: "ci/pipelines/hwlab-nc01-v03-ci-image-publish.yaml"
unidesk.ai/owning-config-ref: "config/hwlab-node-lanes.yaml#lanes.v03.targets.NC01"
unidesk.ai/effective-config-sha256: sha256:1ccef7c0a86212f05e94de6179a2247d1f114f46f9f94442c8c48f6a2a473bdb
unidesk.ai/source-artifact-renderer: hwlab-runtime-lane
unidesk.ai/source-artifact-mode: remote-pipeline-annotation
pipelinesascode.tekton.dev/pipeline: ci/pipelines/hwlab-nc01-v03-ci-image-publish.yaml
hwlab.pikastech.local/ci-contract: tekton-native-primitive-tasks
hwlab.pikastech.local/download-profile: nc01-node-default
hwlab.pikastech.local/download-profile: jd01-node-default
hwlab.pikastech.local/gitops-branch: v0.3-gitops
hwlab.pikastech.local/network-profile: nc01-node-ci-egress
hwlab.pikastech.local/network-profile: jd01-node-ci-egress
hwlab.pikastech.local/node: NC01
hwlab.pikastech.local/policy: native-per-service-taskrun-image-publish
hwlab.pikastech.local/runtime-path: deploy/gitops/node/nc01/runtime-v03
@@ -28,7 +33,7 @@ spec:
timeouts:
pipeline: 1h0m0s
taskRunTemplate:
serviceAccountName: hwlab-nc01-v03-tekton-runner
serviceAccountName: "{{ service_account }}"
podTemplate:
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
@@ -50,31 +55,29 @@ spec:
secretName: hwlab-git-ssh
params:
- name: git-url
value: git@github.com:pikasTech/HWLAB.git
value: "{{ repo_url }}"
- name: git-read-url
value: http://gitea-http.devops-infra.svc.cluster.local:3000/mirrors/pikasTech-HWLAB.git
value: "{{ git_read_url }}"
- name: git-write-url
value: http://git-mirror-write.devops-infra.svc.cluster.local:8080/pikasTech/HWLAB.git
value: "{{ git_write_url }}"
- name: source-branch
value: v0.3
value: "{{ source_branch }}"
- name: gitops-branch
value: v0.3-gitops
value: "{{ gitops_branch }}"
- name: lane
value: v03
value: "{{ lane }}"
- name: catalog-path
value: deploy/artifact-catalog.nc01-v03.json
- name: image-tag-mode
value: full
- name: runtime-path
value: deploy/gitops/node/nc01/runtime-v03
- name: source-commit
value: "{{revision}}"
- name: revision
value: "{{ revision }}"
- name: registry-prefix
value: 127.0.0.1:5000/hwlab
- name: services
value: hwlab-cloud-api,hwlab-workbench-runtime,hwlab-user-billing,hwlab-project-management,hwlab-cloud-web,hwlab-gateway,hwlab-edge-proxy,hwlab-agent-skills
value: "hwlab-cloud-api,hwlab-workbench-runtime,hwlab-user-billing,hwlab-project-management,hwlab-cloud-web,hwlab-gateway,hwlab-edge-proxy,hwlab-agent-skills"
- name: base-image
value: 127.0.0.1:5000/hwlab/hwlab-node20-base:20-bookworm-slim
- name: build-cache-mode
File diff suppressed because one or more lines are too long
@@ -0,0 +1,21 @@
# PaC Source Pipeline YAML 同步
- 来源:[HWLAB #2490](https://github.com/pikasTech/HWLAB/issues/2490)
- 父任务:[HWLAB #2486](https://github.com/pikasTech/HWLAB/issues/2486)
- 业务实现:[HWLAB PR #2488](https://github.com/pikasTech/HWLAB/pull/2488)
- YAML 配置:[UniDesk PR #1738](https://github.com/pikasTech/unidesk/pull/1738)
- 通用工具:[UniDesk #1745](https://github.com/pikasTech/unidesk/issues/1745)
## R1 [in_progress]
以 YAML+renderer 单向权威机械同步并验证 HWLAB PaC source artifact,关联 [HWLAB #2490](https://github.com/pikasTech/HWLAB/issues/2490)、[UniDesk #1745](https://github.com/pikasTech/unidesk/issues/1745)、[#1753](https://github.com/pikasTech/unidesk/issues/1753)、[#1755](https://github.com/pikasTech/unidesk/issues/1755) 与 [#1756](https://github.com/pikasTech/unidesk/issues/1756),完成任务后将详细报告写入[任务报告](./details/pac-source-pipeline-yaml-sync/R1_Task_Report.md)。
### R1.1 [completed]
审查 [#1745 source-artifact](https://github.com/pikasTech/unidesk/issues/1745)、[#1753 YAML serializer](https://github.com/pikasTech/unidesk/issues/1753) 与 [#1756 HWLAB provenance](https://github.com/pikasTech/unidesk/issues/1756) 共用同一 YAML+renderer 合同并保持 fail-closed,完成任务后将详细报告写入[任务报告](./details/pac-source-pipeline-yaml-sync/R1.1_Task_Report.md)。
### R1.2 [completed]
验证机械生成幂等、YAML 结构/EOF、provenance 对齐及 Kafka refresh capability,不以字符串排版建立第二真相;引用 [HWLAB #2490](https://github.com/pikasTech/HWLAB/issues/2490)、[UniDesk #1753](https://github.com/pikasTech/unidesk/issues/1753) 与 [#1756](https://github.com/pikasTech/unidesk/issues/1756),完成任务后将详细报告写入[任务报告](./details/pac-source-pipeline-yaml-sync/R1.2_Task_Report.md)。
### R1.3
提交 [HWLAB #2490](https://github.com/pikasTech/HWLAB/issues/2490) 非草稿 PR;按 [UniDesk #1755](https://github.com/pikasTech/unidesk/issues/1755) 要求,合并后只允许 GitHub webhook→Gitea mirror→PaC→Tekton→GitOps/Argo 自动交付,禁止 closeout/apply/trigger/sync/flush 手工补链,完成任务后将详细报告写入[任务报告](./details/pac-source-pipeline-yaml-sync/R1.3_Task_Report.md)。
+4 -4
View File
@@ -104,7 +104,7 @@ test("tracked PaC remote pipelines pass selected services to catalog restore", a
];
for (const target of targets) {
const pipeline = JSON.parse(await readFile(target.pipelinePath, "utf8"));
const pipeline = await readStructuredFile(process.cwd(), target.pipelinePath);
assert.equal(pipeline.metadata?.name, target.pipelineName, `${target.node} tracked Pipeline name`);
const planArtifacts = pipeline.spec?.tasks?.find((task) => task.name === "plan-artifacts");
assert.ok(planArtifacts, `${target.node} tracked Pipeline plan-artifacts task`);
@@ -115,9 +115,9 @@ test("tracked PaC remote pipelines pass selected services to catalog restore", a
assert.match(script, /rolloutWithoutImageBuildServices/u);
assert.match(script, /artifactCatalog: plan\.artifactCatalog/u);
const pac = await readFile(target.pacPath, "utf8");
assert.ok(pac.includes(`pipelinesascode.tekton.dev/pipeline: "${target.pipelinePath}"`), `${target.node} PaC remote Pipeline path`);
assert.ok(pac.includes(`pipelineRef:\n name: ${target.pipelineName}`), `${target.node} PaC PipelineRef`);
const pac = await readStructuredFile(process.cwd(), target.pacPath);
assert.equal(pac.metadata?.annotations?.["pipelinesascode.tekton.dev/pipeline"], target.pipelinePath, `${target.node} PaC remote Pipeline path`);
assert.equal(pac.spec?.pipelineRef?.name, target.pipelineName, `${target.node} PaC PipelineRef`);
}
});