Commit Graph

5900 Commits

Author SHA1 Message Date
Eric Ernst
e684a54163 docs: add link to VMT on top level README
The VMT process is well documented, but users would need to land on
community repo to find it. Let's make it easier to identify the correct
way to disclose vulnerabilities.

Fixes: #1136

Signed-off-by: Eric Ernst <eric.g.ernst@gmail.com>
2020-11-30 08:12:31 -08:00
Fabiano Fidêncio
68f66c515f agent-ctl: Add void "install" target
Otherwise `make install` run from the top directory would just fail as
the target is not defined.

Fixes: #1149

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2020-11-27 15:26:29 +01:00
Fabiano Fidêncio
5e407758f6 trace-forwarder: Add void "install" target
Otherwise `make install` run from the top directory would just fail as
the target is not defined.

Fixes: #1149

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2020-11-27 15:26:23 +01:00
Julio Montes
70f198d78e cli: check modules and permissions before loading a module
Before loading a module, the check subcommand should check if the
current user can load it.

fixes #3085

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-11-26 11:55:42 -06:00
Julio Montes
cb684cf8ea cli: don't fail if rate limit is exceeded
Don't fail if rate limit is exceeded since this is a
limitation/restriction of Github not a problem in the host.
Print a warning when the rate limit is exceeded.

For more information about Github's rate limit, see
https://developer.github.com/v3/#rate-limiting

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-11-26 11:50:14 -06:00
Bin Liu
b8716d8eec
Merge pull request #1141 from lifupan/fix_thread_spwan
rustjail: fork a new child process to change the pid ns
2020-11-25 15:20:36 +08:00
Bin Liu
8d19b8e013
Merge pull request #1139 from lifupan/skip_networkcheck
rustjail: remove the network ns validation against container
2020-11-25 15:03:18 +08:00
fupan.lfp
9216f2ad63 rustjail: fork a new child process to change the pid ns
The main process do unshare pid namespace, the process
couldn't spawn new thread, in order to avoid this issue,
fork a new child process and do the pid namespace unshare
in the new temporary process.

Fixes: #1140

Signed-off-by: fupan.lfp <fupan.lfp@antfin.com>
2020-11-23 17:57:33 +08:00
fupan.lfp
3b08376c4e rustjail: remove the network ns validation against container
Since kata containers shared the network ns with
the guest system, thus there's no need to do the
network ns check.

Fixes: #1047

Signed-off-by: fupan.lfp <fupan.lfp@antfin.com>
2020-11-23 14:41:22 +08:00
Julio Montes
a853e8eaca
Merge pull request #1124 from devimc/2020-11-17/snap/updateApps
snap: update apps section
2020-11-18 09:21:35 -06:00
James O. D. Hunt
7c12c5481e
Merge pull request #1128 from liubin/fix/1127-delete-wait
runtime: don't wait the second shim process in shim start
2020-11-18 14:19:11 +00:00
Julio Montes
f00655a40f
Merge pull request #1060 from jongwu/rootbus
agent: create pci root Bus Path for arm64
2020-11-18 08:13:30 -06:00
Julio Montes
e411ebc779
Merge pull request #1126 from liubin/fix/1125-enable-lto
agent: enable lto flag for Cargo to get better optimized code
2020-11-18 08:07:58 -06:00
bin liu
c388ec5bef runtime: don't wait the second shim process in shim start
In first shim v2 startup(with `start` command-line option), it will start
the second shim v2 process running as ttrpc server, there is no needs to
wait the second process, because the current shim v2 process will exit immediately.

Fixes: #1127

Signed-off-by: bin liu <bin@hyper.sh>
2020-11-18 17:18:59 +08:00
bin liu
d6acc4c09c agent: enable lto flag for Cargo to get better optimized code
The lto setting controls the -C lto flag which controls LLVM's link time optimizations.
LTO can produce better optimized code, using whole-program analysis,
at the cost of longer linking time.

https://doc.rust-lang.org/cargo/reference/profiles.html#lto

