Commit Graph

1485 Commits

Author SHA1 Message Date
Julio Montes
d99693a564
Merge pull request #1518 from lifupan/fixtop
virtcontainers: prepend a kata specific string to host cgroups path
2019-04-12 08:58:38 -05:00
Julio Montes
e15f3e4938
Merge pull request #1337 from jongwu/bypass
Factory: enable template feature for arm64
2019-04-12 07:03:48 -05:00
Peng Tao
f5125421d0 sandbox: return ErrNoSuchContainer when failing to find a container
So that caller can determine that it is ENOENT-alike error.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2019-04-12 03:57:07 -07:00
Peng Tao
8215a3ce9a shimv2: convert vc errors to grpc errors
containerd checks for the grpc error code to determine
correct recover action upon grpc errors. We need to provide
them properly.

Unfortunately ttrpc doesn't support grpc interceptor so we have
to modify every service function for it.

Fixes: #1527

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2019-04-12 03:57:01 -07:00
Peng Tao
cf90751638 vc: export vc error types
So that shimv2 can convert it into grpc errors.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2019-04-12 02:01:02 -07:00
Peng Tao
9040f6a8cd ut: fix UT failure due to incorrect cleanup
cleanup() actually removes all things under testdir and
causes UT failures.

=== RUN   TestCreateMockSandbox
ERRO[0000] Create new sandbox failed                     error="QEMU path (/tmp/vc-tmp-007004370/hypervisor) does not exist" sandbox=7f49d00d-1995-4156-8c79-5f5ab24ce138 sandboxid=7f49d00d-1995-4156-8c79-5f5ab24ce138 source=virtcontainers subsystem=sandbox
exit status 1

Fixes: #1525

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2019-04-11 23:33:57 -07:00
Peng Tao
a0f49a91e4 ut: fix UT failure due to non-root
We should allow UT to run without root.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2019-04-11 23:21:27 -07:00
lifupan
1a1f93bc78 virtcontainers: add a kata specific prefix to host cgroups path
prepend a kata specific string to oci cgroup path to
form a different cgroup path, thus cAdvisor couldn't
find kata containers cgroup path on host to prevent it
from grabbing the stats data.

Fixes:#1488

Signed-off-by: lifupan <lifupan@gmail.com>
2019-04-12 10:30:19 +08:00
Sascha Grunert
e26f342e00
build: Update golang to 1.12.3
This commit bumps the golang version to remove the go modules hash
mismatch between 1.11 and 1.12.

Fixes: #1520

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2019-04-11 15:41:41 +02:00
Fupan Li
da08b3afc9
Merge pull request #1509 from bergwolf/kata-check
cli: fix kata-check test
2019-04-11 20:13:24 +08:00
Julio Montes
c08976e1a2
Merge pull request #1494 from lifupan/fixstop
shimv2: fix the issue of stop container failed
2019-04-11 07:10:49 -05:00
Julio Montes
dd5c6aa757
Merge pull request #1507 from bergwolf/state
split sandbox/container state
2019-04-11 07:09:23 -05:00
lifupan
f7223c6f00 shimv2: fix the issue of stop container failed
There is no need to send another SIGKILL signal following
SIGTERM signal, otherwise, sending the SIGKILL signal would
get failed since the container process would has been terminated
by the previous SIGTERM signal.

Fixes:#1493

Signed-off-by: lifupan <lifupan@gmail.com>
2019-04-11 18:01:23 +08:00
Fupan Li
6d81e44670
Merge pull request #1437 from teawater/vmcache_grpc
Make factory can control VMCache server
2019-04-11 14:01:47 +08:00
Alex Price
76c4639ada storage: create k8s emptyDir inside VM
This introduces a new storage type: local. Local storage type will
tell the kata-agent to create an empty directory in the sandbox
directory within the VM.

K8s host emptyDirs will then use the local storage type and mount it
inside each container. By doing this, we utilise the storage medium
that the sandbox uses. In most cases this will be 9p.

