mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-24 14:32:33 +00:00
metrics: install kata and launch-times test
This PR installs kata static tarball on metrics runner and run launch-times tests. Fixes: #7049 Signed-off-by: David Esparza <david.esparza.borquez@intel.com>
This commit is contained in:
parent
d071a87c7b
commit
fad3ac9f58
4
.github/workflows/ci-on-push.yaml
vendored
4
.github/workflows/ci-on-push.yaml
vendored
@ -55,4 +55,6 @@ jobs:
|
|||||||
|
|
||||||
run-metrics-tests:
|
run-metrics-tests:
|
||||||
needs: build-kata-static-tarball-amd64
|
needs: build-kata-static-tarball-amd64
|
||||||
uses: ./.github/workflows/run-launchtimes-metrics.yaml
|
uses: ./.github/workflows/run-metrics.yaml
|
||||||
|
with:
|
||||||
|
tarball-suffix: -${{ github.event.pull_request.number}}-${{ github.event.pull_request.head.sha }}
|
||||||
|
19
.github/workflows/run-launchtimes-metrics.yaml
vendored
19
.github/workflows/run-launchtimes-metrics.yaml
vendored
@ -1,19 +0,0 @@
|
|||||||
name: CI | Run launch-times metrics
|
|
||||||
on:
|
|
||||||
workflow_call:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
launch-times-tests:
|
|
||||||
runs-on: metrics
|
|
||||||
env:
|
|
||||||
GOPATH: ${{ github.workspace }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
ref: ${{ github.event.pull_request.head.sha }}
|
|
||||||
|
|
||||||
- name: run launch times on qemu
|
|
||||||
run: bash tests/metrics/gha-run.sh run-test-launchtimes-qemu
|
|
||||||
|
|
||||||
- name: run launch times on clh
|
|
||||||
run: bash tests/metrics/gha-run.sh run-test-launchtimes-clh
|
|
33
.github/workflows/run-metrics.yaml
vendored
Normal file
33
.github/workflows/run-metrics.yaml
vendored
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
name: CI | Run test metrics
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
tarball-suffix:
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
run-metrics:
|
||||||
|
runs-on: metrics
|
||||||
|
env:
|
||||||
|
GOPATH: ${{ github.workspace }}
|
||||||
|
ARTIFACTS_DIR: kata-artifacts
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
|
||||||
|
- name: get-kata-tarball
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: kata-static-tarball-amd64${{ inputs.tarball-suffix }}
|
||||||
|
path: ${{ ARTIFACTS_DIR }}
|
||||||
|
|
||||||
|
- name: Install kata
|
||||||
|
run: bash tests/metrics/gha-run.sh install-kata ${{ ARTIFACTS_DIR }}
|
||||||
|
|
||||||
|
- name: run launch times on qemu
|
||||||
|
run: bash tests/metrics/gha-run.sh run-test-launchtimes-qemu
|
||||||
|
|
||||||
|
- name: run launch times on clh
|
||||||
|
run: bash tests/metrics/gha-run.sh run-test-launchtimes-clh
|
@ -9,13 +9,43 @@ set -o errexit
|
|||||||
set -o nounset
|
set -o nounset
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
|
kata_tarball_dir=${2:-kata-artifacts}
|
||||||
metrics_dir="$(dirname "$(readlink -f "$0")")"
|
metrics_dir="$(dirname "$(readlink -f "$0")")"
|
||||||
|
|
||||||
|
create_symbolic_links() {
|
||||||
|
hypervisor="${1:-qemu}"
|
||||||
|
local link_configuration_file="/opt/kata/share/defaults/kata-containers/configuration.toml"
|
||||||
|
local source_configuration_file="/opt/kata/share/defaults/kata-containers/configuration-${hypervisor}.toml"
|
||||||
|
|
||||||
|
if [ ${hypervisor} != 'qemu' ] && [ ${hypervisor} != 'clh' ]; then
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
sudo ln -sf "${source_configuration_file}" "${link_configuration_file}"
|
||||||
|
}
|
||||||
|
|
||||||
|
install_kata() {
|
||||||
|
local katadir="/opt/kata"
|
||||||
|
local destdir="/"
|
||||||
|
|
||||||
|
# Removing previous kata installation
|
||||||
|
sudo rm -rf "${katadir}"
|
||||||
|
|
||||||
|
pushd ${kata_tarball_dir}
|
||||||
|
for c in kata-static-*.tar.xz; do
|
||||||
|
echo "untarring tarball "${c}" into ${destdir}"
|
||||||
|
sudo tar -xvf "${c}" -C "${destdir}"
|
||||||
|
done
|
||||||
|
popd
|
||||||
|
}
|
||||||
|
|
||||||
function run_test_launchtimes() {
|
function run_test_launchtimes() {
|
||||||
hypervisor="${1}"
|
hypervisor="${1}"
|
||||||
|
|
||||||
echo "Running launchtimes tests: "
|
echo "Running launchtimes tests: "
|
||||||
|
|
||||||
|
create_symbolic_links "${hypervisor}"
|
||||||
|
|
||||||
if [ "${hypervisor}" = 'qemu' ]; then
|
if [ "${hypervisor}" = 'qemu' ]; then
|
||||||
echo "qemu"
|
echo "qemu"
|
||||||
elif [ "${hypervisor}" = 'clh' ]; then
|
elif [ "${hypervisor}" = 'clh' ]; then
|
||||||
@ -26,6 +56,7 @@ function run_test_launchtimes() {
|
|||||||
function main() {
|
function main() {
|
||||||
action="${1:-}"
|
action="${1:-}"
|
||||||
case "${action}" in
|
case "${action}" in
|
||||||
|
install-kata) install_kata ;;
|
||||||
run-test-launchtimes-qemu) run_test_launchtimes "qemu" ;;
|
run-test-launchtimes-qemu) run_test_launchtimes "qemu" ;;
|
||||||
run-test-launchtimes-clh) run_test_launchtimes "clh" ;;
|
run-test-launchtimes-clh) run_test_launchtimes "clh" ;;
|
||||||
*) >&2 echo "Invalid argument"; exit 2 ;;
|
*) >&2 echo "Invalid argument"; exit 2 ;;
|
||||||
|
Loading…
Reference in New Issue
Block a user