Commit Graph

10701 Commits

Author SHA1 Message Date
Graham Whaley
bd6db3031a kata-env: tests: add JSON out/in verify test
Add a test to ensure the JSON output passes the same
parameter check and write/re-read test as the TOML one.

Signed-off-by: Graham Whaley <graham.whaley@intel.com>
2018-07-11 17:54:11 +01:00
Graham Whaley
e45f591219 kata-env: Do not leave temp files on test
One of the test cases was not defer removing the tmpfile
it uses. Add that defer.

Signed-off-by: Graham Whaley <graham.whaley@intel.com>
2018-07-11 17:14:18 +01:00
Graham Whaley
1f8f7629a0 kata-env: Fix test cases for kata-env JSON
With the addition of the JSON kata-env output, we need
to fix up the tests:
 - add a test for the JSON flag
 - fix the format/layout of the other tests to take into
  account the change in function API and the additon of a
  flagset to the cmdline ctx.

Signed-off-by: Graham Whaley <graham.whaley@intel.com>
2018-07-11 17:12:36 +01:00
Archana Shinde
8af3dd4511
Merge pull request #479 from grahamwhaley/20180710_no_exit_check
Fix no exit static check
2018-07-11 08:30:30 -07:00
Eric Ernst
0be8a5cb03
Merge pull request #86 from jcvenegas/update-repository-version
Update repository version
2018-07-10 14:43:47 -07:00
Eric Ernst
e642e32ed5 kata-deploy: add support for deploying Kata on K8S
A Dockerfile is created and reference daemonsets are also
provided for deploying Kata Containers onto a running Kubernetes
cluster. A few daemonsets are introduced:

1) runtime-labeler: This daemonset will create a label on each node in
the cluster identifying the CRI shim in use. For example,
container-runtime=crio or container-runtime=containerd.

2) crio and containerd kata installer: Assuming either CRIO or
containerd is the CRI runtime on the node (determined based on label
from (1),, either the crio or containerd variant will execute.  These daemonsets
will install the VM artifacts and host binaries required for using
Kata Containers.  Once installed, it will add a node label kata-runtime=true
and reconfigure either crio or containerd to make use of Kata for untrusted workloads.
As a final step it will restart the CRI shim and kubelet.  Upon deletion,
the daemonset will remove the kata binaries and VM artifacts and update
the label to kata-runtime=cleanup.

3) crio and containerd cleanup: Either of these two daemonsets will run,
pending the container-runtime label value and if the node has label
kata-runtime=cleanup.  This daemonset simply restarts crio/containerd as
well as kubelet. This was not feasible in a preStepHook, hence the
seperate cleanup step.

An RBAC is created to allow the daemonsets to modify labels on the node.

To deploy kata:
kubectl apply -f kata-rbac.yaml
kubectl apply -f kata-deploy.yaml

To remove kata:
kubectl delete -f kata-deploy.yaml
kubectl apply -f kata-cleanup.yaml
kubectl delete -f kata-cleanup.yaml
kubectl delete -f kata-rbac.yaml

This initial commit is based on contributions by a few folks on
github.com/egernst/kata-deploy

Also-by: Saikrishna Edupuganti <saikrishna.edupuganti@intel.com>
Signed-off-by: Eric Ernst <eric.ernst@intel.com>
Signed-off-by: Jon Olson <jonolson@google.com>
Signed-off-by: Ricardo Aravena <raravena@branch.io>
Signed-off-by: Eric Ernst <eric.ernst@intel.com>
2018-07-10 18:52:05 +00:00
Graham Whaley
031632d5b0 ci: no-exit: Do not run no-exit check on test files
The test files do not have access to our app level
exit() function, and are thus OK to call os.Exit() if
they need. Skip them from the check.

Signed-off-by: Graham Whaley <graham.whaley@intel.com>
2018-07-10 17:04:27 +01:00
Graham Whaley
63c06bee70 kata-env: Add ability to output as JSON
Having a direct JSON output for kata-env will help record
results in our CIs in some instances. Add that ability with
a kata-env command line extension.

Fixes: #474

Signed-off-by: Graham Whaley <graham.whaley@intel.com>
2018-07-10 16:06:53 +01:00
Graham Whaley
62495d45be ci: no-exit: Allow path override for os.Exit check
Allow the path being checked by the os-no-exit script to be
passed in, and update the Makefile to use that to check the
current code paths of the cli and virtcontainers.

Fixes: #477

Signed-off-by: Graham Whaley <graham.whaley@intel.com>
2018-07-10 15:29:34 +01:00
Graham Whaley
6268ba4aa3 ci: no-exit: Skip check if no files to check
If we find no files to check, gracefully quit the test.
Formerly, if the list was empty we ended up trying to read
from stdin, and thus hung.

Signed-off-by: Graham Whaley <graham.whaley@intel.com>
2018-07-10 15:29:34 +01:00
Graham Whaley
1c453a372e ci: no-exit: Document and echo what the check is
Make it clearer why we run the check.
Make it announce itself.

