Commit Graph

5350 Commits

Author SHA1 Message Date
Graham Whaley
cbf7fb2f75 CI: travis: add yq installer script
We need to have `yq` installed before we can 'make', as we
now use it for a version check in the build. But, we may not
have golang installed. Add a script that installs `yq` via
curl'ing from the github releases.
This was cloned from the function in the tests repo .ci scripts
that perform the same action.

Signed-off-by: Graham Whaley <graham.whaley@intel.com>
2018-10-30 15:44:06 +00:00
Marco Vedovati
c8ae9c077c rootfs.sh: improve usage output
Improve rootfs.sh usage output to have a consistent layout and
documentation of options and environment variables.

Signed-off-by: Marco Vedovati <mvedovati@suse.com>
2018-10-30 16:27:57 +01:00
Fupan Li
11c6753bd5 cli: fix the issue of using wrong path to get version
Both of the netmon and proxy should use the right path
figured out from the configure instead of the default settings
to get their versions.

Fixes: #868

Signed-off-by: Fupan Li <lifupan@gmail.com>
2018-10-30 17:25:00 +08:00
Peng Tao
21a671eabe network: set endpoint pci address when hotplug
So that agent can use it to check and wait for the requested nic.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-10-30 11:43:40 +08:00
zhangwei_cs
58ce1b88c4
Merge pull request #834 from flx42/guest-hooks
cli: add guest hook path option (v2)
2018-10-30 09:41:50 +08:00
Peng Tao
26cef3ce0f
Merge pull request #845 from bergwolf/deepcompare
factory: use customised deep compare
2018-10-30 08:50:56 +08:00
Peng Tao
381ea37d86
Merge pull request #745 from bergwolf/query-migrate
qemu: query migrate status
2018-10-30 08:50:21 +08:00
Felix Abecassis
33abb3ecf8 cli: add guest hook path option in the configuration file
Add support for specifying an optional drop-in path for guest OCI hooks.
This is the runtime side for leveraging the agent change introduced in
kata-containers/agent@980023ec62

Fixes: #720

Co-authored-by: Edward Guzman <eguzman@nvidia.com>
Co-authored-by: Felix Abecassis <fabecassis@nvidia.com>
Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
2018-10-29 13:06:22 -07:00
Salvador Fuentes
8b539ef600 release: Add k8s compatible version to release notes
Include in the release notes the kubernetes version that
has been tested with the release.

Fixes: #235.

Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
2018-10-29 11:18:04 -06:00
Peng Tao
6d17e27de0
Merge pull request #852 from amshinde/ipvlan
Add support for ipvlan network driver
2018-10-29 16:41:05 +08:00
zhangwei_cs
95386fb1dd
Merge pull request #734 from WeiZhang555/add-cgroup-support
Add cgroup support
2018-10-27 16:04:28 +08:00
Wei Zhang
34fe3b9d6d cgroups: add host cgroup support
Fixes #344

Add host cgroup support for kata.

This commits only adds cpu.cfs_period and cpu.cfs_quota support.

It will create 3-level hierarchy, take "cpu" cgroup as an example:

```
/sys/fs/cgroup
|---cpu
   |---kata
      |---<sandbox-id>
         |--vcpu
      |---<sandbox-id>
```

* `vc` cgroup is common parent for all kata-container sandbox, it won't be removed
after sandbox removed. This cgroup has no limitation.
* `<sandbox-id>` cgroup is the layer for each sandbox, it contains all other qemu
threads except for vcpu threads. In future, we can consider putting all shim
processes and proxy process here. This cgroup has no limitation yet.
* `vcpu` cgroup contains vcpu threads from qemu. Currently cpu quota and period
constraint applies to this cgroup.

