Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

api: add sandbox hotplug network #287

Merged
merged 4 commits into from
Aug 16, 2018
Merged

Conversation

caoruidong
Copy link
Member

Fixes #113
Refactor generate interface and route, add network hotplug interface

Signed-off-by: Ruidong Cao [email protected]

@caoruidong caoruidong force-pushed the hotplug branch 7 times, most recently from 996402e to 1535dda Compare May 8, 2018 05:55
@codecov
Copy link

codecov bot commented May 8, 2018

Codecov Report

Merging #287 into master will decrease coverage by 0.05%.
The diff coverage is 53.26%.

@@            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

@caoruidong caoruidong force-pushed the hotplug branch 13 times, most recently from c26214a to 82dd787 Compare May 13, 2018 13:35
@caoruidong caoruidong changed the title [WIP] API: add network hotplug api: add sanbox hotplug network May 14, 2018
@egernst
Copy link
Member

egernst commented May 15, 2018

@sboeuf - can you PTAL?

@egernst egernst requested a review from sboeuf May 15, 2018 04:37
@caoruidong caoruidong force-pushed the hotplug branch 3 times, most recently from 3b02c60 to 685aa44 Compare May 15, 2018 07:52
@bergwolf
Copy link
Member

Generally looks good. Can you please add cli side change so that these APIs are actually used and tested?

@@ -194,4 +195,13 @@ type agent interface {
// This function should be called after hot adding vCPUs or Memory.
// 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.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/hotPlugNetwork/plugRoutes

// 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.
Copy link

@devimc devimc May 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/hotPlugNetwork/hotPullNetwork

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx. Fixed

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 <[email protected]>
Add sandbox hotplug network API to meet design

Signed-off-by: Ruidong Cao <[email protected]>
Add update and list commands for notwork hotplug

Signed-off-by: Ruidong Cao <[email protected]>
@opendev-zuul
Copy link

opendev-zuul bot commented Aug 16, 2018

Build succeeded (third-party-check pipeline).

@kata-containers kata-containers deleted a comment from opendev-zuul bot Aug 16, 2018
@WeiZhang555
Copy link
Member

LGTM

I'd prefer to keep the network monitor solution a very specific one, only in case we want to detect network changes. But this monitoring process increases the footprint of the whole system, and might not be reliable for now in case of crash/restart. What I would suggest is that we can configure from configuration.toml if we want the network monitoring process or not. Based on this, we would either start the monitoring process before the OCI hooks from the CLI, or we would simply scan the netns from the CLI.
Does that make sense ?

I think this could make sense :-) @sboeuf

add UTs for network hotplug related fuctions

Fixes kata-containers#113

Signed-off-by: Ruidong Cao <[email protected]>
@katacontainersbot
Copy link
Contributor

PSS Measurement:
Qemu: 169758 KB
Proxy: 4247 KB
Shim: 8959 KB

Memory inside container:
Total Memory: 2043464 KB
Free Memory: 2003760 KB

@caoruidong
Copy link
Member Author

@sboeuf I add some tests. Please check if this is right

@sboeuf
Copy link

sboeuf commented Aug 16, 2018

@caoruidong thank you very much!
I'll review and merge if everything's good :)

@opendev-zuul
Copy link

opendev-zuul bot commented Aug 16, 2018

Build succeeded (third-party-check pipeline).

Copy link

@sboeuf sboeuf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sboeuf
Copy link

sboeuf commented Aug 16, 2018

Merging as -0.06% coverage is clearly negligible here.

@sboeuf sboeuf merged commit 26f3107 into kata-containers:master Aug 16, 2018
@caoruidong caoruidong deleted the hotplug branch August 17, 2018 02:23
@CaesarLXL
Copy link

This feature is currently not valid because the pull request 534 is not fully implemented.

@sboeuf sboeuf added the feature New functionality label Sep 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.