This repository has been archived by the owner on Jun 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 195
/
Copy pathinstall_kata.sh
executable file
·84 lines (72 loc) · 1.94 KB
/
install_kata.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/bin/bash
#
# Copyright (c) 2017-2020 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
set -o errexit
set -o nounset
set -o pipefail
cidir=$(dirname "$0")
tag="${1:-""}"
source /etc/os-release || source /usr/lib/os-release
source "${cidir}/lib.sh"
KATA_BUILD_KERNEL_TYPE="${KATA_BUILD_KERNEL_TYPE:-vanilla}"
KATA_BUILD_QEMU_TYPE="${KATA_BUILD_QEMU_TYPE:-vanilla}"
KATA_HYPERVISOR="${KATA_HYPERVISOR:-qemu}"
experimental_qemu="${experimental_qemu:-false}"
TEE_TYPE="${TEE_TYPE:-}"
arch=$("${cidir}"/kata-arch.sh -d)
if [ -n "${TEE_TYPE}" ]; then
echo "Install with TEE type: ${TEE_TYPE}"
fi
if [ "${TEE_TYPE:-}" == "tdx" ]; then
KATA_BUILD_KERNEL_TYPE="${KATA_BUILD_KERNEL_TYPE:-tdx}"
KATA_BUILD_QEMU_TYPE="${KATA_BUILD_QEMU_TYPE:-tdx}"
fi
if [ "${TEE_TYPE:-}" == "sev" ]; then
KATA_BUILD_KERNEL_TYPE=sev
fi
if [ "${KATA_HYPERVISOR:-}" == "dragonball" ]; then
KATA_BUILD_KERNEL_TYPE=dragonball
fi
echo "Install Kata Containers Image"
echo "rust image is default for Kata 2.0"
"${cidir}/install_kata_image.sh" "${tag}"
echo "Install Kata Containers Kernel"
"${cidir}/install_kata_kernel.sh" -t "${KATA_BUILD_KERNEL_TYPE}"
install_qemu(){
echo "Installing qemu"
if [ "$experimental_qemu" == "true" ]; then
echo "Install experimental Qemu"
"${cidir}/install_qemu_experimental.sh"
else
"${cidir}/install_qemu.sh" -t "${KATA_BUILD_QEMU_TYPE}"
fi
}
echo "Install runtime"
"${cidir}/install_runtime.sh" "${tag}"
case "${KATA_HYPERVISOR}" in
"cloud-hypervisor")
"${cidir}/install_cloud_hypervisor.sh"
echo "Installing virtiofsd"
"${cidir}/install_virtiofsd.sh"
;;
"firecracker")
"${cidir}/install_firecracker.sh"
;;
"qemu")
install_qemu
echo "Installing virtiofsd"
"${cidir}/install_virtiofsd.sh"
;;
"dragonball")
echo "Kata Hypervisor is dragonball"
;;
*)
die "${KATA_HYPERVISOR} not supported for CI install"
;;
esac
kata-runtime kata-env
echo "Kata config:"
cat $(kata-runtime kata-env --json | jq .Runtime.Config.Path -r)