Commit Graph

5426 Commits

Author SHA1 Message Date
Peng Tao
e90e9a2c9b travis: skip static checker for ppc64
As we have already run it on x64.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-09-28 11:01:07 +08:00
Peng Tao
5611283ec5 runtime: fix golint errors
Need to run gofmt -s on them.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-09-28 11:01:07 +08:00
Peng Tao
daf2a54dc8 agent: fix cargo fmt
Otherwise travis fails.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-09-28 11:01:07 +08:00
Peng Tao
c05c4ba5e7 ci: always checkout 2.0-dev of test repository
We use 2.0-dev in the tests repository now. Always make sure
we use the right branch.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-09-28 11:01:07 +08:00
Peng Tao
1569b3b32a docs: fix static check errors
Somehow we are not running static checks for a long time.
And that ended up with a lot for errors.

* Ensure debug options are valid is dropped
* fix snap links
* drop extra CONTRIBUTING.md
* reference kata-pkgsync
* move CODEOWNERS to proper place
* remove extra CODE_OF_CONDUCT.md.
* fix spell checker error on Developer-Guide.md

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-09-28 11:01:03 +08:00
Peng Tao
df3119b679 runtime: fix make check
Need to use the correct script path.

Fixes: #802
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-09-28 10:24:49 +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
zhanghj
07d339c788 devices: fix go test warning in manager_test.go
Create "class" and "config" file in temporary device BDF dir,
and remove dir created  by ioutil.TempDir() when test finished.

fixes: #746

Signed-off-by: zhanghj <zhanghj.lc@inspur.com>
2020-09-26 20:46:12 -04:00
Christophe de Dinechin
a4afe3af33 rust-agent: Replaces improper use of match for non-constant patterns
The code used `match` as a switch with variable patterns `ev_fd` and
`cf_fd`, but the way Rust interprets the code is that the first
pattern matches all values. The code does not perform as expected.

This addresses the following warning:

   warning: unreachable pattern
      --> rustjail/src/cgroups/notifier.rs:114:21
       |
   107 |                     ev_fd => {
       |                     ----- matches any value
   ...
   114 |                     cg_fd => {
       |                     ^^^^^ unreachable pattern
       |
       = note: `#[warn(unreachable_patterns)]` on by default

Fixes: #750
Fixes: #793

Signed-off-by: Christophe de Dinechin <dinechin@redhat.com>
2020-09-25 14:48:26 +02: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
James O. D. Hunt
0351732778 action: Allow long lines if non-alphabetic
Overly long commit lines are annoying. But sometimes,
we need to be able to force the use of long lines
(for example to reference a URL).

Ironically, I can't refer to the URL that explains this
because of ... the long line check! Hence:

```sh
$ cat <<EOT | tr -d '\n'; echo
See: https://github.com/kata-containers/tests/tree/master/
cmd/checkcommits#handling-long-lines
EOT
```

Maximum body length updated to 150 bytes for parity with:

https://github.com/kata-containers/tests/pull/2848

Fixes: #687.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2020-09-24 15:32:38 +01: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
Wainer dos Santos Moschetta
ce675075e1 static-build/qemu-virtiofs: Refactor apply virtiofs patches
In static-build/qemu-virtiofs/Dockerfile the code which
applies the virtiofs specific patches is spread in several
RUN instructions. Refactor this code so that it runs in a
single RUN and produce a single overlay image.

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2020-09-23 15:42:22 -04:00
Wainer dos Santos Moschetta
512b38cf61 packaging/qemu: Add common code to apply patches
The qemu and qemu-virtiofs Dockerfile files repeat the code to apply
patches based on QEMU stable branch being built. Instead, this adds
a common script (qemu/apply_patches.sh) and make it called by the
respective Dockerfile files.

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2020-09-23 15:42:22 -04:00
Wainer dos Santos Moschetta
edce2712cd static-build/qemu-virtiofs: Fix to apply QEMU patches
Fix a bug on qemu-virtiofs Dockerfile which end up not applying
the QEMU patches.

Fixes #786

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2020-09-23 15:41:45 -04: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