If the VM is using device mapper for container storage, the containers
will benefit from the better performance of device mapper for
host emptyDir.

Fixes #1472

Signed-off-by: Alex Price <aprice@atlassian.com>
2019-04-11 09:01:58 +10:00
Julio Montes
6ab15ab890
Merge pull request #1511 from bergwolf/spawner
vc: remove spawner
2019-04-10 08:33:10 -05:00
Julio Montes
baa30b4fd0
Merge pull request #1460 from alicefr/golangci-lint
s390x: fix golangci-lint complains
2019-04-10 07:53:41 -05:00
Peng Tao
40f2a03c85
Merge pull request #1491 from teawater/factory_leak
qemu: Remove the storage directories if qemu get from the factory
2019-04-10 20:14:17 +08:00
Jianyong Wu
98687a3463 Template: enable template for arm64
Now, template feature can't work on arm64. When using bypass-shared-memory
cap to saving sandbox as a template, new sandbox cloning from the template
will fail. From initial investigation, it maybe a qemu issue. Further
research should be done.
To enable template on arm64, this patch adds a switch to offer the capability
to open or close the bypass-shared-memory cap.
While closing bypass-shared-memory cap, saving vm will occupy more space
and consume more time. So increase 300M for mount size and bump the time
waiting for migration to 10 seconds.

Fixes: #1336

Signed-off-by: Jianyong Wu  <jianyong.wu@arm.com>
2019-04-10 05:30:59 -04:00
Hui Zhu
d63b7c92a8
Merge pull request #1496 from lifupan/fixproxy
katautils: fix the issue of missing proxy debug config
2019-04-10 13:59:33 +08:00
Hui Zhu
16fe8553af qemu: Remove the storage directories if qemu get from the factory
Store related in directory /var/lib/vc/sbs and /run/vc/sbs if
vm template is enabled.
The cause is NewVM and NewVMFromGrpc will create vcStore with
VM's ID and set it as store of hypervisor if the factory is enabled.

This commit record the VM's ID to HypervisorConfig.VMid and remove
directories in qemu.cleanupVM to handle the issue.

Fixes: #1452

Signed-off-by: Hui Zhu <teawater@hyper.sh>
2019-04-10 11:11:45 +08:00
Hui Zhu
ace81155a4 factory: Make factory status can show status of VMCache server
This commit adds a new gRPC function Status to CacheService.  VMCache
server will reply the status of VMCache server.
Factory destroy will call gRPC Status to get the status of VMCache
server and output it when VMCache is enabled.

Fixes: #1395

Signed-off-by: Hui Zhu <teawater@hyper.sh>
2019-04-10 11:03:14 +08:00
Hui Zhu
f639787e02 factory: Make factory destroy can stop VMCache server
VMCache server just can be stopped by ctrl-c without current commit.

This commit adds a new gRPC function Quit to CacheService.  VMCache
server will stop by itself after 1 second when Quit is called.
Factory destroy will call gRPC Quit when VMCache is enabled.

Fixes: #1395

Signed-off-by: Hui Zhu <teawater@hyper.sh>
2019-04-10 11:03:14 +08:00
Hui Zhu
3343e9f7b3
Merge pull request #1498 from devimc/topic/vendor/govmm
vendor: update govmm
2019-04-10 10:22:33 +08:00
Peng Tao
9ac68310f7 cli: fix kata-check test
We don't really require nested nor unrestricted_guest to run. And there
is no point validating host cpu properties in UT.

Fixes: #1508

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2019-04-09 19:00:38 -07:00
Peng Tao
a63013de5c vc: remove spawner
Dead code that is never used.

Fixes: #1510

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2019-04-09 19:00:18 -07:00
Peng Tao
c414599635 types: remove pid from sandbox state
No longer needed.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2019-04-09 18:59:56 -07:00
Peng Tao
03ee25d4ef agent: treat container as shared pidns whenever it has pidns path
Current approach cannot work for shimv2 as there is no kata-shim thus
sandbox.state.pid is always -1. Let's just simplify things by always
making a container share pidns if it has a pidns path.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2019-04-09 18:59:56 -07:00
Peng Tao
616f26cfe5 types: split sandbox and container state
Since they do not really share many of the fields.

