Commit Graph

10403 Commits

Author SHA1 Message Date
Archana Shinde
09134c30de
Merge pull request #6737 from nedsouza/265/virtcontainers-clh-go-coverage
virtcontainers/clh_test.go: improve unit test coverage
2023-05-04 16:15:43 -07:00
Bin Liu
e57ac2ae18
Merge pull request #6749 from nedsouza/260/tests_coverage_virtcontainers_factory
virtcontainers/factory: Improved test coverage
2023-05-04 10:54:40 +08:00
Wainer Moschetta
f5ff975560
Merge pull request #6723 from ryansavino/gha-k8s-also-test-snp
gha: Also run k8s tests on qemu-snp
2023-05-01 10:37:12 -03:00
Fabiano Fidêncio
b6e54676eb
Merge pull request #6759 from ryansavino/gha-sev-kata-deploy-fix
gha: sev: fix for kata-deploy error
2023-05-01 11:42:16 +02:00
Ryan Savino
9e2b7ff177 gha: sev: fix for kata-deploy error
kubectl commands need a '-f' instead of a '-k'

Fixes: #6758

Signed-Off-By: Ryan Savino <ryan.savino@amd.com>
2023-04-28 14:54:36 -05:00
Ryan Savino
5c9246db19 gha: Also run k8s tests on qemu-snp
Added the k8s tests for qemu-snp

Fixes: #6722

Signed-Off-By: Ryan Savino <ryan.savino@amd.com>
2023-04-28 14:43:53 -05:00
Ryan Savino
c57a44436c gha: Add the ability to test qemu-snp
With the changes proposed as part of this PR, a qemu-snp cluster
will be created but no tests will be performed.

GitHub Actions will only run the tests using the workflows that are
part of the **target** branch, instead of the using the ones coming
from the PR. No way to work around this for now.

After this commit is merged, the tests (not the yaml files for the
actions) will be altered in order for the checkout action  to help in
this case.

Fixes: #6722

Signed-off-by: Ryan Savino <ryan.savino@amd.com>
2023-04-28 13:07:13 -05:00
Wainer Moschetta
29785a43d7
Merge pull request #6712 from ryansavino/gha-k8s-also-test-sev
gha: Also run k8s tests on qemu-sev
2023-04-28 14:22:03 -03:00
Archana Shinde
65c61785fc
Merge pull request #6660 from amshinde/kata-ctl-cmd
Implement the "kata-ctl env" command
2023-04-28 01:33:28 -07:00
Archana Shinde
4064192896 env: Utilize arch specific functionality to get cpu details
Have kata-env call architecture specific function to get cpu details
instead of generic function to get cpu details that works only for
certain architectures. The functionality for cpu details has been fully
implemented for x86_64 and arm architectures, but needs to be
implemented for s390 and powerpc.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2023-04-27 16:45:41 -07:00
Archana Shinde
fb40c71a21 env: Check for root privileges
Check for root privileges early on.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2023-04-27 16:45:41 -07:00
Archana Shinde
1016bc17b7 config: Add api to fetch config from default config path
Add api to fetch config from default config path and use that in
kata-ctl tool.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2023-04-27 16:45:41 -07:00
Archana Shinde
b908a780a0 kata-env: Pass cmd option for file path
Add ability to write the environment information to a file
or stdout if file path is absent.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2023-04-27 16:45:41 -07:00
Archana Shinde
b1920198be config: Workaround the way agent and hypervisor configs are fetched
This is essentially a workaround for the issue:
https://github.com/kata-containers/kata-containers/issues/5954

runtime-rs chnages the Kata config format adding agent_name and
hypervisor_name which are then used as keys to fetch the agent and
hypervisor configs. This will not work for older configs.
So use the first entry in the hashmaps to fetch the configs as a
workaround while the config change issue is resolved.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2023-04-27 16:45:41 -07:00
Archana Shinde
f2b2621dec kata-env: Implement the kata-env command.
Command implements functionality to get user environment settings.

Fixes: #5339

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2023-04-27 16:45:41 -07:00
Ryan Savino
c849bdb0a5 gha: Also run k8s tests on qemu-sev
Added the k8s tests for qemu-sev

Fixes: #6711

Signed-Off-By: Ryan Savino <ryan.savino@amd.com>
2023-04-27 15:24:08 -05:00
Eduardo Berrocal
6bf1fc6051 virtcontainers/factory: Improved test coverage
Expanded tests on factory_test.go to cover more lines of code. Coverage went from 34% to 41.5% in the case of user-mode run tests,
and from 77.7% to 84% in the case of priviledge-mode run tests.

