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

virtcontainers: add support for VM templating/caching #52

Closed
egernst opened this issue Mar 13, 2018 · 6 comments
Closed

virtcontainers: add support for VM templating/caching #52

egernst opened this issue Mar 13, 2018 · 6 comments
Assignees

Comments

@egernst
Copy link
Member

egernst commented Mar 13, 2018

need to add support for VM caching/cloning

Let's use this issue to discuss the design of this feature. This issue can be closed once a design document is complete and the feature is merged.

@egernst
Copy link
Member Author

egernst commented Mar 13, 2018

@bergwolf
Copy link
Member

Related: kata-containers/documentation#27 on section VM Factory plugin.

The VM templating support can be achieved by implementing VM Factory which controls how a new VM is created. Then we add different plugins to support different VM creation methods.

@egernst
Copy link
Member Author

egernst commented Apr 2, 2018

@laijs - are you planning to put together design/impl proposal for this? Thanks for presenting in arch forum today.

@bergwolf bergwolf changed the title virtcontainers: add support for VM templating virtcontainers: add support for VM templating/caching Apr 19, 2018
bergwolf referenced this issue in bergwolf/kata-runtime May 14, 2018
direct factory just creates the vm directly.
cache factory uses the base factory (either direct or template) to
create the vm.

Fixes: #52

Signed-off-by: Peng Tao <[email protected]>
bergwolf referenced this issue in bergwolf/kata-runtime Jun 8, 2018
direct factory just creates the vm directly.
cache factory uses the base factory (either direct or template) to
create the vm.

Fixes: #52

Signed-off-by: Peng Tao <[email protected]>
bergwolf referenced this issue in bergwolf/kata-runtime Jul 5, 2018
I got following warning after upgrading dep tool:

Warning: the following project(s) have [[constraint]] stanzas in Gopkg.toml:

  ✗  github.com/hashicorp/yamux

However, these projects are not direct dependencies of the current project:
they are not imported in any .go files, nor are they in the 'required' list in
Gopkg.toml. Dep only applies [[constraint]] rules to direct dependencies, so
these rules will have no effect.

Either import/require packages from these projects so that they become direct
dependencies, or convert each [[constraint]] to an [[override]] to enforce rules
on these projects, if they happen to be transitive dependencies,

So let's convert constraint to override over yamux. In the meanwhile,
update the yamux vendor. Full commit list:

