Commit Graph

8757 Commits

Author SHA1 Message Date
Chelsea Mafrica
25b1317ead
Merge pull request #4357 from egernst/iptables-pkg
osbuilder: add iptables package
2022-06-01 09:28:38 -07:00
Snir Sheriber
b9fc24ff3a docs: update release process github token instructions
and fix the gpg generating key url

Signed-off-by: Snir Sheriber <ssheribe@redhat.com>
2022-06-01 19:08:41 +03:00
Snir Sheriber
c1476a174b docs: update release process with latest workflow triggering
instructions

Signed-off-by: Snir Sheriber <ssheribe@redhat.com>
2022-06-01 19:08:25 +03:00
James O. D. Hunt
002f2cd109 snap: Use helper script and cleanup
Move the common shell code to a helper script that is sourced by all
parts.

Add extra quoting to some variables in the snap config file
and simplify.

Fixes: #4304.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2022-06-01 16:09:29 +01:00
Gabriela Cervantes
2e04833fb9 docs: Update Intel QAT documentation links
This PR updates some Intel QAT documentation url links.

Fixes #4374

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2022-06-01 14:41:00 +00:00
Snir Sheriber
8b57bf97ab workflows: add workflow_dispatch triggering to test-kata-deploy
This will allow to trigger the test-kata-deploy workflow manually from
any branch instead of using always the one that is defined on main

See: https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/

Fixes: #4349
Signed-off-by: Snir Sheriber <ssheribe@redhat.com>
2022-06-01 16:21:01 +03:00
Zvonko Kaiser
6d0ff901ab docs: Update vGPU use-case
Now that #4213 is merged we need updated documentation for vGPU time-sliced or vGPU MIG-backed.

Fixes: #4343

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2022-06-01 05:58:46 -07:00
James O. D. Hunt
9b108d9937 docs: Improve snap formatting
Improve the snap docs by using more consistent formatting and proper
shell code in the shell example.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2022-06-01 12:00:40 +01:00
James O. D. Hunt
894f661cc4 docs: Add warning to snap build
Since we must build with `--destructive-mode`, add a warning that the
host environment could change the behaviour of the build, depending on
the packages installed on the system.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2022-06-01 12:00:40 +01:00
James O. D. Hunt
d759f6c3e5 snap: Fix CH architecture check
Correct the `cloud-hypervisor` part architecture check to use `x86_64`, not
`x64_64`.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2022-06-01 12:00:38 +01:00
Bin Liu
3e2817f7b5
Merge pull request #4325 from ManaSugi/runk/error-terminal
runk: Return error when tty is used without console socket
2022-06-01 13:58:38 +08:00
Bin Liu
a9a3074828
Merge pull request #4339 from ManaSugi/runk/add-podman-instruction
runk: Add Podman guide in README
2022-06-01 11:05:42 +08:00
Bin Liu
9f81c2dbf0
Merge pull request #4328 from ManaSugi/runk/output-stdout
agent: Pass standard I/O to container launched by runk
2022-06-01 11:00:26 +08:00
Manabu Sugimoto
5903815746 agent: Pass standard I/O to container launched by runk
The `kata-agent` passes its standard I/O file descriptors
through to the container process that will be launched
by `runk` without manipulation or modification in order to
allow the container process can handle its I/O operations.

Fixes: #4327

Signed-off-by: Manabu Sugimoto <Manabu.Sugimoto@sony.com>
2022-06-01 10:19:57 +09:00
Bin Liu
9658c6218e
Merge pull request #4353 from ManaSugi/runk/enable-agent-unit-tests
agent, runk: Enable test for the agent built with standard-oci-runtime feature
2022-06-01 07:39:01 +08:00
Eric Ernst
d2df1209a5 docs: describe kata handling for core-scheduling
Add initial documentation for core-scheduling.

Signed-off-by: Eric Ernst <eric_ernst@apple.com>
2022-05-31 16:17:00 -07:00
Michael Crosby
22b6a94a84 shim: add support for core scheduling
In linux 5.14 and hopefully some backports, core scheduling allows processes to
be co scheduled within the same domain on SMT enabled systems.

