Commit Graph

4961 Commits

Author SHA1 Message Date
Graham Whaley
6ac1958c90
Merge pull request #121 from sboeuf/exec_process
exec: Allow to exec a process on a ready container
2018-03-29 17:56:59 +01:00
Sebastien Boeuf
aa469f4573 exec: Allow to exec a process on a ready container
If a container is not running, but created/ready instead, this means
a container process exists and that we can actually exec another
process inside this container. The container does not have to be
in running state.

Fixes #120

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2018-03-29 08:40:44 -07:00
Eric Ernst
9a7813e9ea
Merge pull request #126 from jodh-intel/run-central-go-test-script
CI: Use central go test script
2018-03-29 08:37:01 -07:00
Eric Ernst
a69c49398a
Merge pull request #131 from sboeuf/fix_crio_err
virtcontainers: Do not rollback by deleting container or pod
2018-03-29 08:36:05 -07:00
Graham Whaley
d2835557a1
Merge pull request #119 from chavafg/topic/qemu2-11
qemu: Move to qemu 2.11
2018-03-29 09:42:09 +01:00
Sebastien Boeuf
5a57b52c64 virtcontainers: Do not rollback by deleting container or pod
In case a consumer of virtcontainers tries to start/stop a container,
or stop a pod, and for some reasons, this fails, virtcontainers always
tries to delete everything related to the container or the pod before
it returns the error.

The caller of the runtime is the one responsible for cleaning things
up if something goes wrong, that's why this cleanup call is never
needed.

A real example of that is the case of cc-runtime and CRI-O, where this
cleanup prevented CRI-O from retrieving proper state of the container
after the failure, leading to the inability to stop and remove the
container and the VM afterwards.

Fixes #87

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2018-03-28 17:12:12 -07:00
Salvador Fuentes
10c38aeebf qemu: Move to qemu 2.11
This commit modifies version.yaml to now point to the qemu
2.11 stable version.
It modifies the default QEMU_CMD to be qemu-system-x86_64
instead of qemu-lite-system-x86_64.
And modifies virtcontainers unit tests to now point to the
correct QEMU_CMD.

Fixes: #118.

Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
2018-03-28 17:23:05 -06:00
Julio Montes
2079f90290
Merge pull request #12 from chavafg/topic/remove-static-option
qemu: does not use --disable-static for qemu 2.11
2018-03-28 17:28:47 -05:00
Salvador Fuentes
fb59a2b966 qemu: does not use unsupported flags for qemu 2.11
Qemu 2.11 does not support --disable-static flag and
--enable-strip flag, this patch adds a condition
to only use it for qemu 2.7 or older.

Fixes: #11.

Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
2018-03-28 16:23:38 -06:00
Salvador Fuentes
c4f922dc2c
Merge pull request #123 from sboeuf/fix_k8s
virtcontainers: Don't ignore container mounts based on their path
2018-03-28 13:20:11 -06:00
Sebastien Boeuf
2118e5f74b
Merge pull request #10 from chavafg/topic/qemu-config
qemu: Add script to generate hypervisor configure options.
2018-03-28 12:05:56 -07:00
Eric Ernst
2ac900f2d8
Merge pull request #41 from jodh-intel/fix-dev-guide-runtime-link
docs: Fix runtime link in dev guide
2018-03-28 11:07:39 -07:00
James O. D. Hunt
f44248c67c
Merge pull request #43 from jodh-intel/dev-guide-disable-initrd
docs: Disable initrd in dev guide
2018-03-28 17:40:08 +01:00
James O. D. Hunt
117cb58609 docs: Disable initrd in dev guide
Add details on how to disable the `initrd` config option to ensure the
base system as documented is functional.

Fixes #42.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-03-28 17:35:41 +01:00
Salvador Fuentes
d7dd8b623e qemu: Add script to generate hypervisor configure options.
This script will ensure we use a single source of qemu build
options for the Kata Containers project.