Fixes: #1125

Signed-off-by: bin liu <bin@hyper.sh>
2020-11-18 15:50:27 +08:00
Julio Montes
13a8e4e39e snap: update apps section
Add `kata-runtime` and `kata-collect-data.sh` commands to the apps
section, these two command will be accessible through the commands
`kata-containers.runtime` and `kata-containers.collect-data`
respectively.
Henceforth the snap command for `containerd-shim-kata-v2` will be
`kata-containers.shim`

fixes #1122

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-11-17 11:31:08 -06:00
Julio Montes
1dd77e204f
Merge pull request #1120 from liubin/fix/1119-revert-cleanupcontainer-api
virtcontainers: revert CleanupContainer from PR 1079
2020-11-17 09:11:29 -06:00
Tim Zhang
7201745eae
Merge pull request #1065 from jodh-intel/2.0-dev-add-hypervisors-doc
docs: Create hypervisor summary document
2020-11-17 16:07:18 +08:00
bin liu
fdbf7d3222 virtcontainers: revert CleanupContainer from PR 1079
In PR 1079, CleanupContainer's parameter of sandboxID is changed to VCSandbox, but at cleanup,
there is no VCSandbox is constructed, we should load it from disk by loadSandboxConfig() in
persist.go. This commit reverts parts of #1079

Fixes: #1119

Signed-off-by: bin liu <bin@hyper.sh>
2020-11-17 10:31:33 +08:00
Bo Chen
960227165c
Merge pull request #1121 from c3d/docs/855-hyperlinks
Add hyperlink and fix typo
2020-11-16 15:48:43 -08:00
James O. D. Hunt
91a390f072 docs: Create hypervisor summary document
Split some of the core hypervisor details out of the virtualisation
document and present in a simpler fashion for new users.

Fixes: #1063.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2020-11-16 11:52:40 +00:00
James O. D. Hunt
3eeb25a169 docs: Tidied up virtualisation summary table
- Removed the `QEMU-virtio-fs` entry from the virtualization doc since
  support is now available upstream and the QEMU virtio-fs-specific
  configuration file has been removed.
- Removed NEMU as this is no longer used.
- Sorted the remaining rows.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2020-11-16 11:50:43 +00:00
Ariel Adam
8ec3cf08f3 docs: Adding hyperlink to virtio-net in kata documentation 2.0
Referring virtio-net mentioning in the kata virtualization
documentation to the virtio-networking blog series published
and explaining how it works.

Fixes #612

Signed-off-by: Ariel Adam <aadam@redhat.com>
2020-11-16 10:57:55 +01:00
Ariel Adam
b5b67db8d7 docs: Fixing typo in virtualization.md file
Changing "implementor" to "implementer"

Fixes: #612

Signed-off-by: Ariel Adam <aadam@redhat.com>
Signed-off-by: Christophe de Dinechin <dinechin@redhat.com>
2020-11-16 10:57:22 +01:00
Julio Montes
ac6868250a
Merge pull request #1117 from fidencio/wip/update-crio-version-to-include-fix-for-k8s-oom
versions: Use CRI-O v1.18.4-4-g6dee3891e
2020-11-13 13:22:58 -06:00
Fabiano Fidêncio
4d46d0f0f5 versions: Use CRI-O v1.18.4-4-g6dee3891e
This (unreleased) version of CRI-O brings in the possibility of enabling
the `k8s-oom.bats` test.

Depends-on: github.com/kata-containers/tests#3060

Fixes: #1116

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2020-11-13 15:56:02 +01:00
Christophe de Dinechin
53b5d063e9 agent: Adjust OOM Score to avoid agent being killed.
Under stress, the agent can be OOM-killed, which exists the sandbox.
One possible hard-to-diagnose manifestation is a virtiofsd crash.

Fixes: #1111

