Use fdio-infra-publish for nomad executor based jobs 12/31912/3
authorDave Wallace <dwallacelf@gmail.com>
Tue, 6 Apr 2021 21:08:21 +0000 (17:08 -0400)
committerDave Wallace <dwallacelf@gmail.com>
Thu, 8 Apr 2021 19:25:26 +0000 (15:25 -0400)
- Separate post build executor info dump into its
  own script file.
- Remove backup_upload_archives.sh from
  fdio-infra-shiplogs which is now only used for
  openstack executors.
- Add setup_executor_env.sh to run first for all
  jobs which run on nomad/dockerhub images.

Change-Id: I564201b8c578e6541152e6af74537d1d007ba1a7
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
13 files changed:
jjb/ci-management/packagecloud-repo-cleanup.yaml
jjb/cicn/cicn.yaml
jjb/csit/csit-perf.yaml
jjb/csit/csit-tox.yaml
jjb/csit/csit-vpp-device.yaml
jjb/csit/csit.yaml
jjb/global-macros.yaml
jjb/hicn/hicn-docs.yaml
jjb/hicn/hicn.yaml
jjb/scripts/post_build_deploy_archives.sh
jjb/scripts/post_build_executor_info.sh [new file with mode: 0755]
jjb/vpp/docs.yaml
jjb/vpp/vpp.yaml

index 7b8dae4..517c2cc 100644 (file)
           files:
             - file-id: 'packagecloud_api'
               target: '/root/packagecloud_api'
+      - shell:
+          !include-raw-escape:
+          - ../scripts/setup_executor_env.sh
       - shell:
           !include-raw-escape:
           - package-list.sh
           - packagecloud-repo-cleanup.sh
 
     publishers:
-      - fdio-infra-shiplogs:
-          maven-version: 'mvn36'
+      - fdio-infra-publish
 
 - job-template:
     name: 'packagecloud-repo-cleanup-hicn-{os}-{executor-arch}'
           files:
             - file-id: 'packagecloud_api'
               target: '/root/packagecloud_api'
+      - shell:
+          !include-raw-escape:
+          - ../scripts/setup_executor_env.sh
       - shell:
           !include-raw-escape:
           - package-list.sh
           - packagecloud-repo-cleanup.sh
 
     publishers:
-      - fdio-infra-shiplogs:
-          maven-version: 'mvn36'
+      - fdio-infra-publish
index ff296d1..24b1c32 100644 (file)
           settings-type: cfp
           global-settings: "global-settings"
           global-settings-type: cfp
+      - shell: !include-raw-escape:
+          - ../scripts/setup_executor_env.sh
       - shell: !include-raw-escape:
           - include-raw-cicn-libparc-build.sh
       - provide-maven-settings:
           branch: "{branch}"
 
     builders:
+      - shell: !include-raw-escape:
+          - ../scripts/setup_executor_env.sh
       - shell: !include-raw-escape:
           - include-raw-cicn-libparc-build.sh
 
           settings-type: cfp
           global-settings: "global-settings"
           global-settings-type: cfp
+      - shell: !include-raw-escape:
+          - ../scripts/setup_executor_env.sh
       - shell: !include-raw-escape:
           - include-raw-cicn-viper-build.sh
       - provide-maven-settings:
           branch: "{branch}"
 
     builders:
+      - shell: !include-raw-escape:
+          - ../scripts/setup_executor_env.sh
       - shell: !include-raw-escape:
           - include-raw-cicn-viper-build.sh
 
index 1c44e89..d8e8418 100644 (file)
           other-files:
             - '*.*'
 
-      - fdio-infra-shiplogs:
-          maven-version: 'mvn33-new'
+      - fdio-infra-publish
 
 - job-template:
     name: 'csit-vpp-perf-mrr-daily-master{node-arch}'
           other-files:
             - '*.*'
 
-      - fdio-infra-shiplogs:
-          maven-version: 'mvn33-new'
+      - fdio-infra-publish
 
 - job-template:
     name: 'csit-vpp-perf-mrr-weekly-{stream}-{node-arch}'
           other-files:
             - '*.*'
 
-      - fdio-infra-shiplogs:
-          maven-version: 'mvn33-new'
+      - fdio-infra-publish
 
 - job-template:
     name: 'csit-vpp-perf-ndrpdr-weekly-master-{node-arch}'
           other-files:
             - '*.*'
 
