Commit Graph

705 Commits

Author SHA1 Message Date
Julio Montes
081f6de874 versions: change qemu tdx url and tag
https://github.com/intel/qemu-dcp is the new repo that supports
qemu with Intel TDX

fixes #4171

Signed-off-by: Julio Montes <julio.montes@intel.com>
2022-04-28 13:46:11 -05:00
Fabiano Fidêncio
ccb0183934 kata-deploy: Add support to RKE2
"RKE2 - Rancher's Next Generation Kuberentes Distribution" can easily be
supported by kata-deploy with some simple adjustments to what we've been
relying on for "k3s".

The main differences between k3s and RKE2 are, basically:
1. The location where the containerd configuration is stored
   - k3s: /var/lib/rancher/k3s/agent/etc/containerd/
   - rke2: /var/lib/rancher/rke2/agent/etc/containerd/
2. The name of the systemd services used:
   - k3s: k3s.service or k3s-agent.service
   - rke2: rke2-server.service or rke2-agent.service

Knowing this, let's add a new overlay for RKE2, adapt the kata-deploy
and the kata-cleanup scripts, and that's it.

Fixes: #4160

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-04-27 19:05:36 +02:00
Fabiano Fidêncio
9d39362e30 kata-deploy: Reestructure the installing section
Let's move the specific installation instructions, such as for k3s,
upper in the document.

This helps reading (and also skipping) according to what the user
is looking for.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2022-04-27 19:05:36 +02:00
Fabiano Fidêncio
18d27f7949 kata-deploy: Add a missing $ prefix in the README
Commit short-log says it all.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2022-04-27 19:05:36 +02:00
Greg Kurz
b658dccc5f tools: fix typo in clh directory name
This allows to get released binaries again.

Fixes: #4151

Signed-off-by: Greg Kurz <groug@kaod.org>
2022-04-26 17:57:32 +02:00
Greg Kurz
afbd60da27 packaging: Fix clh build from source fall-back
If we fail to download the clh binary, we fall-back to build from source.
Unfortunately, `pull_clh_released_binary()` leaves a `cloud_hypervisor`
directory behind, which causes `build_clh_from_source()` not to clone
the git repo:

    [ -d "${repo_dir}" ] || git clone "${cloud_hypervisor_repo}"

When building from a kata-containers git repo, the subsequent calls
to `git` in this function thus apply to the kata-containers repo and
eventually fail, e.g.:

+ git checkout v23.0
error: pathspec 'v23.0' did not match any file(s) known to git

It doesn't quite make sense actually to keep an existing directory the
content of which is arbitrary when we want to it to contain a specific
version of clh. Just remove it instead.

Fixes: #4151

Signed-off-by: Greg Kurz <groug@kaod.org>
2022-04-26 17:57:32 +02:00
David Esparza
9e4ca0c4f8 doc: Improve kata-deploy README.md by changing sh blocks to bash blocks
The idea is to pass this README file to kata-doc-to-script.sh script and
then execute the result.

Added comments with a file name on top of each YAML snippet.
This helps in assigning a file name when we cat the YAML to a file.

Fixes: #3943

Signed-off-by: David Esparza <david.esparza.borquez@intel.com>
2022-03-30 05:30:41 -04:00
snir911
f1a88371c8
Merge pull request #3991 from gkurz/fix-kata-deploy-binaries-sh
tools/packaging: Fix error path in `kata-deploy-binaries.sh -s`
2022-03-30 11:51:43 +03:00
Hui Zhu
e1a39bde8b
Merge pull request #3987 from bergwolf/kata-deploy
kata-deploy: fix version bump from -rc to stable
2022-03-30 16:13:27 +08:00
Greg Kurz
a779e19bee tools/packaging: Fix error path in 'kata-deploy-binaries.sh -s'
`make kata-tarball` relies on `kata-deploy-binaries.sh -s` which
silently ignores errors, and you may end up with an incomplete
tarball without noticing it because `make`'s exit status is 0.

`kata-deploy-binaries.sh` does set the `errexit` option and all the
code in the script seems to assume that since it doesn't do error
checking. Unfortunately, bash automatically disables `errexit` when
calling a function from a conditional pipeline, like done in the `-s`
case:

	if [ "${silent}" == true ]; then
		if ! handle_build "${t}" &>"$log_file"; then
                ^^^^^^
           this disables `errexit`

and `handle_build` ends with a `tar tvf` that always succeeds.

Adding error checking all over the place isn't really an option
as it would seriously obfuscate the code. Drop the conditional
pipeline instead and print the final error message from a `trap`
handler on the special ERR signal. This requires the `errtrace`
option as `trap`s aren't propagated to functions by default.

Since all outputs of `handle_build` are redirected to the build
log file, some file descriptor duplication magic is needed for
the handler to be able to write to the orignal stdout and stderr.

Fixes #3757

Signed-off-by: Greg Kurz <groug@kaod.org>
2022-03-29 19:00:46 +02:00
Greg Kurz
0baebd2b37 tools/packaging: Fix usage of kata-deploy-binaries.sh
Add missing documentation for -s .

Signed-off-by: Greg Kurz <groug@kaod.org>
2022-03-29 19:00:46 +02:00
Fabiano Fidêncio
2eb07455d0 tools: Add a generate_vendor.sh script
This script is responsible for generating a tarball with all the rust
vendored code that is needed for fully building kata-containers on a
disconnected environment.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-03-29 12:36:36 +02:00
Peng Tao
93d03cc064 kata-deploy: fix version bump from -rc to stable
In such case, we should bump from "latest" tag rather than from
current_version.

Fixes: #3986
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2022-03-29 03:41:12 +00:00
David Gibson
025fa60268
Merge pull request #3969 from gkurz/kata-deploy-copy-yq-installer
tools/packaging/kata-deploy: Copy install_yq.sh before starting parallel builds
2022-03-29 12:56:09 +11:00
GabyCT
a07956a369
Merge pull request #3966 from devimc/2022-03-22/fixOsbuilderQAT
osbuilder/qat: don't pull kata sources if exist
2022-03-25 15:12:03 -06:00
Julio Montes
c27963276b osbuilder/qat: don't pull kata sources if exist
don't pull kata sources if they already exist under GOPATH

fixes #3965

Signed-off-by: Julio Montes <julio.montes@intel.com>
2022-03-25 09:09:52 -06:00
Greg Kurz
154c8b03d3 tools/packaging/kata-deploy: Copy install_yq.sh in a dedicated script
'make kata-tarball' sometimes fails early with:

cp: cannot create regular file '[...]/tools/packaging/kata-deploy/local-build/dockerbuild/install_yq.sh': File exists

This happens because all assets are built in parallel using the same
`kata-deploy-binaries-in-docker.sh` script, and thus all try to copy
the `install_yq.sh` script to the same location with the `cp` command.
This is a well known race condition that cannot be avoided without
serialization of `cp` invocations.