Reported-by: Qian Cai <caiqian@redhat.com>
Signed-off-by: Christophe de Dinechin <dinechin@redhat.com>
2020-11-13 11:10:19 +01:00
Tim Zhang
06b9294c7d
Merge pull request #1110 from liubin/fix/1109-add-enable_pprof
runtime: change configuration key name from EnablePprof to enable_pprof
2020-11-13 17:44:34 +08:00
Peng Tao
3b5245fc55
Merge pull request #1079 from liubin/fix/1078-delete-sandboxlist
runtime: delete sandboxlist.go and sandboxlist_test.go
2020-11-13 15:02:51 +08:00
bin liu
14a21c3ab1 runtime: change configuration key name from EnablePprof to enable_pprof
Key name in configuration file is in snake case but not camel case.
And the key is processed as `enable_pprof` in code, the configuration
template file should replace `EnablePprof` it by `enable_pprof`

Fixes: #1109

Signed-off-by: bin liu <bin@hyper.sh>
2020-11-13 14:52:56 +08:00
bin liu
4e3a8c0124 runtime: remove global sandbox variable
Remove global sandbox variable, and save *Sandbox to hypervisor struct.
For some needs, hypervisor may need to use methods from Sandbox.

Signed-off-by: bin liu <bin@hyper.sh>
2020-11-13 09:47:09 +08:00
bin liu
290203943c runtime: delete sandboxlist.go and sandboxlist_test.go
Delete sandboxlist.go and sandboxlist_test.go under virtcontainers package.

Fixes: #1078

Signed-off-by: bin liu <bin@hyper.sh>
2020-11-13 09:47:09 +08:00
Fabiano Fidêncio
61fccef643
Merge pull request #1095 from fidencio/wip/update-crio-version-to-include-fix-for-k8s-copy-file
versions: Use release-1.18 (commit ee9128444bec10)
2020-11-13 01:00:23 +01:00
Bo Chen
258dd55855
Merge pull request #1101 from devimc/2020-11-06/runtime/fixClhDax
runtime: clh: disable virtiofs DAX when FS cache size is 0
2020-11-12 12:26:35 -08:00
Fabiano Fidêncio
9b88a96bc7 versions: Use release-1.18 (commit ee9128444bec10)
Let's update CRI-O version to the commit which introduced the fix for
the "k8s-copy-file" tests.

Depends-on: github.com/kata-containers/tests#3042

Fixes: #1080

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2020-11-12 18:04:47 +01:00
Julio Montes
36f65ce182 runtime: clh: update cloud-hypervisor
Update cloud-hypervisor to commit 2706319.
Fixes a limitation in OpenAPITools/openapi-generator tool,
it's impossible to send go zero types, like false and 0 to
cloud-hypervisor because `omitempty` is added if a field is not
required.
See cloud-hypervisor/cloud-hypervisor#1961 for more information

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-11-12 09:33:56 -06:00
Julio Montes
e1396f0402 runtime: clh: disable virtiofs DAX when FS cache size is 0
Guest consumes 120Mb more of memory when DAX is enabled and the default
FS cache size (8G) is used. Disable dax when it is not required
reducing guest's memory footprint.

Without this patch:

```
7fdea4000000-7fdee4000000 rw-s 18850589 /memfd:ch_ram (deleted)
Size:            1048576 kB
KernelPageSize:        4 kB
MMUPageSize:           4 kB
Rss:              187876 kB
```

With this patch:

```
7fa970000000-7fa9b0000000 rw-s 612001  /memfd:ch_ram (deleted)
Size:            1048576 kB
KernelPageSize:        4 kB
MMUPageSize:           4 kB
Rss:               57308 kB
Pss:               56722 kB
```

fixes #1100

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-11-12 09:33:56 -06:00
Julio Montes
af04d71feb
Merge pull request #1105 from jodh-intel/2.0-dev-fix-kata-check-version-cmp
release: Fix release candidate to major version upgrade check
2020-11-12 09:26:21 -06:00
James O. D. Hunt
8f38265be4 release: Fix release candidate to major version upgrade check
Fix `kata-runtime kata-check`'s network version check which was failing
when the user was running a release candidate build and the latest
release was a major one, two examples of the error being:

