Commit Graph

22 Commits

Author SHA1 Message Date
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
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
Aurélien Bombo
2b59756894 tests: Build CLH with glibc for Mariner
This enables building CLH with glibc and the mshv feature as required
for Mariner. At test time, it also configures Kata to use that CLH
flavor when running Mariner.

Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
2023-06-30 12:51:40 -07:00
Fabiano Fidêncio
ac88d34e0c static-build: Use relased binary for CLH (aarch64)
There's no need to build Cloud Hypervisor aarch64 as, for a few releases
already, Cloud Hypervisor provides an official release binary for the
architecture.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-05-12 22:05:01 +02:00
Gabriela Cervantes
0ed7da30d7 tools: Fix indentation of build static clh script
This Pr removes single spaces and fix the indentation of the script.

Fixes #5528

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2022-10-27 21:09:34 +00:00
Archana Shinde
e57a1c831e build: Mark git repos as safe for build
This is not an issue when the build is run as non-privilged user.
Marking these as safe in case where the build may be run as root
or some other user.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2022-07-07 12:11:00 -07:00
Rafael Fonseca
e87eb13c4f tools: delete unused param from get_from_kata_deps callers
The param was deleted by a09e58fa80, so
update the callers not to use it.

Fixes #4245

Signed-off-by: Rafael Fonseca <r4f4rfs@gmail.com>
2022-05-17 15:18:41 +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
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
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
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
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
Jianyong Wu
f981fc6456 clh: correct cloud-hypervisor installation
Currently, there is cloud hypervisor binary released only for x86, thus
we must build from source code when install cloud hypervisor on arm64.

Fixes: #2410
Signed-off-by: Jianyong Wu <jianyong.wu@arm.com>
2021-08-09 15:56:28 +08:00
Peng Tao
82e9450124 packaging: fix cloud-hypervisor binary path
1. ensure build-static-clh.sh puts cloud-hypervisor under ./cloud-hypervisor directory
2. install cloud-hypervisor/cloud-hypervisor binary

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-10-10 20:10:03 +08:00
Peng Tao
78318c18f3 packaging: fix missing cloud_hypervisor_repo
It is needed in order to build from source.

Fixes: #916
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-10-10 15:47:41 +08:00
Bo Chen
86a864b8c3 packaging: Build from source if the clh release binary is missing
This patch add fall-back code path that builds cloud-hypervisor static
binary from source, when the downloading of cloud-hypervisor binary is
failing. This is useful when we experience network issues, and also
useful for upgrading clh to non-released version.

Together with the changes in the tests repo
(https://github.com/kata-containers/tests/pull/2862), the Jenkins config
file is also updated with new Execute shell script for the clh CI in the
kata-containers repo. Those two changes fix the regression on clh CI
here. Please check details in the issue below.

Fixes: #781
Fixes: https://github.com/kata-containers/tests/issues/2858

Signed-off-by: Bo Chen <chen.bo@intel.com>
2020-09-23 11:41:49 -07:00
Peng Tao
18d325edb0 packaging: fix cloud-hypervisor build
We should just download the official static build binary instead of
trying to build on our own.

Fixes: #760
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-09-18 23:00:07 +08:00
Peng Tao
782cd2ed10 packaging: merge packaging repository
git-subtree-dir: tools/packaging
git-subtree-mainline: f818b46a41
git-subtree-split: 1f22d72d5d

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-06-23 22:58:18 -07:00