505 Commits

Author SHA1 Message Date
YueGuobin
b4e4739d52
feat(compute): report uBridge tc capabilities and gate filters on them
Consume uBridge's ebpf_modes contract (feature/tc-window 40c36ae): a
stateful mode is usable iff ebpf=1 and its token is listed; builds
predating the field keep their shipped modes (nth/quota/flow), so the
pre-correction window semantics can never be installed silently.

- gns3server/utils/tc_capabilities.py: shared reply parser, mode
  policy and filter-type mappings (compute and controller gate on the
  same rules)
- gns3server/compute/ubridge/tc_probe.py: standalone probe spawning a
  throwaway uBridge as the server's own user, cached by binary
  identity (path/mtime/size - the version string cannot distinguish
  rebuilds); failures cache as unknown
- GET /v3/compute/capabilities gains ubridge_tc {netem, ebpf,
  ebpf_modes, cbpf}; the controller forwards it (Compute.capabilities)
  and available_filters hides kernel-datapath filter types an endpoint
  compute cannot run (both ends apply their own filters, so one
  incapable compute hides the type); computes without a report keep
  the full list and apply-time 409 stays the guard
- docker: _ubridge_apply_ebpf_drops gates per mode token; the cleanup
  path only sends "off" for modes the build declares
- split DockerVM's kernel-datapath machinery (veth lifecycle, carrier,
  marker primitives, tc filter translation, kernel NIO teardown) into
  compute/docker/docker_kernel_datapath.py (DockerKernelDatapathMixin)
