Commit Graph

1233 Commits

Author SHA1 Message Date
James O. D. Hunt
ad228e3c3b build: Add missing targets to show-usage
Add a number of useful build and install targets to the `show-usage`
target which are visible when the user runs `make help`.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2019-03-21 11:30:19 +00:00
James O. D. Hunt
e6a7091981 build: Allow runtime to be built+installed without shim
Add `install-runtime` and `install-netmon` targets. This allows the
`install` target to be simplified and also allows the runtime to be
built without having to build the `containerd-shim-v2` binary which is
slow to build:

```
$ make runtime && sudo -E PATH=$PATH make install-runtime
```

Fixes #1402.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2019-03-21 11:30:12 +00:00
James O. D. Hunt
206ffc66aa build: Don't build the runtime when building shim binary
The `containerd-shim-v2` binary does not need the `kata-runtime` binary
to be built first, so remove the dependency.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2019-03-21 11:30:07 +00:00
Graham Whaley
c70ba4844f
Merge pull request #1390 from devimc/topic/roFS
virtcontainers: improve security and mount the rootfs as read-only fs
2019-03-21 09:33:04 +00:00
Sebastien Boeuf
f1ef63e5c6
Merge pull request #1394 from WeiZhang555/improve-readability
refactor: improve readability of `bumpAttachCount`
2019-03-20 08:13:45 -07:00
Julio Montes
9b73900ba6 katautils: mask systemd-random-seed
systemd-random-seed service fails if the rootfs is a read-only fs.
systemd-random-seed restores the random seed of the system at early
boot and saves it at shutdown, since kata containers are one boot machines
this service is not needed.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-03-20 09:02:20 -06:00
Julio Montes
64984667ad virtcontainers: improve security and mount the rootfs as read-only fs
Mounting the rootfs as read-only fs the binaries can't be modified.

fixes #1389

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-03-20 07:50:20 -06:00
Wei Zhang
26a9b72c34 refactor: improve readability of bumpAttachCount
Fixes #1392

Improve code readability of function `device.bumpAttachCount`

Signed-off-by: Wei Zhang <zhangwei555@huawei.com>
2019-03-20 11:38:49 +08:00
Julio Montes
8e72cf15e6
Merge pull request #1381 from alicefr/bridges_func
s390x: add bridges function
2019-03-19 10:38:38 -06:00
Julio Montes
dbc5a32b74
Merge pull request #1366 from devimc/topic/fixRelativeCgroupPath
virtcontainers: honor OCI cgroupsPath
2019-03-19 10:32:41 -06:00
Julio Montes
b39d0ced69
Merge pull request #1383 from bergwolf/1.6.0-rc2-branch-bump
# Kata Containers 1.6.0-rc2
2019-03-19 09:49:54 -06:00
Peng Tao
70d8b167e7 release: Kata Containers 1.6.0-rc2
- volumes: Handle k8s empty-dirs of "default" medium type
- versions: kernel: update to 4.19.28
- qemu: throw error when fail to get addr from bridges
- vc:qemu: Fix id calculation of memory hotplug
- s390x: 2 small test fixes
- arm64: support NVDIMM
- virtcontainers: move resource calculation to its own function
- versions: update nemu to latest release
- Add crio and containerd details to collect script
- pkg: reduce memory footprint
- Fix rootfs mount assumptions
- s390x: fix golint complain
- Network: remove Physical field in VethEndpoint
- test: add tests for sandbox creation rollback and cleanup
- VMCache: the new function that creates VMs as caches before using it
- unit test: Fix local test
- Add upstream version url regexp's to allow upto date checks
- virtcontainer: watch the qemu's console when proxy's debug enabled
- unit-test: fix undefined struct field SupportVSocks on arm64
- Makefile: Fix aarch64 fail in No GO command or GOPATH not set mode
- tracing: Fix tracing
- config: check the builtIn first when updating shim/proxy/agent
- qemu: fix devID value error
- Makefile: Change "GOPATH not set" to "No GO command"

