Commit Graph

6963 Commits

Author SHA1 Message Date
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
Penny Zheng
ddf638ba86 snap-aarch64: modify qemu-related info for arm64
Former snap configuration snapcraft.toml install qemu-lite for all
platforms, which isn't applicable on aarch64. We need qemu-aarch64
of specific version and extra patches.

Fixes: #399

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2019-03-20 11:08:15 +08:00
Matt Fischer
ad5d879f8c rootfs: Print attempt number after max check
With the old code it was possible to see odd messages like:
"INFO: Create root disk image. Attempt 6 out of 5."

Move the attempt number print to after we check against the max

Fixes #251

Signed-off-by: Matt Fischer <matt@mattfischer.com>
2019-03-19 21:04:40 -06:00
Archana Shinde
8fe64058aa rootfs: Include chrony in the Dockerfile images
Add chrony to distro Dockerfile.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2019-03-19 14:34:14 -07:00
Archana Shinde
0b33519709 rootfs: add PACKAGE var to debian config
debian config seems to be missing PACKAGE variable altogether.
Add it along with appending chrony to the list.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2019-03-19 14:30:10 -07:00
Archana Shinde
510ddd28c8 rootfs: Add chrony service to rootfs
chrony will be used to schronize guest clock with host
using kvm_ptp kernel driver.
This does add another active component to the rootfs
but keeping time scychorized is crucial.

Fixes #255

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2019-03-19 14:12:21 -07:00
Gabriela Cervantes
523405e62d test: Modify test_images script to handle FC
We need to modify this test in order to handle firecracker.

Fixes #248

Depends-on:github.com/kata-containers/osbuilder#247

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2019-03-19 13:42:00 -06:00
Jose Carlos Venegas Munoz
d67aad893f
Merge pull request #247 from devimc/topic/fixFCNoDax
image-builder: make DAX support optional
2019-03-19 11:51:19 -06:00
Archana Shinde
93e59021b9
Merge pull request #404 from jodh-intel/unbreak-debug-console-instructions
Unbreak debug console instructions
2019-03-19 09:45:58 -07: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
6217689cc0
Merge pull request #253 from bergwolf/1.6.0-rc2-branch-bump
# Kata Containers 1.6.0-rc2
2019-03-19 09:50:19 -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
James O. D. Hunt
5a271f06ce scripts: Allow data collection script output to be hidden
Use a clever HTML trick to allow the output of the data collection
script to be hidden / unhidden in the github.com interface.

See the example at the top of
https://github.com/kata-containers/runtime/issues/1347.

Fixes #1386.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2019-03-19 15:29:13 +00:00
James O. D. Hunt
4f34a54777 scripts: Refactor collect script
Create a new function to collect all data display function calls in the
data collection script.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2019-03-19 15:28:14 +00:00
James O. D. Hunt
b347b3302c docs: Don't modify pristine config files
Kata supports multiple configuration file locations, so update the dev
guide to tweak config settings in
`/etc/kata-containers/configuration.toml` rather than the pristine
`/usr/share/defaults/kata-containers/configuration.toml` file. The
former is read first meaning the system can be reset to a vanilla Kata
configuration by simply deleting
`/etc/kata-containers/configuration.toml`.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2019-03-19 11:29:58 +00:00
James O. D. Hunt
c771f76eae docs: Unbreak debug console instructions
The debug console systemd job needs to specify `PrivateDevices=no` to
ensure the job can access the *real* console. Without this, connecting
to the socket does not provide access to the main guest root context.

Fixes #403.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2019-03-19 11:23:24 +00:00
Graham Whaley
ea24ff318a
Merge pull request #402 from ttx/packagecloud
Credit packagecloud for package hosting
2019-03-19 10:53:42 +00:00
Xu Wang
441c51c22c
Merge pull request #402 from amshinde/add-links-to-docs
Add links to all how-to and use-case docs in README.md
2019-03-19 16:18:16 +08:00
Archana Shinde
534ac218c7 docs: Add links to use-case documents.
Fixes #401

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2019-03-18 11:35:33 -07:00
Archana Shinde
e02829b443 docs: Add link for VM templating and VM cache
Add links for these docs in REAME.md

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2019-03-18 11:30:35 -07:00
Peng Tao
6570944b67 release: Kata Containers 1.6.0-rc2
- image-builder: fill out device namespace information into kata image
- tests: install kata components from master
- tests: skip euleros
- arch: Remove calls to arch command
- pullapprove: remove it
- memory_hotplug: MEM_BOUNDARY_MB should be arch-dependent

726f798 image-builder: fill out device namespace information into kata image
cbe5642 image-builder: add gcc as dependecy to generate the image
7620066 image-builder: sync rootfs data after copying it into the image
dc5bc07 image-builder: fix mem boundary recalculation
71ccc0a mage-builder: remove -s option and IMG_SIZE envar
8065bb6 rootfs-builder: delete dnf and rmp data
35588dd tests: install kata containers components from master
519bbe8 tests: remove docker before installing the newer version
b4de168 tests: skip euleros
f38c67d arch: Remove calls to arch command
8963b8e pullapprove: remove it
e4d5c1b memory_hotplug: MEM_BOUNDARY_MB should be arch-dependent

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2019-03-18 22:14:31 +08: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
Julio Montes
02fa22bbdd image-builder: make DAX support optional
Not all hypervisor support NVDIMM hence DAX support MUST BE enabled explicitly
setting the DAX environment variable to 'yes'