4c2fe0d (origin/b-consul-3040) Dont output keepalive error when the session is closed
f21aae5 Make sure to drain the timer channel on defer, and a clarifying comment
601ccd8 Make receive window update logic a bit cleaner
02d320c Uses timer pool in sendNoWait, like in waitForSendErr
cf433c5 window update unit test for partial read; benchmark large buffer
ca8dfd0 improve memory utilization in receive buffer, fix flow control
683f491 Fix race around read and write deadlines in Stream (#52)
40b86b2 Add public session CloseChan method (#44)

Note that commit 4c2fe0d might also help kata-containers/agent/issues/231.

Signed-off-by: Peng Tao <[email protected]>
@devimc
Copy link

devimc commented Sep 19, 2018

@bergwolf can we close this issue ?

@bergwolf
Copy link
Member

Yes

@teawater teawater reopened this Jan 23, 2019
@teawater teawater self-assigned this Jan 23, 2019
@teawater
Copy link
Member

Reopen it for vm cache

teawater added a commit to teawater/runtime that referenced this issue Jan 23, 2019
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: kata-containers#52

Signed-off-by: Hui Zhu <[email protected]>
teawater added a commit to teawater/runtime that referenced this issue Jan 24, 2019
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: kata-containers#52

Signed-off-by: Hui Zhu <[email protected]>
teawater added a commit to teawater/runtime that referenced this issue Jan 24, 2019
VM cache need github.com/golang/protobuf/ptypes/empty/.

Fixes: kata-containers#52

Signed-off-by: Hui Zhu <[email protected]>
teawater added a commit to teawater/runtime that referenced this issue Jan 25, 2019
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: kata-containers#52

Signed-off-by: Hui Zhu <[email protected]>
teawater added a commit to teawater/runtime that referenced this issue Jan 25, 2019
VM cache need github.com/golang/protobuf/ptypes/empty/.

Fixes: kata-containers#52

Signed-off-by: Hui Zhu <[email protected]>
teawater added a commit to teawater/runtime that referenced this issue Jan 25, 2019
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: kata-containers#52

Signed-off-by: Hui Zhu <[email protected]>
teawater added a commit to teawater/runtime that referenced this issue Jan 25, 2019
VM cache need github.com/golang/protobuf/ptypes/empty/.

Fixes: kata-containers#52

Signed-off-by: Hui Zhu <[email protected]>
teawater added a commit to teawater/runtime that referenced this issue Jan 25, 2019
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: kata-containers#52

Signed-off-by: Hui Zhu <[email protected]>
teawater added a commit to teawater/runtime that referenced this issue Jan 25, 2019
VM cache need github.com/golang/protobuf/ptypes/empty/.

Fixes: kata-containers#52

Signed-off-by: Hui Zhu <[email protected]>
teawater added a commit to teawater/runtime that referenced this issue Jan 25, 2019
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: kata-containers#52

Signed-off-by: Hui Zhu <[email protected]>
teawater added a commit to teawater/runtime that referenced this issue Jan 25, 2019
VM cache need github.com/golang/protobuf/ptypes/empty/.

Fixes: kata-containers#52

Signed-off-by: Hui Zhu <[email protected]>
teawater added a commit to teawater/runtime that referenced this issue Jan 29, 2019
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: kata-containers#52

Signed-off-by: Hui Zhu <[email protected]>
teawater added a commit to teawater/runtime that referenced this issue Jan 29, 2019
VM cache need github.com/golang/protobuf/ptypes/empty/.

Fixes: kata-containers#52

Signed-off-by: Hui Zhu <[email protected]>
teawater added a commit to teawater/runtime that referenced this issue Jan 30, 2019
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: kata-containers#52

Signed-off-by: Hui Zhu <[email protected]>
teawater added a commit to teawater/runtime that referenced this issue Jan 30, 2019
VM cache need github.com/golang/protobuf/ptypes/empty/.

Fixes: kata-containers#52

Signed-off-by: Hui Zhu <[email protected]>
teawater added a commit to teawater/runtime that referenced this issue Jan 30, 2019
VM cache helps speeding up new container creation.
To use it,  need set option "enable_vm_cache" to true and use
"kata-vmcache" 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: kata-containers#52

Signed-off-by: Hui Zhu <[email protected]>
teawater added a commit to teawater/runtime that referenced this issue Jan 30, 2019
VM cache need github.com/golang/protobuf/ptypes/empty/.

Fixes: kata-containers#52

Signed-off-by: Hui Zhu <[email protected]>
teawater added a commit to teawater/runtime that referenced this issue Jan 30, 2019
VM cache helps speeding up new container creation.
To use it,  need set option "enable_vm_cache" to true and use
"kata-vmcache" 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: kata-containers#52

Signed-off-by: Hui Zhu <[email protected]>
teawater added a commit to teawater/runtime that referenced this issue Jan 30, 2019
VM cache need github.com/golang/protobuf/ptypes/empty/.

Fixes: kata-containers#52

Signed-off-by: Hui Zhu <[email protected]>
teawater added a commit to teawater/runtime that referenced this issue Feb 10, 2019
VM cache helps speeding up new container creation.
To use it,  need set option "enable_vm_cache" to true and use
"kata-vmcache" 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: kata-containers#52

Signed-off-by: Hui Zhu <[email protected]>
teawater added a commit to teawater/runtime that referenced this issue Feb 10, 2019
VM cache need github.com/golang/protobuf/ptypes/empty/.

Fixes: kata-containers#52

Signed-off-by: Hui Zhu <[email protected]>
teawater added a commit to teawater/runtime that referenced this issue Feb 10, 2019
VM cache helps speeding up new container creation.
To use it,  need set option "enable_vm_cache" to true and use
"kata-vmcache" 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: kata-containers#52

Signed-off-by: Hui Zhu <[email protected]>
teawater added a commit to teawater/runtime that referenced this issue Feb 10, 2019
VM cache need github.com/golang/protobuf/ptypes/empty/.

Fixes: kata-containers#52

Signed-off-by: Hui Zhu <[email protected]>
teawater added a commit to teawater/runtime that referenced this issue Feb 10, 2019
VM cache helps speeding up new container creation.
To use it,  need set option "enable_vm_cache" to true and use
"kata-vmcache" 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: kata-containers#52

Signed-off-by: Hui Zhu <[email protected]>
teawater added a commit to teawater/runtime that referenced this issue Feb 10, 2019
VM cache need github.com/golang/protobuf/ptypes/empty/.

Fixes: kata-containers#52

Signed-off-by: Hui Zhu <[email protected]>
teawater added a commit to teawater/runtime that referenced this issue Feb 12, 2019
VM cache need github.com/golang/protobuf/ptypes/empty/.

Fixes: kata-containers#52

Signed-off-by: Hui Zhu <[email protected]>
teawater added a commit to teawater/runtime that referenced this issue Feb 12, 2019
VM cache helps speeding up new container creation.
To use it,  need set option "enable_vm_cache" to true and use
"kata-vmcache" 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: kata-containers#52

Signed-off-by: Hui Zhu <[email protected]>
teawater added a commit to teawater/runtime that referenced this issue Feb 12, 2019
VM cache helps speeding up new container creation.
To use it,  need set option "enable_vm_cache" to true and use
"kata-vmcache" 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: kata-containers#52

Signed-off-by: Hui Zhu <[email protected]>
teawater added a commit to teawater/runtime that referenced this issue Feb 12, 2019
VM cache helps speeding up new container creation.
To use it,  need set option "enable_vm_cache" to true and use
"kata-vmcache" 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: kata-containers#52

Signed-off-by: Hui Zhu <[email protected]>
teawater added a commit to teawater/runtime that referenced this issue Feb 22, 2019
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.  When VMCache function is enabled,
kata-runtime will request VM from factory grpccache.

VMCache has two options.
vm_cache_number 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]>
teawater added a commit to teawater/runtime that referenced this issue Feb 22, 2019
When VMCache is enabled, factory init will run as a VMcache server.

Fixes: kata-containers#52

Signed-off-by: Hui Zhu <[email protected]>
teawater added a commit to teawater/runtime that referenced this issue Feb 22, 2019
When VMCache is enabled, factory init will run as a VMcache server.

Fixes: kata-containers#52

Signed-off-by: Hui Zhu <[email protected]>
teawater added a commit to teawater/runtime that referenced this issue Feb 23, 2019
VMCache code use github.com/gogo/protobuf.

Fixes: kata-containers#52

Signed-off-by: Hui Zhu <[email protected]>
teawater added a commit to teawater/runtime that referenced this issue Feb 25, 2019
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 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]>
teawater added a commit to teawater/runtime that referenced this issue Feb 25, 2019
When VMCache is enabled, factory init will run as a VMcache server.