Move the copying of `install_yq.sh` to a separate script and ensure
it is called *before* parallel builds. Make the presence of the copy
a prerequisite for each sub-build so that they still can be triggered
individually. Update the GH release workflow to also call this script
before calling `kata-deploy-binaries-in-docker.sh`.

Fixes #3756

Signed-off-by: Greg Kurz <groug@kaod.org>
2022-03-25 15:59:24 +01:00
David Gibson
1ed7da8fc7 packaging: Eliminate TTY_OPT and NO_TTY variables in kata-deploy
NO_TTY configured whether to add the -t option to docker run.  It makes no
sense for the caller to configure this, since whether you need it depends
on the commands you're running.  Since the point here is to run
non-interactive build scripts, we don't need -t, or -i either.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Greg Kurz <groug@kaod.org>
2022-03-25 15:52:02 +01:00
David Gibson
bad859d2f8 tools/packaging/kata-deploy/local-build: Add build to gitignore
This directory consists entirely of files built during a make kata-tarball,
so it should not be committed to the tree. A symbolic link to this directory
might be created during 'make tarball', ignore it as well.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
[greg: - rearranged the subject to make the subsystem checker happy
       - also ignore the symbolic link created by
         `kata-deploy-binaries-in-docker.sh`]
Signed-off-by: Greg Kurz <groug@kaod.org>
2022-03-25 15:52:02 +01:00
Julio Montes
459f4bfedb osbuilder/qat: use centos as base OS
move away from ubuntu, since now it's easier to build using
CentOS as base OS

fixes #3936

Signed-off-by: Julio Montes <julio.montes@intel.com>
2022-03-24 08:18:29 -06:00
GabyCT
d9cd8cde2b
Merge pull request #3909 from fidencio/wip/clh-allow-testing-a-specific-pr
static-build,clh: Add the ability to build from a PR
2022-03-23 15:24:34 -06:00
James O. D. Hunt
3edf25b6c9
Merge pull request #3682 from Jakob-Naucke/cross
Multistrap Ubuntu & enable cross-building guest
2022-03-21 11:11:47 +00:00
Fabiano Fidêncio
ebec6903b8 static-build,clh: Add the ability to build from a PR
Right now it doesn't do much for us, as we're always building from a
specific version.  However, this opens the possibility for us to add a
CI, similar to the one we have for CRI-O, for testing against each
cloud-hypervisor PR, on the cloud-hypervisor branch.

Fixes: #3908

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-03-20 11:24:40 +01:00
Julio Montes
18d4d7fb1d tools: update QEMU to 6.2
bring Intel SGX support

Changes tha may impact in Kata Containers
Arm:
The 'virt' machine now supports an emulated ITS
The 'virt' machine now supports more than 123 CPUs in TCG emulation mode
The pl031 real-time clock device now supports sending RTC_CHANGE QMP events

PowerPC:
Improved POWER10 support for the 'powernv' machine
Initial support for POWER10 DD2.0 CPU added
Added support for FORM2 PAPR NUMA descriptions in the "pseries" machine
 type

s390x:
Improved storage key emulation (e.g. fixed address handling, lazy
 storage key enablement for TCG, ...)
New gen16 CPU features are now enabled automatically in the latest
 machine type

KVM:
Support for SGX in the virtual machine, using the /dev/sgx_vepc device
 on the host and the "memory-backend-epc" backend in QEMU.
New "hv-apicv" CPU property (aliased to "hv-avic") sets the
 HV_DEPRECATING_AEOI_RECOMMENDED bit in CPUID[0x40000004].EAX.

virtio-mem:
QEMU now fully supports guest memory dumps with virtio-mem.
QEMU now cleanly supports precopy migration, postcopy migration and
 background snapshots with virtio-mem.

fixes #3902

Signed-off-by: Julio Montes <julio.montes@intel.com>
2022-03-16 10:35:39 -06:00
Garrett Mahin
dacf6e3955 doc: fix filename typo
Corrects a filename typo in cleanup cluster part
of kata-deploy README.md

Fixes: #3869
Signed-off-by: Garrett Mahin <garrett.mahin@gmail.com>
2022-03-13 17:39:08 -05:00
James O. D. Hunt
5d6d39be48 scripts: Change here document delimiters
Fix the outstanding scripts using non standard shell here document delimiters.

This should have been caught by
https://github.com/kata-containers/tests/pull/3937, but there is a bug
in the checker which is fixed on
https://github.com/kata-containers/tests/pull/4569.

Fixes: #3864.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2022-03-10 09:23:37 +00:00
Eric Ernst
e042593208
Merge pull request #3848 from fidencio/wip/release-dont-consider-rc-as-stable
tools: release: Do not consider release candidates as stable releases
2022-03-08 15:09:04 -08:00
Julio Montes
5ec7592dfa kernel: fix cve-2022-0847
bump guest kernel version to fix cve-2022-0847 "Dirty Pipe"

fixes #3852

Signed-off-by: Julio Montes <julio.montes@intel.com>
2022-03-08 09:49:15 -06:00
Eric Ernst
2b41d275a6 release: Revert kata-deploy changes after 2.4.0-rc0 release
As 2.4.0-rc0 has been released, let's switch the kata-deploy / kata-cleanup
tags back to "latest", and re-add the kata-deploy-stable and the
kata-cleanup-stable files.

Signed-off-by: Eric Ernst <eric_ernst@apple.com>
2022-03-07 14:14:56 -08:00
Eric Ernst
84dff44057 release: Adapt kata-deploy for 2.4.0-rc0
kata-deploy files must be adapted to a new release.  The cases where it
happens are when the release goes from -> to:
* main -> stable:
  * kata-deploy-stable / kata-cleanup-stable: are removed

* stable -> stable:
  * kata-deploy / kata-cleanup: bump the release to the new one.

There are no changes when doing an alpha release, as the files on the
"main" branch always point to the "latest" and "stable" tags.

Signed-off-by: Eric Ernst <eric_ernst@apple.com>
2022-03-07 11:15:25 -08:00
Fabiano Fidêncio
4adf93ef2c tools: release: Do not consider release candidates as stable releases
During the release of 2.4.0-rc0 @egernst noticed an incositency in the
way we handle release tags, as release candidates are being taken as
"stable" releases, while both the kata-deploy tests and the release
action consider this as "latest".

Ideally we should have our own tag for "release candidate", but that's
something that could and should be discussed more extensively outside of
the scope of this quick fix.

For now, let's align the code generating the PR for bumping the release
with what we already do as part of the release action and kata-deploy
test, and tag "-rc"  as latest, regardless of which branch it's coming
from.