Containerd impl sets the core sched domain when launching a shim. This
allows a clean way for each shim(container/pod) to be in its own domain and any
additional containers, (v2 pods) be be launched with the same domain as well as
any exec'd process added to the container.

kernel docs: https://www.kernel.org/doc/html/latest/admin-guide/hw-vuln/core-scheduling.html

For Kata specifically, we will look for SCHED_CORE environment variable
to be set to indicate we shuold create a new schedule core domain.

This is equivalent to the containerd shim's PR: e48bbe8394

Fixes: #4309

Signed-off-by: Eric Ernst <eric_ernst@apple.com>
Signed-off-by: Michael Crosby <michael@thepasture.io>
2022-05-31 10:10:40 -07:00
Eric Ernst
af2ef3f7a5 agent-ctl: introduce handle for iptables get/set
Add support for the updated agent API for iptables

Signed-off-by: Eric Ernst <eric_ernst@apple.com>
2022-05-31 09:27:58 -07:00
Eric Ernst
65f0cef16c kata-runtime: add iptables CLI to test http endpoint
While end users can connect directly to the shim, let's provide a way to
easily get/set iptables from kata-runtime itself.

Fixes: #4080
Signed-off-by: Eric Ernst <eric_ernst@apple.com>
2022-05-31 09:27:58 -07:00
Eric Ernst
3201ad0830 shim-client: ensure we check resp status for Put/Post
Without this, potential errors are silently dropped. Let's ensure we
return the error code as well as potenial data from the response.

Signed-off-by: Eric Ernst <eric_ernst@apple.com>
2022-05-31 09:27:58 -07:00
Eric Ernst
0706fb28ac kata-runtime: shmgmt: make url usage consistent
Before, we had a mix of slash, etc. Unfortunately, when cleaning URL
paths, serve mux seems to mangle the request method, resulting in each
request being a GET (instead of PUT or POST).

Signed-off-by: Eric Ernst <eric_ernst@apple.com>
2022-05-31 09:27:58 -07:00
Eric Ernst
2a09378dd9 shim-client: add support for DoPut
While at it, make sure we check for nil in DoPost

Signed-off-by: Eric Ernst <eric_ernst@apple.com>
2022-05-31 09:27:58 -07:00
Eric Ernst
640173cfc2 shim-mgmt: Add endpoint handler for interacting with iptables
Add two endpoints: ip6tables, iptables.

Each url handler supports GET and PUT operations. PUT expects
the requests' data to be []bytes, and to contain iptable information in
format to be consumed by iptables-restore.

Signed-off-by: Eric Ernst <eric_ernst@apple.com>
2022-05-31 09:27:58 -07:00
Eric Ernst
0136be22ca virtcontainers: plumb iptable set/get from sandbox to agent
Introduce get/set iptable handling. We add a sandbox API for getting and
setting the IPTables within the guest. This routes it from sandbox
interface, through kata-agent, ultimately making requests to the guest
agent.

Signed-off-by: Eric Ernst <eric_ernst@apple.com>
2022-05-31 09:27:58 -07:00
Eric Ernst
bd50d463b2 agent: iptables: get/set handling for iptables
Initial support for getting and setting iptables in the guest.

Signed-off-by: Eric Ernst <eric_ernst@apple.com>
2022-05-31 09:27:58 -07:00
Eric Ernst
7c4049aabb osbuilder: add iptables package
Since we are introducing an agent API for interacting with guest
iptables, let's ensure that our example rootfs' have iptables-save/restore
installed.

Fixes: #4356

Signed-off-by: Eric Ernst <eric_ernst@apple.com>
2022-05-31 09:21:02 -07:00
Eric Ernst
03176a9e09 proto: update generated code based on proto update
Update the generated agent.pb.go code based on proto update.

Signed-off-by: Eric Ernst <eric_ernst@apple.com>
2022-05-31 08:45:59 -07:00
Eric Ernst
38ebbc705b proto: update to add set/get iptables
Update the agent protocol definition to introduce support for setting
and getting iptables from the guest.

