Commit Graph

1760 Commits

Author SHA1 Message Date
James O. D. Hunt
0d6a035f95
Merge pull request #1056 from lifupan/fixVsock
katautils: check config factory/template and vsock
2018-12-19 10:39:38 +00:00
Frank Cao
07a0b163f9
Merge pull request #1049 from sameo/topic/ctx-unset
virtcontainers: Add context when creating tests sandboxes
2018-12-19 14:43:16 +08:00
fupan
e4e7c3ae54 katautils: check config template and vsock
Vsock conflicts with factory, when both of them are enabled,
kata will try to create a new vm template which is useless,
thus it's better to return an error directly to let users know
that those two config cannot be enabled at the same time.

Fixes: #1055

Signed-off-by: fupan <lifupan@gmail.com>
2018-12-19 14:12:41 +08:00
Peng Tao
b446179fa4
Merge pull request #1015 from teawater/fix_yq2
make: Add "GOPATH not set"
2018-12-19 13:16:07 +08:00
Peng Tao
ade738f7b7
Merge pull request #1052 from sboeuf/fc_fix_network
virtcontainers: network: Use multiqueue flag only when appropriate
2018-12-19 09:56:42 +08:00
Sebastien Boeuf
0f1fde498d virtcontainers: network: Use multiqueue flag only when appropriate
The multiqueue flag associated with the TUNTAP network device cannot
be used if the number of queues indicates 0. When 0, this means the
multiqueue is not supported, and we cannot use the according flag.

Fixes #1051

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2018-12-18 11:06:06 -08:00
Samuel Ortiz
f63a18deea virtcontainers: Add context when creating tests sandboxes
We can use the background context when creating test sandboxes from the
sanbox unit tests. This shuts the "trace called before context set"
erros down.

Fixes: #1048

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2018-12-18 13:22:08 +01:00
Sebastien Boeuf
5d91edd695
Merge pull request #1038 from lifupan/fixvsock
katautils: fix the issue of shimv2 boot failed with vsock enabled
2018-12-17 11:35:25 -08:00
Sebastien Boeuf
802bfa26c9 versions: Bump to kernel 4.19.10
We need to bump the kernel version from 4.14.67 to 4.19.10 in order
to follow the recent kernel config bump.

Fixes #1029

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2018-12-17 08:16:10 -08:00
Fupan Li
05be5bf1f9 shimv2: discard log before shim init log output
containerd would like to get the shim's socket
address from shimv2's stdout, thus it's better
to discard the log's output before shimv2 init
it's logger and at the same time add a hook to
log into syslog.

Fixes: #1035

Signed-off-by: Fupan Li <lifupan@gmail.com>
2018-12-17 15:39:44 +00:00
James O. D. Hunt
006d375358
Merge pull request #1040 from alicefr/doc_s390
docs: add IBM Z in the README
2018-12-17 15:25:11 +00:00
Alice Frosi
e98dee6a22 docs: drop 's in architecture names for consistency
Drop 's for the other archs to be consistent

Signed-off-by: Alice Frosi <afrosi@de.ibm.com>
2018-12-17 16:18:16 +01:00
Sebastien Boeuf
658bd82490
Merge pull request #1034 from Pennyzct/hvc
qemu-arm64: refactor 'console=hvc0,hvc1' for kata-agent debugging
2018-12-17 06:50:55 -08:00
Alice Frosi
1892102dc3 docs: add IBM Z in the README
Fixes: #1039

Signed-off-by: Alice Frosi <afrosi@de.ibm.com>
2018-12-17 12:56:25 +01:00
Fupan Li
573b73eb10 katautils: fix the issue of shimv2 boot failed with vsock enabled
shimv2 missed to enable vsock in KataAgentConfig.

Fixes: #1037

Signed-off-by: Fupan Li <lifupan@gmail.com>
2018-12-17 07:13:38 +00:00
Eric Ernst
31489976ae
Merge pull request #1028 from sboeuf/multi_queues
network: Don't assume multiple queues support by default
2018-12-16 21:23:10 -08:00
Penny Zheng
c8c564bdd6 qemu-arm64: refactor 'console=hvc0,hvc1' for kata-agent debugging
Since kata-agent is using virtio-console to output debugging info
and the console ports are available in the guest as /dev/hvc0 and
/dev/hvc1, we should swap origin console type 'console=ttyAMA0'
with 'console=hvc0,hvc1'.