fixes #246

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-03-15 13:14:52 -06: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
James O. D. Hunt
e84c62c960
Merge pull request #386 from amshinde/check-crio-runtime-config
kata-deploy: Add runtime config for crio if it does not exist
2019-03-15 17:43:08 +00:00
Sebastien Boeuf
4d65fb4ec4
Merge pull request #398 from amshinde/sysctl-docs
sysctsl: Add how-to doc for setting sysctls.
2019-03-15 10:18:28 -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
Thierry Carrez
4f4cfb99f7 Credit packagecloud for package hosting
We use a packagecloud OSS account for package hosting.
As part of the arrangement with packagecloud we need to
credit them and add a link back to https://packagecloud.io
on our website and project README.

This was added to the kata-containers repository's README,
but it is also probably appropriate to add it to the packaging
README as well.

Signed-off-by: Thierry Carrez <thierry@openstack.org>
2019-03-15 15:13:37 +01:00
James O. D. Hunt
fd3d0651e0
Merge pull request #391 from lifupan/master
how-to: Update the how-to containerd-kata doc to support runtime option
2019-03-15 09:54:41 +00:00
Thierry Carrez
403fb4c5b0 Credit packagecloud for package hosting
We use a packagecloud OSS account for package hosting.
As part of the arrangement with packagecloud we need to
credit them and add a link back to https://packagecloud.io
on our website and project README.

This repository's README is probably the closest we have to
a "project README", so let's add it here.

Signed-off-by: Thierry Carrez <thierry@openstack.org>
2019-03-15 10:08:22 +01:00
fupan
1998e98f40 how-to: Update the how-to containerd-kata doc to support runtime option
Update the how-to containerd-kata doc to support runtime option, by which
we can specify kata configure file for different kata runtime.

Fixes:#390

Signed-off-by: fupan <lifupan@gmail.com>
2019-03-15 16:39:36 +08:00
Jianyong Wu
eadf97765d Factory: Fix fake return value issue on creating template
Now, function NewFactory will return nil even create template
does't complete. As for this, it will tell user that factory
has been initialized no matter whether the template is created
or not. This patch correct it by adding another return value
of error in NewFactory.

Testing initFactoryCommand when enable template will need root
privilege to mount tmpfs. So skip it for no-root user.

Testing initFactoryCommand func will create template, but no
proxy type assigned to VMconfig which will using katabuiltinProxy
instead. this will lead to failure for this type of proxy will
check proxyparams which contains many null value. This commit
fix it by substitute katabuiltinProxy as noopProxy when for test
purpose.

Fixes: #1333
Signed-off-by: Jianyong Wu <jianyong.wu@arm.com>
2019-03-15 04:17:28 -04: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
James O. D. Hunt
ecd072430f
Merge pull request #236 from devimc/topic/fixDAX
image-builder: fill out device namespace information into kata image
2019-03-14 08:35:50 +00:00
Archana Shinde
8342ca1d04 kata-deploy: Add runtime config for crio if it does not exist
Rather than add the config for kata-qemu and kata-fc unconditionally,
the script now checks if the runtime config exists.
If it exists, then do not chnage the path for the runtime.
The user may have configured this to a specific path for testing
local chnages.

Fixes #374

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2019-03-13 16:13:00 -07: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
19e8a5e024 docs: Add link to the sysctl how-to in README.md
Add link so that the doc is discoverable

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2019-03-13 15:11:16 -07:00
Archana Shinde
817110d652 sysctsl: Add how-to doc for setting sysctls.
Document sysctls for Docker and Kubernetes.

Fixes #399

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2019-03-13 15:11:16 -07:00
Archana Shinde
a8c6d94c58
Merge pull request #397 from bmwiedemann/kernel
Override build user+host+timestamp
2019-03-13 14:37:28 -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
Julio Montes
726f798ff7 image-builder: fill out device namespace information into kata image
The new NVDIMM driver implementation (kernel >= 4.16) needs to know the device
namespace information to map pages, this metadata is read from the nvdimm
namespace at 4k offset.

fixes #235

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-03-13 13:05:06 -06:00
Julio Montes
cbe5642b9d image-builder: add gcc as dependecy to generate the image
gcc is required to build the binary in charge to fill out the device
namespace information (matadata) into the kata containers image.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-03-13 13:05:06 -06:00
Julio Montes
7620066c8a image-builder: sync rootfs data after copying it into the image
Rootfs data must be sync'd after copying it into the image to avoid
data corruption

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-03-13 13:05:06 -06:00
Julio Montes
dc5bc07825 image-builder: fix mem boundary recalculation
$/${} is unnecessary on arithmetic variables. [SC2004]

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-03-13 13:05:06 -06:00
Julio Montes
71ccc0a6ea mage-builder: remove -s option and IMG_SIZE envar
guest kernel needs 64 bytes of DRAM per 4K page of emulated PMEM, hence the
image size should be as small as possible to reduce the container's memory
footprint. The image size is recalculated automatically if it's too small
to contain the rootfs.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-03-13 13:05:06 -06:00