Signed-off-by: Eric Ernst <eric_ernst@apple.com>
2022-05-31 08:45:59 -07:00
Bin Liu
78d45b434f agent: return mount file content if parse mountinfo failed
Include mount file content in error message when parsing
mountinfo failed for debug.

Fixes: #4246, #4103

Signed-off-by: Bin Liu <bin@hyper.sh>
2022-05-31 23:36:14 +08:00
Manabu Sugimoto
c7b3941c96 runk: Enable test for the agent built with standard-oci-runtime feature
This enables tests for the kata-agent for runk that is built
with standard-oci-runtime feature in CI.

Fixes: #4351

Signed-off-by: Manabu Sugimoto <Manabu.Sugimoto@sony.com>
2022-05-31 21:54:28 +09:00
Manabu Sugimoto
6dbce7c3de agent: Remove unused import in console test
Remove some unused imports in console test module
used by runk's test.

Fixes: #4351

Signed-off-by: Manabu Sugimoto <Manabu.Sugimoto@sony.com>
2022-05-31 21:54:02 +09:00
Xuewei Niu
6ecea84bc5 rustjail: get home dir using nix crate
Get user's home dir using `nix::unistd` crate instead of `utils` crate,
and remove useless code from agent.

Fixes: #4209

Signed-off-by: Xuewei Niu <justxuewei@apache.org>
2022-05-31 15:04:33 +08:00
Manabu Sugimoto
648b8d0aec runk: Return error when tty is used without console socket
runk always launches containers with detached mode,
so users have to use a console socket with run or
create operation when a terminal is used.
If users set `terminal` to `true` in `config.json` and
try to launch a container without specifying a console
socket, runk returns an error with a message early.

Fixes: #4324

Signed-off-by: Manabu Sugimoto <Manabu.Sugimoto@sony.com>
2022-05-31 09:55:39 +09:00
James O. D. Hunt
96c8df40b5
Merge pull request #4335 from ManaSugi/runk/fix-invalid-rootfs
runk: Handle rootfs path in config.json properly
2022-05-30 14:03:58 +01:00
Manabu Sugimoto
5205efd9b4 runk: Add Podman guide in README
runk can launch containers using Podman, so add the guide
in README.

Fixes: #4338

Signed-off-by: Manabu Sugimoto <Manabu.Sugimoto@sony.com>
2022-05-30 19:06:46 +09:00
James O. D. Hunt
d157f9b71e
Merge pull request #3871 from amshinde/update-containerd-docs
Update containerd docs
2022-05-30 08:38:07 +01:00
Manabu Sugimoto
d862ca0590 runk: Handle rootfs path in config.json properly
This commit enables runk to handle `root.path` in `config.json`
properly even if the path is specified by a relative path that
includes the single (`.`) or the double (`..`) dots.
For example, with a bundle at `/to/bundle` and a rootfs directly
under `/to/bundle` such as `/to/bundle/{bin,dev,etc,home,...}`,
the `root.path` value can be either `/to/bundle` or just `.`.
This behavior conforms to OCI runtime spec.
Accordingly, a bundle path managed by runk's status file
(`status.json`) always is statically stored as a canonical path.
Previously, a bundle path has been got by `oci_state()` of rustjail's
API that returns the path as the parent directory path of a rootfs
(`root.path`). In case of the kata-agent, this works properly because
the kata containers assume that the rootfs path is always
`/to/bundle/rootfs`. However in case of standard OCI runtimes,
a rootfs can be placed anywhere under a bundle, so the rootfs path
doesn't always have to be at a `/to/bundle/rootfs`.

Fixes: #4334

Signed-off-by: Manabu Sugimoto <Manabu.Sugimoto@sony.com>
2022-05-30 14:41:26 +09:00
snir911
d50937435d
Merge pull request #4318 from fidencio/topic/update-clh-to-v24.0
clh: Update to v24.0
2022-05-29 15:06:17 +03:00
James O. D. Hunt
56591804b3 docs: Improve snap build instructions
Make it clearer how to build the snap package manually.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2022-05-26 15:56:36 +01:00
James O. D. Hunt
cb2b30970d snap: Build using destructive mode
Destructive mode is required to build the Kata Containers snap. See:

