Include container id in console log. 75/31775/3
authorDave Wallace <dwallacelf@gmail.com>
Thu, 25 Mar 2021 18:28:04 +0000 (14:28 -0400)
committerDave Wallace <dwallacelf@gmail.com>
Fri, 26 Mar 2021 20:02:23 +0000 (16:02 -0400)
- Output executor runtime attributes in
  post_build_deploy_archives.sh for the case
  when a job fails prior to setup_executor_env.sh

Change-Id: Icb54c039db21a621d44808221a3100c509583090
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
jjb/scripts/post_build_deploy_archives.sh
jjb/scripts/setup_executor_env.sh

index 0a47903..b7e7cec 100755 (executable)
@@ -19,6 +19,20 @@ set +e  # Do not affect the build result if some part of archiving fails.
 WS_ARCHIVES_DIR="$WORKSPACE/archives"
 BUILD_ENV_LOG="$WS_ARCHIVES_DIR/_build-enviroment-variables.log"
 
+# Output executor runtime attributes [again] in case the job fails prior to
+# running setup_executor_env.sh
+long_line="************************************************************************"
+OS_ID=$(grep '^ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g')
+OS_VERSION_ID=$(grep '^VERSION_ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g')
+OS_ARCH=$(uname -m)
+echo "$long_line"
+echo "Executor Runtime Attributes:"
+echo "OS: $OS_ID-$OS_VERSION_ID"
+echo "Arch: $OS_ARCH"
+echo "Nomad Hostname: $(grep search /etc/resolv.conf | cut -d' ' -f2 | head -1)"
+echo "Container ID: $(hostname)"
+echo "$long_line"
+
 # Generate gdb-command script to output vpp stack traceback from core files.
 gdb_cmdfile="/tmp/gdb-commands"
 cat >$gdb_cmdfile <<'__END__'
index f6b6480..d7e7cd2 100755 (executable)
@@ -26,10 +26,11 @@ long_line="*********************************************************************
 downloads_cache="/root/Downloads"
 
 echo "$long_line"
-echo "Executor OS: $OS_ID-$OS_VERSION_ID"
-echo "Executor Arch: $OS_ARCH"
-# TODO: fix this to print nomad server hostname
-echo "Executor hostname: $(grep search /etc/resolv.conf | cut -d' ' -f2 | head -1)"
+echo "Executor Runtime Attributes:"
+echo "OS: $OS_ID-$OS_VERSION_ID"
+echo "Arch: $OS_ARCH"
+echo "Nomad Hostname: $(grep search /etc/resolv.conf | cut -d' ' -f2 | head -1)"
+echo "Container ID: $(hostname)"
 
 echo "$long_line"
 if [ -f "$dockerfile" ] ; then