Commit Graph

5666 Commits

Author SHA1 Message Date
Bo Chen
8edfab73c3
Merge pull request #1170 from likebreath/1203/update_virt_docs
docs: Update the Cloud Hypervisor description in virtualization.md
2020-12-10 09:04:20 -08:00
Bo Chen
d47122e959 docs: Update the Cloud Hypervisor description in virtualization.md
The current description on the Cloud Hypervisor support in Kata
containers were introduced back to kata 1.10 and are out-dated.

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

Fixes: #1167

Signed-off-by: Bo Chen <chen.bo@intel.com>
2020-12-10 06:17:53 -08:00
Peng Tao
e167bf30e3
Merge pull request #1165 from liubin/fix/exec-hang-when-bg-process-running
agent: exit from exec hangs if background process is present
2020-12-08 20:32:23 +08:00
Julio Montes
94b9b812c7
Merge pull request #1173 from devimc/2020-12-07/updateSnapDoc
[forwardport] install: Improve snap documentation
2020-12-07 14:07:25 -06:00
Julio Montes
8f53893535 install: Improve snap documentation
Improve snap documentation, document how to install
kata 1.x and 2.x, how to configure them and their integration
with container engines.

fixes #1138

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-12-07 08:56:11 -06:00
bin liu
1ca415d87e agent: exit from exec hangs if background process is present
This is the Rust porting of https://github.com/kata-containers/agent/pull/371

`read_stdout`/`read_stderr` is blocking rpc calls, if exec process
exited, these calls is on blocking state for reading on process's
term master fd, and can't get a chance to break the wait.

In this PR, `read_stdout`/`read_stderr` will not read directly from
a term master of a process, instead, it will first have to get
an fd to read from newly added `epoller.poll()`. `epoller.poll()` may returns:

- the term master fd of exec process, if the process is running.
- a fd(piped fd) will return EOF when reading to indicate that th process is exited.

Fixes: #1160

Signed-off-by: bin liu <bin@hyper.sh>
2020-12-07 10:52:44 +08:00
Peng Tao
4bca7312c7
Merge pull request #1158 from liubin/fix/1156-fix-cpuset
handle vcpus properly utilized in the guest
2020-12-04 22:32:15 +08:00
Bin Liu
35e79c97cf
Merge pull request #920 from YchauWang/update-docs-2.0-5
docs: fix the custom agent binary file path for creating initrd image
2020-12-04 21:41:20 +08:00
Ychau Wang
a00f7c3484 docs: fix the custom agent binary file path for creating initrd image
fix the custom agent binary file path for creating an initrd image in
the Developer-Guide.md file.

Fixes: #919

Signed-off-by: Ychau Wang <wangyongchao.bj@inspur.com>
2020-12-04 17:19:23 +08:00
Fabiano Fidêncio
f7383ef835
Merge pull request #1166 from cmaf/fix-ctx-port
shimv2: handle ctx passed by containerd
2020-12-03 19:45:52 +01:00
Bin Liu
4e0a7e31f9
Merge pull request #1103 from likebreath/1111/clh_fix_cleanupVM
runtime: clh: Enforce to call 'cleanupVM' for 'stopSandbox'
2020-12-03 17:34:26 +08:00
Chelsea Mafrica
0155fe1260 shimv2: handle ctx passed by containerd
Sometimes shim process cannot be shutdown because of container list
is not empty. This container list is written in shim service, while
creating container. We find that if containerd cancel its Create
Container Request due to timeout, but runtime didn't handle it properly
and continue creating action, then this container cannot be deleted at
all. So we should make sure the ctx passed to Create Service rpc call
is effective.

Fixes #1088

Signed-off-by: Yves Chan <shanks.cyp@gmail.com>
Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
2020-12-02 14:28:31 -08:00
Archana Shinde
f96cdc1a67
Merge pull request #1114 from c3d/bug/1111-agent-oom-killer
agent: Adjust OOM Score to avoid agent being killed.
2020-12-02 11:40:35 -08:00
Julio Montes
2c6cee0d28
Merge pull request #1146 from devimc/2020-11-19/fixKataCheck
[forward port]  cli: make check subcommand more tolerant to failures
2020-12-02 13:11:30 -06:00
bin liu
a793b8d90d agent: update cpuset of container path
After cpu hot-plugged is available, cpuset for containers will be written into
cgroup files recursively, the paths should include container's cgroup path, and up
to root path of cgroup filesystem.

Fixes: #1156, #1159

Signed-off-by: bin liu <bin@hyper.sh>
2020-12-02 10:38:26 +08:00
bin liu
705182d04e agent: ignore updating cpuset error when update cgroups
The result of `cpuset_controller.set_cpus(&cpu.cpus)` is unwrapped,
this will lead creating container to fail if cpuset is set.

The sandbox's `CreateContainer` sequence is:

c, err := newContainer(s, &contConfig)
err = c.create()
  c.sandbox.agent.createContainer(c.sandbox, c) (1)
err = s.updateResources()
  oldCPUs, newCPUs, err := s.hypervisor.resizeVCPUs(sandboxVCPUs) (2)

cpuset only avaiable after `s.hypervisor.resizeVCPUs` has been called at (2),
and then cpuset is written to cgourps file.

Fixes: #1159

Signed-off-by: bin liu <bin@hyper.sh>
2020-12-02 10:38:16 +08:00
Bo Chen
647331ace6 runtime: clh: Enforce to call 'cleanupVM' for 'stopSandbox'
We should always cleanup the vm directory when doing `stopSandbox`,
while we are skipping the cleanup process on some error code paths when
using cloud-hypervisor driver.

Fixes: #1098

Signed-off-by: Bo Chen <chen.bo@intel.com>
2020-12-01 17:27:44 -08:00
Eric Ernst
095dace7d6
Merge pull request #1137 from egernst/vmt-to-top
docs: add link to VMT on top level README
2020-12-01 16:25:22 -08:00
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
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