Fixes: #1033

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
Signed-off-by: Wei Chen <Wei.Chen@arm.com>
2018-12-17 11:34:11 +08:00
Sebastien Boeuf
a1af1cb099 virtcontainers: network: Rely on hypervisor capabilities for multi queues
In order to properly setup the network, hence allocate or not multiple
queues, this commit makes sure that the hypervisor capabilities are
checked for this.

Fixes #1027

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2018-12-14 15:39:25 -08:00
Sebastien Boeuf
a227ab852a virtcontainers: hypervisor: Add capability regarding multiqueue support
Each hypervisor is different and supports different options regarding
the network interface it creates. In particular, the multiqueue option
is not supported by Firecracker and should not be assumed by default.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2018-12-14 15:11:44 -08:00
Sebastien Boeuf
0bcd221fad virtcontainers: network: Rename numCPUs to queues
The point of knowing the number of CPUs from the network perspective
is to determine the number of queues that can be allocated to the
network interface of the our virtual machine.

Therefore, it's more logical to name it queues from a network.go
perspective.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2018-12-14 15:08:55 -08:00
Sebastien Boeuf
2cb4bb9db7 virtcontainers: network: Reorganize endpoints interconnection
In order to prevent from future duplication of calls into the
hypervisor interface, the hypervisor is directly passed as part
of the xConnectVMNetwork() function. Because this does not apply
the disconnection case, this commit splits the former function
into two separate ones.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2018-12-14 14:50:11 -08:00
James O. D. Hunt
bcf995bfe1
Merge pull request #887 from jcvenegas/sandbox-manage-resources
virtcontainers: make sandbox manage VM resources
2018-12-14 09:21:36 +00:00
x00464843
08f1c05144 Module: fix parameter order error in cli/ps.go
Fixes: #1017
reason: when calls vci.ProcessListContainer, fix wrong parameter order

Signed-off-by: x00464843 <xueshaojia@huawei.com>
2018-12-14 09:08:54 +08:00
Jose Carlos Venegas Munoz
d4586d4bcc test: remove TestHotplugRemoveMemory
HotplugRemoveMemory require to do a qmp call, but
unit test does not start a Qemu instance.

Depends-on: github.com/kata-containers/tests#1007

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2018-12-13 16:33:35 -06:00
Jose Carlos Venegas Munoz
0d80202573 vc:sandbox: rename newcontainer to fetchcontainer.
The containers is not new but fech from an existing one.

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2018-12-13 16:33:24 -06:00
Jose Carlos Venegas Munoz
618cfbf1db vc: sandbox: Let sandbox manage VM resources.
- Container only is responsable of namespaces and cgroups
inside the VM.

- Sandbox will manage VM resources.

The resouces has to be re-calculated and updated:

- Create new Container: If a new container is created the cpus and memory
may be updated.

- Container update: The update call will change the cgroups of a container.
the sandbox would need to resize the cpus and VM depending the update.

To manage the resources from sandbox the hypervisor interaface adds two methods.

- resizeMemory().

This function will be used by the sandbox to request
increase or decrease the VM memory.

- resizeCPUs()

vcpus are requested to the hypervisor based
on the sum of all the containers in the sandbox.

The CPUs calculations use the container cgroup information all the time.

This should allow do better calculations.

For example.

2 containers in a pod.

container 1 cpus = .5
container 2 cpus = .5

Now:
Sandbox requested vcpus 1

Before:
Sandbox requested vcpus 2

When a update request is done only some atributes have
information. If cpu and quota are nil or 0 we dont update them.

If we would updated them the sandbox calculations would remove already
removed vcpus.

This commit also moves the sandbox resource update call at container.update()
just before the container cgroups information is updated.

Fixes: #833

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2018-12-13 16:33:14 -06:00
Hui Zhu
25358444ad make: Add "GOPATH not set"
Most of the projects, they can be built with "make".  After that,
"sudo make install" can install the application.
It is not work for kata-runtime because kata-runtime's make must work
with golang in the environment that default sudo cannot supply it.
But "make install" doesn't need golang.

So add "GOPATH not set" to handle the issue.

Fixes: #1008

Signed-off-by: Hui Zhu <teawater@hyper.sh>
2018-12-13 13:25:43 +08:00
fli
97fce623d5
Merge pull request #976 from bergwolf/synctime
factory: set guest time after resuming
2018-12-12 18:25:18 +08:00
Peng Tao
8444a7a99e factory: set guest time after resuming
We might have paused a guest for a long time so we need to sync
its time.

Fixes:#951
Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-12-12 12:54:16 +08:00
Peng Tao
f81370876c vendor: update agent vendor for SetGuestDateTime
Full commit list:

