Commit Graph

8154 Commits

Author SHA1 Message Date
bin
7241d618f1 versions: add nydus-snapshotter
Add nydus-snapshotter to versions.yaml to
install nydus-snapshotter from its own
releases.

Fixes: #3698

Signed-off-by: bin <bin@hyper.sh>
2022-02-17 14:09:20 +08:00
Fupan Li
8694af6d92
Merge pull request #3657 from liubin/fix/3656-add-make-check-for-tools
trace-forwarder/agent-ctl: run cargo fmt/clippy in make check
2022-02-17 10:05:16 +08:00
GabyCT
ced5e910d5
Merge pull request #3558 from jodh-intel/docs-rework-readme
docs: Improve top-level README
2022-02-16 16:28:14 -06:00
Fabiano Fidêncio
6f9685fbf5
Merge pull request #3624 from mdlayher/mdl-vsock
runtime: use github.com/mdlayher/vsock@v1.1.0
2022-02-16 23:11:47 +01:00
Fabiano Fidêncio
1f28e87e00
Merge pull request #3689 from fidencio/wip/clh-build-and-ship-a-tdx-capable-binary
tools: Build cloud-hypervisor with "--features tdx"
2022-02-16 21:52:55 +01:00
Fabiano Fidêncio
be2e90469a
Merge pull request #3669 from fidencio/wip/virtiofsd-use-announce-submounts
virtiofsd: Use "-o announce_submounts"
2022-02-16 16:43:18 +01:00
Fabiano Fidêncio
a6b4015130 tools: clh: Remove unused variables
Right now we're getting the info for the Cloud Hypervisor repo and
version, but we don't do anything with them, as those are not passed
down to the build script.

Morever, the build script itself gets the info from exactly the same
place when those are not passed, making those redundant.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-02-16 14:54:51 +01:00
Peng Tao
b4a1150638
Merge pull request #3344 from liubin/f/3342-hugepages-support
feature: hugepages support
2022-02-16 21:52:26 +08:00
Fabiano Fidêncio
5816c132ec tools: Build cloud-hypervisor with "--features tdx"
Right now TDx support on Cloud Hypervisor is gated behind a "--features
tdx" flag.  However, having TDx support enabled should not and does not
impact on the general usability of cloud-hypervisor.

As sooner than later we'll need kata-deploy binaries to be tested on a
CI that's TDx capable, for the confidential containers effort, let's
take the bullet and already enable it by default.

By the way, touching kata-deploy-binaries.sh as it's ensure the change
will be used in the following workflows:
* kata-deploy-push
* kata-deploy-test
* release

Fixes: #3688

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-02-16 14:51:15 +01:00
James O. D. Hunt
9818cf7196 docs: Improve top-level and runtime README
Various improvements to the top-level README file:

- Moved the following sections from the runtime's README to the
  top-level README:
  - License
  - Platform support / Hardware requirements
- Added the following sections to the top-level README:
  - Configuration
  - Hypervisors
- Improved formatting of the Documentation section in the top-level
  README.
- Removed some unused named links from the top-level README.

Also improvements to the runtime README:

- Removed confusing mention of the old 1.x runtime name.
- Clarify the binary name for the 2.x runtime and the utility program.

> **Note:**
>
> We cannot currently link to the AMD website as that site's
> configuration causes the CI static checks to fail. See
> https://github.com/kata-containers/tests/issues/4401

Fixes: #3557.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2022-02-16 09:52:48 +00:00
Fabiano Fidêncio
d0c8eb7e14
Merge pull request #3673 from fidencio/wip/allow-passing-a-build-flag-to-cloud-hypervisor
tools: clh: Allow to set when to build from sources and the build flags passed down to cargo
2022-02-16 09:45:54 +01:00
bin
36c3fc12ce agent: support hugepages for containers
Mount hugepage directories and configure the requested number of hugepages
dynamically by writing to sysfs files

Port from:
78b307b5bd

