-
Notifications
You must be signed in to change notification settings - Fork 374
VMCache: the new function that creates VMs as caches before using it #1166
Conversation
2b8d953
to
1e7bb03
Compare
e8380e3
to
151ab6d
Compare
/test |
/test |
7c9e5a5
to
13ff7e3
Compare
/test |
@teawater ping, any updates? Thx! |
/test |
@raravena80 I am fixing the test issue after Chinese new year. |
819a0b3
to
41e2688
Compare
/test |
@amshinde @jodh-intel I pushed new comments according to your comments. Please help me review it. |
48df99c
to
5b351c5
Compare
/test |
jenkins-metrics-ubuntu-16-04 failed:
This pr doesn't change the default behavior of kata-runtime. |
@teawater - ah, yes, since the 4.19 kernel update landed, the metrics will need adjusting. I had to leave it a few days to gather data so I can reset the bounds checks - let me try to update those today... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work @teawater !
return errors.New("VM cache just support kata agent") | ||
} | ||
if config.HypervisorConfig.UseVSock { | ||
return errors.New("config vsock conflicts with VM cache, please disable one of them") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does not really conflict. Need to send the guest vsock cid/port over cache server grpc. Maybe a todo in future PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cli/factory.go
Outdated
if err != nil { | ||
return nil, err | ||
} | ||
if err = os.Chmod(path, 0660); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need to be 660
? Could we use 600
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
And I opened an issue for needing CI test for vmcache in kata-containers/tests#1259
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @teawater !
/test |
jenkins-ci-ARM-ubuntu-18-04 fail:
This PR doesn't change the default behavior of kata-runtime execution. So it has nothing to do with this failure. |
@sboeuf please review the new version. Thanks. |
@teawater I will review this today! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@teawater I have one comment regarding the vendoring.
Also, the code looks fine to me, but I thought you would add some documentation. Have you created an *.md
file somewhere? Maybe the documentation
repo?
We need to make sure documentation gets merged along with this PR.
@@ -74,6 +74,10 @@ | |||
name = "github.com/firecracker-microvm/firecracker-go-sdk" | |||
revision = "961461227bddf7e40a1d690634e866c343910f86" | |||
|
|||
[[constraint]] | |||
name = "github.com/gogo/protobuf" | |||
revision = "342cbe0a04158f6dcb03ca0079991a51a4248c02" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would expect that after you add the constraint and run dep ensure -update
, you would have a modified Gopkg.lock
that also needs to be committed here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would expect that after you add the constraint and run
dep ensure -update
, you would have a modifiedGopkg.lock
that also needs to be committed here.
It is already in
Line 341 in ec6a1cc
name = "github.com/gogo/protobuf" |
because it's a sub-dependency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I get that, but I was expecting that since you're modifying the Gopkg.toml
, running dep ensure -update
would at least modify the digest of the Gopkg.lock
:
[[projects]]
digest = "1:18108594151654e9e696b27b181b953f9a90b16bf14d253dd1b397b025a1487f"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I get that, but I was expecting that since you're modifying the
Gopkg.toml
, runningdep ensure -update
would at least modify the digest of theGopkg.lock
:[[projects]] digest = "1:18108594151654e9e696b27b181b953f9a90b16bf14d253dd1b397b025a1487f"
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Add a pr kata-containers/documentation#393 for vmcache. |
Thanks for opening kata-containers/documentation#393 @teawater 👍 |
VMCache is a new function that creates VMs as caches before using it. It helps speed up new container creation. The function consists of a server and some clients communicating through Unix socket. The protocol is gRPC in protocols/cache/cache.proto. The VMCache server will create some VMs and cache them by factory cache. It will convert the VM to gRPC format and transport it when gets requestion from clients. Factory grpccache is the VMCache client. It will request gRPC format VM and convert it back to a VM. If VMCache function is enabled, kata-runtime will request VM from factory grpccache when it creates a new sandbox. VMCache has two options. vm_cache_number specifies the number of caches of VMCache: unspecified or == 0 --> VMCache is disabled > 0 --> will be set to the specified number vm_cache_endpoint specifies the address of the Unix socket. This commit just includes the core and the client of VMCache. Currently, VM cache still cannot work with VM templating and vsock. And just support qemu. Fixes: kata-containers#52 Signed-off-by: Hui Zhu <[email protected]>
When VMCache is enabled, factory init will run as a VMcache server. Fixes: kata-containers#52 Signed-off-by: Hui Zhu <[email protected]>
4e51ca5
to
39272d3
Compare
/test |
VMCache code use github.com/gogo/protobuf. Fixes: kata-containers#52 Signed-off-by: Hui Zhu <[email protected]>
/test |
VM cache helps speeding up new container creation.
To use it, need set option "enable_vm_cache" to true and use
"kata-runtime cache" command start the VM cache server that created
some VMs as VM cache. Then each kata-runtime will request VM from
VM cache server.
Currently, VM cache still cannot work with VM templating and vsock.
And just support qemu.
Fixes: #52
Signed-off-by: Hui Zhu [email protected]