Repository navigation
feat: the binary runs every slot; mayfly.sh and the engine switch are gone - #42
Merged
Merged
Conversation
The README gets a Commands section, command and option tables, numbered steps for the engine switch, NAT hosts and updates, and a Development section for releases and tests. No behavior is described differently. pool.env.example lists the vm-stuck hook; pve-on-debian.sh names the README section as it is called. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GGBbe73cn8jLtTaF9GtkTU
… gone Every slot kind has had a Rust loop since 0.7.0, chosen with engine= or SLOT_ENGINE. That loop is now the only one. mayfly.sh, the forwarding to it and the switch are removed; engine= and SLOT_ENGINE are ignored and `mayfly check` lists them. `mayfly status` has no ENGINE column. A running slot now takes an update by itself: between two guests the loop looks whether the installed command was replaced and, if so, hands over to it in the same process. Before, a loop kept its old code until the unit was restarted, whatever the update said. Loops of 0.9.0 and earlier cannot do that, so `mayfly install` over such an install (it finds mayfly.sh) removes the script and restarts the running slots once. A restart drains: a job in progress finishes first. install.sh, package.sh and CI read the version from Cargo.toml and find a release by mayfly-slot@.service. `mayfly install` only installs curl. An unknown command prints the help and fails, as the script did. Tests: tests/run.sh and tests/parity.sh compared against the script and go with it. tests/e2e.sh runs the built binary through a slot of each kind against stubs and compares with tests/golden/, recorded from the bash loop before it was removed, and covers the hand-over to a newer command. tests/shipped.rs keeps the checks of the example files and provision.sh. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GGBbe73cn8jLtTaF9GtkTU
The recordings in tests/golden/ carried the name of the machine they were made on (in the pvesh calls), so the suite failed everywhere else. A hostname stub answers pve1; the recordings change in that name only. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GGBbe73cn8jLtTaF9GtkTU
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes
One slot loop. Every slot kind has had a Rust loop since 0.7.0, chosen with
engine=orSLOT_ENGINE. It is now the only loop.mayfly.sh, the forwarding to it and the switch are removed.engine=inslots.confandSLOT_ENGINEinpool.envdo nothing;mayfly checklists them until they are removed.mayfly statushas noENGINEcolumn.Running slots take an update by themselves. A slot loop is one long process, so until now it kept its old code until its unit was restarted, although
mayfly updatesaid "running slots use it from their next job". Between two guests the loop now checks whether the installed command was replaced and, if so, hands over to it in the same process. A VM or container slot does this after its job, a pod slot when its VM is recycled. No job is cancelled.Migration from 0.9.0 or earlier. Loops of those versions cannot hand over.
mayfly installover such an install (it findsmayfly.shin the share directory) removes the script and restarts the running slots once withsystemctl restart --no-block. A restart drains: an idle guest is replaced, a job in progress finishes first.mayfly update --rollbackrestores the script with the old version.Release plumbing.
install.sh,scripts/package.shand CI read the version fromCargo.tomland recognise a release bymayfly-slot@.service. release-please no longer stampsmayfly.sh.mayfly installinstalls onlycurl(the script neededjqandopenssl).This is not marked breaking: nothing has to be done on a host, and a breaking marker would stop
mayfly update --autofrom ever installing it or any later release.The first commit restructures the README (tables, numbered steps, a Commands section) without changing what it says.
Tests
tests/run.shandtests/parity.shcompared the binary with the script and go with it.tests/e2e.sh(new) runs the built binary through a slot of each kind against stub commands and compares every call, file, GitHub request and log line withtests/golden/. The recordings for vm, lxc and pod were made from the bash loop before it was removed, and the binary matches them. It also covers the hand-over to a newer command for a vm and a pod slot.tests/slot.rs: five new tests for the hand-over; the routing tests are replaced by tests that every kind runs the loop whatever the old settings say.tests/cli.rs: the script is removed on install, running slots are restarted once and only once, a slot that cannot be restarted is named, unknown commands, the newcheckwarnings.tests/shipped.rs(new) keeps the two checks ofrun.shthat were about shipped files:pool.env.exampleis plainKEY=value, andprovision.shexports bothtemplate.envfiles.Run locally:
cargo fmt --check,cargo clippy --all-targets -- -D warnings,cargo test(284 passed),bash tests/e2e.sh(6/6), shellcheck, andtests/update.shwith a build stamped 0.10.0: the real 0.9.0 and 0.4.1 releases update to it and roll back (15/15 each). Before deleting it,tests/parity.shwas 58/58 identical.Not tested: a real Proxmox host.
Generated by Claude Code