Fixes: #3342

Signed-off-by: Pradipta Banerjee <pradipta.banerjee@gmail.com>
Signed-off-by: bin <bin@hyper.sh>
2022-02-16 15:14:53 +08:00
bin
81a8baa5e5 runtime: add hugepages support
Add hugepages support, port from:
b486387cba

Signed-off-by: Pradipta Banerjee <pradipta.banerjee@gmail.com>
Signed-off-by: bin <bin@hyper.sh>
2022-02-16 15:14:53 +08:00
bin
7df677c01e runtime: Update calculateSandboxMemory to include Hugepages Limit
Support hugepages and port from:
96dbb2e8f0

Fixes: #3342

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
Signed-off-by: Pradipta Banerjee <pradipta.banerjee@gmail.com>
Signed-off-by: bin <bin@hyper.sh>
2022-02-16 15:14:37 +08:00
GabyCT
1dcb413e68
Merge pull request #3677 from GabyCT/topic/removedockerrun
docs: Remove docker run and shared memory from limitations
2022-02-15 15:04:36 -06:00
Fabiano Fidêncio
948a2b099c tools: clh: Ensure the download binary is executable
We're downloading the released cloud-hypervisor binary from GitHub, but
we should also ensure we set the binary as executable.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-02-15 20:23:46 +01:00
bin
72bf5496fd agent: handle hook process result
Current hook process is handled by just calling
unwrap() on it, sometime it will cause panic.

By handling all Result type and check the error can
avoid panic.

Fixes: #3649

Signed-off-by: bin <bin@hyper.sh>
2022-02-15 19:01:54 +01:00
bin
80e8dbf1f5 agent: valid envs for hooks
Envs contain null-byte will cause running hooks to panic,
this commit will filter envs and only pass valid envs to hooks.

Fixes: #3667

Signed-off-by: bin <bin@hyper.sh>
2022-02-15 19:01:54 +01:00
Gabriela Cervantes
395cff480d docs: Remove docker run and shared memory from limitations
This PR removes the docker run and shared memory segment from the
limitations document as for kata 2.0 we do not support docker
and this is not longer valid.

Fixes #3676

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2022-02-15 15:29:12 +00:00
Fabiano Fidêncio
e07545a23c tools: clh: Allow passing down a build flag
Let's allow passing down a build flag to cargo, when building Cloud
Hypervisor.

By doing this we allow calling this script with:
```
extra_build_flags="--features tdx" ./build-static-clh.sh
```

Fixes: #3671

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-02-15 14:14:30 +01:00
Fabiano Fidêncio
55cdef2295 tools: clh: Add the possibility to always build from sources
The current code will always pull the release binaries in case the
version requested by Kata Containers matches with a released version.

This, however, has a limitation of preventing users / CIs to build
cloud-hypervisor from source for a reason or another, such as passing a
specific build flag to cloud-hypervisor.

This is a pre-req to solving
https://github.com/kata-containers/kata-containers/issues/3671.

While here, a small changes were needed in order to improve readability
and debugability of why we're building something from the sources rather
than simply downloading and using a pre-built binary.

Fixes: #3672

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-02-15 14:13:51 +01:00
Fabiano Fidêncio
4bd945b67b virtiofsd: Use "-o announce_submounts"
German Maglione, one of the current virtio-fs developers, has brought to
our attention that using "announce-submounts" could help us to prevent
inode number collisions.

This feature was introduced a year ago or so by Hanna Reitz as part of
the 08dce386e77eb9ab044cb118e5391dc9ae11c5a8, and as we already mandate
QEMU >= 6.1.0, let's take advantage of that.

Fixes: #3507

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-02-15 08:52:03 +01:00
Fabiano Fidêncio
a3b3274121
Merge pull request #3664 from fidencio/clh-update-to-55479a64d237
versions: Udpate Cloud Hypervisor to 55479a64d237
2022-02-15 00:52:42 +01:00
Fabiano Fidêncio
90fd625d0c versions: Udpate Cloud Hypervisor to 55479a64d237
Let's update cloud-hypervisor to a version that exposes the TDx support
via the OpenAPI's auto-generated code.