Fixes: #1434

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2019-04-09 18:59:56 -07:00
GabyCT
4265509e9c
Merge pull request #1499 from devimc/topic/virtcontainers/onlySupportedNs
virtcontainers: Use only supported namespaces
2019-04-09 13:26:10 -05:00
Julio Montes
11a9005aca
Merge pull request #1479 from chavafg/topic/update-crio-url
cri-o: Update repository URLs
2019-04-09 10:03:38 -05:00
lifupan
8041fc9314 katautils: fix the issue of missing proxy debug config
When used builtin proxy, it's better to config the proxy
debug based on debug setting of runtime in kata configuration.

Fixes:#1495

Signed-off-by: lifupan <lifupan@gmail.com>
2019-04-09 09:17:28 -04:00
Julio Montes
bb347acc56 vendor: update govmm
Bring QMP fixes and vhost-user support

Shortlog:
694a7b1 qemu/qmp: re-implement mainLoop
5712b11 qemu/qmp: fix readLoop() reuse scanner.Bytes() underlying array problem
3c84b1d govmm: add VhostUserFS vhost-user device type

fixes #1497

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-04-09 07:38:16 -05:00
Julio Montes
0b430dc71f virtcontainers: Use only supported namespaces
Depending of the linux versions some namespaces are supported or not.
To avoid failures running containers and unit tests in old linux kernels,
only the supported namespaces should be used.

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

fixes #228

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-04-09 07:36:50 -05:00
Salvador Fuentes
23c00ffa03
Merge pull request #1500 from chavafg/topic/travis-xenial
travis: use xenial
2019-04-09 07:35:09 -05:00
Salvador Fuentes
e31b040085 cri-o: Update repository URL
cri-o was moved to a new organization. The new URL
of the project is https://github.com/cri-o/cri-o
Update URL references.

Fixes: #1478.

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

Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
2019-04-09 07:32:52 -05:00
Salvador Fuentes
ea1df84727 travis: use xenial
We have hit an issue using trusty in travis and go 1.11.7
the issue is fixed using xenial.

Fixes: #1492.

Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
2019-04-08 13:58:17 -05:00
Julio Montes
34e2064b39
Merge pull request #1152 from Pennyzct/memory_hotplug
runtime: support memory hotplug via probe interface on aarch64
2019-04-08 08:43:03 -05:00
Julio Montes
c884f65a26
Merge pull request #1449 from alicefr/thread_id
s390x: not set socketID and threadID
2019-04-08 08:01:40 -05:00
Fupan Li
303f126e5b
Merge pull request #1441 from Ace-Tang/fix-panic
config: fix panic in type assertion
2019-04-08 17:01:17 +08:00
Graham Whaley
26ca2a3429
Merge pull request #1414 from teawater/yq_version
Fix yq issues
2019-04-08 09:47:03 +01:00
Eric Ernst
fef124921c
Merge pull request #1469 from egernst/1.7.0-alpha0-branch-bump
# Kata Containers 1.7.0-alpha0
2019-04-05 14:04:02 -07:00
Eric Ernst
f59e367706 release: Kata Containers 1.7.0-alpha0
- doc: update architecture.md link
- VMCache: check if vm_cache_endpoint file exists before VMCache server…
- vsock: Pass info about vsock being used or not to the agent.
- qemu: fix qemu leak when failed to start container
- hypervisor: return cpu->threadID mapping
- tests: do cleanUp() always in the end
- cgroups: remove duplicate fields from state
- shimv2: optionally plug rootfs block storage instead of mounting it
- linter: remove deadcode linter check for generic item
- virtcontainers: firecracker: disable ACPI
- config: validate proxy path
- lint: Change go linter from gometalinter to golangci-lint
- Factory: Fix fake return value issue on creating template
- config: Add config flag "experimental"
- Add more build targets
- Update collect script for dax nvdimm images
- Allow data collection to be hidden
- config: Make VMCache can work with vsock
- ci: check curl before use it
- virtcontainers: improve security and mount the rootfs as read-only fs
- refactor: improve readability of `bumpAttachCount`