Fixes: #7.

Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
2018-03-28 10:05:27 -06:00
Sebastien Boeuf
80996b3b40 virtcontainers: kata_agent: Handle several /dev/shm
The kata_agent.go code breaks after the first /dev/shm. But in case
several are defined, the agent will crash since other /dev/shm will
be wrongly configured in the OCI spec mounts.

Fixes #127

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2018-03-28 08:55:40 -07:00
Sebastien Boeuf
08909b2213 virtcontainers: Don't ignore container mounts based on their path
Instead of ignoring containers based on their path, this commit
relies on the type of mount being "bind" to choose if this mount
should be ignored or not.

For instance, we have some use cases where k8s expects the path
"/dev/container-log" to be bind mounted inside the container, but
the code ignores it because it has the prefix "/dev" which is a
system prefix mount.

Fixes #122

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2018-03-28 08:55:40 -07:00
James O. D. Hunt
53698c166b CI: Use central go test script
Don't use a copy of the go test script, use the central version for
consistency with the other repos.

Fixes #125.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-03-28 16:53:13 +01:00
Eric Ernst
a6de7edc53
Merge pull request #39 from jodh-intel/dev-guide-improve-agent-debug
docs: Improve command to enable agent debug
2018-03-28 08:41:02 -07:00
Eric Ernst
4d8e58e5da
Merge pull request #35 from jodh-intel/dev-guide-mention-collect-script
docs: Mention collect script in dev guide
2018-03-28 08:37:50 -07:00
Eric Ernst
5643232ce3
Merge pull request #37 from jodh-intel/improve-readme
docs: Embellish README
2018-03-28 08:06:26 -07:00
Peng Tao
01f7e46984
Merge pull request #98 from bergwolf/initrd
support to boot guest with an initrd image
2018-03-28 19:04:14 +08:00
James O. D. Hunt
00ed3a249d docs: Fix runtime link in dev guide
The table of contents showed an incorrect link for building and
installing the runtime.

Fixes #40.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-03-28 10:26:35 +01:00
James O. D. Hunt
4ac5a6ad4d
Merge pull request #112 from jodh-intel/improve-readme
docs: Improve the README
2018-03-28 08:47:22 +01:00
James O. D. Hunt
3b71b57286 docs: Improve command to enable agent debug
Change the command to enable agent debug slightly so that even if the
config file specifies kernel parameters, the command will successfully
enable the agent debug.

Fixes #38.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-03-27 17:55:47 +01:00
James O. D. Hunt
d9a77b3de2 docs: dev guide whitespace fix
Add a blank line to the dev guide.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-03-27 17:55:25 +01:00
James O. D. Hunt
7111e03021 docs: Mention collect script in dev guide
Add details of the collect script in under the "Troubleshoot" section.

Fixes #34.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-03-27 17:32:48 +01:00
James O. D. Hunt
85865d4c4f docs: Improve the README
Add in details to the `README`.

Fixes #111.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-03-27 17:24:35 +01:00
James O. D. Hunt
2b40a280b5 docs: Embellish README
Add some brief explanatory text and a few pointers.

Fixes #36.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-03-27 16:08:36 +01:00
Eric Ernst
33ade410f3
Merge pull request #27 from bergwolf/api-design
design: add api design doc
2018-03-27 07:06:25 -07:00
James O. D. Hunt
4d6e9c9f68
Merge pull request #114 from jodh-intel/add-version-database
versions: Add versions database
2018-03-27 15:04:02 +01:00
James O. D. Hunt
a7c7f92103 versions: Add versions database
Add a YAML format database that is the equivalent of the Clear
Containers `versions.txt` file [1].

The file defines the versions of important non-golang dependencies used
by this and other Kata repositories particularly for testing and packaging.

Defining all version details centrally in this file avoids duplication
and "bit-rot" when versions need to be changed.

[1] - https://github.com/clearcontainers/runtime/blob/master/versions.txt