Fixes: #3663

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-02-14 17:32:30 +01:00
Eric Ernst
1873fd2641
Merge pull request #3660 from devimc/2022-02-11/packaging/supportKernelTDx
kernel: add missing config fragment for TDx
2022-02-14 08:18:59 -08:00
Julio Montes
955d359f9e kernel: add missing config fragment for TDx
Add kernel config fragment that enables TDx

fixes #3659

Signed-off-by: Julio Montes <julio.montes@intel.com>
2022-02-14 07:40:12 -06:00
James O. D. Hunt
8f80dffead
Merge pull request #3648 from yaoyinnan/index-in-for
runtime: The index variable is initialized multiple times in for
2022-02-14 12:36:46 +00:00
James O. D. Hunt
3d3af84cde
Merge pull request #3636 from Kvasscn/kata_dev_fix_check_build_type
scripts: fix a typo while to check build_type
2022-02-14 12:33:59 +00:00
bin
734b618c16 agent-ctl: run cargo fmt/clippy in make check
Run cargo fmt/clippy in make check and
clear clippy warnings.

Fixes: #3656

Signed-off-by: bin <bin@hyper.sh>
2022-02-14 20:12:57 +08:00
bin
12c37fafc5 trace-forwarder: add make check for Rust
Add make check to run cargo fmt/clippy
for Rust projects.

Fixes: #3656

Signed-off-by: bin <bin@hyper.sh>
2022-02-14 20:12:48 +08:00
Fabiano Fidêncio
7ae8901a66
Merge pull request #3483 from fidencio/wip/bump-crio-to-its-1.23-release
versions: bump CRI-O to its 1.23 release
2022-02-14 10:06:51 +01:00
Bin Liu
cf53ec2c71
Merge pull request #2977 from luodw/support_nydus
feature(nydusd): add nydusd support to introduce lazyload ability
2022-02-14 13:08:50 +08:00
Eric Ernst
172fac5cc8
Merge pull request #3613 from hxtmdev/markdown-relative
docs: Fix relative links in Markdown
2022-02-13 21:01:41 -08:00
Fabiano Fidêncio
56c51fba4b
Merge pull request #3651 from devimc/2022-02-11/packaging/supportKernelTDx
kernel: support TDx
2022-02-13 13:13:38 +01:00
Matt Layher
c1ce67d905
runtime: use github.com/mdlayher/vsock@v1.1.0
Fixes #3625
Signed-off-by: Matt Layher <mdlayher@gmail.com>
2022-02-12 19:57:15 -05:00
yaoyinnan
42a878e6c1 runtime: The index variable is initialized multiple times in for
Change the variables `mountTypeFieldIdx := 8`, `mntDestIdx := 4` and `netNsMountType := "nsfs"` to const.

And unify the variable naming style, modify `mntDestIdx` to `mountDestIdx`.

Fixes: #3646

Signed-off-by: yaoyinnan <yaoyinnan@foxmail.com>
2022-02-12 11:10:10 +08:00
Julio Montes
1797b3eb04 packaging/kernel: build TDX guest kernel
Add support for building TDX kernel from github.com/intel/tdx

To build a guest kernel that supports Intel TDx run:

```
./build-kernel.sh -s -x tdx -d setup
./build-kernel.sh -s -x tdx -d install
```

fixes #3650

Signed-off-by: Julio Montes <julio.montes@intel.com>
2022-02-11 16:00:32 -06:00
Julio Montes
9875252917 versions: add url and tag for tdx kernel
Add url and tag for tdx kernel

Signed-off-by: Julio Montes <julio.montes@intel.com>
2022-02-11 15:44:18 -06:00
Julio Montes
bc8464e04f packaging/kernel: add option -s option
Add -s option to skip .config checks

