Commit Graph

5290 Commits

Author SHA1 Message Date
Julio Montes
16f4ff38e5
Merge pull request #674 from devimc/2020-09-03/runtime/qemuRawKernel
runtime: qemu: reduce boot time and memory footprint
2020-09-04 14:39:34 -05:00
Julio Montes
99811645d2
Merge pull request #667 from devimc/2020-09-01/packaging/snap-ubuntu20
snap for kata 2.0
2020-09-04 13:33:19 -05:00
Julio Montes
0be02a8fd3 runtime: qemu: reduce boot time and memory footprint
The linux kernel feature RANDOMIZE_BASE improved the security and at
the same time increased the memory footprint of a kata container,
this feature was enabled in kata-containers/packaging#1006.
In order to mitigate this increase in memory consumption, we can
boot container using the uncompressed kernel.

Reduce boot time by ~5%
Reduce KSM memory footprint by ~14%
Reduce noKSM memory footprint by ~27%

fixes #669

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-09-04 10:25:09 -05:00
Julio Montes
8b07bc2c80 agent: fix unit tests - remove rustjail::errors
Fix unit tests and use `anyhow::Error`.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-09-04 08:29:12 -05:00
Julio Montes
6c96d66667 agent: update Cargo toml and lock
`rustjail::erros` was removed in a previous commit, hence some external crates
like `error_chain` are no longger required, update Cargo.toml and Cargo.lock
to reflect these changes.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-09-04 08:29:12 -05:00
Julio Montes
46d7b9b8dc agent/rustjail: remove rustjail::errors
`anyhow` replaces `rustjail::errors`, hence it's not longer needed

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-09-04 08:28:50 -05:00
Julio Montes
fbb79739c9 agent: Use anyhow for error handling
Don't use `rustjail::errors` for error handling, since it's not
thread safe and there are better alternatives like `anyhow`.

`anyhow` attaches context to help the person troubleshooting
the error understand where things went wrong, for example:

Current error messages:

```
No such file or directory (os error 2)
```

With `anyhow`:

```
Error: Failed to read config.json
Caused by:
    No such file or directory (os error 2)
```

fixes #641

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-09-04 08:23:17 -05:00
Julio Montes
33759af548 agent: Add anyhow dependency
anyhow provides `anyhow::Error`, a trait object based error type for
easy idiomatic error handling in Rust applications

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-09-04 08:22:13 -05:00
Julio Montes
c192446a59 agent/rustjail: Use anyhow for error handling
Convert all Errors and Results to `anyhow::Error` and `anyhow::Result`
respectively

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-09-04 08:22:13 -05:00
Julio Montes
2e3e2ce114 agent/rustjail/capabilities: Use anyhow for error handling
Use `.to_string` to wrap up `caps::errors::Error`s since they are not
thread safe, otherwise `cargo build` will fail with the following error:

```
doesn't satisfy `caps::errors::Error: std::marker::Sync`
```

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-09-04 08:22:13 -05:00
Julio Montes
6a4c9b14f2 agent/rustjail/cgroups: Use anyhow for error handling
Return `anyhow::Result` from all the functions in this directory.
Add function `io_error_kind_eq` to compare an `anyhow::Error` with an
`io::Error`, this function downcast the `anyhow::Error`.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-09-04 08:22:13 -05:00
Julio Montes
359286a87d agent/rustjail: Add anyhow dependency
anyhow provides `anyhow::Error`, a trait object based error type for
easy idiomatic error handling in Rust applications.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-09-04 08:22:13 -05:00
Christophe de Dinechin
dd60e56f28 trivial: Fix spelling of "privilege"
I noticed the spelling mistake while reviewing another change and
doing a "grep" for "privilege" that turned up nothing.

Fixes: #671

Signed-off-by: Christophe de Dinechin <dinechin@redhat.com>
2020-09-04 11:31:09 +02:00
Christophe de Dinechin
6e54767344
Merge pull request #663 from dgibson/machinne
runtime: Fix typo in hotplugVFIODevice()
2020-09-04 09:58:34 +02:00
David Gibson
cb9993759b runtime: Fix typo in hotplugVFIODevice()
"machineType" is misspelled as "machinneType".

Fixes: #670

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-09-04 14:28:51 +10:00
Chelsea Mafrica
0d198f930e virtcontainers: Add unit test for utils/compare.go
Add unit test for virtcontainers/utils/compare.go to increase overall
coverage.

