Commit Graph

1580 Commits

Author SHA1 Message Date
Amulya Meka
b323afeda9
Merge pull request #9214 from Amulyam24/oras
kata-deploy: install oras using release artefacts on ppc64le
2024-06-05 11:40:55 +05:30
Wainer dos Santos Moschetta
af4f9afb71 kata-deploy: add PULL_TYPE handler for CRI-O
A new PULL_TYPE environment variable is recognized by the kata-deploy's
install script to allow it to configure CRIO-O for guest-pull image pulling
type.

The tests/integration/kubernetes/gha-run.sh change allows for testing it:
```
export PULL_TYPE=guest-pull
cd tests/integration/kubernetes
./gha-run.sh deploy-k8s
```

Fixes #9474
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-06-04 14:02:01 -03:00
Zvonko Kaiser
647560539f
Merge pull request #9769 from zvonkok/initrd-image-no-sudo
ci: remove sudo and make sure artifacts is owned by user
2024-06-04 07:16:51 +02:00
Zvonko Kaiser
a48c084e13 ci: remove sudo and make sure image is owed by user
The image build needs special handling since we're doing a lot of
privileged operations.

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-06-03 15:29:06 +00:00
Beraldo Leal
d3a5eb299a tools: bumping kernel config version
Lets make ci happy.

Signed-off-by: Beraldo Leal <bleal@redhat.com>
2024-05-31 13:28:34 -04:00
Beraldo Leal
c99ba42d62 deps: bumping yq to v4.40.7
Since yq frequently updates, let's upgrade to a version from February to
bypass potential issues with versions 4.41-4.43 for now. We can always
upgrade to the newest version if necessary.

Fixes #9354
Depends-on:github.com/kata-containers/tests#5818

Signed-off-by: Beraldo Leal <bleal@redhat.com>
2024-05-31 13:28:34 -04:00
Amulyam24
eadcb868f4 kata-deploy: install oras using release artefacts on ppc64le
We are currently building Oras from source on ppc64le. Now that they offically release the artefacts
for power, consume them to install Oras.

Fixes: #9213

Signed-off-by: Amulyam24 <amulmek1@in.ibm.com>
2024-05-31 14:16:14 +05:30
Fabiano Fidêncio
72a71ff2bf
Merge pull request #9737 from zvonkok/kata-deploy-no-sudo
ci: kata-deploy no sudo
2024-05-31 09:55:24 +02:00
Zvonko Kaiser
063db516f2 ci: Remove all git config safe.directory
Now with the sudo less build we should be good
to remove those hacks.

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-05-30 15:12:28 +00:00
Zvonko Kaiser
d8889684f0 ci: kata-deploy no sudo
Build/push/manage aritfacts without sudo

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-05-30 15:07:27 +00:00
Zvonko Kaiser
02a7f8c852 ci: Fix tools builder images
We weren't considering changes of the tools script dir
adding a fourth hash to accomodate this

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-05-30 08:10:42 +00:00
Fabiano Fidêncio
97806dbdaa
Merge pull request #9732 from zvonkok/shim-v2-no-sudo
ci: shim-v2 no sudo
2024-05-30 07:01:04 +02:00
GabyCT
0eddfdc74f
Merge pull request #9731 from zvonkok/pause-no-sudo
ci: pause-image no sudo
2024-05-29 11:48:41 -06:00
Zvonko Kaiser
7354c427f9
Merge pull request #9734 from zvonkok/virtiofsd-no-sudo
ci: virtiofsd no sudo
2024-05-29 19:31:25 +02:00
GabyCT
3c91aa0475
Merge pull request #9739 from zvonkok/initramfs-no-sudo
ci: initramfs no sudo
2024-05-29 11:28:59 -06:00
Hyounggyu Choi
40d2306f95
Merge pull request #9729 from zvonkok/agent-no-sudo-build
ci: build agent without sudo
2024-05-29 19:27:56 +02:00
GabyCT
03be220482
Merge pull request #9730 from zvonkok/kernel-no-sudo
ci: kernel no sudo
2024-05-29 10:23:31 -06:00
GabyCT
a5808a556d
Merge pull request #9733 from zvonkok/tools-no-sudo
ci: tools no sudo
2024-05-29 10:19:17 -06:00
GabyCT
e94b09839d
Merge pull request #9736 from zvonkok/qemu-no-sudo
ci: qemu no sudo
2024-05-29 10:18:34 -06:00
Hyounggyu Choi
6ba2461404
Merge pull request #9728 from zvonkok/coco-guest-comp-no-sudo
ci: guest-components without sudo
2024-05-29 17:55:43 +02:00
Zvonko Kaiser
25c784c568 ci: shim-v2 no sudo
Build shim-v2 without sudo docker this is not needed. This is part 6 of N

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-05-29 09:24:54 +00:00
Zvonko Kaiser
84a9773cec ci: initramfs no sudo
BUild initramfs  without sudo docker this is not needed. This is part 10 of N

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-05-29 09:20:39 +00:00
Zvonko Kaiser
7dc47c8150 ci: qemu no sudo
Build qemu without sudo docker this is not needed. This is part 9 of N

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-05-28 16:12:06 +00:00
Zvonko Kaiser
4a455bf24a ci: virtiofsd no sudo
build virtiofsd without sudo docker this is not needed. This is part 8 of N

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-05-28 14:19:58 +00:00
Zvonko Kaiser
dd04d26cb0 ci: tools no sudo
Build tools without sudo docker this is not needed. This is part 7 of N

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-05-28 13:57:20 +00:00
Zvonko Kaiser
6c9c0306ac ci: pause-image no sudo
Build pause-image without sudo docker this is not needed. This is part 5 of N

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-05-28 11:31:59 +00:00
Zvonko Kaiser
c95ae5a502 ci: kernel no sudo
Build kernel without sudo docker this is not needed. This is part 4 of N

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-05-28 11:19:08 +00:00
Zvonko Kaiser
8fab5dd584 ci: build agent without sudo
Build agent without sudo docker this is not needed. This is part 3 of N

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-05-28 09:55:32 +00:00
Zvonko Kaiser
1e4cbc4fcd ci: guest-components wihout sudo
Build guest-components without sudo docker this is not needed. This is part 2 of N

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-05-28 09:03:14 +00:00
Zvonko Kaiser
b76938b922 ci: ovmf without sudo
Build ovmf without sudo docker this is not needed. This is part 1 of N

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-05-28 08:25:27 +00:00
Fabiano Fidêncio
e3c2f0b0f1
kata-cleanup: Add k0s kustomization
k0s was added to kata-deploy, but it's kata-cleanup counterpart was
never added.  Let's fix it.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-05-27 05:05:06 +02:00
Fabiano Fidêncio
f15d40f8fb
kata-deploy: Fix k0s deployment
k0s deployment has been broken since we moved to using `tomlq` in our
scripts.  The reason is that before using `tomlq` our script would,
involuntarily, end up creating the file.

Now, in order to fix the situation, we need to explicitly create the
file and let `tomlq` add the needed content.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-05-27 05:05:06 +02:00
stevenhorsman
db4818fe1d ci: cache: Enforce tag length limit
Container tags can be a maximum of 128 characters long
so calculate the length of the arch suffix and then restrict
the tag to this length subtracted from 128

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2024-05-21 18:03:45 +01:00
stevenhorsman
d6afd77eae ci: cache: Update agent cache to use the full commit hash
- Previously I copied the logic that abbreviated the commit hash
from the versioning, but looking at our versions.yaml the clear pattern
is that when pointing at commits of dependencies we use the full
commit hash, not the abbreviated one, so for consistency I think we should
do the same with the components that we make available

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2024-05-21 16:51:16 +01:00
stevenhorsman
d46b6a3879 ci: cache: Add arch suffix to all cache tags
As we have multi-arch builds for nearly all components, we want to ensure
that all the cache tags we set have the architecture suffix, not just the
`TARGET_BRANCH` one.

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2024-05-21 11:25:07 +01:00
vac (Brendan)
d812007b99 kata-deploy: Fix unbound VERSION_ID
VERSION_ID is not guaranteed to be specified in os-release, this
makes kaka-deploy breaks in rolling distros like arch linux and void
linux.

Note that operating system vendors may choose not to provide
version information, for example to accommodate for rolling releases.
In this case, VERSION and VERSION_ID may be unset.
Applications should not rely on these fields to be set.

Signed-off-by: vac <dot.fun@protonmail.com>
2024-05-20 19:48:31 +08:00
Fabiano Fidêncio
94786dc939
Merge pull request #9659 from stevenhorsman/remove-non-printable-tag-characters
ci: cache: Filter out non-printable characters from tag
2024-05-18 14:47:07 +02:00
stevenhorsman
42fddb5530 ci: cache: Filter out non-printable characters from tag
- The tags have a trailing non-printable character, which results
in our cache tags having a trailing underscore e.g. `ghcr.io/kata-containers/cached-artefacts/agent:ce24e9835_`
For ease of use of these cached components, we should strip off the trailing underscore.

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2024-05-17 14:16:40 +01:00
Hyounggyu Choi
3917930a76 CI: Append arch type to initramfs-cryptsetup image
This commit is to append an arch type to the initramfs-cryptsetup image
to prevent a wrong arch image from being pulled on a different arch host.

Fixes: #9654

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-05-17 11:42:49 +02:00
stevenhorsman
ce24e98358 ci: cache: Add tag character filtering
- Container image tags can only contain alphanumeric, period,
hyphen and underscore characters, so convert characters outside
of these to be underscores, to avoid having invalid tag failures

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2024-05-16 21:38:07 +01:00
stevenhorsman
a98b1e3afb ci: cache: Integrate tagging updates with recent changes
Recently the extra gpu caching was added, unfortunately when I
rebased I ended up with both the new tagging logic and old logic.
Let's try and integrate them properly to avoid doing the push twice.

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2024-05-16 21:38:07 +01:00
stevenhorsman
9d9487b17f ci: cache: Fix unbound variable
Now we have the workflow updated and can test the changes in caching
we've hit an error:
```
line 1180: artefact_tag: unbound variable
```
so we need to fix that up. Sorry for missing this before.

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2024-05-16 14:30:32 +01:00
Steve Horsman
d8468cb178
Merge pull request #9550 from stevenhorsman/tag-component-caches
Tag component caches
2024-05-16 11:05:18 +01:00
Steve Horsman
b31ff09b8d
Merge pull request #9617 from zvonkok/artefact-repository
deploy: Add artefact repository
2024-05-16 10:41:23 +01:00
stevenhorsman
7f41329010 ci: cache: Optional tag components with tags
- CoCo wants to use the agent and coco-guest-components cached artifacts
so tag them with a helpful version, so make these easier to get

Signed-off-by: stevenhorsman <steven@uk.ibm.com>

 No commands remaining.
2024-05-15 16:56:40 +01:00
Hyounggyu Choi
e075150fbe CI: Use --abbrev=9 explicitly for abbreviated commit hash
A length of the result of `git log -1 --pretty=format:%h` could vary
over different CI systems, highly likely messing up their caching
mechanisms.

