Commit Graph

6228 Commits

Author SHA1 Message Date
bin liu
40418f6d88 runtime: add geust memory dump
When guest panic, dump guest kernel memory to host filesystem.
And also includes:
- hypervisor config
- hypervisor version
- and state of sandbox

Fixes: #1012

Signed-off-by: bin liu <bin@hyper.sh>
2020-11-05 16:04:21 +08:00
Peng Tao
ff13bde3c1 version: revert back to crio 1.8.3
This reverts commit 87848e874e as it is
breaking the k8s configMap test.

Fixex: #1080
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-11-05 14:48:32 +08:00
Jianyong Wu
6c2fc233e2 agent: create pci root Bus Path for arm64
port https://github.com/kata-containers/agent/pull/860 here.

Fixes: #1059
Signed-off-by: Jianyong Wu <jianyong.wu@arm.com>
2020-11-05 12:18:09 +08:00
Peng Tao
a958eaa8d3 runtime: mount shared mountpoint readonly
bindmount remount events are not propagated through mount subtrees,
so we have to remount the shared dir mountpoint directly.

E.g.,
```
mkdir -p source dest foo source/foo

mount -o bind --make-shared source dest

mount -o bind foo source/foo
echo bind mount rw
mount | grep foo
echo remount ro
mount -o remount,bind,ro source/foo
mount | grep foo
```
would result in:
```
bind mount rw
/dev/xvda1 on /home/ubuntu/source/foo type ext4 (rw,relatime,discard,data=ordered)
/dev/xvda1 on /home/ubuntu/dest/foo type ext4 (rw,relatime,discard,data=ordered)
remount ro
/dev/xvda1 on /home/ubuntu/source/foo type ext4 (ro,relatime,discard,data=ordered)
/dev/xvda1 on /home/ubuntu/dest/foo type ext4 (rw,relatime,discard,data=ordered)
```

The reason is that bind mount creats new mount structs and attaches them to different mount subtrees.
However, MS_REMOUNT only looks for existing mount structs to modify and does not try to propagate the
change to mount structs in other subtrees.

Fixes: #1061
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-11-04 17:51:49 +08:00
Peng Tao
125e21cea3 runtime: readonly mounts should be readonly bindmount on the host
So that we get protected at the VM boundary not just the guest kernel.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-11-04 17:51:49 +08:00
Bin Liu
259589ad89
Merge pull request #1051 from yuchunyu97/patch-1
docs: Fix incorrect docs in config file
2020-11-04 17:46:21 +08:00
Bin Liu
045fc2f7a2
Merge pull request #1052 from yuchunyu97/patch-2
CI: Fix incorrect URL
2020-11-04 16:53:56 +08:00
AIsland
5f0abc20f0 CI: Fix incorrect URL
Correct the link in the GitHub action commit message check showing users how to format all commits.

Fixes: #1053

Signed-off-by: AIsland <yuchunyu01@inspur.com>
2020-11-04 10:05:20 +08:00
AIsland
b6f8a1d5af docs: Fix incorrect docs in config file
Correct the default configuration of [hypervisor.qemu] shared_fs in configuration-qemu.toml to virtio-fs in kata 2.0.

Fixes: #1054

Signed-off-by: AIsland <yuchunyu01@inspur.com>
2020-11-04 09:58:02 +08:00
Bo Chen
93d7962510 clh: Consolidate the code path for device unplug
In cloud-hypervisor, it provides a single unified way of unplugging
devices, e.g. the `/vm.RemoveDevice` HTTP API. Taking advantage of this
API, we can simplify our implementation of `hotplugRemoveDevice` in
`clh.go`, where we can consolidate similar code paths for different
device unplug (e.g. no need to implement `hotplugRemoveBlockDevice` and
`hotplugRemoveVfioDevice` separately). We will only need to retrieve the
right `deviceID` based on the type of devices, and use the single
unified HTTP API for device unplug.

Fixes: #1076

Signed-off-by: Bo Chen <chen.bo@intel.com>
2020-11-03 15:46:38 -08:00
James O. D. Hunt
43ec107d94
Merge pull request #1066 from jodh-intel/2.0-dev-update-readme
docs: Update top-level README
2020-11-03 16:05:55 +00:00
Jing Wang
18a2245986 Agent: README updates for build on ppc64le
README updates for agent build on ppc64le

  Fixes: #1069

