Commit Graph

5258 Commits

Author SHA1 Message Date
Bin Liu
7e7d4c8cea
Merge pull request #814 from bergwolf/agent-mount
agent: fix UT failures due to chdir
2020-09-28 15:22:35 +08:00
Peng Tao
b03d958e2f gitignore: ignore agent service file
As it is auto-generated.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-09-28 14:16:11 +08:00
Peng Tao
64b4f69847 agent: fix UT failures due to chdir
Current working directory is a process level resource. We cannot call
chdir in parallel from multiple threads, which would cause cwd confusion
and result in UT failures.

The agent code itself is correct that chdir is only called from spawned
child init process. Well, there is one exception that it is also called
in do_create_container() but it is safe to assume that containers are
never created in parallel (at least for now).

Fixes: #782
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-09-28 14:09:22 +08:00
Hui Zhu
fb12fff4d8
Merge pull request #808 from lifupan/2.0-dev
agent: Only allow proc mount if it is procfs
2020-09-28 10:09:47 +08:00
Peng Tao
5596eaa31d
Merge pull request #441 from liubin/feature/245-add-debug-console
kata 2.0: add debug console service
2020-09-28 10:06:13 +08:00
Peng Tao
ac6f020c6c
Merge pull request #697 from keloyang/destroy
runtime: Call s.newStore.Destroy if globalSandboxList.addSandbox
2020-09-27 16:30:24 +08:00
Peng Tao
b20ca6334b
Merge pull request #733 from cailca/732
shimv2: add a comment in checkAndMount()
2020-09-27 16:29:51 +08:00
bin liu
484a595f1a runtime: add enable_debug_console configuration item for agent
Set enable_debug_console=true in Kata's congiguration file,
runtime will pass `agent.debug_console`
and `agent.debug_console_vport=1026` to agent.

Fixes: #245

Signed-off-by: bin liu <bin@hyper.sh>
2020-09-27 15:04:59 +08:00
bin liu
febdf8f68c runtime: add debug console service
Add `kata-runtime exec` to enter guest OS
through shell started by agent

Fixes: #245

Signed-off-by: bin liu <bin@hyper.sh>
2020-09-27 10:57:17 +08:00
Bin Liu
740c45ac61
Merge pull request #800 from Kvasscn/rust-version-bump-test
osbuilder: specify default toolchain verion in rust-init
2020-09-25 17:49:01 +08:00
fupan.lfp
acaa806cc7 agent: Only allow proc mount if it is procfs
This only allows some whitelists files bind mounted under proc
and prevent other malicious mount to procfs.

Fixes: #807

Signed-off-by: fupan.lfp <fupan.lfp@antfin.com>
2020-09-25 15:00:07 +08:00
Peng Tao
594519d883
Merge pull request #790 from likebreath/upgrade_clh_v0.10.0
runtime: Update CLH client pkg to version v0.10.0
2020-09-25 11:51:11 +08:00
zhanghj
ca501e5478 osbuilder: specify default toolchain verion in rust-init.
Specify default toolchain version in rust-init.

Fixes: #799

Signed-off-by: zhanghj <zhanghj.lc@inspur.com>
2020-09-24 23:20:43 -04:00
Christophe de Dinechin
8cdccedfb3
Merge pull request #792 from dgibson/bug791
agent/oci: Don't use deprecated Error::description() method
2020-09-24 11:49:06 +02:00
fupan.lfp
33513fb49b rustjail: make the mount error info much more clear
Make the invalid mount destination's error info much
more clear.

Signed-off-by: fupan.lfp <fupan.lfp@antfin.com>
2020-09-24 17:48:53 +08:00
David Gibson
45b0b4ede0 agent/oci: Don't use deprecated Error::description() method
We shouldn't use it, and we don't need to implement it.

fixes #791

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-09-24 18:26:50 +10:00
James O. D. Hunt
ce9a4eeffd
Merge pull request #784 from jodh-intel/2.0-dev-fix-linter-errors
runtime: Fix linter errors in release files
2020-09-24 08:40:19 +01:00
Bo Chen
a34478ffa5 runtime: Update cloud-hypervisor client pkg to version v0.10.0
The latest release of cloud-hypervisor v0.10.0 contains the following
updates: 1) `virtio-block` Support for Multiple Descriptors; 2) Memory
Zones; 3) `Seccomp` Sandbox Improvements; 4) Preliminary KVM HyperV
Emulation Control; 5) various bug fixes and refactoring.