- `BUG: unhandled scenario: current version: 1.12.0-rc0, latest version: 1.12.0`
- `BUG: unhandled scenario: current version: 2.0.0-rc0, latest version: 2.0.0`

Fixes: #1104.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2020-11-12 10:07:18 +00:00
James O. D. Hunt
2e0bf40adb tests: Ensure semver build metadata is ignored
According to the Semantic Versioning specification, build metadata must
be ignored for version comparisions, so add some explicit tests for this
scenario to `TestGetNewReleaseType()`.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2020-11-12 10:06:15 +00:00
James O. D. Hunt
4024a8274b release: Make error format string consistent
Use `%s` for both semver parameters.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2020-11-12 10:04:00 +00:00
Fupan Li
671a2be313
Merge pull request #1094 from liubin/fix/991
runtime: sleep 1 second after GetOOMEvent failed
2020-11-11 14:33:57 +08:00
Peng Tao
9dbd1007d7
Merge pull request #1070 from jing-wang4/readme
Agent: README updates for build on ppc64le
2020-11-11 10:15:22 +08:00
Peng Tao
3c88106f65
Merge pull request #1084 from liubin/fix/1081-clean-codes
runtime: clean/refactor code
2020-11-11 10:09:10 +08:00
Christophe de Dinechin
9511b17819
Merge pull request #1045 from c3d/issue/1044-forward-port-annotation-doc
Forward port annotation doc
2020-11-10 11:34:23 +01:00
bin liu
cb0e6094ff runtime: sleep 1 second after GetOOMEvent failed
In some cases, for example agent crashed and not marked dead yet, the GetOOMEvent
will return errors like `connection reset by peer` or `ttrpc: closed`. Do a sleep
with 1 second (agent check interval) and let agent health check to do the check.

Fixes: #991

Signed-off-by: bin liu <bin@hyper.sh>
2020-11-10 12:02:31 +08:00
Bo Chen
359ab16a8f
Merge pull request #1090 from likebreath/1106/clh_upgrade_v0.11.0
versions: Update cloud-hypervisor to release v0.11.0
2020-11-09 15:51:09 -08:00
Archana Shinde
5444a31f7b
Merge pull request #1092 from yuchunyu97/patch-1
docs: Add instructions for enabling VM templating
2020-11-09 15:50:12 -08:00
Christophe de Dinechin
4c78814bda docs: Fix pre-existing spelling mistakes caught by the CI
The documentation contains existing spelling mistakes that are caught by the CI
and prevent checking in. The errors include:

    INFO: Spell checking file 'docs/how-to/how-to-load-kernel-modules-with-kata.md'
    WARNING: Word 'configurated': did you mean one of the following?: configuration, reconfigured, Confederate, confederate
    WARNING: Word 'cri': did you mean one of the following?: cir, crib, chi, cry, Fri, crier
    ERROR: Spell check failed for file: 'docs/how-to/how-to-load-kernel-modules-with-kata.md'
    INFO: spell check failed for document docs/how-to/how-to-load-kernel-modules-with-kata.md
    INFO: Spell checking file 'docs/how-to/how-to-set-sandbox-config-kata.md'
    INFO: Spell check successful for file: 'docs/how-to/how-to-set-sandbox-config-kata.md'
    ERROR: spell check failed, See https://github.com/kata-containers/documentation/blob/master/Documentation-Requirements.md#spelling for more information.

Signed-off-by: Christophe de Dinechin <dinechin@redhat.com>
2020-11-09 16:52:33 +01:00
Christophe de Dinechin
6c083d9410 docs: Add a link to document describing how to use annotations
Add a link to the document listing the available annotations

Fixes: #1044
Forward-port-of: https://github.com/kata-containers/documentation/pull/757

Signed-off-by: Christophe de Dinechin <dinechin@redhat.com>
2020-11-09 16:50:26 +01:00