diff --git a/.github/workflows/run-metrics.yaml b/.github/workflows/run-metrics.yaml index d8b8c3976c..4be83d83ff 100644 --- a/.github/workflows/run-metrics.yaml +++ b/.github/workflows/run-metrics.yaml @@ -42,3 +42,14 @@ jobs: - name: run blogbench test run: bash tests/metrics/gha-run.sh run-test-blogbench + + - name: make metrics tarball ${{ matrix.vmm }} + run: bash tests/metrics/gha-run.sh make-tarball-results + + - name: archive metrics results ${{ matrix.vmm }} + uses: actions/upload-artifact@v3 + with: + name: metrics-artifacts-${{ matrix.vmm }} + path: results-${{ matrix.vmm }}.tar.gz + retention-days: 1 + if-no-files-found: error diff --git a/tests/common.bash b/tests/common.bash index d4aa446848..090bd7fd9c 100644 --- a/tests/common.bash +++ b/tests/common.bash @@ -240,3 +240,17 @@ restart_containerd_service() { clean_env_ctr return 0 } + +# @path_results: path to the input metric-results folder +# @tarball_fname: path and filename to the output tarball +function compress_metrics_results_dir() +{ + local path_results="${1:-results}" + local tarball_fname="${2:-}" + + [ -z "${tarball_fname}" ] && die "Missing the tarball filename or the path to save the tarball results is incorrect." + [ ! -d "${path_results}" ] && die "Missing path to the results folder." + + cd "${path_results}" && tar -czf "${tarball_fname}" *.json && cd - + info "tarball generated: ${tarball_fname}" +} diff --git a/tests/metrics/gha-run.sh b/tests/metrics/gha-run.sh index 1671c5624c..8a05826b49 100755 --- a/tests/metrics/gha-run.sh +++ b/tests/metrics/gha-run.sh @@ -12,6 +12,7 @@ set -o pipefail kata_tarball_dir="${2:-kata-artifacts}" metrics_dir="$(dirname "$(readlink -f "$0")")" source "${metrics_dir}/../common.bash" +source "${metrics_dir}/lib/common.bash" declare -r results_dir="${metrics_dir}/results" declare -r checkmetrics_dir="${metrics_dir}/cmd/checkmetrics" @@ -104,6 +105,10 @@ function check_metrics() { fi } +function make_tarball_results() { + compress_metrics_results_dir "${metrics_dir}/results" "${GITHUB_WORKSPACE}/results-${KATA_HYPERVISOR}.tar.gz" +} + function run_test_launchtimes() { info "Running Launch Time test using ${KATA_HYPERVISOR} hypervisor" @@ -144,6 +149,7 @@ function main() { action="${1:-}" case "${action}" in install-kata) install_kata ;; + make-tarball-results) make_tarball_results ;; run-test-launchtimes) run_test_launchtimes ;; run-test-memory-usage) run_test_memory_usage ;; run-test-memory-usage-inside-container) run_test_memory_usage_inside_container ;;