summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFabricio Voznika <fvoznika@google.com>2019-10-01 13:49:35 -0700
committergVisor bot <gvisor-bot@google.com>2019-10-01 13:51:10 -0700
commit739f53fc17e3e3ed82dc2bc920f49fa91738a437 (patch)
treeccc8b681bd4a76a38e5c13f45ec1121be6bc1de9
parent103a3906b0ad8cfba7c2a534a7c3aeb22f8e58a8 (diff)
Add runsc logs to kokoro artifacts
PiperOrigin-RevId: 272286122
-rw-r--r--kokoro/docker_tests.cfg1
-rw-r--r--kokoro/hostnet_tests.cfg1
-rw-r--r--kokoro/kvm_tests.cfg1
-rw-r--r--kokoro/overlay_tests.cfg1
-rw-r--r--kokoro/root_tests.cfg1
-rwxr-xr-xscripts/common_bazel.sh11
6 files changed, 14 insertions, 2 deletions
diff --git a/kokoro/docker_tests.cfg b/kokoro/docker_tests.cfg
index 717d71dd3..0a0ef87ed 100644
--- a/kokoro/docker_tests.cfg
+++ b/kokoro/docker_tests.cfg
@@ -5,5 +5,6 @@ action {
regex: "**/sponge_log.xml"
regex: "**/sponge_log.log"
regex: "**/outputs.zip"
+ regex: "**/runsc_logs_*.tar.gz"
}
}
diff --git a/kokoro/hostnet_tests.cfg b/kokoro/hostnet_tests.cfg
index 532755f4a..520dc55a3 100644
--- a/kokoro/hostnet_tests.cfg
+++ b/kokoro/hostnet_tests.cfg
@@ -5,5 +5,6 @@ action {
regex: "**/sponge_log.xml"
regex: "**/sponge_log.log"
regex: "**/outputs.zip"
+ regex: "**/runsc_logs_*.tar.gz"
}
}
diff --git a/kokoro/kvm_tests.cfg b/kokoro/kvm_tests.cfg
index 54365c2b2..1feb60c8a 100644
--- a/kokoro/kvm_tests.cfg
+++ b/kokoro/kvm_tests.cfg
@@ -5,5 +5,6 @@ action {
regex: "**/sponge_log.xml"
regex: "**/sponge_log.log"
regex: "**/outputs.zip"
+ regex: "**/runsc_logs_*.tar.gz"
}
}
diff --git a/kokoro/overlay_tests.cfg b/kokoro/overlay_tests.cfg
index abd96f60c..6a2ddbd03 100644
--- a/kokoro/overlay_tests.cfg
+++ b/kokoro/overlay_tests.cfg
@@ -5,5 +5,6 @@ action {
regex: "**/sponge_log.xml"
regex: "**/sponge_log.log"
regex: "**/outputs.zip"
+ regex: "**/runsc_logs_*.tar.gz"
}
}
diff --git a/kokoro/root_tests.cfg b/kokoro/root_tests.cfg
index 20b97766a..28351695c 100644
--- a/kokoro/root_tests.cfg
+++ b/kokoro/root_tests.cfg
@@ -5,5 +5,6 @@ action {
regex: "**/sponge_log.xml"
regex: "**/sponge_log.log"
regex: "**/outputs.zip"
+ regex: "**/runsc_logs_*.tar.gz"
}
}
diff --git a/scripts/common_bazel.sh b/scripts/common_bazel.sh
index ea2291a4d..f8ec967b1 100755
--- a/scripts/common_bazel.sh
+++ b/scripts/common_bazel.sh
@@ -79,9 +79,16 @@ function collect_logs() {
# Collect sentry logs, if any.
if [[ -v RUNSC_LOGS_DIR ]] && [[ -d "${RUNSC_LOGS_DIR}" ]]; then
- local -r logs=$(ls "${RUNSC_LOGS_DIR}")
+ # Check if the directory is empty or not (only the first line it needed).
+ local -r logs=$(ls "${RUNSC_LOGS_DIR}" | head -n1)
if [[ "${logs}" ]]; then
- tar --create --gzip --file="${KOKORO_ARTIFACTS_DIR}/${RUNTIME}.tar.gz" -C "${RUNSC_LOGS_DIR}" .
+ local -r archive=runsc_logs_"${RUNTIME}".tar.gz
+ if [[ -v KOKORO_BUILD_ARTIFACTS_SUBDIR ]]; then
+ echo "runsc logs will be uploaded to:"
+ echo " gsutil cp gs://gvisor/logs/${KOKORO_BUILD_ARTIFACTS_SUBDIR}/${archive} /tmp"
+ echo " https://storage.cloud.google.com/gvisor/logs/${KOKORO_BUILD_ARTIFACTS_SUBDIR}/${archive}"
+ fi
+ tar --create --gzip --file="${KOKORO_ARTIFACTS_DIR}/${archive}" -C "${RUNSC_LOGS_DIR}" .
fi
fi
fi