Fixes: kata-containers#52

Signed-off-by: Hui Zhu <[email protected]>
teawater added a commit to teawater/runtime that referenced this issue Feb 25, 2019
VMCache code use github.com/gogo/protobuf.

Fixes: kata-containers#52

Signed-off-by: Hui Zhu <[email protected]>
teawater added a commit to teawater/runtime that referenced this issue Mar 1, 2019
When VMCache is enabled, factory init will run as a VMcache server.

Fixes: kata-containers#52

Signed-off-by: Hui Zhu <[email protected]>
teawater added a commit to teawater/runtime that referenced this issue Mar 1, 2019
VMCache code use github.com/gogo/protobuf.

Fixes: kata-containers#52

Signed-off-by: Hui Zhu <[email protected]>
teawater added a commit to teawater/runtime that referenced this issue Mar 8, 2019
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]>
teawater added a commit to teawater/runtime that referenced this issue Mar 8, 2019
When VMCache is enabled, factory init will run as a VMcache server.

Fixes: kata-containers#52

Signed-off-by: Hui Zhu <[email protected]>
teawater added a commit to teawater/runtime that referenced this issue Mar 8, 2019
VMCache code use github.com/gogo/protobuf.

Fixes: kata-containers#52

Signed-off-by: Hui Zhu <[email protected]>
teawater added a commit to teawater/runtime that referenced this issue Mar 8, 2019
VMCache code use github.com/gogo/protobuf.

Fixes: kata-containers#52

Signed-off-by: Hui Zhu <[email protected]>
teawater added a commit to teawater/runtime that referenced this issue Mar 8, 2019
VMCache code use github.com/gogo/protobuf.

Fixes: kata-containers#52

Signed-off-by: Hui Zhu <[email protected]>
zklei pushed a commit to zklei/runtime that referenced this issue Jun 13, 2019
Full commit list:
91c5847 Add go.mod
4c2fe0d Dont output keepalive error when the session is closed
f21aae5 Make sure to drain the timer channel on defer, and a clarifying comment
601ccd8 Make receive window update logic a bit cleaner
02d320c Uses timer pool in sendNoWait, like in waitForSendErr
cf433c5 window update unit test for partial read; benchmark large buffer
ca8dfd0 improve memory utilization in receive buffer, fix flow control
683f491 Fix race around read and write deadlines in Stream (kata-containers#52)
40b86b2 Add public session CloseChan method (kata-containers#44)

Signed-off-by: Peng Tao <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants