Commit Graph

12455 Commits

Author SHA1 Message Date
Chao Wu
2f797a6eb7 pci: rename 2 parameters to follow rust naming convention
PciCapabilityID -> PciCapabilityId
PciBarRegionType::IORegion -> PciBarRegionType::IoRegion

Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
2023-12-26 23:28:47 +08:00
Chao Wu
9c13b2c990 dragonball: introduce vfio support
vfio mod collects lots of information related to the vfio operations, including VfioMsi and VfioMsix capability & state,
vfio interrupt info, pci region infor and vfio pci device info & state.

fixes: #8722

Signed-off-by: Gerry Liu <gerry@linux.alibaba.com>
Signed-off-by: Zizheng Bian <zizheng.bian@linux.alibaba.com>
Signed-off-by: Shifang Feng <fengshifang@linux.alibaba.com>
Signed-off-by: Yang Su <yang.su@linux.alibaba.com>
Signed-off-by: Zha Bin <zhabin@linux.alibaba.com>
Signed-off-by: Xin Lin <jingshan@linux.alibaba.com>
Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
2023-12-26 23:28:43 +08:00
Alex.Lyn
3a3f39aa2d
Merge pull request #8668 from Apokleos/pci-path-refactor
runtime-rs: Refactor the code related to PCI paths and VFIO device driver initialize in DM.
2023-12-23 21:44:07 +08:00
Steve Horsman
1afce09858
Merge pull request #8721 from stevenhorsman/kata-deploy-typos
kata-deploy: snapshotter typo fixes
2023-12-22 21:26:03 +00:00
stevenhorsman
4a95c0d07f kata-deploy: snapshotter typo fixes
- Add spaces so that the if statements are valid

Fixes: #8720
Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2023-12-22 16:32:02 +00:00
Chao Wu
555136c1a5
Merge pull request #8662 from openanolis/pci/4-upstream
dragonball: introduce pci msi/msix interrupt
2023-12-22 18:08:31 +08:00
Steve Horsman
c5f939cdc1
Merge pull request #8655 from fidencio/topic/kata-deploy-add-snapshotter-support
kata-deploy: Allow setting up snapshotters per runtime handler
2023-12-22 09:16:07 +00:00
Chao Wu
8cf3bcefd8 dragonball: introduce pci msi/msix interrupt
introduce msi/msix mod to maintain information for PCI Message Signalled
Interrupt Extended Capability. It will be initialized when parsing pci
configuration space and used when getting interrupt capabilities.

fixes: #8661

Signed-off-by: Gerry Liu <gerry@linux.alibaba.com>
Signed-off-by: Zizheng Bian <zizheng.bian@linux.alibaba.com>
Signed-off-by: Shifang Feng <fengshifang@linux.alibaba.com>
Signed-off-by: Yang Su <yang.su@linux.alibaba.com>
Signed-off-by: Zha Bin <zhabin@linux.alibaba.com>
Signed-off-by: Xin Lin <jingshan@linux.alibaba.com>
Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
2023-12-22 16:28:22 +08:00
Fupan Li
dc9a0ac8ce
Merge pull request #8718 from justxuewei/enable-vhost
tests: Load vhost modules explicitly while Kata installing
2023-12-22 14:52:49 +08:00
Xuewei Niu
206ed6d77d tests: Load vhost modules explicitly while Kata installing
The default network backend of runtime-rs with Dragonball is vhost-net
after #8609 merged. The tests might be failed if vhost modules are not
loaded.

Fixes: #8717

Signed-off-by: Xuewei Niu <niuxuewei.nxw@antgroup.com>
2023-12-22 11:07:37 +08:00
alex.lyn
94c83cea84 runtime-rs: Refactor vfio driver implementation
It's important to ensure that these tasks which setup vfio
devices are completed before add_device.

So Moving vfio device setup code to a dedicated method at device
building time which does not affect the behavior of other code.