Signed-off-by: Wei Zhang <zhangwei555@huawei.com>
Signed-off-by: Jingxiao Lu <lujingxiao@huawei.com>
2018-10-27 09:41:35 +08:00
Wei Zhang
523d49c076 vendor: add github.com/containerd/cgroups lib
Add new vendor library "github.com/containerd/cgroups"
commit: 5017d4e9a9cf2d4381db99eacd9baf84b95bfb14

This library is for host cgroup support for next commit.

Signed-off-by: Wei Zhang <zhangwei555@huawei.com>
2018-10-27 09:41:27 +08:00
Sebastien Boeuf
2c2a60faf1
Merge pull request #851 from amshinde/modify-driver-fetch
vfio: Change the way the driver is fetched
2018-10-26 14:03:32 -07:00
Sebastien Boeuf
110f7a8a29
Merge pull request #858 from sboeuf/rely_agent_types
vendor: Rely on new agent package types
2018-10-26 13:05:34 -07:00
Sebastien Boeuf
38d56c994e netmon: Rely on agent/pkg/types instead of duplicating types
Now that the agent has split the generic types in their own package,
kata-netmon can use them directly and get rid of the duplication of
those. This is very helpful as it will prevent structures from being
out of sync between kata-netmon and the kata-runtime, without bringing
in the huge overhead that the initial grpc package was introducing.

Fixes #857

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2018-10-26 09:36:01 -07:00
Sebastien Boeuf
309dcf9977 vendor: Update the agent vendoring based on pkg/types
Some agent types definition that were generic enough to be reused
everywhere, have been split from the initial grpc package.

This prevents from importing the entire protobuf package through
the grpc one, and prevents binaries such as kata-netmon to stay
in sync with the types definitions.

Fixes #856

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2018-10-26 09:35:59 -07:00
Eric Ernst
a184f98cc9
Merge pull request #272 from raravena80/master
install: Add AWS installation guide
2018-10-26 04:51:14 +01:00
Archana Shinde
0acbbf0651 network: Add support for ipvlan
Support ipvlan interfaces by setting up tc redirect rules.

Fixes #591

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2018-10-25 18:58:48 -07:00
Zhao Xinda
24b89a9dad kernel: configs: Add Intel GPU support
The Intel GPU support has been enabled in kata runtime, but the
guest kernel of kata container lacks the support of Intel GPU,
so this commit enables it as default in guest kernel.

CONFIG_DRM, CONFIG_DRM_I915 and CONFIG_DRM_I915_USERPTR are necessary.
Others are obtained by running command "make menuconfig" and selecting
the following options.

Device Drivers
---> Graphics support
---> Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)

Device Drivers
---> Graphics support
---> Intel 8xx/9xx/G3x/G4x/HD Graphics

Fixes #232

Signed-off-by: Zhao Xinda <xinda.zhao@intel.com>
2018-10-26 08:50:23 +08:00
Jose Carlos Venegas Munoz
1d6c296649
Merge pull request #280 from jodh-intel/ci-add-tests-for-other-install-doc-methods
CI: Test remaining install methods
2018-10-25 16:46:15 -05:00
Ricardo Aravena
942d5344e0
install: Add AWS installation guide
Fixes #273

Installation guide for AWS.

Signed-off-by: Ricardo Aravena <raravena@branch.io>
2018-10-25 08:49:59 -07:00
James O. D. Hunt
2f07105e1f CI: Test remaining install methods
Add new CI tests to ensure that the following installation methods are
also tested:

