The appliance gate boots as many nodes as a caller declares #9
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Keel-Linux/.github!9
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "ci/appliance-several-nodes"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Replication cannot be proved on one machine. Handbook decision 0013 says that
if it cannot be tested in the gate then the replication work should not be
built, because an untested replication feature in an appliance people trust
with data is worse than no feature. This is that gate. Tracker issue
Keel-Linux/tracker#4.
What changes
test-appliance.ymltakes arolesinput, one role name per node. The countis the number of names, so
galera galera galerais three later and nothinghere assumes two; repeats are allowed because Galera nodes share a role, and
five is the ceiling because the runner is shared and a longer list is a typo
rather than a topology.
Empty, the default, is one container. Every new step is conditional on the
input, so no existing caller changes behaviour: keel-core, keel-nodebb,
keel-mariadb and keel-postgresql are called with the arguments they were
called with before.
The interface, and why
rolesinput in the caller's own short workflow,beside
applianceandparent. The same kind of thing an appliance authoralready writes there, and one line.
/etc/keel/node.envin its own rootfs,with
KEEL_NODE_NAME,KEEL_NODE_ROLE,KEEL_NODE_INDEXandKEEL_NODE_COUNT, and/etc/keel/peers.envonce every node has an address.A file in its own filesystem is how every other appliance setting arrives,
and unlike a hostname or a boot order it is the seam the appliance's own
replication feature takes over when the instance description carries the
role.
Debian
localhostresolves to IPv4 alone, so a name anywhere in this pathwould quietly pick the wrong family.
btn_tcp_probe_argvbuilds the bash/dev/tcpconnect one container runs against another, and the appliance'sown
bt_wait_forturns it into a wait with a deadline.Where the logic lives
lib/boot-test-nodes.sh, here rather than copied into four appliancerepositories, which is the trap
docs/traps.mdends with and where thehandbook already decided shared boot test logic belongs. It has no side
effects, so it can be measured: 113 of 113 lines, 39 new bats tests, and
tests/coverage.shnow measureslib/besidebin/. Total 164 of 164 lines,100 percent.
Teardown
Runs whatever the outcome, cancellation included. It enumerates the containers
from LXC instead of recomputing them from the role list, so a node the test
renamed or started just before failing goes too. It stops all of them first
and removes the tree last, because
keel-ci-cleanupstops one container anddeletes the tree in a single call: calling it once per node would delete the
configuration of the nodes not yet stopped and leave their init processes on a
rootfs that no longer exists.
lxc-stopandlxc-destroyare already in therunner's sudo policy, so several nodes need it no wider than one node did.
Test plan
actionlint1.7.7, pinned by digest, clean on all five workflowsshellcheck -x lib/boot-test-nodes.shcleanCOVERAGE_THRESHOLD=100 tests/coverage.sh: 164/164, 100 percentappliance / build-and-booton keel-mariadb