Note that this patch updates the client code of clh's HTTP API in kata,
while the 'versions.yaml' file was updated in an earlier PR.

Fixes: #789

Signed-off-by: Bo Chen <chen.bo@intel.com>
2020-09-23 17:37:34 -07:00
Bo Chen
952b9fe856
Merge pull request #762 from likebreath/fix_clh_ci
packaging: Build from source if the clh release binary is missing
2020-09-23 13:46:24 -07:00
Bo Chen
86a864b8c3 packaging: Build from source if the clh release binary is missing
This patch add fall-back code path that builds cloud-hypervisor static
binary from source, when the downloading of cloud-hypervisor binary is
failing. This is useful when we experience network issues, and also
useful for upgrading clh to non-released version.

Together with the changes in the tests repo
(https://github.com/kata-containers/tests/pull/2862), the Jenkins config
file is also updated with new Execute shell script for the clh CI in the
kata-containers repo. Those two changes fix the regression on clh CI
here. Please check details in the issue below.

Fixes: #781
Fixes: https://github.com/kata-containers/tests/issues/2858

Signed-off-by: Bo Chen <chen.bo@intel.com>
2020-09-23 11:41:49 -07:00
Christophe de Dinechin
1c1b4c9c43
Merge pull request #718 from fgiudici/podman_data_collection_script
runtime: add podman configuration to data collection script
2020-09-23 16:01:47 +02:00
Xu Wang
1641655d8f
Merge pull request #780 from liubin/feature/748-use-travis-cache-and-rust
ci: use Travis cache to reduce build time
2020-09-23 20:30:59 +08:00
Hui Zhu
f5f29d00e0
Merge pull request #779 from lifupan/2.0-dev
agent: update cgroups crate
2020-09-23 17:27:34 +08:00
James O. D. Hunt
33585a8edc runtime: Fix linter errors in release files
Fix the linter errors caught in the `runtime` repos `master` branch [1],
but not in the `2.0-dev` branch [2]. See [3] for further details.

[1] - https://github.com/kata-containers/runtime/pull/2976
[2] - https://github.com/kata-containers/kata-containers/pull/735
[3] - https://github.com/kata-containers/tests/issues/2870

Fixes: #783.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2020-09-23 09:24:54 +01:00
James O. D. Hunt
6e9592e13d
Merge pull request #778 from YchauWang/update-docs-2.0-1
docs: Update the reference path of kata-deploy in the packaging
2020-09-23 08:32:48 +01:00
bin liu
e3a0f9b30e ci: use export command to export envs instead of env config item
Config item env is used as a Matrix Expansion key, so these envs
will export to build jobs individually.

Signed-off-by: bin liu <bin@hyper.sh>
2020-09-23 10:26:07 +08:00
James O. D. Hunt
77ebbc5435
Merge pull request #735 from jodh-intel/2.0-dev-kata-check-compare-versions
runtime: make kata-check check for newer release
2020-09-22 17:49:34 +01:00
fupan.lfp
36ce7018e2 agent: update cgroups crate
Update cgroups crate to fix the building issue
on Aarch64.

Fixes: #770

Signed-off-by: fupan.lfp <fupan.lfp@antfin.com>
2020-09-22 23:00:11 +08:00
Shukui Yang
3523167d20 runtime: Call s.newStore.Destroy if globalSandboxList.addSandbox
Fixes: #696

Signed-off-by: Shukui Yang <keloyangsk@gmail.com>
2020-09-22 22:47:57 +08:00
bin liu
9e5a4b8b80 ci: use Travis cache to reduce build time
This PR includes these changes:
- use Rust installed by Travis
- install x86_64-unknown-linux-musl
- install rustfmt
- use Travis cache
- delete ci/install_vc.sh

Fixes: #748

Signed-off-by: bin liu <bin@hyper.sh>
2020-09-22 21:37:56 +08:00
Julio Montes
d4408807b4
Merge pull request #776 from bergwolf/containerd
how-to: add privileged_without_host_devices to containerd guide
2020-09-22 07:20:46 -05:00
Julio Montes
056a509418
Merge pull request #705 from devimc/2020-08-13/unittest/rustjail-mount
agent: Unit tests for rustjail/mount.rs
2020-09-22 07:19:51 -05:00
Fupan Li
6695e4ff0f
Merge pull request #774 from YchauWang/update-docs-2.0branch
docs: Fix the kata-pkgsync tool's docs script path
2020-09-22 17:17:50 +08:00
Ychau Wang
52984b6724 docs: Update the reference path of kata-deploy in the packaging
Use the relative path of kata-deploy to replace the 1.x packaging url in
the kata-deploy/README.md file. Fixed the path issue, producted by
creating new branch.

Fixes: #777

Signed-off-by: Ychau Wang <wangyongchao.bj@inspur.com>
2020-09-22 16:48:51 +08:00
Francesco Giudici
eae2159168 runtime: add podman configuration to data collection script
Be more verbose about podman configuration in the output of the data
collection script: get the system configuration as seen by podman and
dump the configuration files when present.

Fixes: #243
Signed-off-by: Francesco Giudici <fgiudici@redhat.com>
2020-09-22 10:35:45 +02:00
James O. D. Hunt
954a2cc813
Merge pull request #768 from bergwolf/links
Fix developer guide
2020-09-22 09:11:01 +01:00
Peng Tao
d12778480b how-to: add privileged_without_host_devices to containerd guide
It should be set by default for Kata containers working with containerd.

Fixes: #775
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-09-22 15:38:53 +08:00
Fupan Li
0b9bf24d05
Merge pull request #772 from bergwolf/agent-panic
fix guest panic when running agent as init
2020-09-22 12:57:54 +08:00
Peng Tao
98c4d11b6a docs: fix k8s containerd howto links
It should points to the internal versions.yaml file.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-09-22 11:13:18 +08:00
Peng Tao
f107b12bec docs: fix up developer guide for 2.0
1. Until we restore docker/moby support, we should use crictl as
developer example.
2. Most of the hyperlinks should point to kata-containers repository.
3. There is no more standalone mode.

Fixes: #767
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-09-22 11:13:07 +08:00
Ychau Wang
9f2f520130 docs: Fix the kata-pkgsync tool's docs script path
Fix the kata-pkgsync tool's docs, change the download path of the
packaging tool in 2.0 release.

Fixes: #773

Signed-off-by: Ychau Wang <wangyongchao.bj@inspur.com>
2020-09-22 09:21:02 +08:00
Julio Montes
96f8769a99 travis: enable RUST_BACKTRACE
RUST_BACKTRACE=1 will help us a lot to debug unit tests when
a test is failing

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-09-21 15:48:02 -05:00
Julio Montes
cda7acf7da agent/rustjail: add more unit tests
Add unit tests for finish_root, read_only_path and mknod_dev
increasing code coverage of mount.rs

fixes #284

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-09-21 15:24:53 -05:00
Julio Montes
98cc979ae1 agent/rustjail: remove makedev function
remove `makedev` function, use `nix`'s implementation instead

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-09-21 15:24:53 -05:00
Julio Montes
b99fefad7e agent/rustjail: add unit tests for ms_move_rootfs and mask_path
Increase code coverage of mount.rs

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-09-21 15:24:53 -05:00
Julio Montes
d79fad2dd8 agent/rustjail: implement functions to chroot
Use conditional compilation (#[cfg]) to change chroot behaviour
at compilation time. For example, such function will just return
`Ok(())` when the unit tests are being compiled, otherwise real
chroot operation is performed.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-09-21 15:24:53 -05:00
Julio Montes
25c91afbea agent/rustjail: add unit test for pivot_rootfs
Add unit test for pivot_rootfs increasing the code coverage of
mount.rs

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-09-21 15:24:53 -05:00
Julio Montes
7cf0fd95f1 agent/rustjail: implement functions to pivot_root
Use conditional compilation (#[cfg]) to change pivot_root behaviour
at compilation time. For example, such function will just return
`Ok(())` when the unit tests are being compiled, otherwise real
pivot_root operation is performed.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-09-21 15:24:53 -05:00
Julio Montes
672da4d08c agent/rustjail: add unit test for mount_cgroups
Add a unit test for `mount_cgroups` increasing the code coverage
of mount.rs from 44% to 52%

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-09-21 15:24:53 -05:00
Julio Montes
ab61cf7f9f agent/rustjail: add unit test for init_rootfs
Add a unit test for `init_rootfs` increasing the code coverage
of mount.rs from 0% to 44%.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-09-21 15:24:53 -05:00