Commit Graph
5698 Commits
Author SHA1 Message Date
YueGuobin 61020d3bbc feat(docker): traffic-insight markers on kernel-datapath links via AF_PACKET
Markers no longer disqualify the kernel datapath. They ride the NIO like
on the relay path and attach to the veth host end through uBridge's
marker add_kernel/delete_kernel/enable_kernel commands (AF_PACKET taps,
same BPF/direction/signal semantics as the relay mark filter).

- base_node: marker anchors are now polymorphic (relay bridge name or
  kernel veth host interface); the reconcile loop is datapath-agnostic
  and DockerVM overrides the add/delete/enable primitives to translate
  the commands. Marker-name validation extracted for both add paths.
- docker_vm: kernel NIO connect/update apply markers on the veth anchor;
  link deletion tears markers down explicitly (the veth survives the
  link, unlike a relay bridge whose death drops its filters).
- controller: eligibility and start_marker no longer exclude markers or
  project-level marker definitions; the kernel NIO carries the capture
  node's marker specs.
- NIO creation accepts markers on kernel NIOs (filters still rejected).
2026-10-06 00:21:07 +08:00
YueGuobin f6b869be63 feat(docker): packet capture on kernel-datapath links via AF_PACKET
Replace the capture rejection with wiring to uBridge's capture module:
an AF_PACKET socket bound to the veth host end writes into the same pcap
file the relay path uses (capture start_kernel <if> "<pcap>" /
capture stop_kernel), so the pcap streaming to clients is unchanged.

- capture survives node restarts: _connect_nio re-arms it when the NIO
  is already capturing, mirroring the relay path
- uBridge's kernel capture is a singleton per process: a concurrent
  second capture on the same node surfaces uBridge's EALREADY error
- update the datapath docs: filters and markers remain relay-only,
  capture is now served on both datapaths
2026-10-06 00:21:07 +08:00
YueGuobin 58b97b4ce5 fix(controller): don't push the synthetic suspend filter to kernel links
update_suspend() piggybacks on the filter system: get_active_filters()
returns {"frequency_drop": [-1]} while a link is suspended so relay-based
node types drop all traffic at the uBridge filter. Kernel-datapath links
implement suspend natively via interface carrier, and pushing the
synthetic filter tripped the compute-side guard, making suspend fail
with 409 on every kernel link (and leaving controller/kernel state torn).
_get_node_filters() now returns empty filters for kernel links.
2026-10-06 00:21:07 +08:00
YueGuobin 37d7b9121e feat(docker): wire Docker-to-Docker links through a kernel bridge
Eligible links (both endpoints Docker, same compute, no filters/markers,
stopped nodes, no unix-socket NIO containers) are wired as veth pairs
enslaved into a per-link Linux kernel bridge (gns3 + 11 hex of the link
id, filling IFNAMSIZ) instead of the uBridge UDP relay, so frames flow
entirely in the kernel.

- NIOBridge NIO type: the controller decides the datapath in
  UDPLink._prepare and both computes enslave their deterministic gv*/gc*
  veth pair via uBridge's docker/brctl modules
- carrier/suspend = host-end admin state; both endpoints race-safely
  create/delete the bridge (EEXIST/EBUSY/ENOENT tolerated)
- veth adapters can still attach relay (UDP) links on a running node:
  lazy relay bridge over AF_PACKET on the host end (add_nio_ethernet)
- filters/markers/capture are rejected with explicit errors on this
  datapath (they live in the uBridge relay); vendor unix-socket
  containers are excluded; Server.enable_kernel_datapath is the
  kill-switch (default on)
- host-end veths survive container death and are removed on stop plus
  swept by name on the next start (crash/stale recovery)