8e2a5ea tests: Fix units tests to check empty-dir volumes backed by host-dir
47a6023 volumes: Handle k8s empty-dirs of "default" medium type
4e81522 vc:qemu: Fix id calculation of memory hotplug
502fdab test: add test for addDeviceToBridge
0061e16 virtcontainers: move resource calculation to its own function
7504d9e unit-test: add TestSandboxUpdateResources
f009a53 versions: update nemu to latest release
f2a506a scripts: Add containerd details to collect script
7266d31 scripts: Log crio config file in collect script
30f9776 scripts: Create separate section for crio in collect script
ae08ea3 scripts: Add helper function to collect script
ae4d8b4 versions: kernel: update to 4.19.28
c7ace4b qemu: throw error when fail to get addr from bridges
2456ac5 pkg: reduce memory footprint
df9a401 Network: remove Physical field in VethEndpoint
76d9db3 vendor: Add github.com/gogo/protobuf
45fe870 runtime: Add unit tests
0f8b2ad VMCache: Update factory to run as a VMCache server
90704c8 VMCache: the core and the client
d8bcddb qemu-arm64: add unit test for func appendImage on aarch64
986e4dc qemu-arm64: Support nvdimm on arm64
8ba27e1 s390x: remove pmu from test
6242af3 s390x: fix TestQemuS390xMemoryTopology
613edd5 s390x: fix golint complain
27a92f9 runtime: Fix rootfs mount assumptions
c964a26 virtcontainers: makefile fix .ci path
fcee080 unit-test: Fix local test
c4957dd virtcontainer: watch the qemu's console when proxy's debug enabled
1e30673 test: add tests for sandbox creation rollback and cleanup
bdb34e7 Makefile: Fix aarch64 fail in No GO command or GOPATH not set mode
c759cf5 tracing: Fix tracing
31232b4 config: check the builtIn first when updating shim/proxy/agent
03dd780 qemu: fix devID value error
a1ddf53 Makefile: Change "GOPATH not set" to "No GO command or GOPATH not set"
35672b5 unit-test: fix undefined struct field SupportVSocks on arm64
975157d versions.yaml: add uscan annotations

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2019-03-18 22:13:32 +08:00
Alice Frosi
6a95ad2ca9 s390x: add bridges function
The bridges function was missing for s390x

Fixes: #1380

Signed-off-by: Alice Frosi <afrosi@de.ibm.com>
2019-03-18 14:57:58 +01:00
Peng Tao
925122a411
Merge pull request #1374 from amshinde/k8s-empty-dir
volumes: Handle k8s empty-dirs of "default" medium type
2019-03-18 12:53:35 +08:00
Archana Shinde
8e2a5eaa36 tests: Fix units tests to check empty-dir volumes backed by host-dir
Test verify that k8s volumes that are mounted as tmpfs are considered as
ephemeral.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2019-03-15 11:02:17 -07:00
Archana Shinde
47a6023382 volumes: Handle k8s empty-dirs of "default" medium type
We were considering all empty-dir k8s volumes as backed by tmpfs.
However they can be backed by a host directory as well.
Pass those as 9p volumes, while tmpfs volumes are handled as before,
namely creating a tmpfs directory inside the guest.
The only way to detect "Memory" empty-dirs is to actually check if the
volume is mounted as a tmpfs mount, since any information of k8s
"medium" is lost at the OCI layer.

Fixes #1341

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2019-03-15 09:44:10 -07:00
Julio Montes
3aaa77db22 virtcontainers: honor OCI cgroupsPath
Create cgroup path relative the cgroups mount point if it's absolute,
or create it relative to a runtime-determined location if the path
is relative.

