From 04eced50ad766594d39a71e7b33b44ee3e9a66f6 Mon Sep 17 00:00:00 2001 From: "James O. D. Hunt" Date: Mon, 1 Jun 2020 10:30:59 +0100 Subject: [PATCH 1/6] runtime: Fix whitespace in collect script Remove extraneous whitespace from the `kata-collect-data.sh` script. Signed-off-by: James O. D. Hunt --- src/runtime/data/kata-collect-data.sh.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/runtime/data/kata-collect-data.sh.in b/src/runtime/data/kata-collect-data.sh.in index b6f003db31..f57e0d059c 100644 --- a/src/runtime/data/kata-collect-data.sh.in +++ b/src/runtime/data/kata-collect-data.sh.in @@ -184,7 +184,7 @@ show_runtime_configs() local configs config heading "Runtime config files" - + configs=$($runtime --@PROJECT_TYPE@-show-default-config-paths) if [ $? -ne 0 ]; then version=$($runtime --version|tr '\n' ' ') @@ -624,7 +624,7 @@ show_image_details() { local image local details - + image=$(get_image_file) heading "Image details" @@ -646,7 +646,7 @@ show_initrd_details() { local initrd local details - + initrd=$(get_initrd_file) heading "Initrd details" From e0148c9cb9a3e84e6b6940d60a82f6cffe6b5723 Mon Sep 17 00:00:00 2001 From: "James O. D. Hunt" Date: Mon, 1 Jun 2020 10:32:04 +0100 Subject: [PATCH 2/6] runtime: Fix legacy package regex in collect script The function that checks for legacy packages in the collect script was missing pipes denoting regex alternation. Signed-off-by: James O. D. Hunt --- src/runtime/data/kata-collect-data.sh.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/runtime/data/kata-collect-data.sh.in b/src/runtime/data/kata-collect-data.sh.in index f57e0d059c..2ab8ddb759 100644 --- a/src/runtime/data/kata-collect-data.sh.in +++ b/src/runtime/data/kata-collect-data.sh.in @@ -292,8 +292,8 @@ show_package_versions() # CC 2.x, 3.0 and runv runtimes. They shouldn't be installed but let's # check anyway. pattern+="cc-oci-runtime" - pattern+="cc-runtime" - pattern+="runv" + pattern+="|cc-runtime" + pattern+="|runv" # core components for project in @PROJECT_TYPE@ From 40a37aa5c6ca5feb84ab3d57aa540e0fd6676153 Mon Sep 17 00:00:00 2001 From: "James O. D. Hunt" Date: Tue, 9 Jun 2020 09:12:36 +0100 Subject: [PATCH 3/6] runtime: Re-order funcs in data collection script Ensure functions defined before calling them in the data collection script. Signed-off-by: James O. D. Hunt --- src/runtime/data/kata-collect-data.sh.in | 38 ++++++++++++------------ 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/runtime/data/kata-collect-data.sh.in b/src/runtime/data/kata-collect-data.sh.in index 2ab8ddb759..9886371c36 100644 --- a/src/runtime/data/kata-collect-data.sh.in +++ b/src/runtime/data/kata-collect-data.sh.in @@ -217,25 +217,6 @@ show_runtime_configs() separator } -show_log_details() -{ - heading "Logfiles" - - show_runtime_log_details - show_proxy_log_details - show_shim_log_details - show_throttler_log_details - - separator -} - -show_runtime_log_details() -{ - subheading "Runtime logs" - - find_system_journal_problems "runtime" "@RUNTIME_NAME@" "" -} - find_system_journal_problems() { local name="$1" @@ -268,6 +249,13 @@ show_proxy_log_details() find_system_journal_problems "proxy" "@PROJECT_TYPE@-proxy" "" } +show_runtime_log_details() +{ + subheading "Runtime logs" + + find_system_journal_problems "runtime" "@RUNTIME_NAME@" "" +} + show_shim_log_details() { subheading "Shim logs" @@ -282,6 +270,18 @@ show_throttler_log_details() find_system_journal_problems "throttler" "" "@PROJECT_TYPE@-ksm-throttler" } +show_log_details() +{ + heading "Logfiles" + + show_runtime_log_details + show_proxy_log_details + show_shim_log_details + show_throttler_log_details + + separator +} + show_package_versions() { heading "Packages" From ebbfa321ae132a02577240ab903d948c4646a267 Mon Sep 17 00:00:00 2001 From: "James O. D. Hunt" Date: Tue, 9 Jun 2020 09:14:54 +0100 Subject: [PATCH 4/6] runtime: Fix throttler log handling in collect script Fix a long-standing bug where the KSM throttler logs would not be collected by removing the last (unused) parameter to the `find_system_journal_problems()` function. Signed-off-by: James O. D. Hunt --- src/runtime/data/kata-collect-data.sh.in | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/runtime/data/kata-collect-data.sh.in b/src/runtime/data/kata-collect-data.sh.in index 9886371c36..03f709330d 100644 --- a/src/runtime/data/kata-collect-data.sh.in +++ b/src/runtime/data/kata-collect-data.sh.in @@ -221,7 +221,6 @@ find_system_journal_problems() { local name="$1" local program="$2" - local unit="$3" # select by identifier local selector="-t" @@ -246,28 +245,28 @@ show_proxy_log_details() { subheading "Proxy logs" - find_system_journal_problems "proxy" "@PROJECT_TYPE@-proxy" "" + find_system_journal_problems "proxy" "@PROJECT_TYPE@-proxy" } show_runtime_log_details() { subheading "Runtime logs" - find_system_journal_problems "runtime" "@RUNTIME_NAME@" "" + find_system_journal_problems "runtime" "@RUNTIME_NAME@" } show_shim_log_details() { subheading "Shim logs" - find_system_journal_problems "shim" "@PROJECT_TYPE@-shim" "" + find_system_journal_problems "shim" "@PROJECT_TYPE@-shim" } show_throttler_log_details() { subheading "Throttler logs" - find_system_journal_problems "throttler" "" "@PROJECT_TYPE@-ksm-throttler" + find_system_journal_problems "throttler" "@PROJECT_TYPE@-ksm-throttler" } show_log_details() From ca8acf58954ffc5af59c2397b307bc98fab7ecfe Mon Sep 17 00:00:00 2001 From: "James O. D. Hunt" Date: Mon, 1 Jun 2020 10:34:32 +0100 Subject: [PATCH 5/6] runtime: Add podman to data collection script Updated `kata-collect-data.sh` to gather basic podman details. Fixes: #243. Signed-off-by: James O. D. Hunt --- src/runtime/data/kata-collect-data.sh.in | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/runtime/data/kata-collect-data.sh.in b/src/runtime/data/kata-collect-data.sh.in index 03f709330d..56f261c3aa 100644 --- a/src/runtime/data/kata-collect-data.sh.in +++ b/src/runtime/data/kata-collect-data.sh.in @@ -356,6 +356,11 @@ show_container_mgr_details() run_cmd_and_show_quoted_output "" "cat /etc/containerd/config.toml" fi + if have_cmd "podman"; then + subheading "podman" + run_cmd_and_show_quoted_output "" "podman --version" + fi + separator } From b165e2a43749254503ef3401640343ad32d9a605 Mon Sep 17 00:00:00 2001 From: "James O. D. Hunt" Date: Tue, 9 Jun 2020 09:18:03 +0100 Subject: [PATCH 6/6] runtime: Add containerd shim v2 to collect script Capture log output from the Kata containerd shim v2. Signed-off-by: James O. D. Hunt --- src/runtime/data/kata-collect-data.sh.in | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/runtime/data/kata-collect-data.sh.in b/src/runtime/data/kata-collect-data.sh.in index 56f261c3aa..78969bc5c2 100644 --- a/src/runtime/data/kata-collect-data.sh.in +++ b/src/runtime/data/kata-collect-data.sh.in @@ -241,6 +241,14 @@ find_system_journal_problems() fi } +show_containerd_shimv2_log_details() +{ + local name="Kata Containerd Shim v2" + subheading "$name logs" + + find_system_journal_problems "$name" "kata" +} + show_proxy_log_details() { subheading "Proxy logs" @@ -277,6 +285,7 @@ show_log_details() show_proxy_log_details show_shim_log_details show_throttler_log_details + show_containerd_shimv2_log_details separator }