Fixes: #3847

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-03-07 20:09:18 +01:00
Jakob Naucke
72f7e9e300
osbuilder: Multistrap Ubuntu
Use `multistrap` for building Ubuntu rootfs. Adds support for building
for foreign architectures using the `ARCH` environment variable.
In the process, the Ubuntu rootfs workflow is vastly simplified.

Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
2022-03-07 11:58:46 +01:00
Jakob Naucke
0a313eda1c
osbuilder: Fix use of LIBC in rootfs.sh
- Add a doc comment
- Pass to build container, e.g. to build x86_64 with glibc (would
  always use musl)

Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
2022-03-07 11:58:46 +01:00
Jakob Naucke
2c86b956fa
osbuilder: Simplify Rust installation
no double export, direct target

Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
2022-03-07 11:58:46 +01:00
Jakob Naucke
0072cc2b66
osbuilder: Remove musl installations
Remove a lot of cruft of musl installations -- we needed those for the
Go agent, but Rustup just takes care of everything. aarch64 on
Debian-based & Alpine is an exception -- create a symlink
`aarch64-linux-musl-gcc` to `musl-tools`'s `musl-gcc` or `gcc` on
Alpine. This is unified -- arch-specific Dockerfiles are removed.

Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
2022-03-07 11:58:46 +01:00
Jakob Naucke
5c3e553624
osbuilder: apk add --no-cache
Hadolint DL3019. If you're wondering why this is in this PR, that's
because I touch the file later, and we're only triggering the lints for
changed files.

Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
2022-03-07 11:58:46 +01:00
Jianyong Wu
8828ef4176 kernel: add arm experimental kernel build support
Add a new entry of arm-kernel-experimental and let the kernel build
script support to build it.

Fixes: #3280
Signed-off-by: Jianyong Wu <jianyong.wu@arm.com>
2022-03-04 11:22:18 +08:00
Jianyong Wu
8a9007fe45 config: remove 2 config as they are removed in 5.15
I'm sure that it is correct to remove CONFIG_ARM64_UAO and
CONFIG_MANDATORY_FILE_LOCKING and . Both are gone in 5.15. Maintain a
specific config files for a kernel version is a little ugly. If someone
needs them, shout at me.

Fixes: #3280
Signed-off-by: Jianyong Wu <jianyong.wu@arm.com>
2022-03-04 11:22:18 +08:00
Jianyong Wu
1b6f7401e0 kernel: add arm experimental patches to support vcpu hotplug and virtio-mem
As the support for vcpu hotplug is on the road, I pick them up here as
experimental to let user try cpu hotplug and virtio-mem on arm64.

Fixes: #3280
Signed-off-by: Jianyong Wu <jianyong.wu@arm.com>
2022-03-04 11:22:18 +08:00
Fabiano Fidêncio
01c57da84b
Merge pull request #3552 from goodluckbot/update-hypervisor-version
Update QEMU >= 6.1.0 in configure-hypervisor.sh
2022-03-01 14:19:16 +01:00
Fabiano Fidêncio
6c2cc1fbd1
Merge pull request #3341 from Jakob-Naucke/centos-stream
osbuilder: Add CentOS Stream rootfs
2022-03-01 12:20:22 +01:00
goodluckbot
54d0a672c5 subsystem: build
With the ACPI PCI hotplug changes introduced in 2.3, QEMU >= 6.1 is required.
Remove unnecessary qemu version check in build script.

Fixes #3547

Signed-off-by: goodluckbot <tangbo_gl@hotmail.com>
2022-03-01 01:18:35 +08:00
Fabiano Fidêncio
827ab82a82 tools: clh: Fix unbound variable
4c164afbac renamed extra_build_args to
features, but did it only in one place, leading to:
```
21:15:28 /home/jenkins/workspace/kata-containers-2.0-ubuntu-ARM-PR/go/src/github.com/kata-containers/kata-containers/tools/packaging/static-build/cloud-hypervisor/build-static-clh.sh: line 55: features: unbound variable
21:15:29 make[1]: *** [tools/packaging/kata-deploy/local-build/Makefile:30: cloud-hypervisor-tarball-build] Error 1
```

Fixes: #3775

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-02-25 22:35:25 +01:00
Fabiano Fidêncio
4c164afbac versions: Update Cloud Hypervisor to 5343e09e7b8db
Let's bump the Cloud Hypervisor version to 5343e09e7b8db, as that brings
a few fixes we're interested in, such as:

* hypervisor, vmm: Handle TDX hypercalls with INVALID_OPERAND
  - https://github.com/cloud-hypervisor/cloud-hypervisor/pull/3723
    - This is needed for the TDX support on the cloud hypervisor driver,
      which is part of this very same series.

* openapi: Update the PciBdf types
  - https://github.com/cloud-hypervisor/cloud-hypervisor/pull/3748
    - This is needed due to a change in a DeviceNode field, which would
      cause a marshalling / demarshalling error when running with a
      version of cloud-hypervisor that includes the TDX fixes mentioned
      above.

* scripts: dev_cli: Don't quote $features_build
* scripts: dev_cli: Add --features option
  - https://github.com/cloud-hypervisor/cloud-hypervisor/pull/3773
    - This is needed due to changes in the scripts used to build Cloud
      Hypervisor, which are used as part of Kata Containers CIs and
      github actions.

      Due to this change, we're also adapting the build scripts as part
      of this very same commit.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-02-25 16:49:16 +01:00
GabyCT
7da7e0a8f5
Merge pull request #3724 from Jakob-Naucke/kata-deploy-s390x
kata-deploy: Simplify Dockerfile and support s390x
2022-02-23 11:38:01 -06:00
Fabiano Fidêncio
e604f83c40
Merge pull request #3735 from fidencio/wip/kata-deploy-use-kata-with-qemu-as-the-default-shim-v2-binary
kata-deploy: Use (kata with) qemu as the default shim-v2 binary
2022-02-21 14:52:55 +01:00
Jakob Naucke
9123fc098d
kata-deploy: Simplify Dockerfile and support s390x
The kata-deploy Dockerfile is based on CentOS 7, which has no s390x
support. Add an `IMAGE` argument to specify the registry, which still
defaults to CentOS, but e.g. ClefOS can be selected instead.

Other x86_64 assumptions are also removed. Other general simplicifations
are made.

This does not address the more general issue of #3723 -- what we're
doing here does not seem to be working with systemd >= something between
235-237.

Fixes: #3722
Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
2022-02-21 11:06:54 +01:00
James O. D. Hunt
67c3195c9c
Merge pull request #3721 from Amulyam24/kernel-fix
kernel: remove SYS_SUPPORTS_HUGETLBFS from powerpc fragments
2022-02-21 09:10:21 +00:00
Fabiano Fidêncio
11220f052f kata-deploy: Use (kata with) qemu as the default shim-v2 binary
When using kata-deploy, no `containerd-shim-kata-v2` binary is deployed,
but we do deploy a `kata` runtime class, which seems very much
incosistent.

As the default configuration for kata-containers points to QEMU, let's
also use kata with QEMU as the default shim-v2 binary.

