mirror of
https://github.com/bitcoin/bitcoin
synced 2026-12-04 16:29:39 +00:00
WIP: ci: isolate container test networks #35417
No reviewers
Labels
No labels
Android
Backport
Block storage
Brainstorming
Bug
Build system
CI failed
Consensus
Data corruption
Descriptors
Docs
DrahtBot Guix build requested
Feature
Fuzzing
GUI
Good First Review
IPC
Insufficient Review
Kernel
Linux/Unix
Mempool
Mining
Needs Backport (31.x)
Needs Backport (32.x)
Needs Benchmark
Needs Conceptual Review
Needs backport (30.x)
Needs rebase
Needs release note
Net
P2P
PSBT
Privacy
Private Broadcast
Questions and Help
RPC/REST/ZMQ
Refactoring
Resource usage
Review club
Scripts and tools
Settings
TX fees and policy
Tests
Tracking Issue
UTXO Db and Indexes
Up for grabs
Upstream
Utils/log/libs
Validation
Waiting for author
Wallet
Windows
good first issue
interfaces
macOS
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin/bitcoin!35417
Loading…
Reference in a new issue
No description provided.
Delete branch "container-networks"
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?
Fixes #35416
Local CI jobs currently share Docker networks while requesting fixed
routable addresses. That prevents two jobs from running at the same time
because the second container cannot claim the same static IPs. See
33362.
Name the networks "{container_name}-ipv[4|6]", using a subnet based on
the hash of their name, so each CI job gets a separate network while the
tests continue to see the addresses they expect.
Increment them to 11.x.x.x and 1111:2222:x to avoid hitting (existing) dangling networks on machines.
On successful runs, the networks are cleaned up. On failed runs they will remain (as they are being used by the failing container).
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
External sites
Reviews
See the guideline and AI policy for information on the review process.
If your review is incorrectly listed, please copy-paste
<!--meta-tag:bot-skip-->into the comment that the bot should ignore.Conflicts
No conflicts as of last run.
Implements one apprach from https://github.com/bitcoin/bitcoin/issues/35416#issuecomment-4578958907
I tried other ways of generating deterministic networks here (we have prcedent for using 'os.getpid()`), but I think in the end this is probably the most robust idea.
IMO cleaning up the networks is nicer, but I can drop that commit if it's not wanted for some reason unknown to me currently (or i can squash it).
Also open to other solutions here.
Concept ACK - thanks for following up here.
lgtm, seems fine. Left some nits
Why this hunk? This is verbose and only turns a well-understood python run-time error into a harder-to-debug other runtime error?
nit: Would it not be easier to spin up a single network with both subnets?
nit: Instead of assigning one ip here, and the other below, why not assign both below?
Maybe change the prefix, so that it isn't tied to the CI?
neat. done.
both now assigned together
At first I had something in cleanup using it, but I dropped it, so have now dropped this too.
Done
CI failure:
Converted to draft, due to failing CI
Base:
66776840beb558f7e84451c2c55457f0e06242f0Head:
3fefa9c120bcb0636e630e299361a513e0c30c40🟠 Major
The container cannot join a network after starting with
--network=none(ci/test/02_run_container.py:170, head)The Docker-backed path starts the container with
--network=noneand then tries to attachnetwork_name. Docker rejects attaching another network to a container innonemode, sorun()exits before installation and testing, and the cleanup below is skipped. Start the container directly onnetwork_namewith both requested static addresses instead. (github.com)Review coverage was incomplete. The independent review did not complete. The adversarial_glm review did not complete. Verification was partial.
Full review report
left more feedback, and already addressed all in https://github.com/bitcoin/bitcoin/pull/36435
Also, rewritten the branch by inverting the commit order for easier review.
seems a bit confusing to do all the hashing and the -1, and the +1 "hacks", when a stable int id can just be derived from the container (or rather sorted file name index) name directly. Of course this won't be stable across commits, but we can't really guarantee cross-commit ci concurrent runs anyway?
the check=False now makes me a bit uneasy. Should be safer to remove and check?
the network=none fails ci, so probably needs the --ip=... and ip6=... passed directly above?
comment can be removed and the skip msg below needs an update?
Closed in favour of #36436