Fixes #11.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-03-27 11:36:23 +01:00
Peng Tao
423e86405e qemu: refector createPod()
To fix CI complains:
virtcontainers/qemu.go:248:⚠️ cyclomatic complexity 18 of
function (*qemu).createPod() is high (> 15) (gocyclo)

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-03-27 15:58:41 +08:00
Peng Tao
8c5fb45f99 qemu: only set systemd related kernel parameters when needed
When we use initrd based booting, there is no systemd to be configured.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-03-27 15:58:41 +08:00
Peng Tao
38af66ca39 cli: only set systemd related kernel parameters when needed
When we install agent as init process in initrd based boot,
there is no systemd to be configured.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-03-27 15:58:41 +08:00
Peng Tao
463e6dee0b qemu: append kernel root parameters iff root image is provided
For initrd based boot, we do not need the root parameters.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-03-27 15:58:41 +08:00
Peng Tao
21343d7d71 cli: add initrd info to kata-env
Show the configured hypervisor initrd setting.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-03-27 15:58:41 +08:00
Peng Tao
19c3555412 cli: add hypervisor initrd config option
Add `initrd=[path]` option to configuration.toml and use it to set
the HypervisorConfig.InitrdPath option.

The default value of hypervisor image option is removed since we want
to allow it to be unset. For the same reason, there is no default value
for hypervisor initrd option either.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-03-27 15:58:41 +08:00
Peng Tao
4f57b65147 hypervisor: add initrd image support
If an initrd image is configured in HypervisorConfig or passed in by
annotations, append it to qemu command line arguments.

Fixes: #97

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-03-27 15:58:41 +08:00
Peng Tao
991fe81dff vendor: update govmm package
To include support for qemu initrd config.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-03-27 15:58:41 +08:00
James O. D. Hunt
7b0c2d1670
Merge pull request #117 from devimc/vfio/hotplug
virtcontainers: vfio: add support for hot plugging VFIO devices
2018-03-27 08:28:47 +01:00
Erick Cardona
52022701db rootfs-builder: Refactor rootfs.sh
This patch introduces a bash library (scripts/lib.sh) that concentrates
common functions. This also enhances future additions of other OSes, making
it more simple. Also, new variables were introduced in each distro config.sh
in order to parameterise the creation of package manager config (dnf/yum, in this case).
A fix to the resulting rootfs directory name (include OS name) is also fixed in this
patch.

Fixes #39
Fixes #34

Signed-off-by: Erick Cardona <erick.cardona.ruiz@intel.com>
2018-03-26 16:34:11 -06:00
Julio Montes
249945f749 virtcontainers: pod: remove cold plug support
All devices are hot plugged in the VM, hence cold plug
support is no more needed.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2018-03-26 15:32:01 -06:00
Julio Montes
47edcb3fec virtcontainers: vfio: add support for hot plugging VFIO devices
With this patch VFIO devices are hot plugged in the VM, that means
no more cold plug in kata containers.

fixes #85

Signed-off-by: Julio Montes <julio.montes@intel.com>
2018-03-26 15:32:01 -06:00
Peng Tao
184662416d
Merge pull request #109 from bergwolf/githooks
Makefile: remove git hooks
2018-03-24 11:34:37 +08:00
Peng Tao
ce755056f3
Merge pull request #107 from bergwolf/gitignore
gitignore: merge gitignore files
2018-03-24 11:32:56 +08:00
Peng Tao
fa9a5b8d9e design: add api design doc
To fulfill the kata design requirements, and based on the disscusion on
Virtcontainers API extentions, runtime API early sketch and runtime API
comparison, this commit added the high level design of the kata runtime
library API.

fixes: #26

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-03-24 11:30:35 +08:00
Salvador Fuentes
ae8a849b32
Merge pull request #76 from grahamwhaley/20180323_tests_repo
ci: lib: allow override of tests_repo
2018-03-23 08:51:19 -06:00
Julio Montes
d469cffc7a
Merge pull request #75 from harche/env_args_docker
Pass EXTRA_PKGS var to docker to build rootfs
2018-03-23 08:40:13 -05:00
Graham whaley
93146d91dc ci: lib: allow override of tests_repo
Only set the tests_repo url to the default if it is not
set already.

Fixes: #71

Signed-off-by: Graham whaley <graham.whaley@intel.com>
2018-03-23 09:54:59 +00:00