- "Automatic" method ([`kata-manager`](https://github.com/kata-containers/tests/tree/master/cmd/kata-manager))
- "Scripted" method ([`kata-doc-to-script`](https://github.com/kata-containers/tests/blob/master/.ci/kata-doc-to-script.sh))

**Note:** the "Automatic" method is **not** the same as the existing
`kata-manager` test: the existing test executes the "Manual"
installation method (which runs `kata-manager` to execute the
appropriate distro-specific install guide). However, this new test
executes the `install/installing-with-kata-manager.md` document, which
subsequently calls the `kata-manager` script.

Since the "Automatic" and "Scripted" installation methods are designed
to run "standalone" (without requiring any local git repo clones), the
script which runs these new tests has to take care to ensure the
environment they run in is clean. It does this by using the following
approach:

- Removes any local Kata github repos from the standard `GOPATH`
  locations (to ensure the scripts do not inadvertently access local
  files) [1].
- Creates a temporary directory containing:
  - A copy of *itself*.
  - The scripts it generated from the "Automatic" and "Scripted" installation documents.
- Re-exec's itself to run the version in the temporary directory,
  passing an option that tells itself to simply execute the scripts in
  the specified directory.
- It then runs the scripts in the directory specified.

---

[1] - Since the recursive delete of all local Kata github repos is
potentially dangerous, the test will immediately fail if the standard
`KATA_DEV_MODE` variable is set (since this denotes a developer system)
and will also fail unless the standard `CI` variable is set (denoting
the script is running in a Continuous Integration environment, such as
JenkinsCI.

Fixes #278.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-10-25 16:28:22 +01:00
James O. D. Hunt
78692a1605 CI: Add main function to doc test script
Wrap the function calls in the doc test script in a `main()` function to
simplify future changes.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-10-25 16:28:22 +01:00
James O. D. Hunt
83c38c229e CI: Improve doc test script setup function
Make `setup()` clone the tests repo and check for the `kata-manager`
script.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-10-25 16:28:22 +01:00
James O. D. Hunt
4b1839fc37 CI: Refactor function in install doc test
Split out a function to create a container from
`test_distro_install_guide() in the script used to test install docs.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-10-25 16:28:22 +01:00
James O. D. Hunt
d9c91d3723 CI: Remove golang dependency on doc test script
The script used to test the install docs does not actually use the
golang binary (it only uses the `GOPATH` variables) so remove the
unnecessary call to `go`.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-10-25 16:28:22 +01:00
James O. D. Hunt
8334d90979 CI: Add setup function to doc test script
Create a `setup()` function in the test script used to test
the install documents.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-10-25 16:28:22 +01:00
James O. D. Hunt
e74c431d7c CI: Refactor check_install_guides()
Rework the logic in `check_install_docs()` to make the intention
clearer and support adding additional tests.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-10-25 16:28:22 +01:00
James O. D. Hunt
d21eaaf9e8 CI: Rename+cleanup install doc test function
Rename the `check_install_guides()` function to `check_install_docs()`
and clean up:

- Improve messages.
- Add more braces around variables.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-10-25 16:28:22 +01:00
James O. D. Hunt
3d08ccd6db CI: Fold long Travis check line
Folded the overly-long Travis check line in `check_install_guides()`.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-10-25 16:28:22 +01:00
James O. D. Hunt
f4351e4324 CI: Make info() variable local
Make the variable in the `info()` function a `local` one.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-10-25 16:28:22 +01:00
James O. D. Hunt
7dba230a1c docs: Add instructions to run the kata-doc-to-script generated scripts
Update the `kata-doc-to-script` install document to actually execute the
generated scripts, allowing the entire installation to be tested by the CI.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-10-25 16:28:19 +01:00
James O. D. Hunt
bdec513ca4
Merge pull request #189 from ygefen/doc-patch
docs: Fix link in README
2018-10-25 10:41:37 +01:00
Sebastien Boeuf
c7a9e454ac
Merge pull request #827 from amshinde/tc-filtering
network: Use tc filtering rules in bridge mode
2018-10-24 15:21:54 -07:00
Archana Shinde
c38792ef9e config: Add documentation for tcfilter in configuration.toml
Document this mode for users to be able to use it.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2018-10-24 13:38:57 -07:00
Archana Shinde
17be8e37f5 network: Introduce constants for the network model strings
Introduce constants for the network model strings, so as to
avoid using the strings directly at multiple places.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2018-10-24 13:37:54 -07:00
Yonatan Gefen
06437bb51e docs: Fix link in README
Correct rootfs builder link in the image builder README.

Fixes #185.

Signed-off-by: Yonatan Gefen <yoni.gefen@gmail.com>
2018-10-24 13:52:00 -04:00
Archana Shinde
5da973d465 test: Add test to verify tc redirect
The test verifies tc filter setup by creating a test veth interface.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2018-10-24 10:46:02 -07:00
Archana Shinde
e20dbd04e0 network: Use tc redirect filter to redirect traffic to the VM
Introduce a new mode that uses tc filters to redirect traffic from
the network interface created by the network plugin to a
tap interface that we connect to the VM.
This mode will help support ipvlan as well.

Fixes #144

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2018-10-24 10:46:00 -07:00
James O. D. Hunt
67982e7a0f docs: Make "Scripted" installation method executable
Converted the plain code blocks in
`install/installing-with-kata-doc-to-script.md` to bash code blocks so
that they are executable by... `kata-doc-to-script.sh`.

Also, removed the backslashes to let github render scroll bars for
consistency with other docs.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-10-24 09:19:03 +01:00
zhangwei_cs
5a8b738818
Merge pull request #733 from caoruidong/qemu-ns
cli: add configuration option to use or not use host netns
2018-10-24 11:35:33 +08:00
James O. D. Hunt
0215c83e36
Merge pull request #282 from jodh-intel/ci-set-travis-golang-version
CI: Pin Travis golang version
2018-10-23 17:31:54 +01:00
James O. D. Hunt
b40b9ff13d CI: Pin Travis golang version
Travis appears to be providing a version of golang that is too old for
https://mvdan.cc/xurls/cmd/xurls, which is used by the CI scripts in the
tests repo.

See:

- https://github.com/kata-containers/runtime/pull/744
- https://github.com/kata-containers/tests/pull/843#issuecomment-432297737

Required adding a NOP makefile to avoid Travis from trying to build
this repo using `go`.

Fixes #281.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-10-23 17:25:20 +01:00
Jose Carlos Venegas Munoz
59f29270ee
Merge pull request #184 from marcov/move-config
tests: get config from distro-specific config.sh
2018-10-23 09:56:47 -05:00
James O. D. Hunt
2a54ac9830
Merge pull request #277 from jodh-intel/improve-readme
docs: Improve table in install README
2018-10-23 15:38:31 +01:00
Graham Whaley
f3ef220dce
Merge pull request #744 from jodh-intel/update-to-golang-1.10.4
versions: Update golang to 1.10.4
2018-10-23 14:56:11 +01:00
James O. D. Hunt
526d55b4af versions: Update golang to 1.10.4
Move to golang version 1.10.4 -- the oldest stable golang release at the
time of writing -- since golang 1.10+ is needed to make namespace
handling safe.

Re-ordered a couple of structs (moved `sync.WaitGroup` fields) to keep
the `maligned` linter happy. Previously:

``
virtcontainers/pkg/mock/cc_proxy_mock.go:24:18⚠️ struct of size 160 could be 152 (maligned)
virtcontainers/monitor.go:15:14⚠️ struct of size 80 could be 72 (maligned)
```

See:

- https://github.com/golang/go/issues/20676
- 2595fe7fb6

Also bumped `languages.golang.meta.newest-version` to golang version
1.11, which is the newest stable release at the time of writing.

Fixes #148.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-10-23 14:20:12 +01:00
James O. D. Hunt
62992f5485 versions: Update cri containerd version for golang 1.10.2 fix
Updated `externals.cri-containerd.version` in `versions.yaml` to the
newest version that includes the fix for building on golang 1.10.2:

- 8b0d53c09c

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2018-10-23 14:20:09 +01:00
Graham Whaley
ad911576a7
Merge pull request #279 from marcov/fix-kata-manager
install: clean instructions for kata-manager
2018-10-23 09:51:40 +01:00