Fixes: #3228, #3734

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-02-21 10:03:47 +01:00
Amulyam24
8cc1b18636 kernel: remove SYS_SUPPORTS_HUGETLBFS from powerpc fragments
The name of SYS_SUPPORTS_HUGETLBFS has been changed to
ARCH_SUPPORTS_HUGETLBFS which is being selected on default
by another kernel config.
More info- 855f9a8e87
Change applicable from v5.13.

Fixes: #3720

Signed-off-by: Amulyam24 <amulmek1@in.ibm.com>
2022-02-18 18:06:50 +05:30
Jakob Naucke
5c9d2b413f
packaging: Use patch for applying patches
`tools/packaging/scripts/apply_patches.sh` uses `git apply $patch`, but
this will not apply to subdirectories. If one wanted to apply with
`git apply`, they'd have to run it with `--directory=...`
_relative to the Git tree's root_ (absolute will not work!). I suggest
we just use `patch`, which will do what we expected `git apply` would
do.

`patch` is also added to build containers that require it.

Fixes: #3690
Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
2022-02-18 11:32:17 +01:00
Fabiano Fidêncio
5b3fb6f83d kernel: Build SGX as part of the vanilla kernel
Let's take advantage of the fact that we've bumped to our kernel version
ot the 5.15 LTS and enable SGX by default, as it's present there.

Fixes: #3692

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-02-18 10:41:08 +01:00
Julio Montes
0b31b7ccc2
Merge pull request #3707 from devimc/2022-02-16/qemu-tdx
packaging: support qemu-tdx
2022-02-17 12:20:05 -06:00
Julio Montes
7c4ee6ec48 packaging/qemu: create no_patches file for qemu-tdx
create no_patches.txt file for qemu-tdx, this way we can build it
using packaging scripts

Signed-off-by: Julio Montes <julio.montes@intel.com>
2022-02-17 09:17:57 -06:00
Peng Tao
9e618f1fb2
Merge pull request #3684 from fidencio/kernel-lts-5.15.x
versions: Linux 5.15.x
2022-02-17 10:25:28 +08:00
Fabiano Fidêncio
a6b4015130 tools: clh: Remove unused variables
Right now we're getting the info for the Cloud Hypervisor repo and
version, but we don't do anything with them, as those are not passed
down to the build script.

Morever, the build script itself gets the info from exactly the same
place when those are not passed, making those redundant.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-02-16 14:54:51 +01:00
Fabiano Fidêncio
5816c132ec tools: Build cloud-hypervisor with "--features tdx"
Right now TDx support on Cloud Hypervisor is gated behind a "--features
tdx" flag.  However, having TDx support enabled should not and does not
impact on the general usability of cloud-hypervisor.

As sooner than later we'll need kata-deploy binaries to be tested on a
CI that's TDx capable, for the confidential containers effort, let's
take the bullet and already enable it by default.

By the way, touching kata-deploy-binaries.sh as it's ensure the change
will be used in the following workflows:
* kata-deploy-push
* kata-deploy-test
* release

Fixes: #3688

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-02-16 14:51:15 +01:00
Carlos Venegas
e6060cb7c0 versions: Linux 5.15.x
Upgrade to new Linux kernel LTS version.

Fixes: #3576

Signed-off-by: Carlos Venegas <jose.carlos.venegas.munoz@intel.com>
2022-02-16 11:12:44 +01:00
Fabiano Fidêncio
948a2b099c tools: clh: Ensure the download binary is executable
We're downloading the released cloud-hypervisor binary from GitHub, but
we should also ensure we set the binary as executable.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-02-15 20:23:46 +01:00
Fabiano Fidêncio
e07545a23c tools: clh: Allow passing down a build flag
Let's allow passing down a build flag to cargo, when building Cloud
Hypervisor.

By doing this we allow calling this script with:
```
extra_build_flags="--features tdx" ./build-static-clh.sh
```

Fixes: #3671

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-02-15 14:14:30 +01:00
Fabiano Fidêncio
55cdef2295 tools: clh: Add the possibility to always build from sources
The current code will always pull the release binaries in case the
version requested by Kata Containers matches with a released version.

This, however, has a limitation of preventing users / CIs to build
cloud-hypervisor from source for a reason or another, such as passing a
specific build flag to cloud-hypervisor.

This is a pre-req to solving
https://github.com/kata-containers/kata-containers/issues/3671.

While here, a small changes were needed in order to improve readability
and debugability of why we're building something from the sources rather
than simply downloading and using a pre-built binary.

Fixes: #3672

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-02-15 14:13:51 +01:00
Jakob Naucke
573a37b33b
osbuilder: Add CentOS Stream rootfs
to cover a Red Hat (adjacent) rootfs with great cross-platform compatibility
and a workable release cadence. The previous CentOS & Fedora workflows are
simplified.

Also remove unnecessary `/usr/share` files as on Ubuntu and mark Alpine
as unuspported on ppc64le (due to musl, for a while already).

Fixes: #3340
Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
2022-02-14 15:06:07 +01:00
Jakob Naucke
f10642c82b
osbuilder: Source .cargo/env before checking Rust
We install Rust in the build containers, but we also install Rust in
`rootfs.sh` if it is missing. It makes sense to install Rust in the build
containers so it does not have to be installed every time, but for that check
to work on non-login shells, we should source `.cargo/env` before running it.

Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
2022-02-14 15:06:07 +01:00
Julio Montes
955d359f9e kernel: add missing config fragment for TDx
Add kernel config fragment that enables TDx

fixes #3659

Signed-off-by: Julio Montes <julio.montes@intel.com>
2022-02-14 07:40:12 -06:00
James O. D. Hunt
3d3af84cde
Merge pull request #3636 from Kvasscn/kata_dev_fix_check_build_type
scripts: fix a typo while to check build_type
2022-02-14 12:33:59 +00:00
Bin Liu
cf53ec2c71
Merge pull request #2977 from luodw/support_nydus
feature(nydusd): add nydusd support to introduce lazyload ability
2022-02-14 13:08:50 +08:00
Eric Ernst
172fac5cc8
Merge pull request #3613 from hxtmdev/markdown-relative
docs: Fix relative links in Markdown
2022-02-13 21:01:41 -08:00
Julio Montes
1797b3eb04 packaging/kernel: build TDX guest kernel
Add support for building TDX kernel from github.com/intel/tdx

To build a guest kernel that supports Intel TDx run:

```
./build-kernel.sh -s -x tdx -d setup
./build-kernel.sh -s -x tdx -d install
```

fixes #3650

Signed-off-by: Julio Montes <julio.montes@intel.com>
2022-02-11 16:00:32 -06:00
Julio Montes
bc8464e04f packaging/kernel: add option -s option
Add -s option to skip .config checks

Signed-off-by: Julio Montes <julio.montes@intel.com>
2022-02-11 15:44:03 -06:00
luodaowen.backend
2d9f89aec7 feature(nydusd): add nydusd support to introduse lazyload ability
Pulling image is the most time-consuming step in the container lifecycle. This PR
introduse nydus to kata container, it can lazily pull image when container start. So it
can speed up kata container create and start.

