cli: implement update command#270
Conversation
1e0059a to
0d15561
Compare
|
@kata-containers/runtime please take a look |
4267c9f to
bee9560
Compare
virtcontainers/api.go
Outdated
| } | ||
|
|
||
| // Fetch the container. | ||
| c, err := p.findContainer(containerID) |
There was a problem hiding this comment.
Please make UpdateContainer part of the VCSandbox interface and implement UpdateContainer() here as a wrapper of it. You can move p.findContainer() and c.update() to sandbox.UpdateContainer().
| }, | ||
| "blockIO": { | ||
| "weight": 0 | ||
| } |
There was a problem hiding this comment.
I don't think so, it's base on runC implementation
There was a problem hiding this comment.
It's a bug in runc? --pids-limit and --l3-cache-schema were added after the initial runc update implementation and it seems the developer forgot to add them to the resources file.
There was a problem hiding this comment.
There was a problem hiding this comment.
We do read pid limit at https://github.com/kata-containers/runtime/pull/270/files#diff-1cc31db47bce8b7af5fda9d984c048e6R162. So I think we should at least add pids here. l3-cache-schema may be left out since it is not part of specs.LinuxResources anyway.
Codecov Report
@@ Coverage Diff @@
## master #270 +/- ##
==========================================
+ Coverage 64.4% 65.71% +1.31%
==========================================
Files 85 76 -9
Lines 8214 8197 -17
==========================================
+ Hits 5290 5387 +97
+ Misses 2361 2228 -133
- Partials 563 582 +19
Continue to review full report at Codecov.
|
|
@bergwolf changes applied, thanks |
| packages = ["pkg/cover"] | ||
| revision = "b0c4c6d0583aae4e3b5d12b6ec47767670548cc4" | ||
|
|
||
| [[projects]] |
virtcontainers/hyperstart_agent.go
Outdated
| } | ||
|
|
||
| func (h *hyper) updateContainer(sandbox *Sandbox, c Container, resources specs.LinuxResources) error { | ||
| // cc-agent does not support update |
There was a problem hiding this comment.
I think this should be hyperstart_agent ?
There was a problem hiding this comment.
I think cc-agent is correct, see https://github.com/kata-containers/runtime/blob/master/virtcontainers/hyperstart_agent.go#L800-L808
There was a problem hiding this comment.
Hmmm, so weird, this file is written for hyperstart agent but the comment is saying cc-agent.
I'm confused a bit, is this correct? @bergwolf
There was a problem hiding this comment.
Oh, I believe this is a typo now. Check: https://github.com/kata-containers/runtime/pull/259/files#diff-d4339baeea8e93444b3ddc3e97b53c87R806
It's already been fixed in #259 now
| StatusContainer(sandboxID, containerID string) (ContainerStatus, error) | ||
| StopContainer(sandboxID, containerID string) (VCContainer, error) | ||
| ProcessListContainer(sandboxID, containerID string, options ProcessListOptions) (ProcessList, error) | ||
| UpdateContainer(sandboxID, containerID string, resources specs.LinuxResources) error |
There was a problem hiding this comment.
Why do we need this API? I think sandbox.UpdateContainer is enough for us.
There was a problem hiding this comment.
It's OK for now. I think we have lots of exported functions just used for test, hope we can find a way to remove them and keep the test cases at the same time later.
It's another topic though. This part looks good for now.
|
@egernst changes applied, thanks |
egernst
left a comment
There was a problem hiding this comment.
Looks good to me, thanks @devimc.
@WeiZhang555 - can you please take a look @ the update and merge if you are okay with the changes?
|
Codes LGTM. Only a typo left s/cc-agent/hyperstart-agent/ So anyone please feel free to merge this after the typo is fixed. |
|
@WeiZhang555 changes applied, thanks |
|
@devimc please rebase and lets move forward to merge after... |
go-units package is used to convert integers to memory units, for example 1024 -> 1G Signed-off-by: Julio Montes <julio.montes@intel.com>
Update command is used to update container's resources at run time. All constraints are applied inside the VM to each container cgroup. By now only CPU constraints are fully supported, vCPU are hot added or removed depending of the new constraint. fixes kata-containers#189 Signed-off-by: Julio Montes <julio.montes@intel.com>
This new version of kata-agent brings support for updating resources and cpuset cgroups Shortlog: 28cf91a grpc: implement update command d96b8e1 grpc: update cpuset cgroup 4bcacdc network: Don't remove network routes or DNS when destroying sandbox 1f5cf20 network: Don't store the network info as pointers if slices used 8f828bb uevent: Fix netlink error while assigning pid in netlink client 093f61b agent: add grpc tracer UT 33bd601 agent: add server interceptor to log grpc requests 134d5d5 test: add start/stop grpc server UT 7e94246 agent: track grpc server 9fb8024 UT: add tests for channel bea6183 agent: wait serial channel to be ready before reading f8c8c4c agent: accept grpc connections multiple times Signed-off-by: Julio Montes <julio.montes@intel.com>
Convert all non-string types into strings prior to logging to avoid attempting to display non-string types with the `%q` format verb. Fixes kata-containers#270. Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
Update command is used to update container's resources at run time.
All constraints are applied inside the VM to each container cgroup.
By now only CPU constraints are fully supported, vCPU are hot added
or removed depending of the new constraint.
fixes #189
Signed-off-by: Julio Montes julio.montes@intel.com