fixes #1365
fixes #1357

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-03-14 08:13:22 -06:00
Archana Shinde
8058fb0791
Merge pull request #1289 from grahamwhaley/20190227_v4.19.26
versions: kernel: update to 4.19.28
2019-03-13 15:21:31 -07:00
Archana Shinde
9f96da2014
Merge pull request #1006 from Ace-Tang/throw_error
qemu: throw error when fail to get addr from bridges
2019-03-13 14:34:24 -07:00
James O. D. Hunt
71fc406381
Merge pull request #1361 from darfux/fix-mem-id
vc:qemu: Fix id calculation of memory hotplug
2019-03-13 18:10:47 +00:00
Julio Montes
32220a5beb
Merge pull request #1330 from alicefr/s390_fix_test
s390x: 2 small test fixes
2019-03-13 08:59:50 -06:00
Li Yuxuan
4e81522571 vc:qemu: Fix id calculation of memory hotplug
QMP doesn't guarantee the order of the array that is returned by
`query-memory-devices` command. So we would better search the whole
array to find out the current max slot, rather than simply use the last
element's slot.

Fixes: #1362

Signed-off-by: Li Yuxuan <liyuxuan04@baidu.com>
2019-03-13 16:39:31 +08:00
James O. D. Hunt
ffbae64a2d
Merge pull request #1323 from Pennyzct/nvdimm
arm64: support NVDIMM
2019-03-12 10:11:01 +00:00
Ace-Tang
502fdab75e test: add test for addDeviceToBridge
add test for addDeviceToBridge in three case
1. addDeviceToBridge successful
2. fail cause no more available bridge slot
3. fail cause state.bridge == 0

Signed-off-by: Ace-Tang <aceapril@126.com>
2019-03-12 09:18:03 +08:00
Julio Montes
b18a62c63e
Merge pull request #1346 from jcvenegas/resource-calc-multi-container
virtcontainers: move resource calculation to its own function
2019-03-11 14:59:05 -06:00
Julio Montes
e73beab5ea
Merge pull request #1353 from chavafg/topic/update-nemu-version
versions: update nemu to latest release
2019-03-11 14:55:23 -06:00
Jose Carlos Venegas Munoz
0061e166d4 virtcontainers: move resource calculation to its own function
Make cpu and memory calculation in a different function
this help to reduce the function complexity and easy  unit test.

Fixes: #1296

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2019-03-11 12:17:01 -06:00
Jose Carlos Venegas Munoz
7504d9e50c unit-test: add TestSandboxUpdateResources
Add unit test for Update Resources

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2019-03-11 12:17:01 -06:00
Salvador Fuentes
f009a534c2 versions: update nemu to latest release
Latest release fixes entropy issue.

Fixes: #1251.
Fixes: #987.

Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
2019-03-11 11:59:16 -06:00
James O. D. Hunt
ff7019999f
Merge pull request #1351 from jodh-intel/collect-script-add-more-details
Add crio and containerd details to collect script
2019-03-11 17:43:59 +00:00
James O. D. Hunt
cad58e8a2d
Merge pull request #1340 from devimc/topic/noJournald
pkg: reduce memory footprint
2019-03-11 14:37:48 +00:00
James O. D. Hunt
f2a506affa scripts: Add containerd details to collect script
Add a new sub-section for containerd details.

Fixes #1349.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2019-03-11 14:20:39 +00:00
James O. D. Hunt
7266d31813 scripts: Log crio config file in collect script
Add details of the crio config to the data collection script.

Partially fixes #1349.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2019-03-11 14:20:34 +00:00
James O. D. Hunt
30f9776e60 scripts: Create separate section for crio in collect script
Rather than folding crio under k8s, move it to a separate sub-section.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2019-03-11 14:18:10 +00:00
James O. D. Hunt
ae08ea3211 scripts: Add helper function to collect script
Add a `have_service()` helper function to the data collection script to
simplify the code.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2019-03-11 14:18:02 +00:00
Graham Whaley
ae4d8b453e versions: kernel: update to 4.19.28
Update kernel to latest version.