Fixes #2724

Signed-off-by: luodaowen.backend <luodaowen.backend@bytedance.com>
2022-02-11 21:41:17 +08:00
Daniel Höxtermann
b19b6938a8 docs: Fix relative links in Markdown
Relative links within this repository allow for easier navigation to
the corresponding file / directory in the current commit / for the
selected version.

Link text was slightly changed / fixed in
- docs/Unit-Test-Advice.md
- docs/how-to/how-to-run-docker-with-kata.md

Fixes #3045

Signed-off-by: Daniel Höxtermann <daniel@hxtm.dev>
2022-02-11 13:49:42 +01:00
zhanghj
54e1faec4c scripts: fix a typo while to check build_type
check $build_type is not an empty string instead of equal to "true".

Fixes: #3635

Signed-off-by: zhanghj <zhanghj.lc@inspur.com>
2022-02-09 17:13:04 +08:00
Snir Sheriber
007221875e docs: update Release-Process.md
with a reminder to test kata-deploy

Fixes: #3611
Signed-off-by: Snir Sheriber <ssheribe@redhat.com>
2022-02-06 09:15:57 +02:00
Snir Sheriber
496bc10de2 tools: check for yq before using it
as get_from_kata_deps may be called from scripts that
does not install_yq

Signed-off-by: Snir Sheriber <ssheribe@redhat.com>
2022-02-06 09:14:31 +02:00
Fabiano Fidêncio
aa3fae1397 kata-deploy: Fix the tag replacement logic
When building a non-stable release, the tag is **always** "latest¨,
instead of the version. The same magic done for setting the correct
tags up should be done for replacing the tag on the kata-deploy and
kata-cleanup yaml files, as part of the kata-deploy test.

Fixes: #3559

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-01-26 20:42:48 +01:00
Fabiano Fidêncio
618aa659d6
Merge pull request #3509 from ManaSugi/remove-libseccomp-from-dockerfile
osbuilder: Remove libseccomp from Dockerfile
2022-01-21 06:50:53 +01:00
Gabriela Cervantes
9c2f1de16d docs: Remove kata-pkgsync reference
Now that kata-pkgsync has been removed, this PR removes the reference
in the documentation.

Fixes #3513

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2022-01-20 18:00:58 +00:00
Manabu Sugimoto
df6ae1e789 osbuilder: Remove libseccomp from Dockerfile
Remove the libseccomp package from Dockerfile of `alpine` and `clearlinux`
because the libseccomp library is installed by the `ci/install_libseccomp.sh`
script when building the kata-agent.

Fixes: #3508

Signed-off-by: Manabu Sugimoto <Manabu.Sugimoto@sony.com>
2022-01-21 00:32:57 +09:00
Archana Shinde
f71eedf3a0
Merge pull request #3437 from haslersn/un-gn
tools: Fix groupname if it differs from username
2022-01-19 22:25:59 -08:00
Archana Shinde
1c3f8c708e
Merge pull request #3488 from ManaSugi/fix-seccomp-notice-in-release-page
release: Escape backticks in Libseccomp Notices
2022-01-19 19:40:54 -08:00
Gabriela Cervantes
8cc088b540 packaging: Remove kata-pkgsync tool
This PR removes the kata-pkgsync tool that is mainly used for OBS
packages, currently for kata 2.0 we do not have OBS packages and
this tool is not being used for kata 2.0