Fixes #661

Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
2020-09-03 13:38:43 -07:00
Julio Montes
1de9bc0fa7 snap: reimplement snapcraft.yaml to support kata 2.0
Add snap package for 2.0

fixes #666

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-09-03 12:13:34 -05:00
Julio Montes
85642c328d snap: move snapcraft.yaml to the right place
In order to use a build systemd like launchpad, the snapcraft.yaml file
must be in the root directory of the project or under the `snap`
directory, that way launchpad detects that this project can be build
using the `snapcraft` command

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-09-03 08:09:05 -05:00
Julio Montes
c7745a3350
Merge pull request #662 from dgibson/fix611
drivers: Correct isPCIeDevice logic
2020-09-03 08:06:23 -05:00
Peng Tao
60ea0a5c37
Merge pull request #659 from Jakob-Naucke/vfio-ap-doc
docs: Add documentation for VFIO-AP passthrough
2020-09-03 19:32:20 +08:00
Bo Chen
7e4673d542
Merge pull request #653 from devimc/2020-09-01/packaging/qemu5
[fwport-2.0] qemu: update build dependencies to support QEMU 5
2020-09-02 22:18:53 -07:00
David Gibson
92dfa4634b drivers: Correct isPCIeDevice logic
Currently, isPCIeDevice() attempts to determine if a (host) device is
PCI-Express capable by looking up its link speed via the PCI slots
information in sysfs.  This is a) complicated and b) wrong.  PCI-e
devices don't have to have slots information, so this frequently fails.

Instead determine if devices are PCI-e by checking for the presence of
PCIe extended configuration space by looking at the size of the "config"
file in sysfs.

Forward ported from 6bf93b23 in the Kata 1.x runtime repository.

Fixes: #611

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-09-03 14:32:00 +10:00
Archana Shinde
b474828052 kernel: Remove arm patches for ptp
These patches are causing compilation issues while building on x86.
Remove these while we fix the issue.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2020-09-02 13:21:28 -07:00
Archana Shinde
82efd2f267 kernel: Enabling PTP clock support in kernel
Allows time synchronization.

Fixes #587

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2020-09-02 13:21:28 -07:00
Julio Montes
8666e01e11 qemu/default-configs: update default-config for QEMU 5
Disable the following IPMI configs, since they are not needed
for kata containers and fixes the snap job in launchpad

CONFIG_PCI_IPMI_KCS
CONFIG_PCI_IPMI_BT
CONFIG_IPMI_SSIF

fixes #581

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-09-02 11:58:38 -05:00
Julio Montes
2d12da8ed0 qemu: update default-configs
Update QEMU x86_64 default config to support QEMU 5

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-09-02 11:58:35 -05:00
Jakob-Naucke
cf3ac9f72a
docs: Add documentation for VFIO-AP passthrough
Add guide on how to pass a VFIO-AP device, such as Crypto Express cards
on IBM Z mainframes, to a Kata container. Like the documentation for
VFIO-PCI, this was put in the virtcontainers README.

Fixes: #658

Signed-off-by: Jakob-Naucke <jakob.naucke@ibm.com>
2020-09-02 15:22:52 +02:00
Ychau Wang
11e8a49410 docs: update the docs for minikube installing kata
The command for intalling kata in minikube still keeping the old path of
the packaging project from the 1.x branch. This commit changed the path
of the packaging's files to 2.0-dev branch.

Fixes: #619

Signed-off-by: Ychau Wang <wangyongchao.bj@inspur.com>
2020-09-02 14:47:32 +08:00
Yongchao Wang
00bd04f923 docs: Update local branch from upstream
merge remote branch from commit f1fd00da78

Signed-off-by: Ychau Wang <wangyongchao.bj@inspur.com>
2020-09-02 14:40:07 +08:00
zhanghj
517dda02a3 kernel: update to the latest LTS kernel 5.4.60
Update to the latest lts kernel in versions.yaml

Fixes: #654

Signed-off-by: zhanghj <zhanghj.lc@inspur.com>
2020-09-01 22:30:36 -04:00
Julio Montes
ae98ea450d obs-packaging: fix wait for obs
Reimplement the loop that waits for OBS. Look for the packages
that are still building, not for the repos.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-09-01 13:58:18 -05:00
Julio Montes
f5b71d3455 qemu: update build dependencies to support QEMU 5
Add the following packages as build dependencies to build QEMU
5 in OBS and launchpad (snap)

