mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-06 19:17:28 +01:00
Add the light-use operations path for Seaweed Block alpha users. This includes per-volume status bundles, cluster inventory, product-owned blockvolume lifecycle, durable restart/reattach evidence, same-node alpha placement checks, TestOps control data, and the supporting runner-native gates and QA close reports. The next active plan is Basic Mounted Failover And Reattach MVP, which carries RF=2/RF=3 recovery work forward without claiming it closed in this milestone.
235 lines
9.8 KiB
YAML
235 lines
9.8 KiB
YAML
# Runner-native same-node alpha attach chain.
|
|
#
|
|
# Goal:
|
|
# Prove the documented alpha placement model: generated RF=1 iSCSI
|
|
# blockvolume and writer/reader app pods are pinned to the same selected
|
|
# Kubernetes node, attach through the normal CSI path, and inventory explains
|
|
# the PVC -> blockvolume node -> loopback frontend/support-bundle evidence.
|
|
#
|
|
# Expected invocation:
|
|
# swblock run \
|
|
# -env product_root=/path/to/seaweed_block/on/m02 \
|
|
# -env ssh_key=/path/to/testdev_key/on/controller \
|
|
# testops/scenarios/same-node-alpha-attach-chain.yaml
|
|
|
|
name: same-node-alpha-attach-chain
|
|
timeout: 18m
|
|
|
|
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: pre_clean
|
|
actions:
|
|
- action: pre_run_cleanup
|
|
node: m02
|
|
kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target"
|
|
nvme_disconnect: "true"
|
|
iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs"
|
|
- action: exec
|
|
node: m02
|
|
cmd: "rm -rf /mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach && mkdir -p /mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach/pin_build /mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach/demo"
|
|
- action: exec
|
|
node: m02
|
|
cmd: "pkill -f 'kubectl.*port-forward.*svc/blockmaste[r]' >/dev/null 2>&1 || true"
|
|
- action: assert_no_active_iscsi_sessions
|
|
node: m02
|
|
iqn_substr: "io.seaweedfs"
|
|
- action: assert_no_processes
|
|
node: m02
|
|
pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |^blockmaster |^blockvolume |^blockcsi |^iscsi-target "
|
|
|
|
- name: preflight
|
|
actions:
|
|
- action: exec
|
|
node: m02
|
|
cmd: "cd {{ product_root }} && bash scripts/preflight-k8s-alpha.sh --local-k3s > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach/preflight.txt 2>&1"
|
|
- action: grep_log
|
|
node: m02
|
|
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach/preflight.txt"
|
|
pattern: "summary status=PASS"
|
|
save_as: preflight_count
|
|
- action: assert_greater
|
|
actual: "{{ preflight_count }}"
|
|
threshold: "0"
|
|
|
|
- name: pin_build_alpha_images
|
|
actions:
|
|
- action: exec
|
|
node: m02
|
|
timeout: 8m
|
|
cmd: "cd {{ product_root }} && bash scripts/build-alpha-images.sh {{ product_root }}"
|
|
env.SW_BLOCK_IMPORT_K3S: "1"
|
|
env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach/pin_build"
|
|
- action: grep_log
|
|
node: m02
|
|
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach/pin_build/alpha-images.env"
|
|
pattern: "SW_BLOCK_IMAGE_ID="
|
|
save_as: sw_block_image_id_count
|
|
- action: assert_greater
|
|
actual: "{{ sw_block_image_id_count }}"
|
|
threshold: "0"
|
|
- action: grep_log
|
|
node: m02
|
|
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach/pin_build/alpha-images.env"
|
|
pattern: "SW_BLOCK_CSI_IMAGE_ID="
|
|
save_as: sw_block_csi_image_id_count
|
|
- action: assert_greater
|
|
actual: "{{ sw_block_csi_image_id_count }}"
|
|
threshold: "0"
|
|
|
|
- name: reader_verified_with_live_inventory
|
|
actions:
|
|
- action: exec
|
|
node: m02
|
|
timeout: 10m
|
|
cmd: "cd {{ product_root }} && bash -c 'set -a; source /mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach/pin_build/alpha-images.env; set +a; set +e; SW_BLOCK_DEMO_STOP_AFTER=reader-verified bash scripts/run-k8s-demo.sh {{ product_root }}; rc=$?; echo $rc > /mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach/demo/controlled-stop.exit_code; test \"$rc\" -eq 44'"
|
|
env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach/demo"
|
|
- action: grep_log
|
|
node: m02
|
|
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach/demo/run.log"
|
|
pattern: "\\[app-demo\\] controlled stop after reader verified"
|
|
save_as: reader_verified_stop_count
|
|
- action: assert_greater
|
|
actual: "{{ reader_verified_stop_count }}"
|
|
threshold: "0"
|
|
- action: grep_log
|
|
node: m02
|
|
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach/demo/writer.log"
|
|
pattern: "\\[app-writer\\] wrote and verified /data/demo.bin"
|
|
save_as: writer_checksum_count
|
|
- action: assert_greater
|
|
actual: "{{ writer_checksum_count }}"
|
|
threshold: "0"
|
|
- action: grep_log
|
|
node: m02
|
|
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach/demo/reader.log"
|
|
pattern: "\\[app-reader\\] verified persisted /data/demo.bin"
|
|
save_as: reader_checksum_count
|
|
- action: assert_greater
|
|
actual: "{{ reader_checksum_count }}"
|
|
threshold: "0"
|
|
|
|
- name: same_node_asserts
|
|
actions:
|
|
- action: grep_log
|
|
node: m02
|
|
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach/demo/run.log"
|
|
pattern: "app_node="
|
|
save_as: app_node_logged_count
|
|
- action: assert_greater
|
|
actual: "{{ app_node_logged_count }}"
|
|
threshold: "0"
|
|
- action: grep_log
|
|
node: m02
|
|
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach/demo/run.log"
|
|
pattern: "pin_app_node=1"
|
|
save_as: app_node_pin_count
|
|
- action: assert_greater
|
|
actual: "{{ app_node_pin_count }}"
|
|
threshold: "0"
|
|
- action: grep_log
|
|
node: m02
|
|
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach/demo/demo-app.rendered.yaml"
|
|
pattern: "nodeSelector:"
|
|
save_as: writer_node_selector_count
|
|
- action: assert_greater
|
|
actual: "{{ writer_node_selector_count }}"
|
|
threshold: "0"
|
|
- action: grep_log
|
|
node: m02
|
|
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach/demo/demo-app-reader.rendered.yaml"
|
|
pattern: "nodeSelector:"
|
|
save_as: reader_node_selector_count
|
|
- action: assert_greater
|
|
actual: "{{ reader_node_selector_count }}"
|
|
threshold: "0"
|
|
- action: grep_log
|
|
node: m02
|
|
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach/demo/generated-blockvolume.yaml"
|
|
pattern: "kubernetes.io/hostname:"
|
|
save_as: blockvolume_node_selector_count
|
|
- action: assert_greater
|
|
actual: "{{ blockvolume_node_selector_count }}"
|
|
threshold: "0"
|
|
- action: grep_log
|
|
node: m02
|
|
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach/demo/generated-blockvolume.yaml"
|
|
pattern: "--iscsi-listen=127.0.0.1:"
|
|
save_as: loopback_frontend_count
|
|
- action: assert_greater
|
|
actual: "{{ loopback_frontend_count }}"
|
|
threshold: "0"
|
|
- action: exec
|
|
node: m02
|
|
cmd: "APP_NODE=$(sed -n 's/^.*] app_node=//p' /mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach/demo/run.log | tail -1); test -n \"$APP_NODE\"; grep -q \"node=${APP_NODE}\" /mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach/demo/ops-inventory-reader-verified/volume-inventory-summary.txt"
|
|
- action: grep_log
|
|
node: m02
|
|
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach/demo/ops-inventory-reader-verified/volume-inventory-summary.txt"
|
|
pattern: "pvc=sw-block-demo-pvc"
|
|
save_as: inventory_pvc_count
|
|
- action: assert_greater
|
|
actual: "{{ inventory_pvc_count }}"
|
|
threshold: "0"
|
|
- action: grep_log
|
|
node: m02
|
|
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach/demo/ops-inventory-reader-verified/volume-inventory-summary.txt"
|
|
pattern: "frontend=127.0.0.1:"
|
|
save_as: inventory_frontend_count
|
|
- action: assert_greater
|
|
actual: "{{ inventory_frontend_count }}"
|
|
threshold: "0"
|
|
- action: grep_log
|
|
node: m02
|
|
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach/demo/ops-inventory-reader-verified/volume-inventory-summary.txt"
|
|
pattern: "support_bundle=volumes/"
|
|
save_as: inventory_support_bundle_count
|
|
- action: assert_greater
|
|
actual: "{{ inventory_support_bundle_count }}"
|
|
threshold: "0"
|
|
- action: grep_log
|
|
node: m02
|
|
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach/demo/ops-inventory-reader-verified/nested-ops-status-bundles.json"
|
|
pattern: "\"command\": \"sw-block ops status\""
|
|
save_as: nested_status_bundle_count
|
|
- action: assert_greater
|
|
actual: "{{ nested_status_bundle_count }}"
|
|
threshold: "0"
|
|
|
|
- name: collect_and_cleanup
|
|
always: true
|
|
actions:
|
|
- action: exec
|
|
node: m02
|
|
timeout: 3m
|
|
cmd: "cd {{ product_root }} && bash scripts/uninstall-k8s-alpha.sh {{ product_root }}"
|
|
env.SW_BLOCK_ARTIFACT_DIR: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach/uninstall"
|
|
env.SW_BLOCK_UNINSTALL_DELETE_ALL_BLOCKVOLUMES: "1"
|
|
- action: pre_run_cleanup
|
|
node: m02
|
|
kill_patterns: "blockmaster,blockvolume,blockcsi,iscsi-target"
|
|
nvme_disconnect: "true"
|
|
iscsi_logout_prefix: "iqn.2026-05.io.seaweedfs"
|
|
- action: exec
|
|
node: m02
|
|
cmd: "pkill -f 'kubectl.*port-forward.*svc/blockmaste[r]' >/dev/null 2>&1 || true"
|
|
- action: assert_no_active_iscsi_sessions
|
|
node: m02
|
|
iqn_substr: "io.seaweedfs"
|
|
- action: assert_no_processes
|
|
node: m02
|
|
pattern: "[/]blockmaster --|[/]blockvolume --|[/]blockcsi |[/]iscsi-target |[/]kubectl .*port-forward .*svc/blockmaste[r]|^blockmaster |^blockvolume |^blockcsi |^iscsi-target "
|
|
- action: collect_path
|
|
node: m02
|
|
path: "/mnt/smb/work/share/g15d-k8s/{{ run_id }}-same-node-attach"
|
|
name: "remote-phases"
|
|
ignore_error: true
|