Signed-off-by: Jing Wang <jing.wang4@ibm.com>
2020-11-03 15:29:43 +00:00
Jing Wang
655f2649b3 Agent: README updates for build on ppc64le
README updates for agent build on ppc64le

  Fixes: #1069

Signed-off-by: Jing Wang <jing.wang4@ibm.com>
2020-11-03 15:24:08 +00:00
James O. D. Hunt
62c7e09405 docs: Remove credits
Removed the packagecloud credits since we no longer produce distro
packages for Kata 2.x.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2020-11-03 11:38:59 +00:00
James O. D. Hunt
679df0fb77 docs: Update top-level README
Rework the top-level README to reflect the current use of this
repository.

Fixes: #1064.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2020-11-03 11:38:57 +00:00
Chelsea Mafrica
32505af7bb
Merge pull request #1037 from GabyCT/topic/updatecrio
versions: Update crio version
2020-11-02 16:58:22 -08:00
Jing Wang
dfe364f885 Agent: README updates for build on ppc64le
README updates for agent build on ppc64le

Fixes: #1069

Signed-off-by: Jing Wang <jing.wang4@ibm.com>
2020-11-02 20:26:36 +00:00
Peng Tao
bf57cd844e
Merge pull request #1057 from devimc/29-10-2020/clh/improveMemFoot
runtime: cloud-hypervisor: reduce memory footprint
2020-11-02 15:13:06 +08:00
Bin Liu
8823ca31ad
Merge pull request #1042 from devimc/2020-10-21/unitests/sandbox.rs
agent: Improve unit test coverage for src/sandbox.rs
2020-10-30 11:26:29 +08:00
Bin Liu
7b9013f047
Merge pull request #1035 from lifupan/fix_thread_panic
rustjail: fix the issue of create thread failed causing current thread panic
2020-10-30 11:25:32 +08:00
Julio Montes
77b50969ea runtime: cloud-hypervisor: reduce memory footprint
Cloud-hypervisor supports DAX, let's enable it to reduce its memory
footprint.

Before this patch:

**19.96M**

```
20448kB -- [/usr/share/kata-containers/kata.img]
```

With this patch:

**10.83M**

```
11100kB -- [/usr/share/kata-containers/kata.img]
```

fixes #1056

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-10-29 14:21:57 -06:00
Julio Montes
196e8d81cf
Merge pull request #1032 from devimc/2020-10-21/unitests/container.rs
Improve unit test coverage for rustjail/container.rs
2020-10-28 16:08:23 -06:00
Julio Montes
2e1a8f0ae9 agent: Improve unit test coverage for src/sandbox.rs
Improve unit test coverage for src/sandbox.rs

fixes #293

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-10-28 08:10:46 -06:00
Gabriela Cervantes
87848e874e versions: Update crio version
This PR updates the crio version from 1.18.3 to 1.18.4 in order to include
the fix https://github.com/cri-o/cri-o/pull/4284.

Fixes #1036

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2020-10-27 10:50:09 -06:00
fupan.lfp
172d015e1b rustjail: fix the issue of create thread failed causing thread panic
It's should catch the failed error of spawning a new thread, otherwise,
it would cause the current thread panic.

Fixes: #1034

Signed-off-by: fupan.lfp <fupan.lfp@antfin.com>
2020-10-27 23:31:34 +08:00
Julio Montes
9e93463bb6 agent/rustjail: improve unit test coverage for rustjail/container.rs
Improve unit test coverage for rustjail/container.rs

fixes #282

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-10-27 09:28:38 -06:00
Julio Montes
ad4f7b86f2 agent/rustjail: make mount and umount2 public
make mount and umount2 public, this way they can be
used in other files

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-10-27 09:28:38 -06:00
Julio Montes
926a618624 agent/rustjail: fix typo
not suppoerted  ->  not supported

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-10-27 09:28:38 -06:00
Julio Montes
8130d9b2dd agent/rustjail: don't use unwrap in container::oci_state
replace unwrap with `match` statements, this way we can write
unit tests that don't panic

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-10-27 09:28:38 -06:00
Julio Montes
5d111071be rustjail: add mock implementation for cgroup manager
Only root is able to create and manipulate cgroups, this mock
implementation of a cgroup manager can used in unit testing.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-10-27 09:28:38 -06:00
James O. D. Hunt
157dd041b2
Merge pull request #895 from Apokleos/dev
agent: Update build instructions
2020-10-27 14:54:51 +00:00
James O. D. Hunt
583ed55680
Merge pull request #1027 from knittl/feature/kata-subcommands-aliases
cli: Provide aliases for kata-* subcommands and options
2020-10-27 09:58:05 +00:00
Tim Zhang
d1987f392d
Merge pull request #1018 from c3d/bug/1017-missing-makefile-variable
runtime: Restore QEMUVIRTIOFSPATH variable in Makefile
2020-10-27 11:33:05 +08:00
LiYa'nan
e3eff0eb15 agent: Update build instructions
Fix the instructions explaining how to build the agent from source now that make needs to be run to auto-generate some source files.