Signed-off-by: Graham Whaley <graham.whaley@intel.com>
2018-07-10 15:29:34 +01:00
Sebastien Boeuf
ff7b4f6ed7
Merge pull request #473 from lifupan/hyper-integration
api: To stop its monitor after a sandbox paused
2018-07-09 19:28:01 -07:00
Sebastien Boeuf
cd842afca4
Merge pull request #417 from nitkon/maxmem
virtcontainers: Set ppc64le maxmem depending on qemu version
2018-07-09 12:07:12 -07:00
Jose Carlos Venegas Munoz
4eb3a3dcd1 test: Add test update-repository-version.sh
Add some basic test to verify the script works.

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2018-07-09 13:14:47 -05:00
Jose Carlos Venegas Munoz
d9736af0ba docs: Add information about new release tool.
Add docs about the version bump script.

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2018-07-09 13:14:47 -05:00
Jose Carlos Venegas Munoz
4fef836ffd release: Add make target to bump repos.
Add a target to bump all repos in one command.

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2018-07-09 13:14:47 -05:00
Jose Carlos Venegas Munoz
e12f1df807 release: add script to bump repositories
Add script that will help to bump versions for all the projects.

Fixes: #49

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2018-07-09 13:14:47 -05:00
Sebastien Boeuf
5e17044c23
Merge pull request #464 from jodh-intel/pass-sandbox-to-proxy
proxy: Pass sandbox to proxy
2018-07-09 10:13:52 -07:00
Sebastien Boeuf
a8952fb79b
Merge pull request #470 from bergwolf/memory-hotplug
hypervisor/qemu: add memory hotplug support
2018-07-09 09:56:19 -07:00
Sebastien Boeuf
f084384501
Merge pull request #462 from Pennyzct/versions
ci: add specfic image-type for aarch64
2018-07-09 09:24:04 -07:00
Graham Whaley
2540bb9569 Dev: Document journald limitations and workarounds
Journald, by default on some systems, will rate limit log messages,
and in the case of our 'enable full debug', will likely drop some
of our debug.
Document how to identify if this is happening, and how to configure
`systemd-journald` appropriately.

Fixes: #181

Signed-off-by: Graham Whaley <graham.whaley@intel.com>
2018-07-09 10:52:53 +01:00
Peng Tao
66a3e812f2 hypervisor/qemu: add memory hotplug support
So that we can add more memory to an existing guest.

Fixes: #469

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-07-09 15:29:50 +08:00
Penny Zheng
67de5d4347 ci: reconstructure image-type and initrd for architecture-independant
as default image-type and initrd weren't for non-x86_64 arch,
reconstructuring them to be architecture-specific.

Fixes: #461

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
Signed-off-by: Jianyong Wu <jianyong.wu@arm.com>
Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-07-09 02:27:01 +00:00
fupan
114482ed99 api: To stop its monitor after a sandbox paused
After the sandbox is paused, it's needed to stop its monitor,
Otherwise, its monitors will receive timeout errors if it is
paused for a long time, thus its monitor will not tell it's a
crash caused timeout or just a paused timeout.

Fixes: #472

Signed-off-by: fupan <lifupan@gmail.com>
2018-07-06 19:40:43 +08:00
James O. D. Hunt
a38b251120 tests: Refactor CC proxy test for Kata
Reworked `TestCCProxyStart` to create a generic `testProxyStart()` that
is now used for testing both CC and Kata proxies.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-07-06 11:52:22 +01:00
James O. D. Hunt
23eb13f23a proxy: Pass sandbox to proxy
Add the `-sandbox` option when launching the proxy. This isn't strictly
required by the proxy, but is extremely useful for log analysis to allow
log entries to be matched to sandboxes as the proxy will add a
`sandbox` field in each log entry.

Fixes #463.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-07-06 11:52:22 +01:00
James O. D. Hunt
86cde89809 docs: Requirements for filenames and commands
Explain how to handle filenames and command names in documentation.

Fixes #187.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-07-06 09:35:55 +01:00
James O. D. Hunt
1344bc5f84 docs: Document image requirements
Update the documentation requirements on the topic of images.

Fixes #189.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-07-06 07:48:08 +01:00
Jose Carlos Venegas Munoz
540d3a26be
Merge pull request #82 from devimc/topic/snap
snap: add yaml to build snap image
2018-07-05 10:19:54 -05:00
Peng Tao
0646a39ff0 vendor: fix dep warning and update yamux dependency
I got following warning after upgrading dep tool:

Warning: the following project(s) have [[constraint]] stanzas in Gopkg.toml:

  ✗  github.com/hashicorp/yamux

However, these projects are not direct dependencies of the current project:
they are not imported in any .go files, nor are they in the 'required' list in
Gopkg.toml. Dep only applies [[constraint]] rules to direct dependencies, so
these rules will have no effect.

Either import/require packages from these projects so that they become direct
dependencies, or convert each [[constraint]] to an [[override]] to enforce rules
on these projects, if they happen to be transitive dependencies,

So let's convert constraint to override over yamux. In the meanwhile,
update the yamux vendor. Full commit list:

