Expand description
An executor that is not in this process (D18).
LocalRunner proves the seam can run
real work. It cannot prove the part a microVM, a container, or a
build farm actually adds, which is not virtualization but
distance: the jobs have to leave this address space and the
verdicts have to come back, aligned, including when the far side
stops talking halfway through.
So the third conformance backend is the process boundary itself.
ProtocolRunner spawns a helper, hands it a batch over stdin as
JSON lines, and reads verdicts back from stdout. choir-ci-local is
the reference helper and runs the batch with LocalRunner on the
far side, which means the conformance suite runs the same assertions
against the same execution engine with a pipe in the middle – and
anything that only passes in-process shows up as a difference rather
than as a story about pipes.
A Firecracker or Cloud Hypervisor driver is a different helper
behind the same three lines of protocol. Neither can be built
here: both require KVM, which is Linux-only, so a version written on
this machine would be exactly the untested single implementation
this seam exists to forbid. It can still be gated by the same
list, which is what choir-ci-conform is for: the conformance
suite lives in crate::conform and takes a helper argv, so a
driver on a Linux box answers the checks the four in-tree backends
answer.
§Protocol
One JSON object per line, both directions, and the count is agreed before any work is described so neither side has to guess where the batch ends.
host -> {"protocol":2,"jobs":2}
helper -> {"name":"choir-ci-local","protocol":2}
host -> {"subject":"...","label":"1","command":["true"],"directory":null,...}
host -> {"subject":"...","label":"2","command":["false"],"directory":"/w",...}
helper -> {"verdict":"passed"}
helper -> {"verdict":"failed","exit_code":1}§Examples
use choir_queue::executor::CiExecutor;
use choir_queue::remote::ProtocolRunner;
let mut ci = ProtocolRunner::new(vec!["choir-ci-local".to_string()]);
let info = ci.info().expect("the helper answers");
assert_eq!(info.protocol, choir_queue::executor::PROTOCOL);Structs§
- Protocol
Runner - An executor reached by spawning a helper and talking JSON lines.
Functions§
- job_
from_ json - Parses one job line, the inverse of
job_to_json. - job_
to_ json - Renders one job as the line a helper reads.
- verdict_
from_ json - Parses one verdict line, the inverse of
verdict_to_json. - verdict_
to_ json - Renders one verdict as the line a host reads.