Fixes: #1288

Signed-off-by: Graham Whaley <graham.whaley@intel.com>
2019-03-11 11:44:37 +00:00
James O. D. Hunt
7aa48565d0
Merge pull request #1326 from ganeshmaharaj/fix-rootfs-mount
Fix rootfs mount assumptions
2019-03-11 11:32:57 +00:00
James O. D. Hunt
5b58e6a715
Merge pull request #1328 from alicefr/golint-fix
s390x: fix golint complain
2019-03-11 11:17:31 +00:00
Ace-Tang
c7ace4b4bc qemu: throw error when fail to get addr from bridges
Return error soon when addDeviceToBridge() can not get empty address
from bridges, or the error will thrown by qemu, this is not obvious.

Fixes: #1005

Signed-off-by: Ace-Tang <aceapril@126.com>
2019-03-11 18:03:46 +08:00
James O. D. Hunt
81404baf1d
Merge pull request #1344 from caoruidong/rmphy
Network: remove Physical field in VethEndpoint
2019-03-11 10:01:32 +00:00
Haomin Tsai
7ff18192a4
Merge pull request #880 from jingxiaolu/rollback_when_creation_fail
test: add tests for sandbox creation rollback and cleanup
2019-03-09 14:12:22 +08:00
Julio Montes
2456ac52eb pkg: reduce memory footprint
Reduce memory footprint ~7% by disabling some systemd services like
systemd-journald and systemd-udevd, those services are just consuming memory
and are not needed. For example kata-agent logs the errors through the proxy.

fixes #1339

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-03-08 15:45:25 -06:00
Ruidong Cao
df9a4015a5 Network: remove Physical field in VethEndpoint
This a bool field. It is useless because veth endpoint is never a
physical endpoint.

Fixes #1343

Signed-off-by: Ruidong Cao <caoruidong@huawei.com>
2019-03-09 03:29:27 +08:00
Sebastien Boeuf
80cdf895c5
Merge pull request #1166 from teawater/vm_cache
VMCache: the new function that creates VMs as caches before using it
2019-03-08 07:52:11 -08:00
Hui Zhu
76d9db3e0b vendor: Add github.com/gogo/protobuf
VMCache code use github.com/gogo/protobuf.

Fixes: #52

Signed-off-by: Hui Zhu <teawater@hyper.sh>
2019-03-08 20:59:00 +08:00
Ganesh Maharaj Mahalingam
45fe8700b8 runtime: Add unit tests
Add unit tests for the rootfs patch

Signed-off-by: Ganesh Maharaj Mahalingam <ganesh.mahalingam@intel.com>
2019-03-07 23:50:24 -08:00
Hui Zhu
0f8b2ad007 VMCache: Update factory to run as a VMCache server
When VMCache is enabled, factory init will run as a VMcache server.

Fixes: #52

Signed-off-by: Hui Zhu <teawater@hyper.sh>
2019-03-08 10:06:38 +08:00
Hui Zhu
90704c8bb6 VMCache: the core and the client
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: #52

Signed-off-by: Hui Zhu <teawater@hyper.sh>
2019-03-08 10:05:59 +08:00
Penny Zheng
d8bcddb3d1 qemu-arm64: add unit test for func appendImage on aarch64
Since we overrided the func appendImage for aarch64, we should also
provide related unit test.

Fixes: #843

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2019-03-07 18:38:40 +08:00
Penny Zheng
986e4dc7b8 qemu-arm64: Support nvdimm on arm64
Original guest image was reprensented as block device in qemu-aarch64,
and it will bring up write lock error when running multiple containers.
Thanks to the new expanded IPA_SIZE feature in kernel 4.20 and
Eric Auger's related patch set in qemu(which are still under upstream
review), we could fully support nvdimm on arm64.

Depends-on: github.com/kata-containers/packaging#377

Fixes: #843

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2019-03-07 18:08:11 +08:00