34b7454 grpc: sandbox: add container when is fully created.
df822eb grpc: support rlimits
87ad0a8 release: Kata Containers 1.5.0-rc1
31c6b6e grpc: add SetGuestDateTime API
4eca13b client: do cleanup after UT stop mock server
c25288a Makefile: Decide if agent will be built by seccomp tag
0aae82b release: Kata Containers 1.4.0
7b4c337 vendor: Update vendor/github.com/containerd/console
8dedf30 agent: build as Position-Independent-Executable
dc635d4 test: Add test for ipvlan routes in l3 mode
69ee60f network: Refactor to reduce cyclomatic complexity
4005c33 network: Handle default route where gateway is empty
83138df pkg: types: Add a new field type

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-12-12 12:52:40 +08:00
Peng Tao
971fb677b2
Merge pull request #1004 from lifupan/fixchildreap
shimv2: fix the error of reaping qemu process mistakenly
2018-12-12 12:31:13 +08:00
Julio Montes
976f5b2a6e
Merge pull request #990 from alicefr/s390x
s390x: add support for s390x
2018-12-11 10:57:27 -06:00
Julio Montes
32738ba59c
Merge pull request #998 from teawater/blkconfig
config: Add cache-related options for block devices
2018-12-11 07:40:06 -06:00
Alice Frosi
6f83061139 s390x: add support for s390x
The PR adds the support for s390x.

In the case of CCW devices, the vhost-user devices are not supported.
See #659. An error message is thrown if they tried to be used.

Memory hotplug is not supported on s390 yet and an error message is thrown.

The VirtioNetPCI has been changed to VirtioNet. The generalization
allows to set the VirtioNet to the correct CCW device for s390x.

Fixes: #666

Co-authored-by: Yash D Jain ydjainopensource@gmail.com
Signed-off-by: Alice Frosi <afrosi@de.ibm.com>
2018-12-11 12:32:17 +01:00
Peng Tao
8f22d672db
Merge pull request #996 from lifupan/fixFactory
virtcontainers: share the agent's client between factory's VM and san…
2018-12-11 11:29:33 +08:00
fupan
df8b7db3ae shimv2: fix the issue of reaping child mistakenly
For kata shimv2, the sub-reaper isn't needed, otherwise
it will break the cmd.Run() calling in govmmQemu.LaunchQemu().

Fixes: #939

Signed-off-by: fupan <lifupan@gmail.com>
2018-12-11 03:12:31 +00:00
Fupan Li
e4a3fd5565 vendors: upgrade the containerd vendors
kata shimv2 needs the commit of:
f05672357f,
thus upgrade it to the latest.

Signed-off-by: Fupan Li <lifupan@gmail.com>
2018-12-11 02:50:36 +00:00
Jose Carlos Venegas Munoz
4cc94b6063
Merge pull request #994 from katacontainersbot/1.5.0-rc1-branch-bump
# Kata Containers 1.5.0-rc1
2018-12-10 15:40:17 -06:00
fupan
20f2d30ab8 virtcontainers: share the agent's client between factory's VM and sandbox
When agent is configured as longLive, the VM's agent created
by factory will not close it's client once it connected, thus
the sandbox's agent cannot re-connect successfully.

Sharing the agent's client between VM's agent and sandbox
can fix this issue.

Fixes: #995

Signed-off-by: fupan <lifupan@gmail.com>
2018-12-10 18:28:08 +08:00
Hui Zhu
6024088ca0 config: Add cache-related options for block devices
Add block_device_cache_set, block_device_cache_direct
and block_device_cache_noflush.

Fixes: #997

Signed-off-by: Hui Zhu <teawater@hyper.sh>
2018-12-09 18:10:39 +08:00
Archana Shinde
a323a87b59
Merge pull request #975 from teawater/dimm
versions: refactor configuration of qemu in version.yaml
2018-12-07 10:57:21 -08:00
Archana Shinde
063d04f913
Merge pull request #992 from teawater/upv
vendor: Update govmm vendoring
2018-12-07 10:53:12 -08:00
katacontainers bot
d4104bf5ab release: Kata Containers 1.5.0-rc1
- Block: Add cache-related options for block devices
- versions: Add nemu
- Update cid vsock
- shim: Add trace config option
- vendor: Update govmm vendoring
- git: Add containerd-shim-kata-v2 to .gitignore
- virtcontainers: change uint32 to uint64 for ioctl
- virtcontainers: Return the appropriate container status
- config: Check factory config
- Implement containerd shim v2 API for Kata Containers
- ppc64le: kata-env fails due to missing vendor field
- kata-check: do not require nested vt
- kata-env: Show runtime trace setting