This commit is to use an option `--abbrev=9` to standardize the length
to 9 characters for CI.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-05-15 14:22:07 +02:00
Zvonko Kaiser
117e2f2ecc
Merge pull request #9618 from zvonkok/nvidia-rootfs-#1
gpu: Add build targets for GPU rootfs initrd/image
2024-05-15 13:30:42 +02:00
Fabiano Fidêncio
92bb235723
osbuilder: Log when the default policy is installed
This will help us to debug issues in the future (and would have helped
in the past as well). :-)

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-05-14 20:45:49 +02:00
Fabiano Fidêncio
75bd97e8df
build: Ensure the default rootfs is built with AGENT_POLICY=yes
This is needed, as b1710ee2c0 made the
default agent shipped the one with policy support.  However, we simply
didn't update the rootfs to reflect that, causing then an issue to start
the agent as shown by the strace below:
```
open("/etc/kata-opa/default-policy.rego", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)
futex(0x7f401eba0c28, FUTEX_WAKE_PRIVATE, 1) = 1
rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1 RT_2], [], 8) = 0
tkill(553681, SIGABRT)                  = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
--- SIGABRT {si_signo=SIGABRT, si_code=SI_TKILL, si_pid=553681, si_uid=1000} ---
+++ killed by SIGABRT (core dumped) +++
```

This happens as the default policy **must** be set when the agent is
built with policy support, but the code path that copies that into the
rootfs is only triggered if the rootfs itself is built with
AGENT_POLICY=yes, which we're now doing for both confidential and
non-confidential cases.

Sadly this was not caught by CI till we the cache was not used for
rootfs, which should be solved by the previous commit.

