3879 Commits

Author SHA1 Message Date
Bo Chen
cc80ae0afb versions: cloud-hypervisor: Bump to version 6d30fe05
The cloud-hypervisor commit `6d30fe05` introduced a fix on its API for
VFIO device hotplug (`VmAddDevice`), which is required for supporting
VFIO unplug through openAPI calls in kata.

Signed-off-by: Bo Chen <chen.bo@intel.com>
2020-10-05 12:13:36 -07:00
James O. D. Hunt
1d5eab42d6 Merge pull request #833 from bergwolf/197
rust-agent: Update README
2020-10-01 17:26:21 +01:00
Julio Montes
c2bf8a0f37 Merge pull request #484 from devimc/2020-07-31/SGX
runtime: add support for SGX
2020-10-01 11:08:11 -05:00
Julio Montes
ea1cb37b59 versions: cloud-hypervisor: bump version
Use commit c54452c08a467a3e35d8d72f2a91d424e9718c57 as
version for cloud-hypervisor.
Bring openapi fix cloud-hypervisor/cloud-hypervisor#1760 to
support SGX.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-10-01 08:24:29 -05:00
Julio Montes
0ebffdf29f runtime: cloud-hypervisor: tag openapi-generator-cli container
Tag openapi-generator-cli container to v4.3.1 that is the latest
stable, this way we can have reproducible builds and the same
generated code in all the systems

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-10-01 08:24:29 -05:00
Julio Montes
7d63823141 runtime/vendor: add k8s.io/apimachinery/pkg/api/resource
k8s.io/apimachinery/pkg/api/resource is a memory quantities parser,
we use it to parse the SGX EPC size defined by the `sgx.intel.com/epc`
annotation

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-10-01 08:24:29 -05:00
Julio Montes
6df165c19d runtime: add support for SGX
Support the `sgx.intel.com/epc` annotation that is defined by the intel
k8s plugin. This annotation enables SGX. Hardware-based isolation and
memory encryption.

For example, use `sgx.intel.com/epc = "64Mi"` to create a container
with 1 EPC section with pre-allocated memory.

At the time of writing this patch, SGX patches have not landed on the
linux kernel project.
The following github kernel fork contains all the SGX patches for the
host and guest: https://github.com/intel/kvm-sgx

fixes #483

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-10-01 08:24:29 -05:00
Yang Bo
a89deb3ec1 rust-agent: Update README
rust agent does not use grpc as submodule for a while, update README
to reflect the change.

Fixes: #196
Signed-off-by: Yang Bo <bo@hyper.sh>
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-10-01 20:41:20 +08:00
James O. D. Hunt
0ccbca3be8 agent: Fix OCI Windows network shared container name typo
Correct the typo which would break the Windows-specific OCI network
shared container name feature.

See:

- https://github.com/opencontainers/runtime-spec/blob/master/config-windows.md#network

Fixes: #685.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2020-10-01 11:18:21 +01:00
Peng Tao
ec09971d8e Merge pull request #794 from c3d/bug/793-bad-match
rust-agent: Replaces improper use of match for non-constant patterns
2020-09-30 20:39:45 +08:00
Peng Tao
414b906e9c Merge pull request #747 from Kvasscn/fix-warning-in-device-manager-test
devices: fix go test warning in manager_test.go
2020-09-30 20:37:20 +08:00
Bin Liu
ad7b1ff5ad Merge pull request #820 from Tim-Zhang/mark-unreachable
Indicates never return function and remove unreachable code
2020-09-30 13:59:30 +08:00
fupan.lfp
4501c25a46 agent: propagate the internal detail errors to users
It's should propagate the detail errors to users when
the rpc call failed.

Fixes: #824

Signed-off-by: fupan.lfp <fupan.lfp@antfin.com>
2020-09-30 00:01:23 +08:00
Fabiano Fidêncio
eaf0338b18 Merge pull request #813 from bpradipt/ppc64le-make
agent: Set LIBC=gnu for ppc64le arch by default
2020-09-29 16:28:19 +02:00
Peng Tao
496ac0a4f5 Merge pull request #516 from liubin/feature/472-integrate-fc-metrics
fc: integrate Firecracker's metrics
2020-09-29 21:30:37 +08:00
Pradipta Kr. Banerjee
02c1a59f6d agent: Set LIBC=gnu for ppc64le arch by default
Fixes: #812

Signed-off-by: Pradipta Kr. Banerjee <pradipta.banerjee@gmail.com>
2020-09-29 09:36:45 +00:00
Tim Zhang
7019e72c7b agent: remove unreachable code
The code in the end of init_child is unreachable and need to be removed.
The code after do_exec is unreachable and need to be removed.

Signed-off-by: Tim Zhang <tim@hyper.sh>
2020-09-29 15:51:59 +08:00
Tim Zhang
942999edb9 agent: Change do_exec return type to ! because it will never return
Indicates unreachable code.

Fixes #819

Signed-off-by: Tim Zhang <tim@hyper.sh>
2020-09-29 15:50:54 +08:00
Bin Liu
46f420a9dc Merge pull request #811 from bergwolf/runtime-check
ci: resurrect travis static checkers
2020-09-28 15:23:50 +08:00
bin liu
757dfa70e6 fc: integrate Firecracker's metrics
Firecracker expose metrics through fifo file
and using a JSON format. This PR will parse the
Firecracker's metrics and convert to Prometheus metrics.

Fixes: #472

Signed-off-by: bin liu <bin@hyper.sh>
2020-09-28 15:20:02 +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
Peng Tao
85d22301e9 runtime: fix TestNewConsole UT failure
It needs root.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-09-28 11:02:56 +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
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
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
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
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
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
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
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
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
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