Fixes: #260

Signed-off-by: Eduardo Berrocal <eduardo.berrocal@intel.com>
2023-04-27 13:08:35 -07:00
Archana Shinde
f2ebdd81c2 utils: Get rid of spurious print statement left behind.
The print was used for debugging, get ris of it.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2023-04-26 22:12:30 -07:00
Archana Shinde
9a94f1f149 make: Export VERSION and COMMIT
These will be consumed by kata-ctl, so export these so that
they can be used to replace variables available to the rust binary.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2023-04-26 22:12:30 -07:00
Archana Shinde
2f81f48dae config: Add file under /opt as another location to look for the config
Most of kata installation tools use this path for installation, so
add this to the paths to look for the configuration.toml file.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2023-04-26 22:12:30 -07:00
Archana Shinde
07f7d17db5 config: Make the pipe_size field optional
Add the serde default attribute to the field so that parsing
can continue if this field is not present.
The agent assumes a default value for this, so it is not required
by the user to provide a value here.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2023-04-26 22:12:30 -07:00
Archana Shinde
68f6357731 config: Make function to get the default conf file public
This will be used by the kata-env command.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2023-04-26 22:12:30 -07:00
Archana Shinde
7565b33568 kata-ctl: Implement Display trait for GuestProtection enum
Implement Display for enum to display in env output.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2023-04-26 22:12:30 -07:00
Archana Shinde
94a00f9346 utils: Make certain constants in utils.rs public
These would be used outside of utils.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2023-04-26 22:12:30 -07:00
Archana Shinde
572b338b3b gitignore: Ignore .swp and .swo editor backup files
Ignore temporary files created by vim editor.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2023-04-26 22:12:30 -07:00
Archana Shinde
376884b8a4 cargo: Update version of clap to 4.1.13
This version includes macros related to using command options.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2023-04-26 22:12:30 -07:00
Ryan Savino
521519d745 gha: Add the ability to test qemu-sev
With the changes proposed as part of this PR, a qemu-sev cluster will
be created but no tests will be performed.

GitHub Actions will only run the tests using the workflows that are
part of the **target** branch, instead of the using the ones coming
from the PR. No way to work around this for now.

After this commit is merged, the tests (not the yaml files for the
actions) will be altered in order for the checkout action  to help in this
case.

Fixes: #6711

Signed-off-by: Ryan Savino <ryan.savino@amd.com>
2023-04-26 17:56:28 -05:00
Tamas K Lengyel
0f45b0faa9 virtcontainers/clh_test.go: improve unit test coverage
Credit PR to Hackathon Team3

Fixes: #265

Signed-off-by: Tamas K Lengyel <tamas.lengyel@intel.com>
2023-04-26 19:12:51 +00:00
Bin Liu
509bc8b6c8
Merge pull request #6718 from openanolis/mengze/keep_abnormal
runtime-rs: support keep_abnormal in toml config
2023-04-26 12:36:52 +08:00
Bin Liu
b6d880510a
Merge pull request #6595 from zvonkok/gpu-snp-tdx-kernel
gpu: Build and Ship an GPU enabled Kernel
2023-04-26 12:33:51 +08:00
mengze
cc8ea3232e runtime-rs: support keep_abnormal in toml config
This patch adds keep_abnormal in runtime config. If keep_abnormal =
true, it means that 1) if the runtime exits abnormally, the cleanup
process will be skipped, and 2) the runtime will not exit even if the
health check fails.

This option is typically used to retain abnormal information for
debugging and should NOT be enabled by default.

Fixes: #6717

Signed-off-by: mengze <mengze@linux.alibaba.com>
Signed-off-by: quanweiZhou <quanweiZhou@linux.alibaba.com>
2023-04-25 13:47:44 +08:00
David Esparza
7fdaab49bc
Merge pull request #6295 from dborquez/add_kernel_module_checks_kvm
kata-ctl: checks for kvm, kvm_intel modules loaded
2023-04-24 13:33:18 -06:00
Greg Kurz
0ca6d3b726
Merge pull request #6681 from Vlad1mir-D/6677-fix-kata-agent-dbus-connection
osbuilder: Fix D-Bus enabling in the dracut case
2023-04-24 17:31:13 +02:00
Bin Liu
3d8688f92e
Merge pull request #6620 from jongwu/docker_fail_start_snap
snap: fix docker start fail issue
2023-04-24 10:53:16 +08:00
Archana Shinde
97291d88e9
Merge pull request #6696 from amshinde/kata-manager-containerd-fix
kata-manager: Fix containerd download
2023-04-21 09:54:30 -07:00
Archana Shinde
96e8470dbe kata-manager: Fix containerd download
Newer containerd releases have an additional static package published.
Because of this,  download_url contains two urls causing curl to fail.
To resolve this, pick the first url from the containerd releases to
download containerd.