* libselinux1
* libffi
* libmount
* libblkid
* python3

fixes #1075

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-09-01 13:58:09 -05:00
Julio Montes
fcd29a28cc osbuilder/image-builder: disable reflink
Disable reflink when using DAX. Reflink is a xfs feature that cannot be
used together with DAX.

fixes #577

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-09-01 12:10:47 -05:00
Julio Montes
c422d061cb
Merge pull request #629 from gvancuts/add-kata-acrn-runtime-docker
kata-deploy: add ACRN runtime to Docker configuration
2020-09-01 07:27:04 -05:00
Julio Montes
d20ea14c8a
Merge pull request #578 from Jakob-Naucke/vfio-ap-passthrough
runtime: Add support for VFIO-AP pass-through
2020-09-01 07:23:26 -05:00
Fupan Li
e429f79d36
Merge pull request #644 from devimc/2020-08-28/agent/updateCargoToml
agent: update Cargo files authors
2020-09-01 17:33:58 +08:00
zhanghj
dae6c7d967 osbuilder: update usage of RUST_AGENT variable
Update the default value of RUST_AGENT variable to 'yes' in
usage description.

fixes: #650

Signed-off-by: zhanghj <zhanghj.lc@inspur.com>
2020-09-01 05:23:29 -04:00
Jakob-Naucke
1236e22475
runtime: Add support for VFIO-AP pass-through
Recognise when a device to be hot-plugged is an IBM Adjunct Processor
(AP) device and execute VFIO AP hot-plug accordingly. Includes unittest
for recognising and uses CCW for addDeviceToBridge in hotplugVFIODevice
if appropriate.

Fixes: #491

Signed-off-by: Jakob-Naucke <jakob.naucke@ibm.com>
Co-authored-by: Julio Montes <julio.montes@intel.com>
Reviewed-by: Alice Frosi <afrosi@redhat.com>
2020-09-01 10:41:49 +02:00
Fupan Li
8df06a046e
Merge pull request #418 from bergwolf/packaging
packaging: adjustment for 2.0 branch
2020-09-01 11:06:34 +08:00
Peng Tao
65970d3858 osbuilder: install-yq should not print on success
The caller might rely on the output to determine its failure.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-08-31 22:10:37 +08:00
Peng Tao
c624fa7469 osbuilder: install musl for aarch64
So that it can do musl static build.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-08-31 22:10:32 +08:00
Peng Tao
b24f2cb969 gitignore: ignore vscode directory
That is auto-generated by vscode and should be ignored.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-08-31 22:09:37 +08:00
Peng Tao
cf1b72d6c6 osbuilder: install rust before sourcing cargo env
Otherwise we cannot find it.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-08-31 22:09:37 +08:00
Peng Tao
7b5ab58689 packaging: fix kata-deploy yaml path
Should use the 2.0 directory structure.

Fixes: #547
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-08-31 22:09:37 +08:00
Peng Tao
76c18aa345 osbuilder: fix alpine agent build
Since we always build musl kata-agent, there is no need to build
it inside a musl container. We can just build on the host and then
copy the binary to the target rootfs.

There are still a lot to clean up and it should be made so for ALL
target distros instead of just alpine. But this is at least working
for alpine first.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-08-31 22:09:37 +08:00
Peng Tao
5216815d1c packaging: make build-kernel.sh work for 2.0
We do not need to clone packaging repository, nor apply
virtio_vsock as virtio-fs-dev has already included that fix.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-08-31 22:09:37 +08:00
Peng Tao
aa3fb4db28 packaging: make kata-deploy work for 2.0
We no longer need to deploy multiple repositories.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-08-31 22:09:37 +08:00
Peng Tao
86a6e0b3e7 packaging: fix build image scripts
We do not need to clone osbuilder anymore.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-08-31 22:09:37 +08:00
Peng Tao
ceebd06b64 release: add 2.0 release actions
Use a different action yaml file so that we do not affect the original
1.x release actions.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-08-31 22:09:37 +08:00
Peng Tao
dadab1febf osbuilder: build rust agent by default
Since we only have the rust agent.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-08-31 22:09:37 +08:00