Fixes #3493

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2022-01-19 15:53:37 +00:00
Manabu Sugimoto
a8b66de5e8 release: Escape backticks in Libseccomp Notices
Escape (with backslash) backticks (`) to prevent them from being
evaluated by the shell.

Fixes: #3487

Signed-off-by: Manabu Sugimoto <Manabu.Sugimoto@sony.com>
2022-01-19 19:45:05 +09:00
Fabiano Fidêncio
0b5c0ae2ae
Merge pull request #3188 from weiyuanke/fix_version
update apiVersion
2022-01-17 23:20:06 +01:00
Carlos Venegas
5f41e199dd
Merge pull request #3438 from haslersn/usr-bin-env-bash
scripts: Use shebang /usr/bin/env bash
2022-01-17 15:39:42 -06:00
Carlos Venegas
5a55313431
Merge pull request #3446 from jodh-intel/kernel-proc-config
packaging: Make kernel config accessible to guest
2022-01-17 15:37:34 -06:00
Sebastian Hasler
e347694fff tools: Fix groupname if it differs from username
The script `tools/packaging/static-build/qemu/build-base-qemu.sh`
previously failed on systems where the user's groupname differs from the
username

Fixes: #3461

Signed-off-by: Sebastian Hasler <sebastian.hasler@stuvus.uni-stuttgart.de>
2022-01-17 16:52:39 +01:00
Jianyong Wu
d370604fa5
Merge pull request #3292 from zyzii/vcpu-hotplug2
experimentally enable the vcpu-hotplug for arm in qemu side
2022-01-14 18:10:40 +08:00
Huang Shijie
2d0ec00aff Qemu: Enable the vcpu-hotplug for arm
Initially enable vcpu hotplug in qemu for arm base on Salli's work[1].

Fixes:#3280

Signed-off-by: Huang Shijie <shijie8@gmail.com>
[1] https://github.com/salil-mehta/qemu/tree/virt-cpuhp-armv8/rfc-v1
2022-01-14 13:27:17 +00:00
James O. D. Hunt
e22a4e2a0a packaging: Make kernel config accessible to guest
Provide the `/proc/config.gz` file in guest kernels that allow the guest
to determine the kernel configuration used to build the running kernel.

Note that since `gunzip` expects to rename the gzip'ed file it operates
on, to use this feature you need to run something like the following in
the container environment:

 ```bash
 # cat /proc/config.gz|gunzip -c
 ```

Fixes: #3445.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2022-01-14 08:50:34 +00:00
Sebastian Hasler
adffd3f8b6 scripts: Use shebang /usr/bin/env bash
Not all distros have `/bin/bash`, e.g. NixOS.

Fixes: #3450

Signed-off-by: Sebastian Hasler <sebastian.hasler@stuvus.uni-stuttgart.de>
2022-01-13 22:53:28 +01:00
Fabiano Fidêncio
e4b7a12bf3 qat: Add Debian to the distro examples
Debian is a supported rootfs that uses systemd as init, thus, it should
be mentioned in the QAT README document.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-01-13 21:54:05 +01:00
Fabiano Fidêncio
6979d5be69 osbuilder: Remove gentoo rootfs-builder
As the gentoo rootfs is not tested in our CI, we can't guarantee it
actually works as expected.

Whenever we have someone willing to maintain this rootfs we can have it
added back, and also add a CI job to test it altogether, avoiding then
any possible regression.

Fixes: #2144

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-01-13 21:54:05 +01:00
Fabiano Fidêncio
22c1a093d7 osbuilder: Remove suse rootfs-builder
As the suse rootfs is not tested in our CI, we can't guarantee it
actually works as expected.

Whenver we have someone willing to maintain this rootfs we can have it
added back, and also add a CI job to test it altogether, avoiding then
any possible regression.

Fixes: #2145

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-01-13 21:54:05 +01:00
Fabiano Fidêncio
85dd587382 osbuilder: Remove fedora rootfs-builder
As the fedora rootfs is not tested in our CI, we can't guarantee it
actually works as expected.

Whenever we have someone willing to maintain the rootfs we can have it
added back, and also add a CI job to test it altogether, avoiding then
any possible regression.

Fixes: #2143

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-01-13 21:54:05 +01:00
Fabiano Fidêncio
06fae29f49 osbuilder: Remove centos rootfs-builder
As the centos rootfs is not tested in our CI, we can't guarantee it
actually works as expected.

Whenever we have someone willing to maintain the rootfs we can have it
added back, and also add a CI job to test it altogether, avoiding then
any possible regression.

Fixes: #2140

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-01-13 21:54:05 +01:00
Gabriela Cervantes
01005c5a9c docs: Remove ccloudvm reference
This PR removes the ccloudvm reference at the README document as the
setup of scripts of ccloudvm were removed.

Fixes #3448

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2022-01-13 18:22:26 +00:00
Snir Sheriber
ac7acbf87b kata-deploy: validate conf file can be created
As containerd doesn't exist at cleanup

Fixes: #3429
Signed-off-by: Snir Sheriber <ssheribe@redhat.com>
2022-01-12 10:12:46 +02:00
Gabriela Cervantes
7e2bc4d764 packaging: Remove ccloudvm instructions and script
This PR removes ccloudvm for kata 2.0, ccloudvm was used in kata 1.x
and we are not longer using it for kata 2.0.

Fixes #3427

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2022-01-11 15:41:16 +00:00
Gabriela Cervantes
b48322d44e packaging: Remove obs packages testing for kata 2.0
This PR removes the scripts and the dockerfiles that were used in kata 1.x
to test the different kata components for different distributions in OBS.
Currently for kata 2.0 we are not generating packages in OBS so these scripts
are not longer being used.

Fixes #3404

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2022-01-07 17:06:20 +00:00
Snir Sheriber
e2c1e65e27 kata-deploy: fix tar command in dockerfile
tar params are passed wrongly

Fixes: #3394
Signed-off-by: Snir Sheriber <ssheribe@redhat.com>
2022-01-05 20:07:52 +02:00
Bin Liu
b2166560fa
Merge pull request #3375 from zhaojizhuang/debianrootfs
osbuilder: Restore Debian as a rootfs
2022-01-05 10:27:47 +08:00
zhaojizhuang
3093f93a6f osbuilder: Restore Debian as a rootfs
Restore Debian as a rootfs.
1. revert of #3154, but some change
2. update debian version to 10.11
3. update  `libstdc++-6-dev` to `libstdc++-8-dev`
4.  changes discarded in QAT are not restored

Fixes: #3372
Signed-off-by: zhaojizhuang <571130360@qq.com>
2022-01-04 11:54:34 +08:00
Wainer Moschetta
820dc930db
Merge pull request #3109 from wainersm/delint_dockerfiles
Delint dockerfiles
2021-12-28 10:11:51 -03:00
Jakob Naucke
55bac67ac6
docs: Fix kernel configs README spelling errors
- `fragments` in backticks
- s/perfoms/performs/

Fixes: #3338
Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
2021-12-22 18:57:47 +01:00
Fabiano Fidêncio
67f0ab4092
Merge pull request #3294 from Kvasscn/kata_dev_osbuilder_makefile
osbuilder: avoid to copy versions.txt which already deprecated
2021-12-21 16:07:01 +01:00
Wainer dos Santos Moschetta
d79268ac65 tools/packaging: add copyright to kata-monitor's Dockerfile
The kata-monitor's Dockerfile was added by Eric Ernst on commit 2f1cb7995f
but for some reason the static checker did not catch the file misses the copyright statement
at the time it was added. But it is now complaining about it. So this assign the copyright to
him to make the static-checker happy.

Fixes #3329
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2021-12-21 10:01:11 -05:00
Fabiano Fidêncio
79153c3845
Merge pull request #3288 from gkurz/qemu-disable-libudev
qemu: Disable libudev for QEMU 5.2 and newer
2021-12-21 15:56:16 +01:00
Wainer dos Santos Moschetta
428cf0a685 packaging: delint tests dockerfiles
Removed all errors/warnings pointed out by hadolint version 2.7.0, except for the following
ignored rules:
  - "DL3008 warning: Pin versions in apt get install"
  - "DL3041 warning: Specify version with `dnf install -y <package>-<version>`"
  - "DL3033 warning: Specify version with `yum install -y <package>-<version>`"
  - "DL3048 style: Invalid label key"
  - "DL3003 warning: Use WORKDIR to switch to a directory"
  - "DL3018 warning: Pin versions in apk add. Instead of apk add <package> use apk add <package>=<version>"
  - "DL3037 warning: Specify version with zypper install -y <package>[=]<version>"

Fixes #3107
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2021-12-21 09:54:44 -05:00
Wainer dos Santos Moschetta
1ea9b70383 packaging: delint kata-deploy dockerfiles
Removed all errors/warnings pointed out by hadolint version 2.7.0, except for the following
ignored rules:
  - "DL3008 warning: Pin versions in apt get install"
  - "DL3041 warning: Specify version with `dnf install -y <package>-<version>`"
  - "DL3033 warning: Specify version with `yum install -y <package>-<version>`"
  - "DL3048 style: Invalid label key"
  - "DL3003 warning: Use WORKDIR to switch to a directory"
  - "DL3018 warning: Pin versions in apk add. Instead of apk add <package> use apk add <package>=<version>"
  - "DL3037 warning: Specify version with zypper install -y <package>[=]<version>"

Fixes #3107
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2021-12-21 09:54:44 -05:00
Wainer dos Santos Moschetta
aeb2b673b3 osbuilder: delint dockerfiles
Removed all errors/warnings pointed out by hadolint version 2.7.0, except for the following
ignored rules:
  - "DL3008 warning: Pin versions in apt get install"
  - "DL3041 warning: Specify version with `dnf install -y <package>-<version>`"
  - "DL3033 warning: Specify version with `yum install -y <package>-<version>`"
  - "DL3048 style: Invalid label key"
  - "DL3003 warning: Use WORKDIR to switch to a directory"
  - "DL3018 warning: Pin versions in apk add. Instead of apk add <package> use apk add <package>=<version>"
  - "DL3037 warning: Specify version with zypper install -y <package>[=]<version>"

Fixes #3107
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2021-12-21 09:54:44 -05:00
Wainer dos Santos Moschetta
bc120289ec packaging: delint kata-monitor dockerfiles
Removed all errors/warnings pointed out by hadolint version 2.7.0, except for the following
ignored rules:
  - "DL3008 warning: Pin versions in apt get install"
  - "DL3041 warning: Specify version with `dnf install -y <package>-<version>`"
  - "DL3033 warning: Specify version with `yum install -y <package>-<version>`"
  - "DL3048 style: Invalid label key"
  - "DL3003 warning: Use WORKDIR to switch to a directory"
  - "DL3018 warning: Pin versions in apk add. Instead of apk add <package> use apk add <package>=<version>"
  - "DL3037 warning: Specify version with zypper install -y <package>[=]<version>"

Fixes #3107
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2021-12-21 09:54:44 -05:00
Wainer dos Santos Moschetta
bc71dd5812 packaging: delint static-build dockerfiles
Removed all errors/warnings pointed out by hadolint version 2.7.0, except for the following
ignored rules:
  - "DL3008 warning: Pin versions in apt get install"
  - "DL3041 warning: Specify version with `dnf install -y <package>-<version>`"
  - "DL3033 warning: Specify version with `yum install -y <package>-<version>`"
  - "DL3048 style: Invalid label key"
  - "DL3003 warning: Use WORKDIR to switch to a directory"
  - "DL3018 warning: Pin versions in apk add. Instead of apk add <package> use apk add <package>=<version>"
  - "DL3037 warning: Specify version with zypper install -y <package>[=]<version>"

Fixes #3107
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2021-12-21 09:54:41 -05:00
Fabiano Fidêncio
99ef52a35d osbuilder: Add protoc to the alpine container
It seems the lack of protoc in the alpine containers is causing issues
with some of our CIs, such as the VFIO one.

Fixes: #3323

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2021-12-21 13:57:18 +01:00
Wainer dos Santos Moschetta
2938bb7f89 packaging/qemu: Use QEMU script to update submodules
Currently QEMU's submodules are git cloned but there is the scripts/git-submodule.sh
which is meant for that. Let's use that script.

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2021-12-17 10:20:59 -03:00
Wainer dos Santos Moschetta
5d49ccd613 packaging/qemu: Use partial git clone
The static build of QEMU takes a good amount of time on cloning the
source tree because we do a full git clone. In order to speed up that
operation this changed the Dockerfile so that it is carried out a
partial clone by using --depth=1 argument.

Fixes #3291
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2021-12-17 10:20:29 -03:00
zhanghj
d1bc409d57 osbuilder: avoid to copy versions.txt which already deprecated
Currently the versions.txt in rootfs-builder dir is already removed,
so avoid to copy it in list of helper files.

Fixes: #3267

Signed-off-by: zhanghj <zhanghj.lc@inspur.com>
2021-12-17 17:23:05 +08:00
Greg Kurz
12c8e41c75 qemu: Disable libudev for QEMU 5.2 and newer
Commit 112ea25859 disabled libudev for static builds because it was
breaking snap. It turns out that the only users of libudev in QEMU are
qemu-pr-helper and USB. Kata already disables USB and doesn't use
qemu-pr-helper. Disable libudev for all builds if QEMU supports it, i.e.
version 5.2 or newer.

Fixes #3078

Signed-off-by: Greg Kurz <groug@kaod.org>
2021-12-16 16:12:02 +01:00
Jakob Naucke
a40e4877e9
Merge pull request #3266 from liubin/fix/3265-update-golang-to-1.16-and-remove-ioutil
runtime: update golang to 1.16 and remove ioutil package
2021-12-15 10:09:23 +01:00
bin
03546f75a6 runtime: change io/ioutil to io/os packages
Change io/ioutil to io/os packages because io/ioutil package
is deprecated from 1.16:

Discard => io.Discard
NopCloser => io.NopCloser
ReadAll => io.ReadAll
ReadDir => os.ReadDir
ReadFile => os.ReadFile
TempDir => os.MkdirTemp
TempFile => os.CreateTemp
WriteFile => os.WriteFile

Details: https://go.dev/doc/go1.16#ioutil

Fixes: #3265

Signed-off-by: bin <bin@hyper.sh>
2021-12-15 07:31:48 +08:00
Jakob Naucke
70274b9d39
Merge pull request #3258 from fidencio/wip/kata-deploy-count-with-a-non-existend-containerd-config-file
kata-deploy: Deal with empty containerd conf file
2021-12-14 20:14:41 +01:00
Bin Liu
6c34446f49
Merge pull request #3244 from bergwolf/reorg-code
src: reorg source code directory
2021-12-14 21:57:07 +08:00
Peng Tao
7c4263b3e1 src: reorg source directories
To make the code directory structure more clear:

└── src
    ├── agent
    ├── libs
    │   └── logging
    ├── runtime
    ├── runtime-rs (to be added)
    └── tools
        ├── agent-ctl
        └── trace-forwarder

Fixes: #3204
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2021-12-14 10:30:08 +08:00
Fabiano Fidêncio
8457150684 kata-deploy: Deal with empty containerd conf file
As containerd can properly run without having a existent
`/etc/containerd/config.toml` file (it'd run using the default
cobnfiguration), let's explicitly create the file in those cases.

This will avoid issues on ammending runtime classes to a non-existent
file.

Fixes: #3229

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
Tested-by: Jakob Naucke <jakob.naucke@ibm.com>
2021-12-13 11:20:22 +01:00
bin
3f7cf7ae67 osbuilder: show usage if no options/arguments specified
Now if no options/arguments specified, the shell scripts will return an error:

ERROR: Invalid rootfs directory: ''

This commit will show usage if no options/arguments specified.

Fixes: #3256

Signed-off-by: bin <bin@hyper.sh>
2021-12-13 16:10:55 +08:00
Bin Liu
978b13c9e8
Merge pull request #3235 from Kvasscn/kata_dev_image_builer_help
image_build: add help info for '-f' option and 'BLOCK_SIZE' env.
2021-12-09 22:55:24 +08:00
Julio Montes
70062e1563
Merge pull request #3238 from snir911/wip/build_with_runtime
osbuilder: be runtime consistent with podman build
2021-12-09 08:06:00 -06:00
Snir Sheriber
2ebaaac73d osbuilder: be runtime consistent also with podman build
Use the same runtime used for podman run also for the podman build cmd
Additionally remove "docker" from the docker_run_args variable

Fixes: #3239
Signed-off-by: Snir Sheriber <ssheribe@redhat.com>
2021-12-09 11:28:16 +02:00
Jakob Naucke
2204ecac39
versions: Upgrade Alpine, using minor version
- Upgrade Alpine guest rootfs to 3.15
- Specify a minor version rather than patch level as the Alpine
  repositories use that.

Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
2021-12-08 15:18:44 +01:00
Jakob Naucke
dfd0732ff9
osbuilder: Revert to using apk.static for Alpine
#2399 partially reverted #418, missing on returning to bootstrapping a
rootfs with `apk.static` instead of copying the entire root, which can
result in drastically larger (more than 10x) images. Revert this as well
(requires some updates to URL building).

Fixes: #3216
Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
2021-12-08 15:18:43 +01:00
zhanghj
6b3e4c212c image_build: add help info for '-f' option and 'BLOCK_SIZE' env.
The help information of '-f' option is missing, and same issue
with 'BLOCK_SIZE' env variables, fix it in usage() function.

Fixes: #3231

Signed-off-by: zhanghj <zhanghj.lc@inspur.com>
2021-12-08 17:33:07 +08:00
yuanke wei
b5b9de1de9 kata-deploy: Update API Version of RuntimeClass to v1
API Version of node.k8s.io/v1beta1 is deprecated in
v1.22+, unavailable in v1.25+

Fixes: #3185

Signed-off-by: yuanke wei <yuanke.wyk@alibaba-inc.com>
2021-12-08 14:18:57 +08:00
Binbin Zhang
8fae263170 packaging: Fix missing commit message in building kata-runtime
add `git` package to the shim-v2 build image

Fixes: #3196

Signed-off-by: Binbin Zhang <binbin36520@gmail.com>
2021-12-04 11:59:59 +08:00
Bin Liu
86d9d2eed5
Merge pull request #3169 from Kvasscn/kata_dev_add_install_go_help
packaging: add help information for '-f' option in install_go.sh
2021-12-03 14:39:05 +08:00
zhanghj
1e6f58e562 packaging: add help information for '-f' option in install_go.sh
add help info for force install, and remove unused '-p' option.

Fixes: #3168

Signed-off-by: zhanghj <zhanghj.lc@inspur.com>
2021-12-02 02:58:12 -05:00
Feng Wang
6105e3ee85 runtime: enable FUSE_DAX kernel config for DAX
Otherwise DAX device cannot be set up.

Fixes #3165

Signed-off-by: Feng Wang <feng.wang@databricks.com>
2021-12-01 13:38:57 -08:00
Fupan Li
87f350db53
Merge pull request #3125 from jodh-intel/update-rust-crate-versions
Update rust crate versions
2021-12-01 18:00:33 +08:00
Gabriela Cervantes
923e098db6 osbuilder: Remove debian as a rootfs
Currently we do not have debian as part of the kata CI as we
do not have a mantainer, this PR removes debian as a supported
rootfs in order to have only the distros that we are supporting
and mantainining.

Fixes #3153

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2021-11-30 19:31:33 +00:00
James O. D. Hunt
13257986ae agent-ctl: Update rust lockfile
Ran `cargo update` to bump crate versions.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2021-11-30 12:58:15 +00:00
Binbin Zhang
8ee67aae4f osbuilder: fix missing cpio package when building rootfs-initrd image
1. install cpio package before building rootfs-initrd image
2. add `pipefaili;errexit` check to the scripts

Fixes: #3144

Signed-off-by: Binbin Zhang <binbin36520@gmail.com>
2021-11-29 23:42:44 +08:00
Peng Tao
f59d3ff600 osbuilder: add coreutils to guest rootfs
So that the debug console is more useful. In the meantime, remove
iptables as it is not used by kata-agent any more.

Fixes: #3138
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2021-11-29 11:22:07 +08:00
Julio Montes
857501d8dd tools/osbuilder: build QAT kernel in fedora 34
kernel compiled in fedora 35 (latest) is not working, following error
is reported:

```
qemu-system-x86_64: Error loading uncompressed kernel without PVH ELF
Note
```

Build QAT kernel in fedora 34 container to fix it

fixes #3135

Signed-off-by: Julio Montes <julio.montes@intel.com>
2021-11-26 13:56:43 -06:00
Fabiano Fidêncio
abf39ddef0
Merge pull request #3089 from fidencio/wip/kata-deploy-remove-files-and-revert-removal-as-part-of-the-release-scripts
tools: Automatically revert kata-deploy changes
2021-11-25 15:23:52 +01:00
Fabiano Fidêncio
5ba2f52c73 tools: Quote functions arguments in the update repos script
Although this is not strictly needed, better be safe than sorry on those
cases.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2021-11-24 22:09:58 +01:00
Fabiano Fidêncio
5dbd752f8f tools: Remove the check for the VERSION file
All repos we release (https://github.com/kata-containers/kata-containers
and https://github.com/kata-containers/tests) have a VERSION file.

Keeping a check for it, although useful for a new repo, just complicates
the use-case we currently deal with.

While here, let's also anchor the '#' and potentially exclude blank
lines, following James' suggestion.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2021-11-24 22:09:49 +01:00
Fabiano Fidêncio
85eb743f46 tools: Make hub usage slightly less fragile
`grep`ing by a specific output, in a specific language, is quite fragile
and could easily break `hub`.  For now, let's work this around following
James' suggestion of setting `LC_ALL=C LANG=C` when calling `hub`.

> **Note**: I don't think we should invest much time on fixing `hub`
> usage, as it'll be soon replaced by `gh`, see:
> https://github.com/kata-containers/kata-containers/issues/3083

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2021-11-24 22:09:30 +01:00
Fabiano Fidêncio
76540dbdd1 tools: Automatically revert kata-deploy changes
When branching the "stable-x.y" branch, we need to do some quite
specific changes to kata-deploy / kata-cleanup files, such as:
* changing the tags from "latest" to "stable-x.y".
* removing the kata-deploy / kata-cleanup stable files.

However, after the branching is done, we need to get the `main` repo to
its original state, with the kata-deploy / kata-cleanup using the
"latest" tag, and with the stable files present there, and this commit
ensures that, during the release process, a new PR is automatically
created with these changes.

Fixes: #3069

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2021-11-24 22:07:53 +01:00
Fabiano Fidêncio
36d73c96c8 tools: Do the kata-deploy changes on its own commit
Rather than doing the kata-deploy changes as part of the release bump
commit, let's split those on its own changes, as it will both make the
life of the reviewer less confusing and also allows us to start
preparing the field for a possible automated revert of these changes,
whenever it becomes needed.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2021-11-24 22:07:52 +01:00
Fabiano Fidêncio
c8e22daf67 tools: Use vars for the registry in the update repo script
Similarly to what was done for the yaml files, let's use a var for
representing the registry where our images will be pushed to and avoid
repetition and too long lines.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2021-11-24 22:07:03 +01:00
Fabiano Fidêncio
ac958a3073 tools: Use vars for the yaml files used in the update repo script
Instead of always writing the full path of some files, let's just create
some vars and avoid both repetition (which is quite error prone) and too
long lines (which makes the file not so easy to read).

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2021-11-24 22:06:45 +01:00
Fabiano Fidêncio
edca829242 tools: Rewrite the logic around kata-deploy changes
We can simplify the code a little bit, as at least now we group common
operationr together.  Hopefully this will improve the maintainability
and the readability of the code.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2021-11-24 22:05:35 +01:00