Fixes: #9630, #9631

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-05-14 20:39:15 +02:00
Hyounggyu Choi
37060a7d2e
local-build: Stop using cached artifacts when local-build/* is updated
This is to add an info for files at `tools/packaging/kata-deploy/local-build/*
to a version of the components and ensure that the cached artefacts are not used
when the files of interest are updated.

Fixes: #9630

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-05-14 19:47:33 +02:00
Fabiano Fidêncio
9a3392993d
Merge pull request #9629 from ldoktor/tdx_not_supported_warning
kata-deploy: Fix tdx_not_supported call
2024-05-14 17:27:56 +02:00
Greg Kurz
f14a1330d4
Merge pull request #9585 from littlejawa/debugging_the_runtime
debugging: adding a script and instructions for debugging the GO shim
2024-05-14 15:31:07 +02:00
Lukáš Doktor
d9ae130031
kata-deploy: Fix tdx_not_supported call
the `tdx_not_supported_warning` function does not exists, the
`tdx_not_supported` should be called instead.

Fixes: #9628

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
2024-05-14 13:26:07 +02:00
Julien Ropé
e7cfc0865a debugging: adding a script and instructions for debugging the GO shim
Using a debugger with the kata runtime is complicated, but it can be done
and can be very useful.

This commits provides a helper script that simplifies it, and updates
the developper's documentation to explain how to use it.

Signed-off-by: Julien Ropé <jrope@redhat.com>
2024-05-14 11:12:31 +02:00
Fabiano Fidêncio
4cd048444d build: nvidia-gpu: Fix cache usage of the headers tarball
Whenever we count on having the headers tarball, we must unpack the
cached content into the expected directory, otherwise we'd simply fail,
as we've been failing in our CI, at the end of the process where we
generate the tarball from the cached components.

It's weird to me, sincerely, that the headers tarball end up in such
weird place (build/kernel-nvidia-gpu/builddir/), but I'll leave that to
Zvonko to figure out whether something better can be done, as the intuit
of this PR is simply unblock Kata Containers CI.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-05-11 17:59:53 +02:00
Zvonko Kaiser
693e307f72 deploy: Add artefact repository
New env var so everyone can test the PUSH_TO_REGISTRY feature

export PUSH_TO_REGISTRY=yes
export ARTEFACT_REGISTRY=quay.io
export ARTEFACT_REPOSITORY=my-fancy-kata-containers
export ARTEFACT_REGISTRY_USERNAME=zvonkok
export ARTEFACT_REGISTRY_PASSWORD=<super-secret>

make ...-tarball

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-05-10 16:41:52 +00:00
Zvonko Kaiser
4d0f42a145 deploy: Fix wrong pushing of artifacts
Added explicit case statements for nvidia-gpu and
nvidia-gpu-confidential

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-05-10 14:08:32 +00:00
Zvonko Kaiser
85374f55d2 gpu: Add build targets for GPU rootfs initrd/image
Preparation for complete GPU rootfs build step #1/#N

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-05-10 09:47:21 +00:00
Fabiano Fidêncio
20515fed70
Merge pull request #9484 from zvonkok/nvidia-runtimeclasses
deploy: Add runtimeClasses relating to the NVIDIA GPU
2024-05-10 03:52:12 +02:00
Fabiano Fidêncio
2f686b1179
Merge pull request #9608 from fidencio/topic/tdx-depend-on-distro-host-stack-part-II
tdx: Adapt kata-deploy to use QEMU / OVMF from the distros
2024-05-09 10:25:19 +02:00
Zvonko Kaiser
da7e6a0f07
deploy: Add runtimeClasses relating to the NVIDIA GPU
Fixes: #9483

For the added configurations we need to provide runtimeClasses.

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-05-09 10:00:59 +02:00
Fabiano Fidêncio
96a100f910
Merge pull request #9482 from zvonkok/kernel-headers-tarball
kernel: Add caching of kernel-headers
2024-05-09 09:58:30 +02:00
Fabiano Fidêncio
a9720495de
kata-deploy: Ensure the distro QEMU and OVMF are used for TDX
Here we're checking the distro's `/etc/os-release` or
`/usr/lib/os-release` in order to get which distro we're deploying the
Kata Containers artefacts to, and then to properly adjust the QEMU and
OVMF with TDX support that's been shipped with the distros.

Together with that, we're also printing the instructions provided by the
distro on how to enable and use TDX.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-05-09 07:59:12 +02:00
Fabiano Fidêncio
84b94dc2b1
kata-deploy: Expose /host to the daemon-set
We'll need to have access to the host os-release file (either under
`/etc/os-release` or under `/usr/lib/os-release`), and the simplest
approach that comes to my mind to do is doing what a debug pod would do,
mounting `/` as `/host` and then allowing us to have access to those
files, and then corectly set the TDX specific QEMU and OVMF (TDVF) paths
for the tdx available configurations.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-05-09 07:59:12 +02:00
Fabiano Fidêncio
f2d40da8e4
versions: build: Remove unused td-shim entry
We haven't been using nor testing with td-shim, as Cloud Hypervisor does
not officially support TDX yet, and TDVF is supposed to be used with
QEMU, instead of td-shim.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-05-09 07:59:12 +02:00
Fabiano Fidêncio
ea82740b19
versions: build: Remove TDX specific QEMU
Let's remove everything related to the TDX specific QEMU building /
shipping from our repo, as we'll be relying on the one coming from the
distros.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-05-09 07:59:12 +02:00
Fabiano Fidêncio
4292c4c3b1
versions: build: Remove TDX specific OVMF (TDVF)
Let's remove everything related to the TDVF building / shipping from our
repo, as we'll be relying on the one coming from the distro.

Later on, we may need to re-add TDVF logic, as we're already using
upstream edk2 repo / content, but when that's needed we'll simply revert
this commit.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-05-09 07:59:12 +02:00
Zvonko Kaiser
fb0b821771 kernel: Add caching of kernel-headers
Fixes: #9481

We need to cache the kernel-headers for the NVIDIA GPU initrd/image build.

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-05-08 11:30:39 +00:00
Fabiano Fidêncio
ddf6b367c7
Merge pull request #9568 from kata-containers/dependabot/go_modules/src/runtime/go_modules-22ef55fa20
build(deps): bump the go_modules group across 5 directories with 8 updates
2024-05-07 13:14:48 +02:00
Fabiano Fidêncio
f04a7a55ed
Merge pull request #9563 from fidencio/topic/agent-use-policy-by-default
build: Build the shipped agent with policy enabled
2024-05-01 12:22:05 +02:00
Julien Ropé
c2aed995b7 kata-deploy: configure debugging for crio
Fix the configuration for crio's log_level

Fixes: #9556

Signed-off-by: Julien Ropé <jrope@redhat.com>
2024-04-30 17:48:43 +02:00
dependabot[bot]
391bc35805 build(deps): bump the go_modules group across 5 directories with 8 updates
Bumps the go_modules group with 2 updates in the /src/runtime directory: [github.com/containerd/containerd](https://github.com/containerd/containerd) and [github.com/containers/podman/v4](https://github.com/containers/podman).
Bumps the go_modules group with 4 updates in the /src/tools/csi-kata-directvolume directory: [golang.org/x/sys](https://github.com/golang/sys), google.golang.org/protobuf, [golang.org/x/net](https://github.com/golang/net) and [google.golang.org/grpc](https://github.com/grpc/grpc-go).
Bumps the go_modules group with 2 updates in the /src/tools/log-parser directory: [golang.org/x/sys](https://github.com/golang/sys) and gopkg.in/yaml.v3.
Bumps the go_modules group with 2 updates in the /tests directory: [golang.org/x/sys](https://github.com/golang/sys) and gopkg.in/yaml.v3.
Bumps the go_modules group with 2 updates in the /tools/testing/kata-webhook directory: [golang.org/x/sys](https://github.com/golang/sys) and [golang.org/x/net](https://github.com/golang/net).


Updates `github.com/containerd/containerd` from 1.7.2 to 1.7.11
- [Release notes](https://github.com/containerd/containerd/releases)
- [Changelog](https://github.com/containerd/containerd/blob/main/RELEASES.md)
- [Commits](https://github.com/containerd/containerd/compare/v1.7.2...v1.7.11)

Updates `github.com/containers/podman/v4` from 4.2.0 to 4.9.4
- [Release notes](https://github.com/containers/podman/releases)
- [Changelog](https://github.com/containers/podman/blob/v4.9.4/RELEASE_NOTES.md)
- [Commits](https://github.com/containers/podman/compare/v4.2.0...v4.9.4)

Updates `google.golang.org/protobuf` from 1.29.1 to 1.33.0

Updates `github.com/cyphar/filepath-securejoin` from 0.2.3 to 0.2.4
- [Release notes](https://github.com/cyphar/filepath-securejoin/releases)
- [Commits](https://github.com/cyphar/filepath-securejoin/compare/v0.2.3...v0.2.4)

Updates `golang.org/x/sys` from 0.15.0 to 0.19.0
- [Commits](https://github.com/golang/sys/compare/v0.15.0...v0.19.0)

Updates `google.golang.org/protobuf` from 1.31.0 to 1.33.0

Updates `golang.org/x/net` from 0.19.0 to 0.23.0
- [Commits](https://github.com/golang/net/compare/v0.19.0...v0.23.0)

Updates `google.golang.org/grpc` from 1.59.0 to 1.63.2
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.59.0...v1.63.2)

Updates `golang.org/x/sys` from 0.0.0-20191026070338-33540a1f6037 to 0.1.0
- [Commits](https://github.com/golang/sys/compare/v0.15.0...v0.19.0)

Updates `gopkg.in/yaml.v3` from 3.0.0-20200313102051-9f266ea9e77c to 3.0.0

Updates `golang.org/x/sys` from 0.0.0-20220429233432-b5fbb4746d32 to 0.19.0
- [Commits](https://github.com/golang/sys/compare/v0.15.0...v0.19.0)

Updates `gopkg.in/yaml.v3` from 3.0.0-20210107192922-496545a6307b to 3.0.0

Updates `golang.org/x/sys` from 0.15.0 to 0.19.0
- [Commits](https://github.com/golang/sys/compare/v0.15.0...v0.19.0)

Updates `golang.org/x/net` from 0.19.0 to 0.23.0
- [Commits](https://github.com/golang/net/compare/v0.19.0...v0.23.0)

---
updated-dependencies:
- dependency-name: github.com/containerd/containerd
  dependency-type: direct:production
  dependency-group: go_modules
- dependency-name: github.com/containers/podman/v4
  dependency-type: direct:production
  dependency-group: go_modules
- dependency-name: google.golang.org/protobuf
  dependency-type: direct:production
  dependency-group: go_modules
- dependency-name: github.com/cyphar/filepath-securejoin
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: golang.org/x/sys
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: google.golang.org/protobuf
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  dependency-group: go_modules
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  dependency-group: go_modules
- dependency-name: golang.org/x/sys
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: gopkg.in/yaml.v3
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: golang.org/x/sys
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: gopkg.in/yaml.v3
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: golang.org/x/sys
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: golang.org/x/net
  dependency-type: indirect
  dependency-group: go_modules
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-30 09:46:13 +01:00
Wainer dos Santos Moschetta
c6708726ff kata-deploy: install the new kata-qemu-coco-dev runtimeclass
Created the runtimeclasses/kata-qemu-coco-dev.yaml file and updated the list
of SHIMS.

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-04-29 05:45:11 -03:00
Fabiano Fidêncio
d3b300ff95
build: tests: Remove agent-opa
Now that the `kata-agent` is being built with policy support, let's stop
building the `kata-opa-agent`, reducing the amount of things we need to
test and maintain.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-04-28 12:52:54 +02:00
Fabiano Fidêncio
b1710ee2c0
build: Build the shipped agent with policy enabled
Now that the OPA binary is not required anymore, let's start shipping
the agent with the policy enabled by default.

The agent *without* policy enabled has 30MB, while it's 34MB *with* the
policy enabled.

This 4MB (~10%) increase is, IMHO, worth it in order to reduce the
amount of components we have to maintain and test, including the
possibility to also reduce the amount of possible rootfs / initrd
images.

Whoever wants to use the agent without policy enabled can simply do that
by building their own agent. :-)

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-04-28 12:52:54 +02:00
Fabiano Fidêncio
fe21d7a58b
rootfs: Stop building and shipping OPA
Since OPA binary was replaced by the regorus crate, we can finally stop
building and shipping the binary.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-04-26 18:51:28 +02:00
Fabiano Fidêncio
7dd2fde22d
Revert "rootfs: Make OPA build working in docker for s390x and ppc64le"
This reverts commit d523e865c0, as we will
not depend on the OPA binary anymore.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-04-26 18:51:27 +02:00
Jakub Ledworowski
73366da9f9 build: Fix tarball not building correctly in docker
When docker is installed on the host system using script from https://get.docker.com/ it automatically creates a docker group with gid=999.
Then during docker build process of tarball, eg. make qemu-tdx-experimental-tarball docker is also installed inside the image with the same
script, which also automatically adds docker group with gid=999.
Then, the build tries to add a new group docker_on_host with gid=999, which already exists, which breaks the build.

Signed-off-by: Jakub Ledworowski <jakub.ledworowski@intel.com>
2024-04-24 15:35:36 +02:00
Fabiano Fidêncio
4e35f11a3d
Merge pull request #9535 from fidencio/topic/fix-crio-debug-drop-in
kata-deploy: Stop append `log_level = "debug"` for CRI-O
2024-04-24 10:03:36 +02:00
Fabiano Fidêncio
d190c9d4d9
kata-deploy: Stop append log_level = "debug" for CRI-O
This should only be done once, and if CRI-O restarts, there's a big
chance kata-deploy will also restart and the user would end up with a
file that looks like:
```
[crio]
log_level = "debug"
[crio]
log_level = "debug"
[crio]
log_level = "debug"
...
```

And that would simply cause CRI-O to not start.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-04-23 14:51:35 +02:00
Hyounggyu Choi
8fbed9f6a4 local-build: Use confidential kernel and initrd for boot-image-se
This is to make `boot-image-se-tarball` use confidential kernel and
initrd instead of vanilla version of artifacts.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-04-19 07:09:04 +02:00
Hyounggyu Choi
d523e865c0 rootfs: Make OPA build working in docker for s390x and ppc64le
The commit is to make the OPA build from source working in `ubuntu-rootfs-osbuilder`.
To achieve the goal, the configuration is changed as follows:

- Switch the make target to `ci-build-linux-static` not triggering docker-in-docker build
- Install go in the builder image for s390x and ppc64le

Fixes: #9466

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-04-16 16:49:12 +02:00
Hyounggyu Choi
a792dc3e2b kernel: Adjust s390x config for confidential containers
`CONFIG_TN3270_TTY` and `CONFIG_S390_AP_IOMMU` are dropped for s390x
in 6.7.x which is used for a confidential kernel.
But they are still used for a vanilla kernel. So we need to add them
to the whitelist.

Fixes: #9465

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-04-15 10:28:59 +02:00
stevenhorsman
29a5652e31 packaging: guest-components, set new environment variables
- Set KBC_PROVIDER and ATTESTER rather than TEE_PLATFORM
to avoid tss build issues for vTPM attester(s)
- There are future plans to make a matching TEE_PLATFORM, so this can be simplified once that is available

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2024-04-08 11:38:53 +01:00
stevenhorsman
101a5bf273 packaging: Update guest-components Dockerfile
- Switch to Ubuntu 20.04 for building guest-components as
The rootfs is based on 20.04, so we need matching GLIBC versions.
See #8955
- Add dependencies needed by TDX verifier as we want to build for all platforms

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2024-04-08 11:38:53 +01:00
Fabiano Fidêncio
2ee03b5dc3
tdvf: Adapt the build command
This is done in order to match the example from:
https://github.com/intel/tdx-linux/wiki/Instruction-to-set-up-TDX-host-and-guest#build-tdvf-image

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-04-05 19:51:27 +02:00
Fabiano Fidêncio
fe5adae5d9
qemu-tdx: Update to v8.1.0 + TDX patches
Let's update the QEMU to the one that's officially maintained by Intel
till all the TDX patches make their way upstream.

We've had to also update python to explicitly use python3 and add
python3-venv as part of the dependencies.

Fixes: #8810

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-04-05 10:23:51 +02:00
GabyCT
12947b1ba6
Merge pull request #9344 from GabyCT/topic/kerneldoc
docs: Remove stale kernel information
2024-04-03 11:13:54 -06:00
Tobin Feldman-Fitzthum
04d021bd12 packaging: remove SERVICEOFFLOAD option
Since we're removing the unused service_offload parameter,
don't set it in any of the packaging scripts.

Signed-off-by: Tobin Feldman-Fitzthum <tobin@ibm.com>
2024-03-27 12:21:13 -05:00
Greg Kurz
e1068da1a0
Merge pull request #9326 from gkurz/draft-release
Only tag and publish the release when it is fully ready
2024-03-27 15:59:59 +01:00
Steve Horsman
45aba769c0
Merge pull request #9346 from cmaf/ci-remove-repo-docs
Remove additional links to tests directory
2024-03-27 11:13:32 +00:00
Greg Kurz
5009fabde4 release: Keep it draft until all artifacts have been published
The automated release workflow starts with the creation of the release in
GitHub. This is followed by the build and upload of the various artifacts,
which can be very long (like hours). During this period, the release appears
to be fully available in https://github.com/kata-containers/kata-containers/
even though it lacks all the artifacts. This might be confusing for users
or automation consuming the release.

Create the release as draft and clear the draft flag when all jobs are
done. This ensure that the release will only be tagged and made public
when it is fully usable.

If some job fails because of network timeout or any other transient
error, the correct action is to restart the failed jobs until they
eventually all succeed. This is by far the quicker path to complete
the release process.

If the workflow is *canceled* for some reason, the draft release is left
behind. A new run of the workflow will create a brand new draft release
with the same name (not an issue with GitHub). The draft release from
the previous run should be manually deleted. This step won't be automated
as it looks safer to leave the decision to a human.

[1] https://github.com/kata-containers/kata-containers/releases

Fixes #9064 - part VI

Signed-off-by: Greg Kurz <groug@kaod.org>
2024-03-26 14:48:05 +01:00
Chelsea Mafrica
4e3deb5a3b tools: Fix path for installing yq in packaging script
The lib.sh script uses the right directory but the wrong path for the
script that installs yq; fix it.

Fixes #9165

Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
2024-03-25 15:09:52 -07:00
Chelsea Mafrica
d69514766e src: Remove references to files in tests repo
Change scripts and source that uses files in the tests repo to use the
corresponding file in the current repo.

Fixes #9165

Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
2024-03-25 15:09:52 -07:00
Gabriela Cervantes
ddef2be4f1 docs: Remove stale kernel information
This PR removes stale kernel information from the README document.

Fixes #9343

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-03-25 15:57:00 +00:00
Greg Kurz
dce6ea57b2 release: Simplify the create-new-release action of release.sh
Now that the version is an invariant for the entire workflow, it
isn't required to obtain it with an environment variable. Just
rely on the content of the `VERSION` file like other actions.

Fixes #9064 - part VI

Signed-off-by: Greg Kurz <groug@kaod.org>
2024-03-25 15:50:35 +01:00
Alex Lyn
079d894496 kernel: bump version in kata config version
Fixes: #9140

Signed-off-by: Alex Lyn <alex.lyn@antgroup.com>
2024-03-25 20:25:27 +08:00
Alex Lyn
bc309b9865 kernel: add CONFIG_CRYPTO_ECDSA into whitelist
CONFIG_CRYPTO_ECDSA is not supported in older kernels such as 5.10.x
which may cause building broken problem if we build such kernel with
NVIDIA GPU in version 5.10.x

So this patch is to add CONFIG_CRYPTO_ECDSA into whitelist.conf to
avoid break building guest kernel with NVIDIA GPU.

Fixes: #9140

Signed-off-by: Alex Lyn <alex.lyn@antgroup.com>
2024-03-25 08:05:31 +08:00
Fabiano Fidêncio
0278fc8a91
Revert "release: Skip --generate-notes for this release"
This reverts commit 0fa59ff94b, as now
we'll be able to use the `--generate-notes`, hopefully, without blowing
the allowed limit.

Fixes: #9064 - part VI

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-03-20 15:48:22 +01:00
Fabiano Fidêncio
0fa59ff94b
release: Skip --generate-notes for this release
This release is a special case, as we've slacked for 6 months and the
release content is way too long ... long enough to exceed the allowed
limit for the release notes.

With this in mind we'll just remove the `--generate-notes` for now, and
then revert this commit as soon as the release is out, as releases
should be happening every month and, ideally, we won't reach this
situation never ever again.

Fixes: #9064 - part V

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-03-20 10:32:11 +01:00
Fabiano Fidêncio
291b14bfb5
kata-deploy: Add the ability to set {https,no}_proxy if needed
Let's make sure those two proxy settings are respected, as those will be
widely used when pulling the image inside the guest on the Confidential
Containers case.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-03-19 18:06:00 +01:00
ChengyuZhu6
6e5e4e55d0
rootfs: add ca file to guest rootfs
To access the URL, the component to pull image in the guest needs to send a request to the remote.
Therefore, we need to add CA to the rootfs.

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
2024-03-19 18:06:00 +01:00
ChengyuZhu6
8724d7deeb
packaging: Enable to build agent with PULL_TYPE feature
Enable to build kata-agent with PULL_TYPE feature.

We build kata-agent with guest-pull feature by default, with PULL_TYPE set to default.
This doesn't affect how kata shares images by virtio-fs. The snapshotter controls the image pulling in the guest.
Only the nydus snapshotter with proxy mode can activate this feature.

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
2024-03-19 18:06:00 +01:00
ChengyuZhu6
cd6a84cfc5
kata-deploy: Setting up snapshotters per runtime handler
Setting up snapshotters per runtime handler as the commit
(6cc6ca5a7f) described.

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
2024-03-19 18:05:59 +01:00
ChengyuZhu6
c269b9e8c6
agent: Add guest-pull feature for kata-agent
Add "guest-pull" feature option to determine that the related dependencies
would be compiled if the feature is enabled.

By default, agent would be built with default-pull feature, which would
support all pull types, including sharing images by virtio-fs and
pulling images in the guest.

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
2024-03-19 18:05:59 +01:00
Greg Kurz
3cfc1b6ba7 releases: Adjust documentation to the new workflow
This drops the documentation of the legacy release scripts and adds
a quick description of the scripts of the new workflow. It also
highlights the bump of the `VERSION` file.

Signed-off-by: Greg Kurz <groug@kaod.org>
2024-03-18 12:57:02 +01:00
Greg Kurz
76c640767e releases: Drop Makefile
It isn't used anymore.

Signed-off-by: Greg Kurz <groug@kaod.org>
2024-03-18 12:54:00 +01:00
Greg Kurz
bfe19e68e8 kata-deploy: Adapt test-kata.sh to the new release workflow
All releases are now created in the `main` branch following
the very same workflow. No need to special case pre-releases.

Signed-off-by: Greg Kurz <groug@kaod.org>
2024-03-18 12:54:00 +01:00
Fabiano Fidêncio
12578f11bc
releases: Assume VERSION has the correct version to be released
This is done in order to avoid having to push a commit to the main
branch, which is against the defined rules on GitHub.

By doing this, we need to educate ourselves to always bump the VERSION
file as soon as a release is cut out.

As a side effect of this change, we can drop the release-major and
release-minor workflows, as those are not needed anymore.

Fixes: #9064 - part IV

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-03-16 13:30:58 +01:00
Fabiano Fidêncio
eab78cf1ba release: Reword the extra notes added as part of the release
We're trying to keep just the bare minimum info, as we really would like
to not have the list of commits, and mainly the list of new
contributors, trucated from the release notes.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-03-07 12:02:51 +00:00
Fabiano Fidêncio
658fb6972b release: Ensure the release-type is passed to workflows
We need to ensure the release type is passed down to workflows,
otherwise we'll fail to get the correct release version for tagging the
daemonset images.

Fixes: #9064 - part III

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-03-07 12:02:51 +00:00
GabyCT
640ed591bd
Merge pull request #9219 from GabyCT/topic/fixkerneldoc
docs: Remove stale kernel information at README documentation
2024-03-06 10:24:31 -06:00
Ryan Savino
fdfc825bc4
Merge pull request #9174 from ryansavino/snp-qemu-stable-coco-tag
versions: SNP qemu updated to stable coco tagged version
2024-03-06 01:03:10 -06:00
Gabriela Cervantes
12be4cf828 docs: Remove stale kernel information at README documentation
This PR removes stale kernel information at README documentation.

Fixes #9218

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-03-05 16:46:45 +00:00
Jimmy-Xu
5ada7329b8 gpu: fix build guest kernel with nvidia gpu
- enable CONFIG_MTRR,CONFIG_X86_PAT on x86_64 for nvidia gpu
- optimize -f of build-kernel.sh, clean old kernel path and config before setup
- add kernel 5.16.x

Fixes: #9143

Signed-off-by: Jimmy-Xu <xjimmyshcn@gmail.com>
2024-03-04 09:40:42 +08:00
Greg Kurz
58bc026656
Merge pull request #9180 from fidencio/topic/actually-add-the-pause-image-into-the-rootfs
rootfs: Fix PAUSE_IMAGE_TARBALL addition to the rootfs
2024-02-29 13:56:32 +01:00
Fabiano Fidêncio
0022474164
rootfs: Fix PAUSE_IMAGE_TARBALL addition to the rootfs
We were never passing the arguments to add the PAUSE_IMAGE to the
rootfs, leading to it never being present in the confidential image /
initrd.

Fixes: #9032 -- part II

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-28 22:42:27 +01:00
Ryan Savino
9e9dae8efb versions: SNP qemu updated to stable coco tagged version
New qemu fork of AMDESE created in confidential-containers project.
SNP qemu version now pointed to stable tag at:
https://github.com/confidential-containers/qemu/tree/amd-snp-202402240000

Fixes: #9173

Signed-Off-By: Ryan Savino <ryan.savino@amd.com>
2024-02-28 09:28:14 -06:00
Fabiano Fidêncio
520cd90c43
release: Remove the "test-" from the release version
This is not needed anymore as we can run the tests from any branch, and
we can patch this locally before doing a test.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-28 12:34:56 +01:00
Fabiano Fidêncio
3db0630bc1
release: Add our own bits to the release notes
I'm getting here the most relevant parts of what we had as part of the
release-notes.sh script.  As the script will not be used anymore, it's
been removed.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-28 12:34:56 +01:00
Fabiano Fidêncio
aaf38aca98
release: Fix typo in the _upload_libseccomp_tarball()
RELEASE_VERSIOB -> RELEASE_VERSION

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-28 12:34:56 +01:00
Fabiano Fidêncio
397167836b
release: Fix yq installation
For some reason we need to force its installation in the GOPATH,
otherwise yq is not found.

Ideally we should switch to a packaged version of yq, but that's a topic
for another series.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-28 12:34:55 +01:00
Fabiano Fidêncio
6915131adc
release: Fix KATA_DEPLOY_{IMAGE_TAGS,REGISTRIES} declaration
Otherwise we may end up with an unbound variable.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-28 12:34:55 +01:00
Fabiano Fidêncio
d339366a16
release: Get the release version from our internal function
This is utterly counter intuitive, but if we change a file during the
GitHub Action, the checkout done for the next workflow won't have that
file updated, but rather the branch on its original state when the
workflow was created.

This makes us safe to always "calculate" the next release version from
the VERSION file at the time the workflow was triggered.

This requires us to have the release type exported for the whole
workflow.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-28 12:30:06 +01:00
Fabiano Fidêncio
d10b818de5
release: Add missing return to _check_required_env_var()
Otherwise none of the calls to this function will actually continue
after it's called.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-28 12:30:06 +01:00
Fabiano Fidêncio
0aa82e7050
release: Add missing env vars to _check_required_env_var()
We missed doing this as part of
50011e89a0, but we also need to check for:
* RELEASE_VERSION
* GH_TOKEN
* ARCHITECTURE
* KATA_STATIC_TARBALL

While here, let's fix a ARCHITECURE -> ARCHITECTURE typo.

Fixes: #9064 -- part II

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-28 12:30:05 +01:00
Fabiano Fidêncio
111bb3ec66
release: Add "test-" into the release name
This commit should be merged as it's now, then we trigger a test
release, fix whatever has to be fixed, and drop it as soon as we know
our workflows are working as expected.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-27 08:34:03 +01:00
Fabiano Fidêncio
a85481110a
releases: Remove scripts that won't be used anymore
Those are not needed anymore as we're automating our release process
around GitHub actions.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-27 08:34:03 +01:00
Fabiano Fidêncio
3229c777e7
kata-deploy: Remove "stable" yamls
As we're not maintaining a stable branch anymore, let's get rid of the
kata-deploy stable pieces.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-27 08:34:02 +01:00
Fabiano Fidêncio
f0675a163a
release: Add _next_release_version()
This function returns the version of the next release (the one about to
be cut), and it'll be used as part of our new workflow that will take
care of the release.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-27 08:34:02 +01:00
Fabiano Fidêncio
4675364d8d
release: Add _update_version_file() function
Let's add a function that will be responsible for bumping the project's
version in the VERSION file, and push it to the branch as part of the
release process that will be introduced.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-27 08:34:02 +01:00
Fabiano Fidêncio
a99f9026e1
release: Add _create_new_release()
This is a helper function that will be used to create a new release as
part of our release process workflow (which will still be modified).

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-27 08:34:02 +01:00
Fabiano Fidêncio
fd699625fe
release: Add _upload_libseccomp_tarball()
As the name of the function says, it's responsible for uploading the
libseccomp source tarballs as par of our release process.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-27 08:34:02 +01:00
Fabiano Fidêncio
d517fa54ac
release: Add _upload_vendored_code_tarball()
As hinted by the name of the function, this is used to generate and
upload the vendored code we have as its own tarball.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-27 08:34:02 +01:00
Fabiano Fidêncio
94b30fcb14
release: Add _upload_versions_yaml_file()
As the name says, this function will be used to upload the versions.yaml
file during a given release process of the project.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-27 08:34:02 +01:00
Fabiano Fidêncio
50011e89a0
release: Add _upload_kata_static_tarball
This function, as it names says, will be used to upload the
kata-static.tar.xz tarballs generated during the release process.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-27 08:34:02 +01:00
Fabiano Fidêncio
a45988766c
release: Add _publish_multiarch_manifest()
This function, as it names says, will be used to publish multiarch
manifests for the Kata Containers CI and Kata Containers releases.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-27 08:34:01 +01:00
Fabiano Fidêncio
fb2ef32c04
release: Introduce the release.sh helper
For now this script does nothing, but we're introducing it in order to
redduce the diffs for the next commits in this series.

My intention is to have as much as possible related to the release as
part of this helper script, and it'll be populated function by function
while replacing content that's "hard coded" (and duplicated) on
different GitHub actions.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-27 08:34:01 +01:00
James O. D. Hunt
8c72abe38d packaging: Add link to survey in release notes
Add a link in the release notes to the Kata Container survey, to
advertise it, and hopefully encourage users to take the survey.

Fixes: #9074.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2024-02-23 09:57:52 +00:00
James O. D. Hunt
0391c0de82 packaging: Add twistie to release notes shortlog
Add a "twistie" / arrow (`▶`) that the user can click on to see the full
list of commits _if they want to_.

This way, the release notes become easier to read and we can display
information below the shortlog which would (probably) normally not be
seen due to the huge long list of commits.

Fixes: #9075.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2024-02-23 09:57:52 +00:00
Steve Horsman
e342a9adc4
Merge pull request #9119 from ChengyuZhu6/pause-confidential
kata-deploy: Add pause image to confidential rootfs
2024-02-22 17:10:55 +00:00
ChengyuZhu6
f16f709a5e kata-deploy: Add pause image to confidential rootfs
For confidential containers, the pause image needs to be installed in
the rootfs.

Fixes: #9118

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
2024-02-22 15:41:16 +08:00
ChengyuZhu6
cddaf2ce97 kata-deploy: Remove specific kernel/initrd/image leftovers in Makefile
Remove specific kernel/initrd/image leftovers in Makefile of
local-build, which is the part of #9026.

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
2024-02-21 18:24:10 +08:00
Ryan Savino
61ce7455c5
Merge pull request #9086 from niteeshkd/nd_snp_upm
packaging: qemu-snp-experimental: support host kernel with gmem
2024-02-19 10:50:13 -06:00
Niteesh Dubey
0538bbfc49 packaging: qemu-snp-experimental: support host kernel with gmem
This is required to allow creation of SNP coco on host kernel
(e.g. https://github.com/AMDESE/linux ,branch:snp-host-latest)
supporting guest private memory for SNP using gmem.

Note: This qemu does not work if the host kernel does not support
gmem/UPM.

Fixes: #9092

Signed-off-by: Niteesh Dubey <niteesh@us.ibm.com>
2024-02-15 16:33:46 +00:00
Wainer Moschetta
db744aa8d2
Merge pull request #9023 from ldoktor/webhook-path
tools.kata-webhook: Fix lib path
2024-02-15 12:34:01 -03:00
James O. D. Hunt
8c51e02f55 packaging: Add the kata manager script
Add `kata-manager.sh` to the release packages.

Fixes: #9066.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2024-02-14 17:44:42 +00:00
James O. D. Hunt
e49aeec97f packaging: Use variable for default binary permissions
Create a variable for the default binary permissions.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2024-02-14 17:44:35 +00:00
James O. D. Hunt
cc2d96671f packaging: Remove extraneous whitespace
Remove some unnecessary whitespace from a couple of `kata-deploy` files.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>

whitespace

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2024-02-14 17:44:08 +00:00
Fabiano Fidêncio
6c3338271b
packaging: kernel: Remove sev/snp/tdx specific stuff
Now we're using a "confidential" image that has support for all of
those.

Fixes: #9010 -- part II
       #8982 -- part II
       #8978 -- part II

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-13 19:07:33 +01:00
Fabiano Fidêncio
14f4480f12
packaging: Remove specific TEEs image / initrd leftovers
Let's remove the targets as those are not built anymore as part of our
CI.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-13 18:03:12 +01:00
Fabiano Fidêncio
0c761f14b3
packaging: Remove specific TEEs kernel leftovers
Let's remove the targets as those are not built anymore as part of our
CI.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-13 18:03:11 +01:00
Dan Mihai
42d13a0f33
Merge pull request #9068 from microsoft/danmihai1/dockerfile-linux-musl-gcc
tools: avoid rootfs-image build "ln -s" error
2024-02-11 18:02:53 -08:00
Dan Mihai
fcd005774d tools: avoid rootfs-image build "ln -s" error
Avoid error when building for amd64 using:

USE_CACHE=no AGENT_POLICY=yes DEBUG=1 \
tools/packaging/kata-deploy/local-build/kata-deploy-binaries.sh \
--build=rootfs-image

Fixes: #9067

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-02-09 17:10:35 +00:00
GabyCT
b8f277676f
Merge pull request #9047 from GabyCT/topic/ukd
docs: Remove jenkins reference in kernel documentation
2024-02-09 10:58:06 -06:00
ChengyuZhu6
a43edd0c30 rootfs: Install pause image into rootfs
Install the pause image into the confidential rootfs
image and initrd.

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
2024-02-08 16:49:56 +08:00
ChengyuZhu6
42ef6bdcae osbuilder:rootfs: support to unpack pause image to rootfs
This env ver will serve us to pass the pause image tarball to the rootfs builder, which will then just
unpack the content into the rootfs.

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
Co-authored-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
Co-authored-by: Wang, Arron <arron.wang@intel.com>
Co-authored-by: stevenhorsman <steven@uk.ibm.com>
Co-authored-by: Jakob Naucke <jakob.naucke@ibm.com>
2024-02-08 16:29:36 +08:00
ChengyuZhu6
70a84eca9e packaging: allow to pull and unpack pause image
For Confidential containers stack, the pause image is managed by host side,
then it may configure a malicious pause image, we need package
a pause image inside the rootfs and don't the pause image from host.

But the installation of skopeo is not included in 20.04 release, so we
can not directly install skopeo in rootfs and pull pause image.

So I plan to let the task as a static build stuff, which would not be influenced
by the system version in rootfs. And the pause image will be part of the Kata Containers rootfs
that's used by the Confidential Containers usecase. This commit enables the component to be built
both locally and in our CI environment with the command: make pause-image-tarball.

Fixes: #9032

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
Co-authored-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
Co-authored-by: Wang, Arron <arron.wang@intel.com>
Co-authored-by: stevenhorsman <steven@uk.ibm.com>
Co-authored-by: Jakob Naucke <jakob.naucke@ibm.com>
2024-02-08 11:23:23 +08:00
Gabriela Cervantes
ff1ace1c74 docs: Remove jenkins reference in kernel documentation
This PR removes the jenkins reference which is not longer being used
in the kernel documentation.

Fixes #9046

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-02-07 15:44:07 +00:00
Fabiano Fidêncio
ce82b5e3f5
rootfs: Add libtdx-attest into the confidential rootfs
This is required as the tdx-attest-rs crate, which is used as part of
the guest components, has a runtime dependency on libattest-tdx.

Fixes: #9021 -- part II

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-06 09:13:49 +01:00
Fabiano Fidêncio
27e7974048
rootfs: confidential: Install coco-guest-components
Let's install the coco-guest-components into the confidential rootfs
image and initrd.

Fixes: #9021

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-05 14:41:29 +01:00
Fabiano Fidêncio
f80dbcee0e
rootfs: Add logging about the coco guest components
This will make our lives easier to figure out whether the components are
being installed or not.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-05 14:41:29 +01:00
Fabiano Fidêncio
68b8186ec4
osbuilder: Expose COCOGUEST_COMPONENTS_TARBALL
We need to pass this to the container where the rootfs is built, so it
can actually be unpacked inside the rootfs.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-05 14:41:28 +01:00
Lukáš Doktor
3b0049b2a4
tools.kata-webhook: Fix lib path
When moving the webhook we skipped the common.bash as (close-enough)
version is already in `/tests` but we forgot to update the source path,
fixing it here.

Fixes: #8653

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
2024-02-05 14:17:24 +01:00
Fabiano Fidêncio
64d09874c3
packaging: coco-guest-components: Pass DESTDIR to the build script
As DESTDIR was not being passed, we've been installing the final
binaries in a container path that was not exposed to the host, leading
to creating an empty tarball with the guest components.

Now, theoretically, guest-components should respect a PREFIX passed, but
that's not the case and we're manually adding "/usr/local/bin" to the
passed DESTDIR.

Here's the result of the tarball:
```bash
⋊> kata-containers ≡ tar tf build/kata-static-coco-guest-components.tar.xz
./
./usr/
./usr/local/
./usr/local/bin/
./usr/local/bin/confidential-data-hub
./usr/local/bin/attestation-agent
./usr/local/bin/api-server-rest
```

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-05 14:07:10 +01:00
Fabiano Fidêncio
a9f8888c15
packaging: Add confidential image / initrd
Let's use a single rootfs image / initrd for confidential workloads,
instead of having those split for different TEEs.

We can easily do this now as the soon-to-be-added guest-components can
be built in a generic way.

Fixes: #8982

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-03 00:58:52 +01:00
Fabiano Fidêncio
e9de0ef6b3
packaging: rootfs: Depend on kernel-confidential tarball
Now that we're using the kernel-confidential, let the rootfs depending
on it, instead of depending on the TEE specific ones.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-02 21:13:41 +01:00
Fabiano Fidêncio
b58cfc765c
packaging: Ensure rootfs is rebuilt in case kernel changes
We need to do this in order to ensure that the measure boot will be
taking the latest kernel bits, as needed.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-02 21:13:06 +01:00
Fabiano Fidêncio
4394dacb88
packaging: Build the confidential kernel with MEASURED_ROOTFS support
This is already done for the TDX kernel, and should have been done also
for the confidential one.

This action requires us to bump the kernel version as the resulting
kernel will be different from the cached one.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-02 21:13:06 +01:00
Fabiano Fidêncio
c7680839f9
packaging: Fix modules tarball for nvidia-gpu-confidential
The modules dir has an extra "-nvidia-gpu-confidential" string in its
name.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-02 21:13:06 +01:00
Fabiano Fidêncio
741ed1c8bd
Merge pull request #9001 from fidencio/topic/fix-cache-for-confidential-kernel-part-III
packaging: Don't build the confidential / sev kernel twice -- part III
2024-02-02 15:19:41 +01:00
Wainer Moschetta
424fbfe58f
Merge pull request #8654 from ldoktor/openshift-tests
ci/openshift-ci: Move openshift-ci from the tests repo here
2024-02-02 10:40:30 -03:00
Fabiano Fidêncio
2ff3f0afc6
packaging: Remove trailing whitespace from extra_tarballs arg
This was overlooked during the reviews.

Fixes: #6415 -- part III

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-02 12:42:02 +01:00
Fabiano Fidêncio
228bc48c73
packaging: Fix kernel confidential name
It should be "kernel-confidential" instead of "kernel".

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-02 12:42:02 +01:00
Fabiano Fidêncio
31b21093b0
packaging: Pass the kernel flavour to get_kernel_modules_dir
I made this a required argument during the series and ended up
forgetting to add that while calling the function.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-02 12:42:02 +01:00
Fabiano Fidêncio
51b1df2333
packaging: Fix typo to get the extra_tarballs path
It should've been  "${m#*:}" instead of "${m#&:}".

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-02 12:41:54 +01:00
Fabiano Fidêncio
0b221b5618
packaging: Fix pushing artefacts to the registry
This issues was introduced due to a typo not caught during reviews on
e5bca90274.

Fixes: #6415 -- part II

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-02 10:13:11 +01:00
Fabiano Fidêncio
0520b272a3
Merge pull request #8987 from fidencio/topic/fix-cache-for-confidential-kernel
packaging: cache: Fix caching kernels which rely on extra modules
2024-02-02 09:10:52 +01:00
Fabiano Fidêncio
5d2906c36a
packaging: Bump the kata config kernel version
Just to make sure we won't use cached components.

Fixes: #6415

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-01 16:57:15 +01:00
Fabiano Fidêncio
d2ea11dbff
packaging: Use the cached kernel modules
Till now we didn't have a logic to consume the kernel modules cached
tarball.  Let's make sure those are consumed as it'll save us a
reasonable amount of build time.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-01 16:57:15 +01:00
Fabiano Fidêncio
e5bca90274
packaging: Cache the kernel modules
This will save us a lot of time, as right now the CI is rebuilding the
kernel for absolutely no reason.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-01 16:55:21 +01:00
Fabiano Fidêncio
f481f58659
packaging: Create the tarball for the kernel modules
Let's start doing this for the confidential kernels (and also for SEV,
till it gets removed).

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-01 16:55:20 +01:00
Fabiano Fidêncio
a58caca723
packaging: Take extra tarballs in install_cached_tarball_component()
This allows us to add a map, in the format of:
`"tarball1_name:tarball1_path tarball2_name:tarball2_path ..."`

With this we have a base to start doing a better job when caching extra
artefacts, like kernel modules.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-01 16:55:20 +01:00
Fabiano Fidêncio
33ac5468fe
packaging: Add function to get the kernel modules directory
Right now this is just being added but not used yet.  The idea is to use
this to both cache and later on untar the kernel modules needed for some
of the kernel targets we have (specifically looking at the confidential
one).

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-01 16:55:20 +01:00
Fabiano Fidêncio
39a64d1447
Merge pull request #8269 from wainersm/kata-deploy_deprecated
kata-deploy: fix deprecations on kustomization files
2024-01-31 20:02:01 +01:00
Hyounggyu Choi
2e1d770fcf packaging: Track files correctly when naming builder image for agent
The necessary files for the agent builder image can be found in
`tools/packaging/static-build/agent`,
`ci/install_libseccomp.sh` and
`tools/packaging/kata-deploy/local-build/kata-deploy-copy-libseccomp-installer.sh`.
Identifying the correct files addresses the previously misreferenced path
used to name the builder image.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-01-31 10:49:20 +01:00
Wainer dos Santos Moschetta
abc2fcd88f kata-deploy: fix deprecations on kustomization files
By running `kustomize edit fix` on those files they have changed
deprecated instructions ('bases' and 'patchesStrategicMerge') as well as
'apiVersion' and 'kind' were added.

Fixes #8268
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-01-30 18:41:03 -03:00
Lukáš Doktor
4c58478536
ci/openshift-ci: Move openshift-ci from the tests repo
Move the f15be37d9bef58a0128bcba006f8abb3ea13e8da version of scripts
required for openshift-ci from "kata-containers/tests/.ci/openshift-ci"
into "kata-containers/kata-containers/ci/openshift-ci" and required
webhook+libs into "kata-containers/kata-containers/tools/testing" as is
to simplify verification, the different location handling will be added
in following commit.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
2024-01-30 19:05:55 +01:00
Hyounggyu Choi
f3bc6e4155 packaging: Use Ubuntu 20.04 for building an agent
This involves using Ubuntu 20.04 as a build environment for an agent to match with a runtime environment.

Fixes: #8955

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-01-30 10:22:14 +01:00
Greg Kurz
d687b601f1
Merge pull request #8933 from fidencio/topic/package-coco-guest-components
packaging: Build coco-guest-components
2024-01-29 16:34:06 +01:00
Zvonko Kaiser
a9348fa35b
Merge pull request #8375 from zvonkok/opa-binary-fix
arm64: agent_policy build always pulls amd64 opa binary
2024-01-29 15:10:10 +01:00
Fabiano Fidêncio
98dc2d4c52
rootfs: agent: Initialise AGENT_SOURCE_BIN & AGENT_TARBALL
Otherwise those would be unbound if not passed.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-01-26 19:58:41 +01:00
Fabiano Fidêncio
5e57e0235e
rootfs: agent: Fix build with AGENT_SOURCE_BIN
We need to actually check that the env var is not empty. :-)
This was introduced by 8307718842.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-01-26 19:58:20 +01:00
Fabiano Fidêncio
fbfc880eb6
rootfs: Add COCO_GUEST_COMPONENTS_TARBALL env var
This env ver will serve us to pass the Confidential Containers
guest-components tarball to the rootfs builder, which will then just
unpack the content into the rootfs.

Fixes: #8848 -- part I

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
Signed-off-by: Linda Yu <linda.yu@intel.com>
Co-authored-by: stevenhorsman <steven@uk.ibm.com>
Co-authored-by: Jakob Naucke <jakob.naucke@ibm.com>
Co-authored-by: Wang, Arron <arron.wang@intel.com>
Co-authored-by: zhouliang121 <liang.a.zhou@linux.alibaba.com>
Co-authored-by: Alex Carter <alex.carter@ibm.com>
Co-authored-by: Suraj Deshmukh <suraj.deshmukh@microsoft.com>
Co-authored-by: Xynnn007 <xynnn@linux.alibaba.com>
2024-01-26 19:58:19 +01:00
Fabiano Fidêncio
644abde35c
packaging: coco-guest-components: Allow building the project
The Confidential Containers guest-components will, in the very short
future, be part of the Kata Containers rootfs that's used by the
Confidential Containers usecase.

This commit introduces the ability to, standalone, build the component
locally and as part of our CI, and this can be done by calling:
`make coco-guest-components-tarball`

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
Signed-off-by: Linda Yu <linda.yu@intel.com>
Co-authored-by: stevenhorsman <steven@uk.ibm.com>
Co-authored-by: Jakob Naucke <jakob.naucke@ibm.com>
Co-authored-by: Wang, Arron <arron.wang@intel.com>
Co-authored-by: zhouliang121 <liang.a.zhou@linux.alibaba.com>
Co-authored-by: Alex Carter <alex.carter@ibm.com>
Co-authored-by: Suraj Deshmukh <suraj.deshmukh@microsoft.com>
Co-authored-by: Xynnn007 <xynnn@linux.alibaba.com>
2024-01-26 19:36:01 +01:00
Fabiano Fidêncio
a7c68225aa
Merge pull request #8916 from fidencio/topic/packaging-reuse-already-built-agent
packaging:  Don't always build the kata-agent
2024-01-26 12:00:55 +01:00
Fabiano Fidêncio
95c569b0a6
packaging: Add safe.directory to the git config
Otherwise building as root will not work, as demonstrated by the arm64
CI.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-01-26 09:44:43 +01:00
GabyCT
c13a63c8ba
Merge pull request #8905 from zvonkok/enable-tpm
qemu: enable TPM
2024-01-25 14:52:00 -06:00
GabyCT
aa958adf90
Merge pull request #8904 from GabyCT/topic/buildbq
tools: Use defined variable in build base qemu script
2024-01-25 13:51:44 -06:00
Fabiano Fidêncio
dd49479829
packaging: Don't build the agent if not needed
Let's start relying on the already cached agent to be deployed inside
the rootfs.  By doing this we save a lot of time in our CI, and we have
a better way, for developers, to play with changes in the agent.

Fixes: #8915

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-01-25 19:41:33 +01:00
Fabiano Fidêncio
21fd7e6dfd
packaging: Fail in case oras can't find an artefact
It just means the component is not cached, and that it must be built in
the usual way.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-01-25 19:41:32 +01:00
Fabiano Fidêncio
eb7a33ee71
rootfs: Always strip the agent binary
Let's always do this, regardless of where the agent is coming from.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-01-25 19:41:32 +01:00
Fabiano Fidêncio
f23451de01
rootfs: Add xz as a dep
As we'll be untarring the agent tarball (and any other component that
may be part of the rootfs) into the rootfs, we have to have xz
installed.

For debian and ubuntu the package is called xz-utils; for centos,
alpine and cbl-mariner the package is called xz.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-01-25 19:41:32 +01:00
Fabiano Fidêncio
8307718842
rootfs: Add AGENT_TARBALL env var
This env var will serve us to pass the agent tarball to the rootfs
builder, which will then just unpack the content into the rootfs instead
of building the agent again.

AGENT_TARBALL and AGENT_SOURCE_BIN should never be used together.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-01-25 19:41:32 +01:00
Fabiano Fidêncio
5b0d0687e5
packaging: agent: Allow building in all arches
We're moving away from alpine and using ubuntu in order to be able to
build the agent for all the architectures we need.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-01-25 19:41:32 +01:00
Fabiano Fidêncio
1039641ab8
packaging: agent: Add the arch to the builder container
This has been missed during reviews and is already a problem as we're
trying to build the agent outside of the rootfs for other architectures
than x86_64.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-01-25 14:11:14 +01:00
Fabiano Fidêncio
58874f9c3e
packaging: tools: Add the arch to the builder container
This has been missed during reviews and will become a problem when the
tools start to be built in different architectures.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-01-25 14:10:22 +01:00
Dan Mihai
723c76d945 tools: allow all users to execute genpolicy
This tool can be useful for any users.

Fixes: #8907

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-01-25 00:40:53 +00:00
Zvonko Kaiser
19ecdbca3b qemu: enable TPM
Several use-cases need a vTPM lets enable it for QEMU, a follow up patch will introduce the runtime config.

Fixes: #8902

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-01-24 17:49:08 +00:00
Gabriela Cervantes
98b5a19b3a tools: Use defined variable in build base qemu script
This PR uses a variable that is already defined in the build base
qemu script to have uniformity across the script as this variable
is already used in the script.

Fixes #8903

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-01-24 17:05:17 +00:00
Zvonko Kaiser
ab597a4d5b opa: Improve the download logic
The versions.yaml has a default for the amd64 binary, but there is no
code to actually build the arm64 binary, which seems an overlook.

Let's simplify the OPA logic by removing the direct link to the binary,
and construct that link as part of the checks we do to decide whether we
need to build OPA or not.

Fixes: #8373

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-01-23 09:16:16 +00:00
Zvonko Kaiser
4fc34323ae gpu: Add NVIDIA GPU Confidential kernel target
This is a follow up to the work of minimizing targets, unifying TDX,SNP builds for NVIDIA GPUs

Fixes: #8828

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-01-22 14:58:57 +00:00
Dan Mihai
febabef08c tools: install genpolicy settings files
Install the default genpolicy OPA rules and settings JSON files, in
addition to the genpolicy binary.

Fixes: #8844

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-01-16 23:59:59 +00:00
Dan Mihai
201eec628a tools: genpolicy static checks
Package genpolicy and enable static checks for it.

Fixes: #8813

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-01-15 16:49:58 +00:00
Fabiano Fidêncio
c3f6eaa267
build-kernel: Fix typo 'terball' -> 'tarball'
SSIA. :-)

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-01-09 14:35:45 -03:00
Fabiano Fidêncio
8b2f43a2c2
build: Add "confidential" kernel
We're using a Kernel based on v6.7, which should include all te
patches needed for SEV / SNP / TDX.

By doing this, later on, we'll be able to stop building the specific
kernel for each one of the targets we have for the TEEs.

Let's note that we've introduced the "confidential" target for the
kernel builder script, while the TEE specific builds are being kept as
they're -- at least for now.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-01-09 14:35:45 -03:00
Jianyong Wu
379e2f3da2
kernel: update some configs based on kernel 6.5 and 6.6
There are lots of configs removed from latest kernel. Update them here
for convenience of next kernel upgrade.

Remove CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE [1]
Remove CONFIG_IP_NF_TARGET_CLUSTERIP [2]
Remove CONFIG_NET_SCH_CBQ [3]
Remove CONFIG_AUTOFS4_FS [4]
Remove CONFIG_EMBEDDED [5]

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v6.6&id=a7e4676e8e2cb158a4d24123de778087955e1b36
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v6.6&id=9db5d918e2c07fa09fab18bc7addf3408da0c76f
[3] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v6.6&id=051d442098421c28c7951625652f61b1e15c4bd5
[4] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v6.6&id=1f2190d6b7112d22d3f8dfeca16a2f6a2f51444e
[5] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v6.6&id=ef815d2cba782e96b9aad9483523d474ed41c62a

Fixes: #8408
Signed-off-by: Jianyong Wu <jianyong.wu@arm.com>
2024-01-09 14:35:45 -03:00
Fabiano Fidêncio
cf4835e3ae
packaging: qemu: Simplify "--disable-virtiofsd" logic
As all the supported architectures are disabling the virtiofsd build,
there's no need to keep the switch statement there.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-01-09 14:35:45 -03:00
Fabiano Fidêncio
bfc6fc7a85
build: Get rid of QEMU experimental
We've not been building QEMU experimental for a very long time, and the
entry there has only been serving the purpose to clutter the
versions.yaml (in the best case scenario) or even confuse new
contributors to the project.

Mind that the machinery to build the QEMU experimental is not touched,
and that's used to build the TEEs capabale artefacts.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-01-09 14:35:45 -03:00
Gabriela Cervantes
7d41c97f60 packaging: Fix indentation of build static stratovirt
This PR fixes the indentation of the build static stratovirt script
for kata containers.

Fixes #8777

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-01-05 18:06:08 +00:00
Zhigang Wang
44b5b88f4c docs: Update docs for new StratoVirt VMM introduction
As the StratoVirt VMM has been added, we can update the docs
and make some intoduction to StratoVirt, thus users can know more
about the hypervisor choices.

Fixes: #8645

Signed-off-by: Zhigang Wang <wangzhigang17@huawei.com>
Signed-off-by: Liu Wenyuan <liuwenyuan9@huawei.com>
2024-01-04 14:26:48 +08:00
Chao Wu
f9e0a4bd7e upcall: introduce pci device add & del kernel patch
add pci add and del guest kernel patch as the extension
in the upcall device manager server side.

also, dump config version to 120 since we need to add config
for dragonball pci in upcall

fixes: #8741

Signed-off-by: Gerry Liu <gerry@linux.alibaba.com>
Signed-off-by: Helin Guo <helinguo@linux.alibaba.com>
Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
2023-12-28 16:21:30 +08:00
Fabiano Fidêncio
6ee7fb5402
kata-deploy: Double quote the snapshotter name
Otherwise `jq` will complain about:
```sh
jq: error: nydus/0 is not defined at <top-level>, line 1:
.plugins."io.containerd.grpc.v1.cri".containerd.runtimes."kata-clh".snapshotter=nydus
jq: 1 compile error
```

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-12-26 09:14:36 -03:00
Fabiano Fidêncio
8332f3c684
kata-deploy: Fix the snapshotter config placement
In the way the script is without this patch, we're trying to set
```toml
[`$shim`]
snapshotter = $snapshotter
```

However, what we actually want to set is the full runtime table instead
of shim.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-12-26 08:26:38 -03:00
Fabiano Fidêncio
907f1ddb9e
kata-deploy: Fix shim check for snapshotter configuration
We want to check whether the shim is part of the "plain text" shims
passed to the daemonset (meaning, checking against `$SHIMS`).  Before
this fix we were checking against `$shims`, which is an array of shims
instead of a string, resulting on a broken check.

Fixes: #8732

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-12-26 07:42:36 -03:00
Bin Liu
23eb3042c7 kata-monitor: fix Dockerfile to build image
move `SKIP_GO_VERSION_CHECK` after `make` command to skip
checking golang version.

And also upgrade golang to 1.19.

Fixes: #8728

Signed-off-by: Bin Liu <bin@hyper.sh>
2023-12-26 15:11:13 +08: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
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
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
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
Fabiano Fidêncio
7ad873cf29
kata-deploy: Simplify shim configuration
We never have to add a configuration for the "default" case, as we're
already creating the runtime class pointing to what should be the
"default" handler.

This helps to simplify the logic by quite a lot.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-12-13 10:52:54 +01:00
Fabiano Fidêncio
e618949937
kata-deploy: Remove useless comment from CRI-O drop-in
The comment adds absolutely nothing to the runtime handler added, and
it'd make our life slightly harder to properly say which VMM is being
used when setting the default `kata` handler.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-12-13 10:49:52 +01:00
Fabiano Fidêncio
dd9f5b07b9
kata-deploy: Use tomlq to configure containerd
This save us a lot of trouble on properly sed'ing content that may or
may not be in the containerd configuration file.

Fixes: #8638

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-12-13 10:49:49 +01:00
Fabiano Fidêncio
4f01f294bb
kata-deploy: Install tomlq to the base image
This will help us to have an easier time playing with the containerd
configuration, instead of having to sed the **** out of it, which is
super error prone.

`tomlq` is a tool that comes from https://github.com/kislyuk/yq, and
that depends on `jq` to do the toml parsing / editing.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-12-13 10:49:07 +01:00
Fabiano Fidêncio
39f5cea3b1
kata-deploy: Fix k0s cri notation comment
We can safely assume we're using the *newer* notation, not the *older*
one.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-12-12 18:20:18 +01:00
Hyounggyu Choi
375c787e09 rootfs: build OPA binary from source for ppc64le and s390x
This PR is to build a binary for OPA from source code for ppc64le and s390x.

Fixes: #7616

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2023-12-11 12:59:48 +01:00
Hyounggyu Choi
28c3e0e5f0 GHA: Fix kata-deploy-runtime-classes-check for kata-qemu-se
This is to fix an error on kata-deploy-runtime-classes-check for kata-qemu-se.

Fixes: #8623

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2023-12-11 10:30:00 +01:00
Chelsea Mafrica
1c42d94550
Merge pull request #6826 from gabevenberg/log-parser-rs
kata-ctl: Moved log-parser-rs into kata-ctl
2023-12-08 11:33:09 -08:00
Hyounggyu Choi
588f639a69
Merge pull request #6755 from BbolroC/add-se-artifacts-to-main
packaging: Add IBM Z SE artifacts to main
2023-12-08 05:17:38 +01:00
Gabe Venberg
69fdd05ce5 kata-ctl: Moved log-parser-rs into kata-ctl
Log-parser-rs was always intended to become a sub-functionality of
kata-ctl, but it was useful to develop it and initaly merge it as a
standalone program, and migrate it to a subcommand later.

Fixes #6797

Signed-off-by: Gabe Venberg <gabevenberg@gmail.com>
2023-12-07 21:35:28 -06:00
Hyounggyu Choi
3fab1690a4 local-build: make strip support for cross-compilation
This is to adjust a name of the binary `strip` to a target architecture for cross-compilation.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2023-12-07 20:05:40 +01:00
Hyounggyu Choi
31db56207b local-build: add support for key verification for IBM Secure Execution
This is to make `build_se_image.sh` incorporate the key verification originally supported by `genprotimg`.
It can be achieved by specifying two environment variables called `SIGNING_KEY_CERT_PATH` and `INTERMEDIATE_CA_CERT_PATH`.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2023-12-07 20:05:40 +01:00
Hyounggyu Choi
52bdc87fe9 local-build: make kernel parameters configurable
This is to make kernel parameters configurable during the secure image build by adding an environment variable SE_KERNEL_PARAMS.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2023-12-07 20:05:40 +01:00
Hyounggyu Choi
9ceb2c27e0 local-build: consider cross-compilation env
This is to make a base builder image build genprotimg without a package
manager under the cross-compilation environment.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2023-12-07 20:05:40 +01:00
Zvonko Kaiser
16380558e0 deployment: Create a stable overaly for kata-deploy
Fixes: #8508

Create a stable overlay for kata-deploy.yaml so we do not have to maintain two files, only one.
Single source for both. This is also preparation for the helm-overlay

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2023-12-06 14:23:22 +00:00
Fabiano Fidêncio
b056683b7a
Merge pull request #8436 from Lu-Biao/main
image-builder: bugfix incorrect partition location
2023-12-06 00:10:06 +01:00
Fabiano Fidêncio
d149b9f9ca
Merge pull request #7231 from wainersm/measured_rootfs-improvements
Build for measured rootfs improvements
2023-12-05 22:20:33 +01:00
Hyounggyu Choi
511dd5feac local-build: add support to build IBM Z SE image
This is to add an artifact for IBM Z SE(TEE) to main.

Fixes: #6754

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2023-12-04 21:08:51 +01:00
Hyounggyu Choi
4de8ef3d18 local-build: add build target boot-image-se
This is to add a build target boot-image-se for s390x.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2023-12-04 21:08:51 +01:00
Hyounggyu Choi
a63a6959d1 local-build: install s390-tools in Dockerfile
This is to install s390-tools including genprotimg during the docker
build.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2023-12-04 21:08:51 +01:00
Hyounggyu Choi
8de4241d3b kata-deploy: add kata-qemu-se runtimeclass
This is to increase resources for relaxing the limitation of hotplug for
SE.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2023-12-04 21:06:53 +01:00
Hyounggyu Choi
9ede2bcd95 local-build: differentiate build targets based on architecture
This is to rule out unnecessary build targets for s390x.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2023-12-04 21:06:53 +01:00
Fabiano Fidêncio
03c3f4275e kernel: Add CONFIG_TDX_GUEST_DRIVER to the tdx.conf
The driver enables the userspace interface to communicate with the TDX
module to request the TDX guest details, like the attestation report.

Fixes: #8555

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-12-04 10:25:59 +01:00
Biao Lu
b816dca3ed image-builder: fix incorrect part start position
The 'part_start' of image and dax_image should exactly specify the
same location, according to the parted documentation, to exactly
specify the location, the units of start and end should use MiB.

https://www.gnu.org/software/parted/manual/parted.html#IEC-binary-units

Fixes: #8435

Signed-off-by: Biao Lu <biao.lu@intel.com>
2023-12-04 17:20:26 +08:00
Fabiano Fidêncio
852021e416
Merge pull request #8483 from fidencio/topic/move-rust-config-files-to-subdir-based-on-jodh-approach
build/kata-deploy: Move rust runtime config files to runtime-rs directory -- based on #8445
2023-12-01 16:22:51 +01:00
soup
811ec07359 osbuilder: add pkg bash for alpine
The bash component is required in the guest for debug console to work properly.

Fixes: #8447

Signed-off-by: soup <lqh348659137@outlook.com>
2023-11-30 09:42:39 +08:00
James O. D. Hunt
158ca17ae7 kata-deploy: Add cloud-hypervisor
Now that we have a separate Cloud Hypervisor configuration file for the
rust runtime, add it to the kata-deploy.

See: https://github.com/kata-containers/kata-containers/pull/8250

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-11-28 18:02:06 +01:00
Fabiano Fidêncio
d4e00238ab kata-deploy: Improve the logic for linking to the rust runtime
This change for now doesn't do much, apart from making it easier to
expand which runtimes should be linked to the runtime-rs containerd shim
binary.

Also, this matches the logic used for the config files.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-11-28 18:01:27 +01:00
James O. D. Hunt
fc28deee0e kata-deploy: Use rust runtime config files in runtime-rs directory
Update `kata-deploy` to modify the rust runtime configuration files in
their new `runtime-rs/` directory.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2023-11-28 18:01:25 +01:00
Wainer dos Santos Moschetta
a13eecf7f3 runtime(-rs): add clean-generated-files target
The new clean-generated-files make target allows for removing the
generated files (including the configuration.toml files).

The tools/packaging/static-build/shim-v2/build.sh script now uses that
target to always force the re-generation of those files.

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2023-11-28 11:21:53 -03:00
Wainer dos Santos Moschetta
ba4f806c30 initramfs: re-wrote devices checking on init.sh
Re-wrote the logic of init.sh to follow the rules:

 * the root device MUST exist always because it will be either mounted
   or verified (then mounted)
 * if rootfs verifier is enabled then the hash device MUST exist. Avoid
   the case where dm-verity is set but the hash device does not exist and
   so the verification is silently skipped

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2023-11-28 11:21:53 -03:00
Wainer dos Santos Moschetta
72ef82368c shim-v2: ensure root hash exist when measured rootfs
When measured toofs is enabled then the shim-v2 build should find the
guest rootfs hash file, otherwise might (silently) generate configuration
files with empty hash.

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2023-11-28 11:21:53 -03:00
Wainer dos Santos Moschetta
1465e58854 kernel: ensure initramfs exist when measured rootfs
The KATA_BUILD_CC variable plus the existence (or not) of the initramfs
were used to determine whether to build the kernel for measured rootfs
or not. Currently the variable MEASURED_ROOTFS has been used
to trigger the feature build and when it is activated it should expect
the initramfs exist. In other words, this changed the kernel build
so that if `MEASURED_ROOTFS=yes` then the initramf file must exist and
be found.

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2023-11-28 11:21:53 -03:00
Wainer dos Santos Moschetta
4dbba5215f shim-v2: moved measured rootfs logic to its builder
Moved the measure rootfs logic from kata-deploy-binaries.sh to the
shim-v2's builder script so that the former get less bloated with
components's specific code.

Fixes #6674
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2023-11-28 11:21:53 -03:00
Wainer dos Santos Moschetta
34be78df19 kernel: moved measured rootfs logic to its builder
Moved the measure rootfs logic from kata-deploy-binaries.sh to the
kernel's builder script so that the former get less bloated with
components's specific code.

Fixes #6674
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2023-11-28 11:21:53 -03:00
Wainer dos Santos Moschetta
3f16d29593 kernel: measured rootfs as argument to build-kernel.sh
By convention the caller of tools/packaging/kernel/build-kernel.sh changes
the script behavior by passing arguments, whereas, for measured rootfs
it has used an environment variable (MEASURED_ROOTFS). This refactor
the script so that the caller now must pass the "-m" argument to enable
the build of the kernel with measured rootfs support.

Fixes #6674
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2023-11-28 11:21:51 -03:00
James O. D. Hunt
45cc417a4e
Merge pull request #8461 from jodh-intel/update-codeowners
CODEOWNERS: Expand scope
2023-11-27 15:38:39 +00:00
Steve Horsman
bee6fba5c7
Merge pull request #8459 from Amulyam24/workflow-1
github: add workflows for building and publishing kata artefacts on ppc64le
2023-11-27 14:31:20 +00:00
ChengyuZhu6
6de01eacfd kernel: backport erofs patch to 6.1.52 guest kernel
Backport the erofs patch from linux kernel to solve the error #8083

Fixes: #8083

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
Co-authored-by: Gao Xiang <hsiangkao@linux.alibaba.com>
2023-11-21 15:22:40 +08:00
Amulyam24
d8a8cc4491 tools: install oras from source on ppc64le
Since the release is not yet out for ppc64le, build oras from source and use it.

Fixes: #8458

Signed-off-by: Amulyam24 <amulmek1@in.ibm.com>
2023-11-21 11:38:20 +05:30
Amulyam24
08f3603123 tools: fix static build of qemu and shimv2 on ppc64le
- statically linked qemu requires slof.bin to run, hence remove it from blacklist
- By default, initrd is used for Power, modify the configuration.toml accordingly

Fixes: #8458

Signed-off-by: Amulyam24 <amulmek1@in.ibm.com>
2023-11-21 11:38:20 +05:30
Wainer Moschetta
728565d1e4
Merge pull request #7046 from stevenhorsman/remote-hypervisor-cherry-picks
CC: Remote hypervisor merge to main
2023-11-20 15:22:37 -03:00
Hyounggyu Choi
c489f1f504 kata-deploy: Set a default value for ALLOWED_HYPERVISOR_ANNOTATIONS
As a follow-up PR for #8404, this is to set a default value for an environment variable `ALLOWED_HYPERVISOR_ANNOTATIONS`.
This will prevent a pod launching without an explicit configuration for the variable from getting into a `CrashLoop` state.

Fixes: #8477

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2023-11-20 12:33:34 +01:00
stevenhorsman
ebf9d2725a kata-deploy: Add remote shim
- Add remote to the list of shims in kata-deploy and kata-cleanup

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2023-11-17 13:38:49 +00:00
Fabiano Fidêncio
d5cf169adf kata-deploy: Add missing kata-remote runtimeclass
It's CCv0 specific for now, and it's needed as the Operator is now
delegating the runtimeclass creation to the kata-deploy daemonset.

Fixes: #7550

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
(cherry picked from commit 2df6cb7609)
2023-11-17 13:34:40 +00:00
James O. D. Hunt
4a4fc9c648 CODEOWNERS: Expand scope
Improve the `CODEOWNERS` file by specifying more groups.

Since GitHub automatically checks the `CODEOWNERS` file when a PR is
created and adds all matching groups as reviewers for the PR, this may
help reduce the PR backlog since the right people will be alerted and
requested to review the PR. That should improve the quality of reviews
(and thus the quality of the landed code). It may also have a positive
effect on PR velocity.

> **Note:**
>
> This PR combines the other `CODEOWNERS` files so we have
> a single, visible, top-level file.

See: https://github.com/kata-containers/community/issues/253

Fixes: #3804.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2023-11-16 16:09:20 +00:00
Liu Wenyuan
14d8790d83 kata-deploy: Add StratoVirt support to deploy process
Allow kata-deploy process to pull StratoVirt from release binaries, and
add them as a part of kata release.

Fixes: #7794

Signed-off-by: Liu Wenyuan <liuwenyuan9@huawei.com>
2023-11-16 20:47:26 +08:00
Alexandru Matei
bfd1ce30e1 kernel: Fix vsock packets drop when the vsock driver starts
The virtio vsock driver has a small window during initialization
where it can silently drop replies to connection requests.
Because no reply is sent, kata waits for 10 seconds and in the
end it generates a connection timeout error in HybridVSockDialer.

Fixes: #8291

Signed-off-by: Alexandru Matei <alexandru.matei@uipath.com>
2023-11-14 11:02:52 +02:00
Fabiano Fidêncio
1a81989d20 tests: k8s: Use the "ALLOWED_HYPERVISOR_ANNOTATIONS"
The current kata-deploy code has been doing a `sed` to add allowed
hypervisor annotations, so CBL mariner can be tested with their own
kernel and initrd.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-11-09 13:42:31 +01:00
Fabiano Fidêncio
023c4a17cf kata-deploy: Allow users to set hypervisor annotations
Currently the only way one can specify allowed hypervisor annotations is
during build time, which is a big issue for users grabbing kata-deploy
as we provide.

Fixes: #8403

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-11-09 13:42:31 +01:00
Greg Kurz
6236fa4617 release: Drop build_hub helper
Not used anymore.

Signed-off-by: Greg Kurz <groug@kaod.org>
2023-10-31 15:28:57 +01:00
Greg Kurz
bc4c66caaf release: Migrate tag_repos.sh to GitHub CLI
The hub tool is deprecated. Convert this script to use the
official GitHub CLI gh instead of hub.

A typical gh setup is able to access repos using HTTPS along with
GitHub credentials. It is only needed to patch the remote url when
using SSH.

Signed-off-by: Greg Kurz <groug@kaod.org>
2023-10-31 15:11:28 +01:00
Greg Kurz
e331102ba3 release: Migrate update-repository-version.sh to GitHub CLI
The hub tool is deprecated. Convert this script to use the
official GitHub CLI gh instead of hub.

A couple of adjustments had to be made :
- the notes.md temporary file is moved to ${tmp_dir} in order to silent gh,
  otherwise it complains about an untracked file,
- title of a PR no longer goes to the notes.md file since gh requires the
  title to be passed with a dedicated --title option.

Fixes #8303

Signed-off-by: Greg Kurz <groug@kaod.org>
2023-10-31 15:10:50 +01:00
Greg Kurz
b83a7149ee release: Introduce helper to get GitHub CLI
If gh isn't installed already, download it from GitHub.

Signed-off-by: Greg Kurz <groug@kaod.org>
2023-10-31 15:09:24 +01:00
Greg Kurz
ceeabe3714 release: Allow to test release scripts with an alternate repo
We don't want to mess with the official repo when testing a change
in the release scripts. Adapt `update-repository-version.sh` to
be able to use an alternate repo just like `tag_repos.sh` already
does.

This means that the following command :

$ OWNER="$SOME_ORG" ./update-repository-version.sh -p "$NEW_VERSION" "$BRANCH"

will only create a PR in this repo :

http://github.com/$SOME_ORG/kata-containers.git

Signed-off-by: Greg Kurz <groug@kaod.org>
2023-10-31 09:49:27 +01:00
Fabiano Fidêncio
026f6a1a4c release: Adapt the CIs using the kata-deploy image
This is needed in order to properly run the CIs in branches that are not
the main one, as the kata-deploy.yaml file on those branches do not have
the `latest` tag, but rather the latest stable release.

Fixes: #8274

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-10-20 18:59:14 +02:00
Fabiano Fidêncio
a93fdb014b kata-deploy-stable: Adapt to what we're using in the stable branch
This is basically to make sure that folks trying to use the kata-deploy
script from the main branch, to deploy **stable** kata-deploy images, do
not have a hard time.

Fixes: #7194

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-10-20 12:58:42 +02:00
Fabiano Fidêncio
fbc8f8f466 scripts: Use install_yq from the kata-containers repo
As the file is already part of the kata-containers repo, and the tests
repo is about to become read-only, we're good to drop the tests
references from here and use everything coming from the
`kata-containers` repo instead.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-10-11 12:52:55 +02:00
Fabiano Fidêncio
65b1a2d277 release: tag_repos: Stop tagging / updating the tests repo
As we've moved all the tests to the `kata-containers` repo, the `tests`
repo will become a read-only repo.

Fixes: #8200

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-10-11 11:45:27 +02:00
Wainer dos Santos Moschetta
4af78be13a kata-deploy: re-format kata-[deploy|cleanup].yaml
The .tests/integration/kubernetes/gh-run.sh script run `yq write` a
couple of times to edit the kata-[deploy|cleanup].yaml, resulting
on the file being formatted again. This is annoying because leaves
the git tree dirty.

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2023-10-09 11:05:40 -03:00
Fabiano Fidêncio
c2cce12de5
Merge pull request #8100 from fidencio/topic/kata-deploy-build-agent
kata-deploy: Build kata-agent as we build all the other components
2023-10-04 11:56:03 +02:00
Fabiano Fidêncio
560bbffb57 packaging: tools: Remove set -x leftover
This was used for debugging, and ended up being merged with that.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-10-03 15:33:55 +02:00
Fabiano Fidêncio
18fa483d90 packaging: release: Mention newly added images
We've added two new containerd builder images recently, one for the
components under `src/tools` and another one for the Kata Containers
agent.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-10-03 15:33:55 +02:00
Fabiano Fidêncio
ca3b888371 packaging: tools: Fix container image env var name
This should be TOOLS_CONTAINER_BUILDER instead of
VIRTIOFSD_CONTAINER_BUILDER.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-10-03 15:33:55 +02:00
Fabiano Fidêncio
5ca66795c7 packaging: Allow passing the TOOLS_CONTAINER_BUILDER
This follows what we've been doing for all the components we're
building, but was missed as part of #8077.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-10-03 15:33:55 +02:00
Fabiano Fidêncio
5208386ab1 packaging: Build the kata-agent
Let's add the needed functions to start building the kata-agent, with or
without the OPA support.

For now this build is not used as part of the rootfs build, but later on
this will (not as part of this series, though).

Fixes: #8099

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-10-03 15:33:55 +02:00
Fabiano Fidêncio
45c1188839 packaging: Add get_agent_image_name()
This will be used for building the kata-agent.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-10-03 14:17:38 +02:00
Wainer dos Santos Moschetta
0db8fb8f98 versions: migrate out of k8s.gcr.io
The k8s.gcr.io is deprecated for a while now and has been redirected to
registry.k8s.io. However on some bare-metal machines in our testing
pools that redirection is not working, so let's just replace the
registries.

Fixes #8098
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
(cherry picked from commit b2c3bca558c38deff2117d5909d9071c23c05590)
2023-10-03 11:52:59 +01:00
Fabiano Fidêncio
501a168a81 kata-deploy: Build components from src/tools
Let's add targets and actually enable users and oursevles to build those
components in the same way we build the rest of the project.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-09-27 18:49:02 +02:00