api: add sandbox hotplug network #287
Conversation
996402e to
1535dda
Compare
Codecov Report
@@ Coverage Diff @@
## master #287 +/- ##
=========================================
- Coverage 64.76% 64.7% -0.06%
=========================================
Files 83 84 +1
Lines 9178 9551 +373
=========================================
+ Hits 5944 6180 +236
- Misses 2620 2723 +103
- Partials 614 648 +34 |
c26214a to
82dd787
Compare
|
@sboeuf - can you PTAL? |
3b02c60 to
685aa44
Compare
|
Generally looks good. Can you please add cli side change so that these APIs are actually used and tested? |
virtcontainers/agent.go
Outdated
| // cpus specifies the number of CPUs that were added and the agent should online | ||
| onlineCPUMem(cpus uint32) error | ||
|
|
||
| // hotPlugNetwork will tell the agent to add a new nic for an existed Sandbox. |
virtcontainers/agent.go
Outdated
| // hotPlugNetwork will tell the agent to add a new nic for an existed Sandbox. | ||
| hotPlugNetwork(sandbox *Sandbox, endpoint Endpoint) error | ||
|
|
||
| // hotPlugNetwork will tell the agent to del a new nic for an existed Sandbox. |
|
@caoruidong thx! |
|
@WeiZhang555 Yes, I agree that we should rely on the netns monitor to do the (scan/hotplug) work. |
|
@WeiZhang555 @bergwolf Does that make sense ? Just to be clear, I'm trying to not push too much complexity with our current architecture, and that's why I'm trying to make sure we don't consider the network monitoring process as mandatory. |
|
@caoruidong I have rebased and repushed so that we can see the code coverage as it was getting confused. @WeiZhang555 @devimc you both had requested some changes, could you please take another look and let us know if the PR is okay now? |
|
@sboeuf Codecov is still not working well. Maybe I need to update it again. |
|
@caoruidong give it some time, now that the pr has been rebased on master, it should be fine I think ;) |
|
Not sure, Maybe a new rebase is needed? |
|
@sboeuf I think we should separate the daemon part of netns monitor from the actual implementation that does the scan/hotplug job, -- e.g., by making scan/hotplug a standalone package. Then both the netns monitor process, and the CLI can use the standalone package to kick off network scan/hotplug. The only difference is that netns is a long running daemon and CLI only does it in one shot when/after executing the prestart hooks. When there are no prestart hooks, CLI does not even bother calling scan/hotplug -- which would allow us to create a working sandbox w/o any external NICs. |
|
@bergwolf yes definitely. I am currently working on reworking the whole OCI hook. This will be the first step. And then, we'll move more code to CLI if needed. But all of this sounds good to me :) |
|
@caoruidong please try to fix the build for this as I'd like to get it merged by tomorrow (unless @WeiZhang555 @bergwolf or @devimc has any objections). |
To support tap network hotplug. Implement netdev_add, netdev_del and corresponding device_add QMP commands.
Full list in govmm:
10efa84 qemu/qmp: add function for hotplug network by fds
80ed88e qemu/qmp: implement function to hotplug serial ports
ca46f21 qemu/qmp: implement function to hotplug character devices
03f1a1c qemu/qmp: implement getfd
84b212f qemu: add vhostfd and disable-modern to vsock hotplug
12dfa87 qemu/qmp: implement function for hotplug network
4ca232e qmp_test: Fix Warning and Error level logs
430e72c qemu,qmp: Enable gas security checker
ffc06e6 qemu,qmp: Add staticcheck to travis and fix errors
Add agent ListInterfaces and ListRoutes APIs.
Full list in agent:
7c287c6 agent: add ListInterfaces and ListRoutes rpc
Signed-off-by: Ruidong Cao <caoruidong@huawei.com>
Add sandbox hotplug network API to meet design Signed-off-by: Ruidong Cao <caoruidong@huawei.com>
Add update and list commands for notwork hotplug Signed-off-by: Ruidong Cao <caoruidong@huawei.com>
|
Build succeeded (third-party-check pipeline).
|
|
LGTM
I think this could make sense :-) @sboeuf |
add UTs for network hotplug related fuctions Fixes kata-containers#113 Signed-off-by: Ruidong Cao <caoruidong@huawei.com>
|
PSS Measurement: Memory inside container: |
|
@sboeuf I add some tests. Please check if this is right |
|
@caoruidong thank you very much! |
|
Build succeeded (third-party-check pipeline).
|
|
Merging as |
|
This feature is currently not valid because the pull request 534 is not fully implemented. |
Fixes #113
Refactor generate interface and route, add network hotplug interface
Signed-off-by: Ruidong Cao caoruidong@huawei.com