-      - fdio-infra-shiplogs:
-          maven-version: 'mvn33-new'
+      - fdio-infra-publish
 
 - job-template:
     name: 'csit-dpdk-perf-verify-{stream}-{node-arch}'
           other-files:
             - '*.*'
 
-      - fdio-infra-shiplogs:
-          maven-version: 'mvn33-new'
+      - fdio-infra-publish
 
 - job-template:
     name: 'csit-dpdk-perf-mrr-weekly-master{node-arch}'
           other-files:
             - '*.*'
 
-      - fdio-infra-shiplogs:
-          maven-version: 'mvn33-new'
+      - fdio-infra-publish
 
 - job-template:
     name: 'csit-vpp-perf-report-iterative-{stream_report}-{node-arch}'
           other-files:
             - '*.*'
 
-      - fdio-infra-shiplogs:
-          maven-version: 'mvn33-new'
+      - fdio-infra-publish
 
 - job-template:
     name: 'csit-dpdk-perf-report-iterative-{stream_report}-{node-arch}'
           other-files:
             - '*.*'
 
-      - fdio-infra-shiplogs:
-          maven-version: 'mvn33-new'
+      - fdio-infra-publish
 
 - job-template:
     name: 'csit-vpp-perf-report-coverage-{stream_report}-{node-arch}'
           other-files:
             - '*.*'
 
-      - fdio-infra-shiplogs:
-          maven-version: 'mvn33-new'
+      - fdio-infra-publish
 
 - job-template:
     name: 'csit-dpdk-perf-report-coverage-{stream_report}-{node-arch}'
           other-files:
             - '*.*'
 
-      - fdio-infra-shiplogs:
-          maven-version: 'mvn33-new'
+      - fdio-infra-publish
index f5f7b2b..cd1b855 100644 (file)
             max: 250
             unstable: 250
             pattern: 'pylint.log'
-      - fdio-infra-shiplogs:
-          maven-version: 'mvn33-new'
+      - fdio-infra-publish
index fae559d..99c1659 100644 (file)
           output-path: 'archives'
           other-files:
             - '*.*'
-      - fdio-infra-shiplogs:
-          maven-version: 'mvn33-new'
+      - fdio-infra-publish
 
 - job-template:
     name: 'csit-vpp-device-{stream}-{os}-{executor-arch}-{node-arch}-semiweekly'
           output-path: 'archives'
           other-files:
             - '*.*'
-      - fdio-infra-shiplogs:
-          maven-version: 'mvn33-new'
+      - fdio-infra-publish
 
 - job-template:
     name: 'csit-vpp-device-{stream}-{os}-{executor-arch}-{node-arch}-weekly'
           output-path: 'archives'
           other-files:
             - '*.*'
-      - fdio-infra-shiplogs:
-          maven-version: 'mvn33-new'
+      - fdio-infra-publish
index 75da7df..ea2d550 100644 (file)
           - ../scripts/csit/docs.sh
 
     publishers:
-      - fdio-infra-shiplogs:
-          maven-version: 'mvn33-new'
+      - fdio-infra-publish
 
 - job-template:
     name: 'csit-report-merge-{stream}-{os}-{executor-arch}'
           - ../scripts/csit/report.sh
 
     publishers:
-      - fdio-infra-shiplogs:
-          maven-version: 'mvn33-new'
+      - fdio-infra-publish
 
 - job-template:
     name: 'csit-trending-daily-master-{os}-{executor-arch}'
           always: true
           failure: false
 
-      - fdio-infra-shiplogs:
-          maven-version: 'mvn33-new'
+      - fdio-infra-publish
 
 - job-template:
     name: 'csit-trending-weekly-2009-lts-{os}-{executor-arch}'
           always: true
           failure: false
 
-      - fdio-infra-shiplogs:
-          maven-version: 'mvn33-new'
+      - fdio-infra-publish
 
 - project:
     name: csit-info
index 1146607..42ed907 100644 (file)
                 - SUCCESS
                 - UNSTABLE
               build-steps:
+                - shell: !include-raw: scripts/post_build_executor_info.sh
                 - shell: !include-raw: scripts/post_build_deploy_archives.sh
                 - shell: !include-raw: scripts/backup_upload_archives.sh
                 - fdio-infra-ship-logs
                 - UNSTABLE
               build-steps:
                 - shell: !include-raw: include-raw-deploy-archives.sh