```
.github/workflows/snap-release.yaml
.github/workflows/snap.yaml
```

Hence, update the last file that we forgot to update with
`--destructive-mode`.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2022-05-26 15:56:36 +01:00
James O. D. Hunt
60823abb9c docs: Move snap README
Move the snap README to a subdirectory to resolve the warning given by
`snapcraft` (folded and reformatted slightly for clarity):

```
The 'snap' directory is meant specifically for snapcraft,
but it contains the following non-snapcraft-related paths,
which is unsupported and will cause unexpected behavior:

- README.md

If you must store these files within the 'snap' directory,
move them to 'snap/local', which is ignored by snapcraft.
```

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2022-05-26 15:56:36 +01:00
James O. D. Hunt
4134beee39
Merge pull request #4301 from jodh-intel/snap-package-rust-virtiofsd
snap: Build and package rust version of virtiofsd
2022-05-26 15:55:06 +01:00
Fabiano Fidêncio
fff832874e clh: Update to v24.0
This release has been tracked through the v24.0 project.

virtio-iommu specification describes how a device can be attached by default
to a bypass domain. This feature is particularly helpful for booting a VM with
guest software which doesn't support virtio-iommu but still need to access
the device. Now that Cloud Hypervisor supports this feature, it can boot a VM
with Rust Hypervisor Firmware or OVMF even if the virtio-block device exposing
the disk image is placed behind a virtual IOMMU.

Multiple checks have been added to the code to prevent devices with identical
identifiers from being created, and therefore avoid unexpected behaviors at boot
or whenever a device was hot plugged into the VM.

Sparse mmap support has been added to both VFIO and vfio-user devices. This
allows the device regions that are not fully mappable to be partially mapped.
And the more a device region can be mapped into the guest address space, the
fewer VM exits will be generated when this device is accessed. This directly
impacts the performance related to this device.

A new serial_number option has been added to --platform, allowing a user to
set a specific serial number for the platform. This number is exposed to the
guest through the SMBIOS.

* Fix loading RAW firmware (#4072)
* Reject compressed QCOW images (#4055)
* Reject virtio-mem resize if device is not activated (#4003)
* Fix potential mmap leaks from VFIO/vfio-user MMIO regions (#4069)
* Fix algorithm finding HOB memory resources (#3983)

* Refactor interrupt handling (#4083)
* Load kernel asynchronously (#4022)
* Only create ACPI memory manager DSDT when resizable (#4013)

Deprecated features will be removed in a subsequent release and users should
plan to use alternatives

* The mergeable option from the virtio-pmem support has been deprecated
(#3968)
* The dax option from the virtio-fs support has been deprecated (#3889)

Fixes: #4317

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-05-26 08:51:18 +00:00
James O. D. Hunt
49361749ed snap: Build and package rust version of virtiofsd
Update the snap config file to build the rust version of `virtiofsd` for
x86_64, but build QEMU's C version for other platforms.

Fixes: #4261.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2022-05-25 17:04:05 +01:00
James O. D. Hunt
27d903b76a snap: Put the yq binary in the staging bin directory
Rather than putting the `yq` binary in the staging directory itself,
put it in the `bin/` sub-directory.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2022-05-25 09:40:09 +01:00
James O. D. Hunt
d7b4ce049e snap: Remove unused variable
Remove the unused `kata_url` variable and use the value in the `website`
YAML metadata instead.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2022-05-25 09:40:09 +01:00
James O. D. Hunt
43de5440e5 snap: Fix unbound variable error
Don't assume `GITHUB_REF` is set.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2022-05-25 09:40:09 +01:00
James O. D. Hunt
c9b291509d snap: Fix whitespace
Remove trailing space.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2022-05-25 09:40:09 +01:00
Fupan Li
62d1ed0651
Merge pull request #4290 from Tim-Zhang/remove-oci-kata-agent
runk: merge oci-kata-agent into runk
2022-05-25 11:31:25 +08:00
Fabiano Fidêncio
8a2b82ff51
Merge pull request #4276 from jongwu/build_rust_virtiofsd
virtiofsd: static build virtiofsd from rust code for non-x86
2022-05-24 14:57:21 +02:00