And this change makes it easier to understand the difference
between create and attach, and also makes the boundaries
clearer.

Fixes: #8665

Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
2023-12-22 10:37:40 +08:00
alex.lyn
82d3cfdeda runtime-rs: Make VhostUserConfig's field pci_path type more specific
Make VhostUserConfig pci_path's type more specific, change it
from Option<String> to Option<PciPath>.

Fixes: #8665

Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
2023-12-22 10:35:38 +08:00
alex.lyn
5cc2890a10 runtime-rs: refactor and re-implement pci path.
Do refactor and re-implement to make the pci path more "rusty".

Fixes: #8665

Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
2023-12-22 10:34:41 +08:00
Fabiano Fidêncio
32e1ba2525
Merge pull request #8714 from cmaf/libsh-update-loc
tests: Use function from Kata repo
2023-12-21 12:30:31 -03:00
Fabiano Fidêncio
6cc6ca5a7f
kata-deploy: Allow setting up snapshotters per runtime handler
Since containerd 1.7.0 we can easily set a specific snapshotter to be
used with a runtime handler, and we should take advantage of this,
mostly as it'll help setting up any runtime using devmapper or nydus
snapshotters.

This implementation here has a few caveats:
* The format expected for the SNAPSHOTTER_HANDLER_MAPPING is:
  `shim:snapshotter,shim:snapshotter,...`
* It only works with containerd 1.7 or newer
* We **never** change the default containerd snapshotter
* We don't do any check on our side to verify whether the snapshotter
  required is properly deployed
* Users will have to add an annotation to their pods, in order to use
  the snapshotter set up per runtime handler
  * Example:
    ```
    metadata:
      ...
      annotations:
        io.containerd.cri.runtime-handler: kata-fc
    ```

Fixes: #8615

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-12-21 07:20:10 -03:00
alex.lyn
1b5758c1f2 runtime-rs: Move the PciPath-related code to a dedicated file
Move the pciPath code to a new file pci_path.rs and update the
references.

Fixes: #8665

Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
2023-12-21 11:35:18 +08:00
alex.lyn
275de453d5 runtime-rs: remove useless get_host_guest_map and its test case
Fixes: #8665

Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
2023-12-21 11:07:56 +08:00
Chelsea Mafrica
9f394f6e18 tests: Use function from Kata repo
Switch to use function from Kata repo in common.bash to reduce
dependency on the tests repo.

Fixes #8713

Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
2023-12-20 16:45:06 -08:00
Dan Mihai
d916da15dd
Merge pull request #8688 from microsoft/danmihai1/k8s-confidential
tests: retry connection to pod SSH server
2023-12-20 15:01:26 -08:00
Fabiano Fidêncio
3482256340
Merge pull request #8709 from fidencio/topic/update-jq-for-kata-deploy
kata-deploy: Update `jq` as part of the kata-deploy daemonset
2023-12-20 16:48:07 -03:00
Fabiano Fidêncio
c9e631dc0c
kata-deploy: Reapply "kata-deploy: Use tomlq to configure containerd"
This reverts commit ee5fa08a27.

This is perfectly fine to do as we narrwoed down the issue to be on the
version of `jq` provided by alpine, and we've already updated it in the
previous commit (in this very same series).

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-12-20 12:52:41 -03:00
Fabiano Fidêncio
41320c586e
kata-deploy: Install jq from GitHub
`jq` coming from alpine is in its 1.6 version, and that has a bug that
hits us quite hard, as it changes a float to an int whenever the number
is in the `x.0` format.

One example is:
```bash
/ # jq --version
jq-1.6
/ # echo '{"foo": 1.0}' | jq .foo
1
```

With this in mind, let's switch, at least for now, to using the `jq`
released directly on github, as it does address the issue we've been
hitting.
```bash
⋊> Downloads ./jq-linux-amd64 --version
jq-1.7
⋊> Downloads echo '{"foo": 1.0}' | jq .foo
1.0
```