Signed-off-by: Julio Montes <julio.montes@intel.com>
2022-02-11 15:44:03 -06:00
Julio Montes
dfbde2e06c
Merge pull request #3643 from dgibson/vfio-env-fix
device: Actually update PCIDEVICE_ environment variables for the guest
2022-02-11 10:47:33 -06:00
luodaowen.backend
2d9f89aec7 feature(nydusd): add nydusd support to introduse lazyload ability
Pulling image is the most time-consuming step in the container lifecycle. This PR
introduse nydus to kata container, it can lazily pull image when container start. So it
can speed up kata container create and start.

Fixes #2724

Signed-off-by: luodaowen.backend <luodaowen.backend@bytedance.com>
2022-02-11 21:41:17 +08:00
Daniel Höxtermann
b19b6938a8 docs: Fix relative links in Markdown
Relative links within this repository allow for easier navigation to
the corresponding file / directory in the current commit / for the
selected version.

Link text was slightly changed / fixed in
- docs/Unit-Test-Advice.md
- docs/how-to/how-to-run-docker-with-kata.md

Fixes #3045

Signed-off-by: Daniel Höxtermann <daniel@hxtm.dev>
2022-02-11 13:49:42 +01:00
David Gibson
9590874d9c device: Update PCIDEVICE_ environment variables for the guest
In commit 78dff468bf1 we introduced logic to rewrite PCIDEVICE_ environment
variables for the container so that they contain correct addresses for the
Kata VM rather than for the host.  Unfortunately, we never actually invoked
the function to do this.

It turns out we need to do this not only at container creation time, but
also for environment variables supplied to processes exec-ed into the
container after creation (e.g. with crictl exec).  Add calls to make both
those updates.

fixes #3634

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2022-02-11 13:46:36 +11:00
David Gibson
7b7f426a3f device: Keep host to VM PCI mapping persistently
add_devices() generates a mapping of host to guest PCI addresses which is
used to update some environment variables for the workload.  Currently it
just does this locally, but it turns out we're going to need the same map
again in order to correct environment variables for processes exec-ed into
the existing container.

Move the map to the sandbox structure so we can keep it around for those
later uses.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2022-02-11 13:46:17 +11:00
David Gibson
0b2bd64124 device: Rework update_spec_pci() to update_env_pci()
This function updates PCIDEVICE_ environment variables (such as those
supplied by the Kubernetes SR-IOV plugin) in the OCI spec to be correct
for the Kata VM, rather than for the host.

We neglected to actually call this function, however, and it turns out that
when we do, we need to do things slightly different.  We actually need to
adjust envionment variables both in the OCI spec when creating a container
and also in the variables supplied for exec-ing a new process within an
existing container.

Adjust the function so that it can be used for both these cases.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2022-02-11 13:46:05 +11:00
Eric Ernst
88b3e9e848
Merge pull request #3617 from hxtmdev/fluentd-link
docs: Update link to EFK stack docs
2022-02-10 12:50:17 -08:00
Julio Montes
046aae7e52
Merge pull request #3619 from devimc/2021-02-03/supportQEMUSGX
runtime: support QEMU SGX
2022-02-10 11:36:49 -06:00
Julio Montes
982f14fa66 runtime: support QEMU SGX
Enable SGX in QEMU when `sgx.intel.com/epc` annotation is defined

fixes #3436

Signed-off-by: Julio Montes <julio.montes@intel.com>
2022-02-10 09:45:48 -06:00
Daniel Höxtermann
40aa43f429 docs: Update link to EFK stack docs
Fixes #3616

Signed-off-by: Daniel Höxtermann <daniel@hxtm.dev>
2022-02-09 15:32:21 -08:00
Fabiano Fidêncio
0f856da402
Merge pull request #3628 from jongwu/snap_qemu_version
snap: update qemu version to 6.1.0 for arm
2022-02-09 20:12:28 +01:00