deb6f16 virtcontainers: update context id of vsock to uint64
f651147 block: Add cache-related options for block devices
018c8c1 vendor: Update govmm vendoring
ea74b98 shim: Add trace config option
2af240b versions: Add nemu
7093eec git: Add containerd-shim-kata-v2 to .gitignore
96ed6c5 git: Sort .gitignore entries
04ce4c0 virtcontainers: change uint32 to uint64 for ioctl
0bf29c8 config: Check factory config
fe784c1 config: Create function to check config options
70e4dc5 config: Move check code to end of LoadConfiguration
fa9b15d virtcontainers: Return the appropriate container status
02f8b29 containerd-shim-kata-v2: add building of shimv2 into Makefile
8199d10 containerd-shim-kata: add unit test cases
7951041 containerd-shim-kata-v2: add the service Stats support
5cc016c containerd-shim-kata-v2: add the service Kill support
9ee53be containerd-shim-kata-v2: add the service Resume support
8df33d3 containerd-shim-kata-v2: add the service Pause support
cd321a3 containerd-shim-kata-v2: add the service ResizePty support
47326f5 containerd-shim-kata-v2: add the service Update support
642231b containerd-shim-kata-v2: add the service Shutdown support
87f591a containerd-shim-kata-v2: add the service Connect support
ec4f27b containerd-shim-kata-v2: add the service CloseIO support
8c95b75 containerd-shim-kata-v2: add the service Pids support
709bc9a containerd-shim-kata-v2: add the service Cleanup support
a0e6456 containerd-shim-kata-v2: add the service Delete support
fd18b22 containerd-shim-kata-v2: add the service State support
fbaefc9 containerd-shim-kata-v2: add the service wait support
269c940 containerd-shim-kata-v2: add the exec service support
4c5b296 containerd-shim-kata-v2: add the start service support
72fd6e0 containerd-shim-kata-v2: add the create service support
ca58bb4 ppc64le: kata-env fails due to missing vendor field
d6c4ca5 container-shim-kata-v2: The init containerd shim v2 support
5e6cd00 containerd-shim-v2: add the shim v2 required vendors
f0cb0c7 cli: refactor to align with katautils package
9984636 kata-env: Show runtime trace setting
8cfb06f kata-check: optionally require kvm-intel unrestricted_guest
acbcde3 kata-check: do not require nested vt
ea9ecd7 kata-check: modprobe missing kernel modules

Signed-off-by: katacontainers bot <katacontainersbot@katacontainers.io>
2018-12-07 16:06:23 +00:00
Hui Zhu
617e5e4e25 vendor: Update govmm vendoring
Shortlog:

97fc343 contributors: add my name
c891f5f qmp: Add nvdimm support

Fixes #991

Signed-off-by: Hui Zhu <teawater@hyper.sh>
2018-12-07 19:10:29 +08:00
Xu Wang
408428edf4
Merge pull request #957 from teawater/cache
Block: Add cache-related options for block devices
2018-12-07 11:01:40 +08:00
Julio Montes
4d1a92adea
Merge pull request #971 from chavafg/topic/nemu
versions: Add nemu
2018-12-06 16:26:09 -06:00
Sebastien Boeuf
31b0db0892
Merge pull request #960 from alicefr/update_cid_vsock
Update cid vsock
2018-12-06 22:11:31 +00:00
James O. D. Hunt
ed6f7eb56a
Merge pull request #938 from jodh-intel/trace-shim
shim: Add trace config option
2018-12-06 11:03:44 +00:00
Alice Frosi
deb6f16d82 virtcontainers: update context id of vsock to uint64
The CID of VSock needs to be change to uint64. Otherwise that leads to
an endianess issue. For more details see
https://github.com/kata-containers/runtime/issues/947

Remove the uint64 introduced by #984

Fixes: #958

Signed-off-by: Alice Frosi <afrosi@de.ibm.com>
2018-12-06 10:13:30 +00:00
Hui Zhu
f6511471d4 block: Add cache-related options for block devices
Add block_device_cache_set, block_device_cache_direct and
block_device_cache_noflush.
They are cache-related options for block devices that are described in
https://github.com/qemu/qemu/blob/master/qapi/block-core.json.
block_device_cache_direct denotes whether use of O_DIRECT (bypass the host
page cache) is enabled.  block_device_cache_noflush denotes whether flush
requests for the device are ignored.
The json said they are supported since 2.9.
So add block_device_cache_set to control the cache options set to block
devices or not.  It will help to support the old version qemu.

Fixes: #956

Signed-off-by: Hui Zhu <teawater@hyper.sh>
2018-12-06 18:07:44 +08:00