Fixes: #6695

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2023-04-20 23:08:51 -07:00
David Esparza
432d407440
kata-ctl: checks for kvm, kvm_intel modules loaded
Ensure that kvm and kvm_intel modules are loaded.
Renames the get_cpu_info() function to read_file_contents()

Fixes #5332

Signed-off-by: David Esparza <david.esparza.borquez@intel.com>
2023-04-20 11:29:36 -06:00
Zvonko Kaiser
b1730e4a67 gpu: Add new kernel build option to usage()
With each release make sure we ship a GPU  enabled kernel

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2023-04-20 07:48:30 +00:00
Fupan Li
ceefd50bd0
Merge pull request #6680 from Tim-Zhang/fix-ut-bad-fd
agent: Fix ut issue caused by fd double closed
2023-04-20 11:18:27 +08:00
Fupan Li
a7b4b69230
Merge pull request #6673 from Tim-Zhang/upgrade-ttrpc-protobuf
Bump ttrpc to 0.7.2 and protobuf to 3.2.0
2023-04-20 10:13:43 +08:00
Fupan Li
a1568cd2f5
Merge pull request #6676 from zvonkok/gpu-runtime
gpu: Add GPU enabled confguration and runtime
2023-04-19 13:01:49 +08:00
Vladimir
3e7b902265 osbuilder: Fix D-Bus enabling in the dracut case
- D-Bus enabling now occurs only in setup_rootfs (instead of
prepare_overlay and setup_rootfs)
- Adjust permissions of / so dbus-broker will be able to traverse FS

These changes enables kata-agent to successfully communicate with D-Bus.

Fixes #6677

Signed-off-by: Vladimir <amigo.elite@gmail.com>
2023-04-18 23:17:34 +03:00
Tim Zhang
53c749a9de agent: Fix ut issue caused by fd double closed
Never ever try to close the same fd double times, even in a unit test.

A file descriptor is a number which will be reused, so when you close
the same number twice you may close another file descriptor in the second
time and then there will be an error 'Bad file descriptor (os error 9)'
while the wrongly closed fd is being used.

Fixes: #6679

Signed-off-by: Tim Zhang <tim@hyper.sh>
2023-04-18 23:19:10 +08:00
Hyounggyu Choi
5c032c64ac
Merge pull request #6664 from zvonkok/vfio-fix
gpu: Do not pass-through PCI (Host) Bridges
2023-04-18 19:50:15 +09:00
Tim Zhang
2e3f19af92 agent: fix clippy warnings caused by protobuf3
Fix warnings introduced by protobuf upgrade.

Signed-off-by: Tim Zhang <tim@hyper.sh>
2023-04-17 20:15:49 +08:00
Tim Zhang
4849c56faa agent: Fix unit test issue cuased by protobuf upgrade
Fixes: #6646

Signed-off-by: Tim Zhang <tim@hyper.sh>
2023-04-17 19:49:21 +08:00
Tim Zhang
0a582f7815 trace-forwarder: remove unused crate protobuf
Remove unused crate protobuf.

Signed-off-by: Tim Zhang <tim@hyper.sh>
2023-04-17 19:49:21 +08:00
Tim Zhang
73253850e6 kata-ctl: remove unused crate ttrpc
Remove unused crate ttrpc.

Signed-off-by: Tim Zhang <tim@hyper.sh>
2023-04-17 19:49:21 +08:00
Tim Zhang
76d2e30547 agent-ctl: Bump ttrpc from 0.6.0 to 0.7.1
Fixes: #6646

Signed-off-by: Tim Zhang <tim@hyper.sh>
2023-04-17 19:49:21 +08:00
Tim Zhang
eb3d20dccb protocols: Add ut for Serde
Fixes: #6646

Signed-off-by: Tim Zhang <tim@hyper.sh>
2023-04-17 19:49:21 +08:00