57b103a vsock: Pass info about vsock being used or not to the agent.
fb64a3e doc: update architecture.md link
b6f382e VMCache: check if vm_cache_endpoint file exists before VMCache server runs
dd6d1e4 fc: return vcpu thread info properly
6fda03e hypervisor: make getThreadIDs return vcpu to threadid mapping
ad697cc vendor: add prometheus/procfs dependency
0e2be42 vendor: fix containerd/cgroups dependency
52c66d2 shimv2: plugin the block backed rootfs directly instead of mount it
628ea46 virtcontainers: change container's rootfs from string to mount alike struct
c0aedeb virtcontainers: firecracker: disable ACPI
096fa04 qemu: fix qemu leak when failed to start container
2e5194e linter: remove deadcode linter check for generic item
dca7a6f config: validate proxy path
dd6e8eb tests: do cleanUp() always in the end
ad7d9b7 cgroups: remove duplicate fields from state
f442876 lint: Update go linter from gometalinter to golangci-lint.
5d761ce scripts: Handle images with a DAX/NVDIMM header
bdf6b2d scripts: Handle missing partitions in collect script
ad228e3 build: Add missing targets to show-usage
e6a7091 build: Allow runtime to be built+installed without shim
206ffc6 build: Don't build the runtime when building shim binary
639e827 config: Make VMCache can work with vsock
aec0d26 ci: check curl before use it
9b73900 katautils: mask systemd-random-seed
6498466 virtcontainers: improve security and mount the rootfs as read-only fs
26a9b72 refactor: improve readability of `bumpAttachCount`
5a271f0 scripts: Allow data collection script output to be hidden
4f34a54 scripts: Refactor collect script
eadf977 Factory: Fix fake return value issue on creating template
da80c70 config: enhance Feature structure
111774c config: add docs for experimental
050f03b config: Add config flag "experimental"

Signed-off-by: Eric Ernst <eric.ernst@intel.com>
2019-04-05 09:24:55 -07:00
Eric Ernst
d362102c6a
Merge pull request #1484 from jcvenegas/master-travis-fix
ci: travis
2019-04-05 08:52:39 -07:00
Jose Carlos Venegas Munoz
f61cbed15a ci: travis
Use TRAVIS branch to checkout test repository

Fixes: #1481

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2019-04-04 13:19:48 -06:00
Penny Zheng
b50292a215 arm64: dep ensure to keep track of the revisons in kata agent
We need to change the constraints of kata agent into the memory-hotplug
related commit, to keep track of the revisons in kata agent.

Fixes: #1149

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2019-04-04 17:03:20 +08:00
Penny Zheng
3bfcdf755a agent: add interface memHotplugByProbe
we need to notify guest kernel about memory hot-added event via probe interface.
hot-added memory deivce should be sliced into the size of memory section.

Fixes: #1149

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2019-04-04 17:03:20 +08:00
Penny Zheng
47670fcf73 memoryDevice: reconstruct memoryDevice
If kata-runtime supports memory hotplug via probe interface, we need to reconstruct
memoryDevice to store relevant status, which are addr and probe. addr specifies the
physical address of the memory device, and probe determines it is hotplugged via
acpi-driven or probe interface.

Fixes: #1149

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2019-04-04 17:03:20 +08:00
Penny Zheng
30a6a7de39 agent: acquire memory hotplug probe info via GetGuestDetails
In order to support memory hotplug via probe interface in kata-runtime,
firstly, we need to verify whether guest kernel is capable of that.

Fixes: #1149

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2019-04-04 17:03:19 +08:00
Eric Ernst
722aa3f2d3
Merge pull request #1456 from gabibeyer/updatedocs
doc: update architecture.md link
2019-04-02 20:48:16 -07:00