2026-10-06 00:21:07 +08:00
Mark Paronyan 3135c8b7e3 refactor: use f-strings in remaining modules, scripts and tests 2026-10-03 19:44:02 +03:00
Mark Paronyan 7a9c600f54 refactor: use f-strings in controller modules 2026-10-03 19:44:01 +03:00
Mark Paronyan 552c0ca3e0 refactor: use f-strings in remaining compute modules 2026-10-03 19:44:01 +03:00
Mark Paronyan bbebf20825 refactor: use f-strings in dynamips manager 2026-10-03 19:44:01 +03:00
Mark Paronyan c458459626 refactor: use f-strings in dynamips NIO modules 2026-10-03 19:44:01 +03:00
Mark Paronyan fba3ecc5fc refactor: use f-strings in dynamips nodes 2026-10-03 19:44:00 +03:00
Mark Paronyan a5d2bca921 refactor: use f-strings in dynamips router node 2026-10-03 19:44:00 +03:00
Mark Paronyan 97f6805d0a refactor: use f-strings in iou compute modules 2026-10-03 19:44:00 +03:00
Mark Paronyan d5ad4c67c6 refactor: use f-strings in qemu compute modules 2026-10-03 19:44:00 +03:00
Mark Paronyan 7f2c0c7e9c refactor: use f-strings in docker compute modules 2026-10-03 19:44:00 +03:00
Mark Paronyan 72fae7a1ce refactor: declare new image sync models in the public API 2026-10-03 19:43:59 +03:00
Mark Paronyan b622ccae7b refactor: declare explicit public API in package __init__ modules 2026-10-03 19:43:59 +03:00
Mark Paronyan 306d8fbde4 refactor: remove unused imports 2026-10-03 19:43:58 +03:00
Mark Paronyan 1ed8320e31 Merge branch '3.1' into ruff/pr01-imports 2026-10-03 14:21:22 +03:00
grossmj 64e2a62a04 fix: improve warning message for missing mtools in config disk creation. Ref #2778 2026-10-02 16:08:38 +02:00
Mark Paronyan b78672a8ca style: sort imports in the new image management modules 2026-10-02 12:43:26 +03:00
Mark Paronyan 55df230864 style: sort imports in controller 2026-10-02 12:43:26 +03:00
Mark Paronyan 61caa20524 style: sort imports in agent and remaining compute modules 2026-10-02 12:43:26 +03:00
Mark Paronyan 3b993b464f style: sort imports in schemas 2026-10-02 12:43:26 +03:00
Mark Paronyan 634189d443 style: sort imports in api and utils modules 2026-10-02 12:43:26 +03:00
Mark Paronyan 4ebc941951 style: sort imports in controller API routes 2026-10-02 12:43:26 +03:00
Mark Paronyan b9cdac487c style: sort imports in compute, db and services modules 2026-10-02 12:43:26 +03:00
Mark Paronyan 38e9ddca09 style: sort imports in compute node modules 2026-10-02 12:43:26 +03:00
Mark Paronyan a77e06b907 Merge branch '3.1' into ruff/trivia-fixups 2026-10-01 19:58:02 +03:00
Mark Paronyan 74943b4c74 refactor: convert remaining percent formatting in log messages 2026-10-01 19:57:47 +03:00
Mark Paronyan 95ada23395 refactor: replace percent formatting with format specifiers 2026-10-01 19:57:47 +03:00
Mark Paronyan 06899c92fc refactor: use iterable unpacking instead of concatenation 2026-10-01 19:57:46 +03:00
Mark Paronyan 2dc7479d11 style: remove f-strings without placeholders 2026-10-01 19:57:46 +03:00
Mark Paronyan c9416d2569 style: remove quotes from type annotations 2026-10-01 19:57:45 +03:00
Mark Paronyan fdb8d87a64 style: drop useless object inheritance 2026-10-01 19:57:45 +03:00
Mark Paronyan 396407827e style: drop redundant open mode arguments 2026-10-01 19:57:44 +03:00
Mark Paronyan d356a68987 refactor: replace aliased OSError subclasses 2026-10-01 19:57:44 +03:00
Mark Paronyan 7d0be62da8 style: drop redundant utf-8 encode arguments 2026-10-01 19:57:44 +03:00
Mark Paronyan 06ef803ee9 style: use not-in membership tests 2026-10-01 19:57:43 +03:00
Mark Paronyan 7a1e79a8a0 style: parenthesize chained boolean operators 2026-10-01 19:57:43 +03:00
Mark Paronyan 1a495ab318 refactor: replace getattr with attribute access 2026-10-01 19:57:42 +03:00
Mark Paronyan 0416ad8228 style: sort __all__ declarations 2026-10-01 19:57:42 +03:00
Mark Paronyan c5b5091f5e refactor: use explicit conversion in f-strings 2026-10-01 19:57:41 +03:00
Mark Paronyan 0f66fd6c2b style: remove trailing whitespace 2026-10-01 19:57:41 +03:00
Mark Paronyan 06e98f8b55 style: drop redundant utf-8 coding declarations 2026-10-01 19:57:40 +03:00
Mark Paronyan 9e5ab02147 style: remove unused noqa directives 2026-10-01 19:57:40 +03:00
grossmj 1456d36bf0 chore(tests): fix mypy errors 2026-10-01 15:22:17 +02:00
Jeremy Grossmann a2cdc14a25 Merge branch '3.1' into image-manager-out-of-sync 2026-10-01 14:44:24 +02:00
Jeremy Grossmann e90be1ebac Merge pull request #2930 from markparonyan/mypy-db-templates-images
fix(typing): resolve the remaining mypy errors (18 modules)
2026-09-29 21:37:14 +02:00
Mark Paronyan eae69bd5c5 fix(typing): resolve mypy errors in compute.virtualbox.virtualbox_vm 2026-09-29 22:02:23 +03:00
Mark Paronyan 472c1b61fd fix(typing): resolve mypy errors in controller.project 2026-09-29 22:02:23 +03:00