diff --git a/seaweed-block/charts/seaweed-block/README.md b/seaweed-block/charts/seaweed-block/README.md index ff2e30f606..bfff3354ad 100644 --- a/seaweed-block/charts/seaweed-block/README.md +++ b/seaweed-block/charts/seaweed-block/README.md @@ -115,6 +115,29 @@ stage2Multipath: This only enables chart wiring. The host still needs iSCSI, multipath, and ALUA support configured. +## Optional Failback Runtime Wiring + +Returned-replica failback execution is disabled by default. The chart only +renders the blockmaster failback RPC and executor runtime flags when all +execution switches are explicit: + +```yaml +blockmaster: + failbackRuntimeRPC: true + +failbackExecutor: + create: true + dryRun: false + execution: + enabled: true + policy: true + failbackRuntimeGrpcAddr: blockmaster.kube-system.svc:9333 +``` + +The chart rejects unsafe combinations such as execution with `dryRun: true`, +missing execution policy, or both HTTP and gRPC runtime addresses. This wiring +does not enable automatic failback by default. + ## Current Boundary - Use immutable image tags such as `sha-` for QA and release checks. diff --git a/seaweed-block/charts/seaweed-block/templates/blockmaster.yaml b/seaweed-block/charts/seaweed-block/templates/blockmaster.yaml index 8842b5d5ec..13a11d03f8 100644 --- a/seaweed-block/charts/seaweed-block/templates/blockmaster.yaml +++ b/seaweed-block/charts/seaweed-block/templates/blockmaster.yaml @@ -93,6 +93,9 @@ spec: {{- end }} - "--launcher-kubernetes-apply" - "--listen=0.0.0.0:{{ .Values.blockmaster.listenPort }}" + {{- if .Values.blockmaster.failbackRuntimeRPC }} + - "--failback-runtime-rpc" + {{- end }} - "--expected-slots-per-volume={{ include "seaweed-block.expectedSlotsPerVolume" . }}" ports: - name: grpc diff --git a/seaweed-block/charts/seaweed-block/templates/failback-executor.yaml b/seaweed-block/charts/seaweed-block/templates/failback-executor.yaml index 71150997e3..fc0337eebf 100644 --- a/seaweed-block/charts/seaweed-block/templates/failback-executor.yaml +++ b/seaweed-block/charts/seaweed-block/templates/failback-executor.yaml @@ -1,4 +1,19 @@ {{- if .Values.failbackExecutor.create }} +{{- if and .Values.failbackExecutor.execution.enabled .Values.failbackExecutor.dryRun -}} +{{- fail "failbackExecutor.execution.enabled=true requires failbackExecutor.dryRun=false" -}} +{{- end -}} +{{- if and .Values.failbackExecutor.execution.enabled (not .Values.failbackExecutor.execution.policy) -}} +{{- fail "failbackExecutor.execution.enabled=true requires failbackExecutor.execution.policy=true" -}} +{{- end -}} +{{- if and .Values.failbackExecutor.execution.failbackRuntimeGrpcAddr (not .Values.failbackExecutor.execution.enabled) -}} +{{- fail "failbackExecutor.execution.failbackRuntimeGrpcAddr requires failbackExecutor.execution.enabled=true" -}} +{{- end -}} +{{- if and .Values.failbackExecutor.execution.failbackRuntimeURL (not .Values.failbackExecutor.execution.enabled) -}} +{{- fail "failbackExecutor.execution.failbackRuntimeURL requires failbackExecutor.execution.enabled=true" -}} +{{- end -}} +{{- if and .Values.failbackExecutor.execution.failbackRuntimeGrpcAddr .Values.failbackExecutor.execution.failbackRuntimeURL -}} +{{- fail "failbackExecutor.execution.failbackRuntimeGrpcAddr and failbackExecutor.execution.failbackRuntimeURL are mutually exclusive" -}} +{{- end -}} apiVersion: apps/v1 kind: Deployment metadata: @@ -35,5 +50,17 @@ spec: {{- if .Values.failbackExecutor.dryRun }} - "--dry-run" {{- end }} + {{- if .Values.failbackExecutor.execution.enabled }} + - "--enable-execution" + {{- end }} + {{- if .Values.failbackExecutor.execution.policy }} + - "--execution-policy" + {{- end }} + {{- if .Values.failbackExecutor.execution.failbackRuntimeGrpcAddr }} + - "--failback-runtime-grpc-addr={{ .Values.failbackExecutor.execution.failbackRuntimeGrpcAddr }}" + {{- end }} + {{- if .Values.failbackExecutor.execution.failbackRuntimeURL }} + - "--failback-runtime-url={{ .Values.failbackExecutor.execution.failbackRuntimeURL }}" + {{- end }} - "--interval={{ .Values.failbackExecutor.interval }}" {{- end }} diff --git a/seaweed-block/charts/seaweed-block/values.schema.json b/seaweed-block/charts/seaweed-block/values.schema.json index 364fe3fba3..aeb0fb6ccb 100644 --- a/seaweed-block/charts/seaweed-block/values.schema.json +++ b/seaweed-block/charts/seaweed-block/values.schema.json @@ -34,6 +34,7 @@ "type": "object", "additionalProperties": { "type": "string" } }, + "failbackRuntimeRPC": { "type": "boolean" }, "durableImpl": { "type": "string", "enum": ["walstore", "smartwal"] }, "stateHostPath": { "type": "string" }, "stateHostPathType": { "type": "string" }, @@ -105,6 +106,33 @@ "additionalProperties": { "type": "string" } } } + }, + "failbackExecutor": { + "type": "object", + "properties": { + "create": { "type": "boolean" }, + "dryRun": { "type": "boolean" }, + "interval": { "type": "string" }, + "execution": { + "type": "object", + "properties": { + "enabled": { "type": "boolean" }, + "policy": { "type": "boolean" }, + "failbackRuntimeGrpcAddr": { "type": "string" }, + "failbackRuntimeURL": { "type": "string" } + } + }, + "rbac": { + "type": "object", + "properties": { + "create": { "type": "boolean" } + } + }, + "nodeSelector": { + "type": "object", + "additionalProperties": { "type": "string" } + } + } } } } diff --git a/seaweed-block/charts/seaweed-block/values.yaml b/seaweed-block/charts/seaweed-block/values.yaml index fb7a901e27..3886fbe776 100644 --- a/seaweed-block/charts/seaweed-block/values.yaml +++ b/seaweed-block/charts/seaweed-block/values.yaml @@ -31,6 +31,7 @@ blockmaster: nodeSelector: {} serviceName: blockmaster listenPort: 9333 + failbackRuntimeRPC: false authorityStore: /var/lib/sw-block/authority lifecycleStore: /var/lib/sw-block/lifecycle durableRoot: /var/lib/sw-block @@ -187,6 +188,11 @@ failbackExecutor: create: false dryRun: true interval: 30s + execution: + enabled: false + policy: false + failbackRuntimeGrpcAddr: "" + failbackRuntimeURL: "" rbac: create: true nodeSelector: {} diff --git a/seaweed-block/docs/roadmap.md b/seaweed-block/docs/roadmap.md index d4a0440ddf..4850605413 100644 --- a/seaweed-block/docs/roadmap.md +++ b/seaweed-block/docs/roadmap.md @@ -341,7 +341,14 @@ Recommended order from here: `--failback-runtime-grpc-addr` are all explicit. HTTP runtime remains supported; HTTP and gRPC transports are mutually exclusive. Default behavior remains status-only. -40. Add backup/restore and NVMe ANA parity after they can reuse the same action +40. Phase 83: failback runtime chart wiring. **Closed 2026-06-26, local PASS** + (`internal/docs/finished-plans/phase83_finishedplan_failback_chart_runtime_wiring.md`). + Helm can now render the disabled-by-default blockmaster failback RPC and + failback-executor gRPC runtime flags when every execution switch is + explicit. Default chart behavior remains non-mutating. The chart fails fast + for dry-run execution, missing execution policy, and ambiguous HTTP/gRPC + runtime transports. +41. Add backup/restore and NVMe ANA parity after they can reuse the same action owner, evidence, and status model rather than creating another isolated control plane. @@ -376,7 +383,9 @@ frontend publication, and storage/workload mutation remain disabled. Phase 81 adds the disabled-by-default RPC boundary that a separate failback executor can call in a later phase; default installs still keep the mutation path off. Phase 82 adds that executor-side gRPC runtime transport, still requiring -explicit execution policy and an explicit blockmaster address. +explicit execution policy and an explicit blockmaster address. Phase 83 packages +that path in Helm while preserving the default-off boundary and adding render +guardrails for incoherent execution values. The practical rule is: diff --git a/seaweed-block/internal/docs/current-plan.md b/seaweed-block/internal/docs/current-plan.md index e9979b3869..f764a99346 100644 --- a/seaweed-block/internal/docs/current-plan.md +++ b/seaweed-block/internal/docs/current-plan.md @@ -1,85 +1,110 @@ -# Current Plan: Phase 82 Failback Executor gRPC Runtime +# Current Plan: Phase 83 Failback Runtime Chart Wiring Status: complete. ## Goal -Phase 81 added a disabled-by-default blockmaster FailbackService RPC. Phase 82 -wires the failback executor to call that RPC as a runtime transport, still -behind the existing explicit execution policy. +Phase 82 added the failback executor gRPC transport. Phase 83 packages that +transport in the Helm chart without enabling it by default. -Default behavior remains status-only. A gRPC address alone is rejected unless -execution is explicitly requested. +Default installs remain non-mutating: + +```text +blockmaster.failbackRuntimeRPC=false +failbackExecutor.create=false +failbackExecutor.execution.enabled=false +``` + +The chart only renders the active failback RPC/executor path when the operator +sets all execution switches explicitly. ## Deliverables -### D1: gRPC Runtime Client +### D1: Blockmaster RPC Flag Added: ```text -core/ops.GRPCFailbackRuntime -core/ops.NewGRPCFailbackRuntime +blockmaster.failbackRuntimeRPC ``` -The runtime maps `ops.FailbackRuntimeRequest` to: +When true, the blockmaster Deployment renders: ```text -control.FailbackService.ExecuteFailback +--failback-runtime-rpc ``` -and maps `FailbackResponse` back to `ops.FailbackRuntimeResult`. +The value defaults to false. -### D2: CLI Runtime Transport +### D2: Failback Executor Runtime Values Added: ```text -sw-block ops failback-executor --failback-runtime-grpc-addr +failbackExecutor.execution.enabled +failbackExecutor.execution.policy +failbackExecutor.execution.failbackRuntimeGrpcAddr +failbackExecutor.execution.failbackRuntimeURL ``` -Guardrails: +When explicitly enabled with `dryRun=false`, the failback executor can render: ```text ---failback-runtime-grpc-addr requires --enable-execution ---failback-runtime-url and --failback-runtime-grpc-addr are mutually exclusive ---execution-policy is still required for any execution +--enable-execution +--execution-policy +--failback-runtime-grpc-addr= ``` -The existing HTTP runtime remains supported. +HTTP runtime remains available through: -### D3: Gate +```text +--failback-runtime-url= +``` + +### D3: Render Guardrails + +Helm now fails fast for incoherent execution values: + +```text +execution.enabled=true with dryRun=true +execution.enabled=true without execution.policy=true +runtime address without execution.enabled=true +both HTTP and gRPC runtime addresses +``` + +This keeps chart behavior aligned with the CLI contract and avoids deployed +pods that immediately reject their own flags. + +### D4: Gate Added: ```text -scripts/run-phase82-failback-executor-grpc-runtime-gate.sh -testops/scenarios/failback-executor-grpc-runtime-chain.yaml +scripts/run-phase83-failback-chart-runtime-gate.sh +testops/scenarios/failback-chart-runtime-chain.yaml ``` The gate proves: ```text -gRPC runtime calls FailbackService -request fields are mapped -response terminal evidence is mapped -CLI gRPC runtime writes failed_back status on terminal evidence -gRPC runtime requires --enable-execution -HTTP and gRPC transports are mutually exclusive -HTTP runtime still works -frontend publication remains false -storage mutation remains false +default chart omits --failback-runtime-rpc +default chart does not create failback executor +default chart omits --enable-execution and runtime address +explicit chart renders blockmaster RPC flag +explicit chart renders failback executor execution policy and gRPC address +dry-run execution is rejected +missing execution policy is rejected +ambiguous HTTP/gRPC runtime is rejected ``` ## Non-Claims -Phase 82 does not implement: +Phase 83 does not implement: ```text -chart-enabled failback executor gRPC address automatic failback from the deployed controller loop default-enabled failback RPC -blockvolume frontend switching +live end-to-end failback through Helm install frontend publication after failback storage rebuild/catch-up traffic workload mutation @@ -89,38 +114,38 @@ NVMe ANA behavior ## Verification ```text -go test ./core/ops -run "TestGRPCFailbackRuntime" -count=1 -v -go test ./cmd/sw-block -run "TestOpsFailbackExecutor(GRPCRuntimeWritesFailedBackStatus|RejectsGRPCRuntimeWithoutEnable|RejectsAmbiguousRuntimeTransports|RuntimeURLWritesFailedBackStatus)" -count=1 -v -go test ./core/authority ./core/ops ./core/host/master ./cmd/blockmaster ./cmd/sw-block helm lint charts/seaweed-block -"C:\Program Files\Git\bin\bash.exe" scripts/run-phase82-failback-executor-grpc-runtime-gate.sh . -C:\work\swblock.exe validate testops\scenarios\failback-executor-grpc-runtime-chain.yaml -git diff --check +"C:\Program Files\Git\bin\bash.exe" scripts/run-phase83-failback-chart-runtime-gate.sh . +C:\work\swblock.exe validate testops\scenarios\failback-chart-runtime-chain.yaml ``` Terminal evidence: ```text -phase82_failback_executor_grpc_runtime_status=ok -core_ops_grpc_failback_runtime_tests=pass -cmd_failback_grpc_runtime_tests=pass -grpc_runtime_calls_failback_service=true -grpc_runtime_requires_address=true -cmd_grpc_runtime_writes_failed_back_status=true -cmd_grpc_runtime_requires_enable=true -cmd_rejects_ambiguous_runtime_transports=true -cmd_http_runtime_still_supported=true -grpc_runtime_request_fields_mapped=true -grpc_runtime_response_fields_mapped=true +phase83_failback_chart_runtime_status=ok +helm_lint=pass +default_omits_failback_runtime_rpc=true +default_omits_failback_executor_deployment=true +default_omits_enable_execution=true +default_omits_failback_grpc_addr=true +enabled_renders_failback_runtime_rpc=true +enabled_renders_failback_executor_deployment=true +enabled_renders_enable_execution=true +enabled_renders_execution_policy=true +enabled_renders_failback_grpc_addr=true +enabled_omits_dry_run=true +rejects_execution_with_dry_run=true +rejects_execution_without_policy=true +rejects_ambiguous_runtime_transports=true execution_policy_still_required=true -http_grpc_runtime_mutually_exclusive=true -authority_mutation_allowed_only_with_execution_policy=true +runtime_transport_must_be_unambiguous=true +chart_default_remains_non_mutating=true frontend_publication_allowed=false storage_mutation_allowed=false ``` ## Next -The next phase should add Helm/chart wiring for this transport while keeping it -disabled by default, or run an integrated local blockmaster + executor smoke -with both flags explicitly enabled. +The next phase should run an integrated local blockmaster + failback-executor +smoke with all flags explicitly enabled, or add the missing release/README +documentation for the opt-in failback path before any public release claim. diff --git a/seaweed-block/internal/docs/finished-plans/phase83_finishedplan_failback_chart_runtime_wiring.md b/seaweed-block/internal/docs/finished-plans/phase83_finishedplan_failback_chart_runtime_wiring.md new file mode 100644 index 0000000000..5578eb0bb9 --- /dev/null +++ b/seaweed-block/internal/docs/finished-plans/phase83_finishedplan_failback_chart_runtime_wiring.md @@ -0,0 +1,83 @@ +# Phase 83 Finished Plan: Failback Runtime Chart Wiring + +Status: complete. + +Date: 2026-06-26. + +## What Changed + +Phase 83 packages the Phase 81/82 failback runtime path in Helm while keeping +default installs non-mutating. + +Added Helm values: + +```text +blockmaster.failbackRuntimeRPC +failbackExecutor.execution.enabled +failbackExecutor.execution.policy +failbackExecutor.execution.failbackRuntimeGrpcAddr +failbackExecutor.execution.failbackRuntimeURL +``` + +Default values keep the path off: + +```text +blockmaster.failbackRuntimeRPC=false +failbackExecutor.create=false +failbackExecutor.dryRun=true +failbackExecutor.execution.enabled=false +failbackExecutor.execution.policy=false +``` + +When explicitly enabled, the chart can render: + +```text +--failback-runtime-rpc +--enable-execution +--execution-policy +--failback-runtime-grpc-addr= +``` + +## Guardrails + +Helm render fails for unsafe or incoherent configurations: + +```text +execution enabled while dry-run remains true +execution enabled without policy enabled +runtime address without execution enabled +both HTTP and gRPC runtime addresses +``` + +The failback executor remains disabled by default and status-only unless the +operator opts into the full runtime path. + +## Verification + +```text +helm lint charts/seaweed-block +scripts/run-phase83-failback-chart-runtime-gate.sh . +swblock validate testops/scenarios/failback-chart-runtime-chain.yaml +``` + +Result: + +```text +phase83_failback_chart_runtime_status=ok +helm_lint=pass +default_omits_failback_runtime_rpc=true +default_omits_failback_executor_deployment=true +enabled_renders_failback_runtime_rpc=true +enabled_renders_failback_grpc_addr=true +rejects_execution_with_dry_run=true +rejects_execution_without_policy=true +rejects_ambiguous_runtime_transports=true +chart_default_remains_non_mutating=true +frontend_publication_allowed=false +storage_mutation_allowed=false +``` + +## Non-Claims + +Phase 83 does not claim automatic failback, frontend publication, rebuild +traffic, storage mutation, workload mutation, or NVMe ANA parity. diff --git a/seaweed-block/internal/docs/qa-assignments/phase83-failback-chart-runtime-qa-signoff.md b/seaweed-block/internal/docs/qa-assignments/phase83-failback-chart-runtime-qa-signoff.md new file mode 100644 index 0000000000..a7bbfd3f5d --- /dev/null +++ b/seaweed-block/internal/docs/qa-assignments/phase83-failback-chart-runtime-qa-signoff.md @@ -0,0 +1,81 @@ +# Phase 83 Failback Chart Runtime QA Sign-off + +Verdict: PASS. + +Date: 2026-06-26. + +Scope: Helm packaging gate for the failback runtime path. This phase renders +the disabled-by-default blockmaster failback RPC and failback-executor runtime +flags only when explicitly configured. + +## Result + +```text +phase83_failback_chart_runtime_status=ok +helm_lint=pass +``` + +## Gate Evidence + +```text +default_omits_failback_runtime_rpc=true +default_omits_failback_executor_deployment=true +default_omits_enable_execution=true +default_omits_failback_grpc_addr=true +enabled_renders_failback_runtime_rpc=true +enabled_renders_failback_executor_deployment=true +enabled_renders_enable_execution=true +enabled_renders_execution_policy=true +enabled_renders_failback_grpc_addr=true +enabled_omits_dry_run=true +rejects_execution_with_dry_run=true +rejects_execution_without_policy=true +rejects_ambiguous_runtime_transports=true +execution_policy_still_required=true +runtime_transport_must_be_unambiguous=true +chart_default_remains_non_mutating=true +frontend_publication_allowed=false +storage_mutation_allowed=false +``` + +## Checks + +| Check | Result | +| --- | --- | +| Default chart omits `--failback-runtime-rpc` | PASS | +| Default chart does not create failback executor | PASS | +| Default chart omits `--enable-execution` | PASS | +| Explicit chart renders `--failback-runtime-rpc` | PASS | +| Explicit chart renders failback executor Deployment | PASS | +| Explicit chart renders `--enable-execution` and `--execution-policy` | PASS | +| Explicit chart renders `--failback-runtime-grpc-addr` | PASS | +| Explicit execution render omits `--dry-run` | PASS | +| Helm rejects execution with dry-run still enabled | PASS | +| Helm rejects execution without policy | PASS | +| Helm rejects ambiguous HTTP and gRPC runtime addresses | PASS | +| frontend publication remains false | PASS | +| storage mutation remains false | PASS | +| runner scenario validates | PASS | + +## Verification Commands + +```text +helm lint charts/seaweed-block +"C:\Program Files\Git\bin\bash.exe" scripts/run-phase83-failback-chart-runtime-gate.sh . +C:\work\swblock.exe validate testops\scenarios\failback-chart-runtime-chain.yaml +git diff --check +``` + +## Non-Claims + +This sign-off does not claim: + +```text +automatic failback from the deployed controller loop +default-enabled failback RPC +live end-to-end failback through Helm install +frontend publication after failback +storage rebuild/catch-up traffic +workload mutation +NVMe ANA behavior +``` diff --git a/seaweed-block/scripts/run-phase83-failback-chart-runtime-gate.sh b/seaweed-block/scripts/run-phase83-failback-chart-runtime-gate.sh new file mode 100644 index 0000000000..1fef08c831 --- /dev/null +++ b/seaweed-block/scripts/run-phase83-failback-chart-runtime-gate.sh @@ -0,0 +1,132 @@ +#!/usr/bin/env bash +set -euo pipefail + +PRODUCT_ROOT="${1:-$(pwd)}" +ARTIFACT_DIR="${SW_BLOCK_ARTIFACT_DIR:-${PRODUCT_ROOT}/results/phase83-failback-chart-runtime-gate}" +SUMMARY="${ARTIFACT_DIR}/phase83-failback-chart-runtime-summary.txt" +DEFAULT_RENDER="${ARTIFACT_DIR}/helm-default.yaml" +ENABLED_RENDER="${ARTIFACT_DIR}/helm-enabled.yaml" +BAD_DRYRUN_LOG="${ARTIFACT_DIR}/helm-bad-dryrun.log" +BAD_POLICY_LOG="${ARTIFACT_DIR}/helm-bad-policy.log" +BAD_AMBIGUOUS_LOG="${ARTIFACT_DIR}/helm-bad-ambiguous.log" +LINT_LOG="${ARTIFACT_DIR}/helm-lint.log" + +mkdir -p "${ARTIFACT_DIR}" +: >"${SUMMARY}" + +write_summary() { + echo "$*" | tee -a "${SUMMARY}" >/dev/null +} + +require_present() { + local name="$1" + local pattern="$2" + local file="$3" + local found="false" + if grep -Fq -- "${pattern}" "${file}"; then + found="true" + fi + write_summary "${name}=${found}" + if [ "${found}" != "true" ]; then + echo "missing ${name}: ${pattern}" >&2 + return 1 + fi +} + +require_absent() { + local name="$1" + local pattern="$2" + local file="$3" + local absent="true" + if grep -Fq -- "${pattern}" "${file}"; then + absent="false" + fi + write_summary "${name}=${absent}" + if [ "${absent}" != "true" ]; then + echo "unexpected ${name}: ${pattern}" >&2 + return 1 + fi +} + +require_helm_failure() { + local name="$1" + local want="$2" + local log="$3" + shift 3 + if (cd "${PRODUCT_ROOT}" && helm template sw-block charts/seaweed-block --namespace kube-system "$@") >"${log}" 2>&1; then + write_summary "${name}=false" + echo "expected helm failure for ${name}" >&2 + return 1 + fi + require_present "${name}" "${want}" "${log}" +} + +write_summary "phase83_failback_chart_runtime_status=running" +write_summary "phase83_scope=failback_chart_runtime_wiring" +write_summary "default_failback_runtime_rpc=false" +write_summary "default_failback_executor_created=false" +write_summary "default_failback_attempts=0" +write_summary "frontend_publication_allowed=false" +write_summary "storage_mutation_allowed=false" + +if (cd "${PRODUCT_ROOT}" && helm lint charts/seaweed-block) >"${LINT_LOG}" 2>&1; then + write_summary "helm_lint=pass" +else + write_summary "helm_lint=fail" + cat "${LINT_LOG}" >&2 || true + exit 1 +fi + +(cd "${PRODUCT_ROOT}" && helm template sw-block charts/seaweed-block --namespace kube-system) >"${DEFAULT_RENDER}" +require_absent "default_omits_failback_runtime_rpc" "--failback-runtime-rpc" "${DEFAULT_RENDER}" +require_absent "default_omits_failback_executor_deployment" "name: sw-block-failback-executor" "${DEFAULT_RENDER}" +require_absent "default_omits_enable_execution" "--enable-execution" "${DEFAULT_RENDER}" +require_absent "default_omits_failback_grpc_addr" "--failback-runtime-grpc-addr" "${DEFAULT_RENDER}" + +(cd "${PRODUCT_ROOT}" && helm template sw-block charts/seaweed-block --namespace kube-system \ + --set blockmaster.failbackRuntimeRPC=true \ + --set failbackExecutor.create=true \ + --set failbackExecutor.dryRun=false \ + --set failbackExecutor.execution.enabled=true \ + --set failbackExecutor.execution.policy=true \ + --set failbackExecutor.execution.failbackRuntimeGrpcAddr=blockmaster.kube-system.svc:9333) >"${ENABLED_RENDER}" + +require_present "enabled_renders_failback_runtime_rpc" "--failback-runtime-rpc" "${ENABLED_RENDER}" +require_present "enabled_renders_failback_executor_deployment" "name: sw-block-failback-executor" "${ENABLED_RENDER}" +require_present "enabled_renders_enable_execution" "--enable-execution" "${ENABLED_RENDER}" +require_present "enabled_renders_execution_policy" "--execution-policy" "${ENABLED_RENDER}" +require_present "enabled_renders_failback_grpc_addr" "--failback-runtime-grpc-addr=blockmaster.kube-system.svc:9333" "${ENABLED_RENDER}" +require_absent "enabled_omits_dry_run" "--dry-run" "${ENABLED_RENDER}" + +require_helm_failure "rejects_execution_with_dry_run" \ + "failbackExecutor.execution.enabled=true requires failbackExecutor.dryRun=false" \ + "${BAD_DRYRUN_LOG}" \ + --set failbackExecutor.create=true \ + --set failbackExecutor.execution.enabled=true \ + --set failbackExecutor.execution.policy=true \ + --set failbackExecutor.execution.failbackRuntimeGrpcAddr=blockmaster.kube-system.svc:9333 + +require_helm_failure "rejects_execution_without_policy" \ + "failbackExecutor.execution.enabled=true requires failbackExecutor.execution.policy=true" \ + "${BAD_POLICY_LOG}" \ + --set failbackExecutor.create=true \ + --set failbackExecutor.dryRun=false \ + --set failbackExecutor.execution.enabled=true \ + --set failbackExecutor.execution.failbackRuntimeGrpcAddr=blockmaster.kube-system.svc:9333 + +require_helm_failure "rejects_ambiguous_runtime_transports" \ + "failbackExecutor.execution.failbackRuntimeGrpcAddr and failbackExecutor.execution.failbackRuntimeURL are mutually exclusive" \ + "${BAD_AMBIGUOUS_LOG}" \ + --set failbackExecutor.create=true \ + --set failbackExecutor.dryRun=false \ + --set failbackExecutor.execution.enabled=true \ + --set failbackExecutor.execution.policy=true \ + --set failbackExecutor.execution.failbackRuntimeGrpcAddr=blockmaster.kube-system.svc:9333 \ + --set failbackExecutor.execution.failbackRuntimeURL=http://127.0.0.1:23260/runtime/failback + +write_summary "execution_policy_still_required=true" +write_summary "runtime_transport_must_be_unambiguous=true" +write_summary "chart_default_remains_non_mutating=true" +write_summary "frontend_publication_allowed=false" +write_summary "storage_mutation_allowed=false" +write_summary "phase83_failback_chart_runtime_status=ok" diff --git a/seaweed-block/testops/scenarios/failback-chart-runtime-chain.yaml b/seaweed-block/testops/scenarios/failback-chart-runtime-chain.yaml new file mode 100644 index 0000000000..a8cfb445ea --- /dev/null +++ b/seaweed-block/testops/scenarios/failback-chart-runtime-chain.yaml @@ -0,0 +1,106 @@ +# Runner-native Phase 83 gate: Helm chart wiring for the failback gRPC +# runtime transport. The default chart remains non-mutating; explicit values +# render the blockmaster RPC flag plus executor execution/gRPC flags. + +name: failback-chart-runtime-chain +timeout: 6m + +env: + product_root: "/tmp/seaweed_block" + ssh_key: "C:\\work\\dev_server\\testdev_key" + +topology: + nodes: + m02: + host: 192.168.1.184 + user: testdev + key: "{{ ssh_key }}" + +phases: + - name: failback_chart_runtime_gate + actions: + - action: exec + node: m02 + timeout: 5m + cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase83-failback-chart-runtime && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase83-failback-chart-runtime && cd {{ product_root }} && SW_BLOCK_ARTIFACT_DIR=/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase83-failback-chart-runtime bash scripts/run-phase83-failback-chart-runtime-gate.sh {{ product_root }}" + + - action: grep_log + node: m02 + path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase83-failback-chart-runtime/phase83-failback-chart-runtime-summary.txt" + pattern: "^phase83_failback_chart_runtime_status=ok$" + save_as: phase83_ok + - action: assert_greater + actual: "{{ phase83_ok }}" + threshold: "0" + + - action: grep_log + node: m02 + path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase83-failback-chart-runtime/phase83-failback-chart-runtime-summary.txt" + pattern: "^default_omits_failback_runtime_rpc=true$" + save_as: default_rpc_off + - action: assert_greater + actual: "{{ default_rpc_off }}" + threshold: "0" + + - action: grep_log + node: m02 + path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase83-failback-chart-runtime/phase83-failback-chart-runtime-summary.txt" + pattern: "^enabled_renders_failback_runtime_rpc=true$" + save_as: enabled_rpc + - action: assert_greater + actual: "{{ enabled_rpc }}" + threshold: "0" + + - action: grep_log + node: m02 + path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase83-failback-chart-runtime/phase83-failback-chart-runtime-summary.txt" + pattern: "^enabled_renders_failback_grpc_addr=true$" + save_as: enabled_grpc + - action: assert_greater + actual: "{{ enabled_grpc }}" + threshold: "0" + + - action: grep_log + node: m02 + path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase83-failback-chart-runtime/phase83-failback-chart-runtime-summary.txt" + pattern: "^rejects_execution_with_dry_run=true$" + save_as: rejects_dryrun + - action: assert_greater + actual: "{{ rejects_dryrun }}" + threshold: "0" + + - action: grep_log + node: m02 + path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase83-failback-chart-runtime/phase83-failback-chart-runtime-summary.txt" + pattern: "^rejects_execution_without_policy=true$" + save_as: rejects_policy + - action: assert_greater + actual: "{{ rejects_policy }}" + threshold: "0" + + - action: grep_log + node: m02 + path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase83-failback-chart-runtime/phase83-failback-chart-runtime-summary.txt" + pattern: "^rejects_ambiguous_runtime_transports=true$" + save_as: rejects_ambiguous + - action: assert_greater + actual: "{{ rejects_ambiguous }}" + threshold: "0" + + - action: grep_log + node: m02 + path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase83-failback-chart-runtime/phase83-failback-chart-runtime-summary.txt" + pattern: "^chart_default_remains_non_mutating=true$" + save_as: default_non_mutating + - action: assert_greater + actual: "{{ default_non_mutating }}" + threshold: "0" + + - name: collect + always: true + actions: + - action: collect_path + node: m02 + path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-phase83-failback-chart-runtime" + name: "remote-phases" + ignore_error: true