Fixes: #8678

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-12-20 12:52:41 -03:00
Greg Kurz
ce094ecdc2
Merge pull request #8679 from stevenhorsman/kata-deploy-containerd-config-fix
gha: kata-deploy: Revert containerd config break
2023-12-20 12:58:56 +01:00
stevenhorsman
ee5fa08a27 Revert "kata-deploy: Use tomlq to configure containerd"
This reverts commit dd9f5b07b9.

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2023-12-20 09:10:43 +00:00
stevenhorsman
9e718b4e23 gha: kata-deploy: Add containerd status check
After kata-deploy has installed, check that the worker nodes
are still in Ready state and don't have a containerd://Unknown
container runtime versions, identicating that container isn't working
to ensure that we didn't corrupt the containerd config during kata-deploy's edits

Fixes: #8678
Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2023-12-20 09:10:43 +00:00
Archana Shinde
7e5868a55f
Merge pull request #8588 from amshinde/runtime-rs-update-readme
runtime-rs: Update readme to indicate cloud-hypervisor support
2023-12-19 22:09:14 -08:00
Dan Mihai
8aa390279e tests: retry connection to pod SSH server
To become more resilient against these kinds of errors:

deployment.apps/confidential-unencrypted created
pod/confidential-unencrypted-c5fdd6964-rrb6q condition met
ssh: connect to host 10.42.0.109 port 22: Connection refused

Fixes: #8687

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2023-12-20 02:48:05 +00:00
GabyCT
5504176e9a
Merge pull request #8699 from GabyCT/topic/fixconfidentialscript
tests: k8s: Fix indentation in confidential common script
2023-12-19 16:01:28 -06:00
Dan Mihai
6cea8a5f2a
Merge pull request #8697 from microsoft/danmihai1/runk
tests: additional run-runk logging
2023-12-19 11:27:29 -08:00
Dan Mihai
551a50cd72 tests: additional run-runk logging
Add logging to run-runk, for debugging possible failures.

Fixes: #8696

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2023-12-19 14:08:01 +00:00
Xuewei Niu
ec30d5a9a8
Merge pull request #8700 from justxuewei/dbs-ut
dragonball: Trigger unit tests of dbs_* subcrates by `make test`
2023-12-19 17:51:20 +08:00
Xuewei Niu
039fe7f391 dragonball: Trigger unit tests of dbs_* subcrates by make test
`make SUPPORT_VIRTUALIZATION=1 test` iterates through all subcrates and
does test.

Plus, this patch fixes some issues about unit tests:

- Feed too much parameters to `I8042Device::new()`.
- Virtqueue checks have been introduced since `virtio-queue v0.7.0`.
- GHA might have no access to `/var/tmp` dir on runner.

Fixes: #8690

Signed-off-by: Xuewei Niu <niuxuewei.nxw@antgroup.com>
2023-12-19 16:22:37 +08:00
Hyounggyu Choi
ceea8882db
Merge pull request #8672 from BbolroC/introduce-vsock-device-init
runtime-rs: Separate init_config() from new() for struct VsockDevice
2023-12-18 22:04:37 +01:00
Gabriela Cervantes
1469a5efca tests: k8s: Fix indentation in confidential common script
This PR fixes the indentation of the confidential common
script for kubernetes tests.

Fixes #8698

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2023-12-18 20:25:06 +00:00
Chelsea Mafrica
312475508a
Merge pull request #8682 from cmaf/static-checks-update-loc
ci: Use static checks from kata repo for lib functions
2023-12-18 09:53:01 -08:00
Hyounggyu Choi
3cd0cc1388 runtime-rs: Separate init_config() from new() for struct VsockDevice
As a follow-up for #8516, guest_cid and vhost_fd are not necessarily initialised
via new(). Instead, the fields should be initialised later when they are really
used to construct hypervisor's parameters.
This commit is to separate init_config() from new() to initialise guest_cid
and vhost_fd and leave only the assignment of id for the existing function.