4c2fe0d (origin/b-consul-3040) Dont output keepalive error when the session is closed
f21aae5 Make sure to drain the timer channel on defer, and a clarifying comment
601ccd8 Make receive window update logic a bit cleaner
02d320c Uses timer pool in sendNoWait, like in waitForSendErr
cf433c5 window update unit test for partial read; benchmark large buffer
ca8dfd0 improve memory utilization in receive buffer, fix flow control
683f491 Fix race around read and write deadlines in Stream (#52)
40b86b2 Add public session CloseChan method (#44)

Note that commit 4c2fe0d might also help kata-containers/agent/issues/231.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-07-05 15:31:53 +08:00
Peng Tao
0f20b6b81b vendor: update govmm changes
To include vm factory related commits. Full list:
54caf78 (mine/templating, templating) qmp: add hotplug memory
e66a9b4 qemu: add appendMemoryKnobs helper
8aeca15 qmp: add migrate set arguments
a03d496 qmp: add set migration capabilities
0ace417 qemu: allow to set migration incoming
723bc5f qemu: allow to create a stopped guest
283d7df qemu: add file backed memory device support

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-07-05 15:25:19 +08:00
James O. D. Hunt
b2bec3362b
Merge pull request #449 from jodh-intel/add-runtime-cli-cmd-to-vc-log
main: Pass runtime CLI command to vc logger
2018-07-05 08:17:54 +01:00
James O. D. Hunt
830d50e9c5 main: Pass runtime CLI command to vc logger
Add the runtime CLI command name to the virtcontainers logger so that it
is clear when reading virtcontainers log entries which runtime command
they refer to.

Fixes #448.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-07-05 07:08:02 +01:00
James O. D. Hunt
47dfb7d6da
Merge pull request #466 from jodh-intel/pass-sandbox-id-to-agent
qemu: Pass sandboxID to agent for logging purposes
2018-07-05 06:49:12 +01:00
James O. D. Hunt
2865dc21aa
Merge pull request #468 from jodh-intel/improve-cid+sid-logging
logging: Reset external loggers when cid+sid available
2018-07-05 06:47:26 +01:00
Julio Montes
38a82d725e snap: add yaml to build snap image
the yaml file is the recipe to build a snap image
with all Kata Containers components inside.

fixes #81

Signed-off-by: Julio Montes <julio.montes@intel.com>
2018-07-04 15:59:33 -05:00
Julio Montes
ce470dc8af
Merge pull request #87 from jcvenegas/kata-1.1.0
Kata 1.1.0
2018-07-04 15:52:04 -05:00
Jose Carlos Venegas Munoz
ad6faf0d59 ci: Skip pkgs test on CI.
The zypper still hangs in the CI.

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2018-07-04 15:26:17 -05:00
Jose Carlos Venegas Munoz
9e93b510e2 Makefile: fix test path.
obs scripts are now in a new directory.

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2018-07-04 14:32:07 -05:00
Jose Carlos Venegas Munoz
122a8cc198 pkgs: build add flag to do local builds.
Add PUSH flag to to do a local build.

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2018-07-04 14:30:41 -05:00
Jose Carlos Venegas Munoz
8e558bed75 pkgs: pkglib: Clean OBS repository.
We populate all the conent of a OBS project.
Lets remove after we checkout to the OBS project.

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2018-07-04 14:30:41 -05:00
Jose Carlos Venegas Munoz
2d0c9cc4f7 scripts: Fix qemu build.
Fix build when we are not building as static qemu.

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2018-07-04 14:30:41 -05:00
Jose Carlos Venegas Munoz
4eae71e4b3 pkgs: kernel: add symlink to patches.
Packaging scripts search for patches in a directory
called 'patches'. We store the kernel patches in a diferent place
to make easy to mantain them.

Lets do a symlink to allow the automation find the patches.

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2018-07-04 14:30:41 -05:00
Jose Carlos Venegas Munoz
5dfc0c1f23 kata: 1.1.0 hashes
Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2018-07-04 14:30:41 -05:00
Jose Carlos Venegas Munoz
69e4f93358 pkgs: sort versions variables.
Make easy to identify variables.

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2018-07-04 14:30:41 -05:00
Jose Carlos Venegas Munoz
a4355a7104 pkgs: Make constent variables names for versions.
Add `kata` prefix to versions variables.

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2018-07-04 14:30:41 -05:00
Jose Carlos Venegas Munoz
1a8fd811db versions: Update to 1.1.0
Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2018-07-04 14:30:41 -05:00
Jose Carlos Venegas Munoz
a26187069c versions: Update to master
update packages to master

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2018-07-04 14:30:41 -05:00
Jose Carlos Venegas Munoz
6396e7c6d6 pkgs: Add commit to build.
We dont have commit when we build the pkg.
Lets define the COMMIT variable to kwnow the commit from each project.

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2018-07-04 14:30:41 -05:00
Jose Carlos Venegas Munoz
90c62f8da1 pkgs: runtime: use DESTDIR variable.
Use DESTDIR to install kata-runtime.

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2018-07-04 14:30:41 -05:00