2026-10-06 00:21:08 +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
306d8fbde4
refactor: remove unused imports 2026-10-03 19:43:58 +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
a77e06b907
Merge branch '3.1' into ruff/trivia-fixups 2026-10-01 19:58:02 +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
7a1e79a8a0
style: parenthesize chained boolean operators 2026-10-01 19:57:43 +03:00
Mark Paronyan
0f66fd6c2b
style: remove trailing whitespace 2026-10-01 19:57:41 +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
bacfab8465
fix(typing): resolve mypy errors in api.routes.controller.pools 2026-09-29 22:02:21 +03:00
Mark Paronyan
adf9c15e21
fix(typing): resolve mypy errors in api.routes.controller.projects 2026-09-29 22:02:21 +03:00
Mark Paronyan
323055c486
fix(typing): resolve mypy errors in api.routes.controller.templates 2026-09-29 22:02:20 +03:00
Mark Paronyan
bbf4e6aa2c
fix(typing): resolve mypy errors in api.routes.controller.images 2026-09-29 22:02:20 +03:00
Mark Paronyan
4361598df0
fix(typing): resolve mypy errors in api.routes.controller.llm_model_configs 2026-09-29 22:02:19 +03:00
Mark Paronyan
b1d13edd2d
fix(typing): resolve mypy errors in api.routes.controller.users 2026-09-29 22:02:18 +03:00
Mark Paronyan
a3cb73da3d
fix(typing): resolve mypy errors in api.routes.controller.dependencies.authentication 2026-09-29 21:48:33 +03:00
Jeremy Grossmann
e8f49877fc
Merge branch '3.1' into mypy-api-routes-controller-1 2026-09-29 13:28:33 +02:00
Jeremy Grossmann
7f4f9eb2d0
Merge branch '3.1' into mypy-api-routes 2026-09-29 13:25:35 +02:00
Jeremy Grossmann
49f1af0962
Merge branch '3.1' into mypy-api-routes-compute-4 2026-09-29 13:23:50 +02:00
Jeremy Grossmann
1f7048d49d
Merge branch '3.1' into mypy-api-routes-compute-3 2026-09-29 13:23:05 +02:00
Jeremy Grossmann
cbd29ece37
Merge branch '3.1' into mypy-api-routes-compute-2 2026-09-29 13:21:10 +02:00
Jeremy Grossmann
726da8383a
Merge branch '3.1' into mypy-agent-gns3_copilot-plus 2026-09-29 13:20:27 +02:00
Jeremy Grossmann
4efc22b7ab
Merge branch '3.1' into mypy-api-routes-compute-1 2026-09-29 13:15:30 +02:00
Jeremy Grossmann
563b6080f0
Merge pull request #2923 from markparonyan/mypy-api-routes-controller-2
fix(typing): resolve mypy errors in gns3server.api.routes.controller
2026-09-29 13:13:58 +02:00
Jeremy Grossmann
9e9a778f8b
Merge pull request #2912 from markparonyan/mypy-api-controller-routes
fix(typing): resolve mypy errors in api.routes.controller
2026-09-29 12:50:06 +02:00
Jeremy Grossmann
ce3911be71
Merge pull request #2911 from markparonyan/mypy-api-compute-routes
fix(typing): resolve mypy errors in api.routes.compute
2026-09-29 12:48:36 +02:00
Mark Paronyan
ebe6dee916
fix(typing): resolve mypy errors in api.routes.controller.snapshots 2026-09-29 09:23:08 +03:00
Mark Paronyan
68d96193ec
fix(typing): resolve mypy errors in api.routes.controller.groups 2026-09-29 09:23:07 +03:00
Mark Paronyan
c340b18ba2
fix(typing): resolve mypy errors in api.routes.controller.roles 2026-09-29 09:23:07 +03:00
Mark Paronyan
2cf90dfce6
fix(typing): resolve mypy errors in api.routes.controller.privileges 2026-09-29 09:23:07 +03:00
Mark Paronyan
93419fc33a
fix(typing): resolve mypy errors in api.routes.controller.nodes 2026-09-29 09:23:07 +03:00
Mark Paronyan
0872576b46
fix(typing): resolve mypy errors in api.routes.controller.acl 2026-09-29 09:23:06 +03:00
Mark Paronyan
a648bf3780
fix(typing): resolve mypy errors in api.routes.controller.dependencies.database 2026-09-29 09:23:06 +03:00
Mark Paronyan
58609bae7b
fix(typing): resolve mypy errors in api.routes.controller.controller 2026-09-29 09:23:06 +03:00
Mark Paronyan
d826285748
fix(typing): resolve mypy errors in api.routes.controller.computes 2026-09-29 09:23:06 +03:00
Mark Paronyan
83b80b8c52
fix(typing): resolve mypy errors in api.routes.compute.virtualbox_nodes 2026-09-29 09:23:05 +03:00
Mark Paronyan
a86cae541e
fix(typing): resolve mypy errors in api.routes.compute.vpcs_nodes 2026-09-29 09:23:05 +03:00
Mark Paronyan
e0c4cb8122
fix(typing): resolve mypy errors in api.routes.compute.vmware_nodes 2026-09-29 09:23:05 +03:00
Mark Paronyan
0ff63bfd90
fix(typing): resolve mypy errors in api.routes.compute.nat_nodes 2026-09-29 09:23:04 +03:00
Mark Paronyan
04ca7ffd9b
fix(typing): resolve mypy errors in api.routes.compute.frame_relay_switch_nodes 2026-09-29 09:23:04 +03:00
Mark Paronyan
fed8aab86c
fix(typing): resolve mypy errors in api.routes.compute.projects 2026-09-29 09:23:04 +03:00
Mark Paronyan
9218f3fc72
fix(typing): resolve mypy errors in api.routes.compute.iou_nodes 2026-09-29 09:23:04 +03:00
Mark Paronyan
cacbc18ad1
fix(typing): resolve mypy errors in api.routes.compute.ethernet_hub_nodes 2026-09-29 09:23:03 +03:00
Mark Paronyan
5ed85340af
fix(typing): resolve mypy errors in api.routes.compute.ethernet_switch_nodes 2026-09-29 09:23:03 +03:00
Mark Paronyan
904672559e
fix(typing): resolve mypy errors in api.routes.compute.dynamips_nodes 2026-09-29 09:23:03 +03:00