-                - shell: !include-raw: scripts/backup_upload_archives.sh
                 - maven-target:
                     maven-version: '{maven-version}'
                     pom: '.archives/deploy-archives.xml'
index 24810be..5d748ed 100644 (file)
       - provide-maven-settings:
           settings-file: "hicn-settings"
           global-settings-file: "global-settings"
+      - shell: !include-raw-escape: ../scripts/setup_executor_env.sh
       - shell: !include-raw-escape: include-raw-hicn-docs.sh
 
     publishers:
-      - fdio-infra-shiplogs:
-          maven-version: "mvn36"
+      - fdio-infra-publish
       - naginator:
           rerun-unstable-builds: false
           max-failed-builds: 1
       - provide-maven-settings:
           settings-file: "hicn-settings"
           global-settings-file: "global-settings"
+      - shell: !include-raw-escape: ../scripts/setup_executor_env.sh
       - shell: !include-raw-escape: include-raw-hicn-docs.sh
 
     publishers:
-      - fdio-infra-shiplogs:
-          maven-version: "mvn36"
+      - fdio-infra-publish
       - naginator:
           rerun-unstable-builds: false
           max-failed-builds: 1
index 15f66ac..c3bc910 100644 (file)
 
     builders:
       - shell: !include-raw-escape:
-            include-raw-hicn-checkstyle.sh
+          - ../scripts/setup_executor_env.sh
+      - shell: !include-raw-escape:
+          - include-raw-hicn-checkstyle.sh
 
     publishers:
       - fdio-infra-publish
           branch: "{branch}"
 
     builders:
+      - shell: !include-raw-escape:
+          - ../scripts/setup_executor_env.sh
       - shell: !include-raw-escape:
           - include-raw-hicn-build.sh
 
           settings-type: cfp
           global-settings: "global-settings"
           global-settings-type: cfp
+      - shell: !include-raw-escape:
+          - ../scripts/setup_executor_env.sh
       - shell: !include-raw-escape:
           - include-raw-hicn-checkstyle.sh
       - shell: !include-raw-escape:
                   branch-pattern: "**/{branch}"
 
     builders:
+      - shell: !include-raw-escape:
+          - ../scripts/setup_executor_env.sh
       - shell: !include-raw-escape:
           - include-raw-hicn-extras-build.sh
 
           settings-type: cfp
           global-settings: "global-settings"
           global-settings-type: cfp
+      - shell: !include-raw-escape:
+          - ../scripts/setup_executor_env.sh
       - shell: !include-raw-escape:
           - include-raw-hicn-extras-build.sh
       - provide-maven-settings:
index b7e7cec..79fa05a 100755 (executable)
@@ -19,20 +19,6 @@ 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__'
@@ -83,21 +69,17 @@ generate_vpp_stacktrace_and_delete_core() {
     fi
 }
 
-# Delete existing archives dir to ensure current artifact upload
-rm -rf "$WS_ARCHIVES_DIR"
 mkdir -p "$WS_ARCHIVES_DIR"
 
 # Log the build environment variables
 echo "Logging build environment variables in '$BUILD_ENV_LOG'..."
 env > $BUILD_ENV_LOG
 
-echo "WS_ARCHIVE_ARTIFACTS = '$WS_ARCHIVE_ARTIFACTS'"
-if [ -n "${WS_ARCHIVE_ARTIFACTS}" ]; then
+echo "ARCHIVE_ARTIFACTS = '$ARCHIVE_ARTIFACTS'"
+if [ -n "${ARCHIVE_ARTIFACTS:-}" ] ; then
     pushd $WORKSPACE
     shopt -s globstar  # Enable globstar to copy archives
-    archive_artifacts=$(echo ${WS_ARCHIVE_ARTIFACTS})
-    shopt -u globstar  # Disable globstar
-    for file in $archive_artifacts; do
+    for file in $ARCHIVE_ARTIFACTS ; do
         if [ -f "$file" ] ; then
             fname="$(basename $file)"
             # Decompress core.gz file
@@ -121,11 +103,15 @@ if [ -n "${WS_ARCHIVE_ARTIFACTS}" ]; then
             echo "Archiving '$file' to '$destfile'"
             destdir="$(dirname $destfile)"
             mkdir -p $destdir
-            mv $file $destfile
+            mv -f $file $destfile
         else
             echo "Not archiving '$file'"