Fixes: #8671

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2023-12-18 16:36:09 +01:00
Greg Kurz
2987d3eeb5
Merge pull request #8341 from jongwu/fix_cpushares
agent: correct CPUShares and CPUWeight value
2023-12-18 15:40:04 +01:00
James O. D. Hunt
3c49120d2f
Merge pull request #8641 from jodh-intel/kata-ctl-add-cfg-file-cli-option
kata-ctl: Add option to dump config files
2023-12-18 11:54:19 +00:00
Greg Kurz
1cfcc80018
Merge pull request #8664 from amshinde/remove-ignore-paths-ga
github-actions: Remove ignore paths for required CI checks
2023-12-18 12:49:21 +01:00
Chelsea Mafrica
b785ef96ec docs: Change location of static checks script
We now use the static checks script from the main kata containers repo
and not the tests repo; update documentation to reflect this.

Fixes #8681

Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
2023-12-15 17:13:02 -08:00
Chelsea Mafrica
bfb756199f ci: Use static checks from kata repo for lib functions
Change the two functions in lib.sh to use the static checks script from
the kata containers repo instead of tests. Remove cloning the repo from
these functions since we don't need it anymore. Leave these two
functions because the document checking one may be used locally and the
static checks one is called from the virtcontainers Makefile.

Fixes #8681

Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
2023-12-15 17:08:33 -08:00
Archana Shinde
510bc36a77 github-actions: Remove ignore paths for required CI checks
If a PR contains files from the ignore-paths, these actions do not run
as intended. However, the actions are make as required. And there does
not seem to be a way to mark these as non-required in that case.
As a result a PR containing the files from the ignore-paths remains
stalled.
Hence remove the ignore-paths until github provides a way to mark
actions that are skipped due to ignore-paths as non-required/passed.

Fixes: #8663

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2023-12-15 15:12:20 -08:00
Zhongtao Hu
0f80dc636c
Merge pull request #6876 from openanolis/memory_hotlug
runtime-rs: support Memory hotplug
2023-12-15 14:28:35 +08:00
Zhongtao Hu
9a37e77f2a runtime-rs: check the update memory size
check the update memory size greater than default max memory size

Fixes:#6875
Signed-off-by: Zhongtao Hu <zhongtaohu.tim@linux.alibaba.com>
2023-12-15 11:25:34 +08:00
Zhongtao Hu
6039417104 runtime-rs: add default_maxmemory in config file
add default_maxmemory in config file

Fixes:#6875
Signed-off-by: Zhongtao Hu <zhongtaohu.tim@linux.alibaba.com>
2023-12-15 10:25:20 +08:00
Zhongtao Hu
8d9fd9c067 runtime-rs: support memory resize
Fixes:#6875
Signed-off-by: Zhongtao Hu <zhongtaohu.tim@linux.alibaba.com>
2023-12-15 10:25:13 +08:00
Zhongtao Hu
81e55c424a runtime-rs: add resize_memory trait for hypervisor
Fixes: #6875
Signed-off-by: Zhongtao Hu <zhongtaohu.tim@linux.alibaba.com>
2023-12-15 10:25:03 +08:00
Zhongtao Hu
d428a3f9b9 runtim-rs: get guest memory details
get memory block size and guest mem hotplug probe

Fixes:#6356
Signed-off-by: Zhongtao Hu <zhongtaohu.tim@linux.alibaba.com>
2023-12-15 10:22:37 +08:00
GabyCT
4a49dd73db
Merge pull request #8676 from GabyCT/topic/fixins
tests: k8s: Fix indentation in setup script
2023-12-14 13:57:47 -06:00
GabyCT
7a606a19c4
Merge pull request #8659 from GabyCT/topic/improvecleanuplatency
metrics: Improve latency network cleanup
2023-12-14 13:57:28 -06:00