Repository navigation
Description
Split from #3695.
Problem: The fix needs a live measure with temporary pods. The measure must show at least 20 complete copies of 20. The implement job cannot reach a cluster, and the runner image holds no cluster tool. Why deferred: the rest of the fix has offline tests and documentation. A person or an agent with cluster access must run this measure after the fix merges. Acceptance criteria: run 20 copies of 100 MiB of random data through the new copy path on two nodes. At least 20 copies complete and the digest matches. Record the numbers in the pull request or a comment.
Alternatives check of 2026-11-08: not-applicable.
Class: test, no search.
Tool: none found.
Proposed design
Problem statement
The copy path of devops k8s volume move has no reusable reliability harness. This item adds the offline harness and its tests only. A person runs the harness live in #3953 and records the numbers there.
Acceptance criteria
Requirement: Copy command reuse
The reliability harness SHALL plan the same copy command as devops k8s volume move and compare both sides with CONST_K8S_VOLUME_MOVE_DIGEST_SCRIPT.
Scenario: Harness plans the copy command
- WHEN The harness plans one copy against a fake cluster.
- THEN The planned command holds the named-pipe hold and both
kubectl execstreams, and the digest command runs the digest script on the source pod and on the destination pod.
Requirement: Twenty copies of 100 MiB
The reliability harness MUST run 20 copies of 104,857,600 bytes of random source data.
Scenario: Twenty copies of 100 MiB
- WHEN The harness runs against a fake cluster whose copies succeed.
- THEN It starts 20 copies, and each source holds 104,857,600 bytes of random data.
Requirement: Copy pods on two nodes
The reliability harness MUST place the source pod and the destination pod on different nodes with the copy path placement.
Scenario: Destination selects the target node
- WHEN The harness renders the two copy pods for a plan whose source node is
node-aand whose target hostname isnode-b. - THEN The destination pod has
nodeSelector: {kubernetes.io/hostname: node-b}, the source pod has nonodeSelector, andnode-adiffers fromnode-b.
Requirement: Digest mismatch fails
The reliability harness MUST fail when the SHA-256 content digest of a copy differs from the digest of its source.
Scenario: A mismatch fails the report
- WHEN The report reads a fixture with one source digest different from its target digest.
- THEN The report exits non-zero and names the mismatched copy.
Requirement: Report counts complete copies
The reliability harness SHALL report the number of complete copies and the number of digest matches, and SHALL exit non-zero when fewer than 20 copies complete with a matching digest.
Scenario: All copies match
- WHEN The report reads a fixture with 20 complete copies and 20 matching digests.
- THEN The report exits 0 and prints
20/20complete copies and20/20digest matches.
Requirement: Report is a Markdown table
The reliability harness SHALL print the report as a Markdown table.
Scenario: Report output is a table
- WHEN The report runs on a fixture.
- THEN The output holds a Markdown table with a row for the copy count and a row for the digest match count.
Requirement: Temporary resources are removed
The reliability harness MUST delete its temporary namespace, claims and pods when a run ends, whether the copies passed or failed.
Scenario: A failed copy still cleans up
- WHEN A copy fails during a run against a fake cluster.
- THEN The harness sends the delete of the temporary namespace and exits non-zero.
Requirement: Offline tests use the process fake
The tests of the reliability harness MUST use the shared process fake and MUST NOT start kubectl, bash or a cluster.
Scenario: Tests make no process call
- WHEN The test suite runs the reliability harness tests.
- THEN The process fake records each planned command, and no real kubectl or bash process starts.
Existing Tool Considered
The alternatives check of 2026-11-08 recorded not-applicable (class test, no search) and named no tool. No open, maintained tool covers a reliability harness for this project's own copy path. The harness uses kubectl 1.37.2, pinned in src/devops_cli/tools_lock/tools.lock and installed by devops install-tools --tool kubectl, with _copy_argv and _digest_args. The change builds the 20-copy loop, the 100 MiB random source, the 20/20 counts, the cleanup and the Markdown report: about 5,000 tokens to build, keep and fix, and 1 day. The Kubernetes Python client is already a dependency, but #3695 kept the copy on the two kubectl exec streams.
Key questions
- Can the implement job run the live measure?: No. The runner pod sets
automountServiceAccountToken: false, and its image holds no kubectl. [sources: k8s/devops/cronjob-runner.yaml:33, CONTEXT.md] - Which client does the reliability harness use to reach the cluster?: kubectl, through the project's
run_subprocessandbuild_kubectl_cmdseam, because the copy path runs twokubectl execstreams and the digest runs throughkubectl exec. (best practice) [sources: src/devops_cli/k8s/volume_move.py:306, src/devops_cli/k8s/volume_move.py:276, src/devops_cli/config/commands.py:60, src/devops_cli/tools_lock/tools.lock]- Chosen: kubectl through run_subprocess. It is the client of the copy path, it is pinned at 1.37.2, and it adds no dependency.
- Rejected: Kubernetes Python client. It is already a dependency, but the copy path runs on two kubectl exec streams, so it would measure a different path.
- Rejected: Custom Kubernetes REST client. It rebuilds authentication, retries and exec streams for no gain.
- How do the two copy pods land on two nodes?: Reuse the copy path placement: the source pod mounts the old claim, whose volume keeps it on the source node, and the destination pod sets
nodeSelectoronkubernetes.io/hostnameto the target hostname. (best practice) [sources: src/devops_cli/k8s/volume_move.py, tests/k8s/test_k8s_volume_move.py]- Chosen: Copy path placement. It is the placement of the copy path, and it binds each pod to the node that holds its claim.
- Rejected: Required pod anti-affinity. It separates pods, but it does not bind a pod to the node that holds its claim.
- Rejected: nodeName. It hard-codes a node and bypasses the scheduler.
- Rejected: nodeSelector on both pods. The source claim's volume binding already pins the source node.
- Which digest does the reliability harness compare?: SHA-256, through
CONST_K8S_VOLUME_MOVE_DIGEST_SCRIPT, so the harness compares the same content digest that the move compares. (best practice) [sources: src/devops_cli/config/constants.py:4295, src/devops_cli/k8s/volume_move.py:276]- Chosen: SHA-256 through the digest script. It is the digest of the copy path, so the harness compares the same value.
- Rejected: md5sum in the harness. It is not the digest that the move compares.
- Rejected: Python hashlib over the exec stream. No byte of the copy passes through Python, so this measures another path.
- What does the reliability harness measure?: The copy step only, in a temporary namespace: two copy pods, two claims, 20 runs of
_copy_argv, and_digest_argson both sides. (best practice) [sources: src/devops_cli/k8s/volume_move.py, CONTEXT.md]- Chosen: Copy step only in a temporary namespace. It measures the changed code without pausing Argo CD, scaling a workload or deleting a real claim.
- Rejected: The full
devops k8s volume move20 times. It pauses Argo CD, scales workloads and deletes the old claim, 20 times on a live cluster. - Rejected: A Kubernetes Job with 20 completions. A Job pod cannot drive the two kubectl exec streams without a token and kubectl, which the runner denies.
- How are the reliability harness tests kept offline?: With a fake cluster and pure functions for the manifest builder, the 20-copy loop and the report, as ADR 0007 requires. (best practice) [sources: docs/adr/0007-tests-double-only-process-edges.md, docs/TESTING.md]
- Chosen: Offline tests with a fake cluster. ADR 0007 requires it, and the implement job verifies the harness with no cluster.
- Rejected: A live pytest test. ADR 0007 removed
@pytest.mark.live, and a test must not skip on host state. - Rejected: A
devops cirow. A CI row cannot reach a cluster either.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
devops-cli-service commentedon Nov 5, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
testprefix of the title gives the type.(k8s)scope of the title gives the scope.It must run after the fix merges to confirm reliability, but it does not block the fix itself.It gives confidence that the copy path survives 20 full transfers, which protects users from silent data loss.A person with cluster access runs 20 copies and records the result; no new code is needed.Both concern volume move copy reliability; #3695 delivers the fix, the candidate delivers the live measurement that confirms it.devops-cli-service commentedon Nov 7, 2026
Status set to Ready at 72c52c6 (see proposed design in issue body).
Moved to new items: #3953.
devops-cli-service commentedon Nov 8, 2026
Alternatives check: not-applicable
Class: test. The check makes no search and no model call for an item of this class.
Tool: none found
Checked on 2026-11-08. A person decides what this means for the item. The check changes no label and closes no issue.
dan-petty commentedon Nov 14, 2026
Returned to New: the acceptance is a live measure that an agent cannot run. It asks for 20 copies of 100 MiB on two nodes, at least 20 complete copies with matching digests, and the numbers recorded. #3695 is closed, but the implement job has no Kubernetes token (
k8s/devops/cronjob-runner.yaml:33setsautomountServiceAccountToken: false) and the runner image holds no kubectl, as the issue itself anddocs/ROUTINE_TASKS.md:331say. The refined design moves the live run to a new issue that does not exist, and adds only an offline harness; a harness alone does not meet the live acceptance. A person with cluster access runs the measure and records the numbers, or a person splits the harness into its own item.22 remaining items
test(k8s): Share the copy command and the digest arguments of the cop…
test(k8s): Plan the measure: two pods on two nodes and twenty copies …
test(k8s): Run the measure, compare each digest and report the counts (…
test(k8s): Add the entry point and the dry run of the measure (#3701)
test(k8s): Share the copy command and the digest arguments of the cop…
test(k8s): Plan the measure: two pods on two nodes and twenty copies …
test(k8s): Run the measure, compare each digest and report the counts (…
test(k8s): Add the entry point and the dry run of the measure (#3701)
test(k8s): Document the live measure in the k8s guide (#3701)
devops-cli-service commentedon Nov 16, 2026
Released in v0.165.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.165.0
devops-cli-service commentedon Nov 16, 2026
Live since 2026-11-16 14:50 UTC