Fixes: #889.

Signed-off-by: LiYa'nan <oliverliyn@gmail.com>
2020-10-27 01:19:21 +00:00
Peng Tao
f77937de35
Merge pull request #1025 from wainersm/static_build_qemu_patches
Use apply_patches.sh in qemu and kernel scripts
2020-10-26 18:23:41 +08:00
Bin Liu
43770b28da
Merge pull request #1029 from bergwolf/agent-proto
clean up agent proto files
2020-10-26 17:06:18 +08:00
Peng Tao
0896ce80a4 agent: update proto file copyright
Now that it is Ant Group...

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-10-26 16:03:47 +08:00
Peng Tao
6e9ca45732 agent: generate proto files properly
Need to generate all protos.

Depends-on: github.com/kata-containers/tests#3006
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-10-25 11:27:00 +08:00
Peng Tao
837343f08a agent-ctl: update cargo.lock
Just compiling would show that the cargo.lock file is not updated.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-10-25 10:58:27 +08:00
Peng Tao
b316661818 runtime: remove the unused proto files
These are moved to the agent and no longer needed.

Fixes: #1028
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-10-25 10:57:38 +08:00
Peng Tao
54e23c8302 agent: move gogo.proto out of the github.com namespance
To follow the same namespace scope as other proto files.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-10-25 10:44:53 +08:00
Peng Tao
583e6ed3e5 agent: types.pb.go is not regenerated
When types.proto was relocated, types.pb.go is not regenerated and still
references the old location.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-10-25 10:35:35 +08:00
Peng Tao
74a155c65b
Merge pull request #1023 from lifupan/fix_stdio
agent: fixes the permissions of PID 1's STDIO
2020-10-25 10:21:11 +08:00
Daniel Knittl-Frank
bb19fcb936 docs: Update documentation with new subcommand forms
Remove the old subcommands from the documentation and replace them with
the new form (without the redundant `kata-` prefix).

Signed-off-by: Daniel Knittl-Frank <knittl89+git@googlemail.com>
2020-10-24 15:28:54 +02:00
Daniel Knittl-Frank
d2fe709174 cli: Use new subcommand forms in kata-manager script
Update the `kata-manager` script to call the new subcommand forms
without `kata-` prefix.

Signed-off-by: Daniel Knittl-Frank <knittl89+git@googlemail.com>
2020-10-24 15:27:32 +02:00
Daniel Knittl-Frank
4d9ab0cd21 cli: Support new subcommand forms in bash completion
Support new `check` and `env` subcommands in bash completion.

Signed-off-by: Daniel Knittl-Frank <knittl89+git@googlemail.com>
2020-10-24 15:27:32 +02:00
Daniel Knittl-Frank
c5d355e1ff cli: Remove kata- prefix from env and check subcommands
Provide the subcommands `kata-env` and `kata-check` as `env` and `check`
respectively.

Fixes #1011

Signed-off-by: Daniel Knittl-Frank <knittl89+git@googlemail.com>

fixup! cli: Add aliases to kata-env and kata-check commands
2020-10-24 15:25:17 +02:00
Peng Tao
063e8bd801
Merge pull request #1010 from liubin/feature/1004-add-version-for-kata-monitor
Feature/1004 add version for kata monitor
2020-10-24 11:13:22 +08:00
Peng Tao
fba181088b
Merge pull request #1021 from Tim-Zhang/autogen-proto
agent: Generate proto files programmatically
2020-10-24 11:12:24 +08:00
LiYa'nan
f134b4a301 agent: Update build instructions
Fix the instructions explaining how to build the agent from source now that make needs to be run to auto-generate some source files.

Fixes: #889

Signed-off-by: LiYa'nan <oliverliyn@gmail.com>
2020-10-24 03:06:41 +00:00