Add docker workflow alongside host mode - #25
Open
pgray wants to merge 4 commits into
Open
Conversation
Author
|
heya @toidiu I loved your talk at SRUG I added some docker stuff in case you want it. no pressure at all and just trying to help out. I'll add some more context around where you could go with injecting packet loss. |
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.
Adds a docker workflow for boar without disturbing the existing host workflow. Toidiu's
scripts/virt_*.shnetns chain stays the default; docker mode is opt-in via--mode docker.Usage
Existing host workflow keeps working via
make build/make run.Topology
Two containers on a user-defined bridge instead of the 6-namespace chain.
Server lifecycle is owned by docker, not boar. Shaping is applied on the client's eth0 ingress via IFB so it lands on the download path — semantically equivalent to the legacy netem-on-ns_m2 hop.
What's in
Dockerfile(rust:1-trixie + iproute2/ethtool/tc tooling + BoringSSL build deps). BuildKit cache mounts for cargo registry/git and both target dirs; binaries materialized to/opt/boar/binso they survive the cache mount being unmounted.docker-compose.yml— two services onboar-net,NET_ADMINon the client for tc/ifb, bind-mount./reports,HOST_UID/HOST_GIDenv so output files land owned by the host user.scripts/docker_tc.sh— eth0 ingress redirect → ifb0 withhtb(rate) +netem(delay/loss); eth0 egress =fq.scripts/docker_tc_cleanup.sh— idempotent teardown.scripts/docker_entrypoint.sh—EXITtrap chowns/boar/reportsback to the host user; configurable readiness sleep.src/mode.rs—Mode { Host, Docker }, defaultHost. Plumbed throughEndpointSetupandargs::parse.src/args.rs—--mode,--server-hostflags; DNS-resolves the hostname to an IP because quiche-client's--connect-todoes a bareSocketAddr::parseand panics on hostnames.src/endpoint.rs—run_serverreturnsOptionand isNonein docker mode (server lives in a peer container);run_clientdrops the netns wrap.src/network.rs— adds acleanup_cmdfield so docker mode can actually tear down qdiscs (host mode keeps the legacy no-optest.sh).src/stats/delivery_rate.rs— fail-soft likeDownloadDuration. No more unwrap-panic when the client fails to download.src/main.rs— handles the optional server handle; dumpsclient_logsto stderr when either parser misses a pattern.Makefile—make helpliststest/build/run(host) anddocker-*(docker).reports/instead ofreport/.Host prereqs for docker mode
Known caveats
--cc-algorithmis label-only in docker mode. Boar no longer starts the server, so the CCA is configured at compose time viaBOAR_SERVER_CCAenv. Per-run CCA control would need either a control-plane RPC into the server container ordocker.sockaccess — left as a follow-up.StartupExitisNaNin docker mode. The metric used to be built from the server's in-process stderr; now the server is in a peer container. Recovering it cleanly means a shared log volume — TODO inmain.rs.