+            if ! grep -qe '*' <<<"$file" ; then
+                echo "WARNING: No artifacts detected in ARCHIVE_ARTIFACTS '$ARCHIVE_ARTIFACTS'!"
+            fi
         fi
     done
+    shopt -u globstar  # Disable globstar
     popd
 fi
 
diff --git a/jjb/scripts/post_build_executor_info.sh b/jjb/scripts/post_build_executor_info.sh
new file mode 100755 (executable)
index 0000000..f361900
--- /dev/null
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+# Copyright (c) 2021 Cisco and/or its affiliates.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at:
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+echo "---> jjb/scripts/post_build_executor_info.sh"
+
+# 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)"
+
+if [ -n "$(which ccache)" ] ; then
+    echo "$long_line"
+    [ -n "${CCACHE_DISABLE:-}" ] && echo "CCACHE_DISABLE = '$CCACHE_DISABLE'"
+    [ -n "${CCACHE_DIR:-}" ] && echo "CCACHE_DIR = '$CCACHE_DIR'"
+    echo "ccache statistics:"
+    ccache -s
+fi
+
+echo "$long_line"
index e5337b7..eac0bc4 100644 (file)
           - ../scripts/vpp/docs.sh
 
     publishers:
-      - fdio-infra-shiplogs:
-          maven-version: 'mvn36'
+      - fdio-infra-publish
 
 - job-template:
     name: 'vpp-docs-merge-{stream}-{os}-{executor-arch}'
           - ../scripts/vpp/docs.sh
 
     publishers:
-      - fdio-infra-shiplogs:
-          maven-version: 'mvn36'
+      - fdio-infra-publish
 
 - job-template:
     name: 'vpp-sphinx-docs-verify-{stream}-{os}-{executor-arch}'
           - ../scripts/vpp/sphinx-docs.sh
 
     publishers:
-      - fdio-infra-shiplogs:
-          maven-version: 'mvn36'
+      - fdio-infra-publish
 
 - job-template:
     name: 'vpp-sphinx-docs-merge-{stream}-{os}-{executor-arch}'
           - ../scripts/vpp/sphinx-docs.sh
 
     publishers:
-      - fdio-infra-shiplogs:
-          maven-version: 'mvn36'
+      - fdio-infra-publish
 
 - job-template:
     name: 'vpp-make-test-docs-verify-{stream}-{os}-{executor-arch}'
           - ../scripts/vpp/make-test-docs.sh
 
     publishers:
-      - fdio-infra-shiplogs:
-          maven-version: 'mvn36'
+      - fdio-infra-publish
 
 - job-template:
     name: 'vpp-make-test-docs-merge-{stream}-{os}-{executor-arch}'
           - ../scripts/vpp/make-test-docs.sh
 
     publishers:
-      - fdio-infra-shiplogs:
-          maven-version: 'mvn36'
+      - fdio-infra-publish
index 8031d42..2f015d4 100644 (file)
       - robot-report:
           output-path: 'archives'
 
-      - fdio-infra-shiplogs:
-          maven-version: 'mvn36'
+      - fdio-infra-publish
 # [end] VPP-CSIT-VERIFY-DEVICE-PERIODIC JOB TEMPLATE
 
 # VPP-CSIT-VERIFY-DEVICE-PERPATCH JOB TEMPLATE
       - robot-report:
           output-path: 'archives'
 
-      - fdio-infra-shiplogs:
-          maven-version: 'mvn36'
+      - fdio-infra-publish
 # [end] VPP-CSIT-VERIFY-DEVICE-PERPATCH JOB TEMPLATE
 
 # VPP-CSIT-VERIFY-PERF JOB TEMPLATE
       - robot-report:
           output-path: 'csit_current/0/'
 
-      - fdio-infra-shiplogs:
-          maven-version: 'mvn36'
+      - fdio-infra-publish
 # [end] VPP-CSIT-VERIFY-PERF JOB TEMPLATE
 
 # VPP-CSIT-VERIFY-API-CRC JOB TEMPLATE
       # TODO: Add sending e-mail notifications to vpp-api-dev@lists.fd.io
 
     publishers:
-      - fdio-infra-shiplogs:
-          maven-version: 'mvn36'
+      - fdio-infra-publish
 # [end] VPP-CSIT-VERIFY-API-CRC JOB TEMPLATE
 # [end] JOB TEMPLATE DEFINITIONS