From d59690bcecfdf97111b91b4fad8017b2b2efcf16 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Wed, 9 Sep 2015 15:35:55 +0200 Subject: reproducible: add new job, nodes_info, to collect environment variables from build nodes --- bin/jenkins_node_wrapper.sh | 4 ++-- bin/reproducible_info.sh | 4 +--- bin/reproducible_nodes_info.sh | 32 ++++++++++++++++++++++++++++++++ job-cfg/reproducible.yaml | 10 ++++++++++ 4 files changed, 45 insertions(+), 5 deletions(-) create mode 100755 bin/reproducible_nodes_info.sh diff --git a/bin/jenkins_node_wrapper.sh b/bin/jenkins_node_wrapper.sh index cf2dd3b4..054ea2a3 100755 --- a/bin/jenkins_node_wrapper.sh +++ b/bin/jenkins_node_wrapper.sh @@ -56,8 +56,6 @@ fi set "dummy" ${SSH_ORIGINAL_COMMAND} shift -info "remote_host called with $*" - allowed_cmds=() if [[ "$*" =~ /bin/nc\ localhost\ 4949 ]] ; then @@ -67,6 +65,8 @@ elif [[ "$*" =~ rebootstrap_.* ]] ; then REBOOTSTRAPSH="/srv/jenkins/bin/rebootstrap.sh $@" export LC_ALL=C exec $REBOOTSTRAPSH; croak "Exec failed"; +elif [ "$1" = "/srv/jenkins/bin/reproducible_info" ] ; then + exec /srv/jenkins/bin/reproducible_info.sh "$2" ; croak "Exec failed"; elif [ "$1" = "/srv/jenkins/bin/reproducible_build.sh" ] && ( [ "$2" = "1" ] || [ "$2" = "2" ] ) ; then exec /srv/jenkins/bin/reproducible_build.sh "$2" "$3" "$4" "$5" ; croak "Exec failed"; elif [[ "$*" =~ rsync\ --server\ --sender\ .*\ .\ /srv/reproducible-results/tmp.* ]] ; then diff --git a/bin/reproducible_info.sh b/bin/reproducible_info.sh index 41a4c630..e6d0bb54 100755 --- a/bin/reproducible_info.sh +++ b/bin/reproducible_info.sh @@ -11,7 +11,5 @@ CPU_MODEL=$(cat /proc/cpuinfo |grep "model name"|head -1|cut -d ":" -f2|xargs ec DATETIME=$(date +'%Y-%m-%d %H:%M %Z') for i in ARCH NUM_CPU CPU_MODEL DATETIME ; do - if [ "$1" = "$i" ] ; then - echo "${!i}" - fi + echo "$i=${!i}" done diff --git a/bin/reproducible_nodes_info.sh b/bin/reproducible_nodes_info.sh new file mode 100755 index 00000000..6c6ab7ed --- /dev/null +++ b/bin/reproducible_nodes_info.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +# Copyright © 2015 Holger Levsen +# released under the GPLv=2 + +DEBUG=false +. /srv/jenkins/bin/common-functions.sh +common_init "$@" + +# common code defining db access +. /srv/jenkins/bin/reproducible_common.sh + +TARGET_DIR=/srv/reproducible-results/node-information/ +mkdir -p $TARGET_DIR +TMPFILE_SRC=$(mktemp) +TMPFILE_NODE=$(mktemp) + +for NODE in bpi0-armhf-rb.debian.net hb0-armhf-rb.debian.net wbq0-armhf-rb.debian.net cbxi4pro0-armhf-rb.debian.net profitbricks-build1-amd64.debian.net profitbricks-build2-amd64.debian.net ; do + # call jenkins_master_wrapper.sh so we only need to track different ssh ports in one place... + /srv/jenkins/bin/jenkins_master_wrapper.sh $NODE dummy-job /srv/jenkins/bin/reproducible_info.sh > $TMPFILE_SRC + for KEY in ARCH NUM_CPU CPU_MODEL DATETIME ; do + VALUE=$(egrep "^$KEY=" $TMPFILE_SRC | cut -d "=" -f2-) + if [ ! -z "$VALUE" ] ; then + echo "$KEY=$VALUE" >> $TMPFILE_NODE + fi + done + if [ -s $TMPFILE_NODE ] ; then + mv $TMPFILE_NODE $TARGET_DIR/$NODE + fi + rm -f $TMPFILE_SRC $TMPFILE_NODE +done + diff --git a/job-cfg/reproducible.yaml b/job-cfg/reproducible.yaml index 64370e42..d241415d 100644 --- a/job-cfg/reproducible.yaml +++ b/job-cfg/reproducible.yaml @@ -348,6 +348,10 @@ defaults: reproducible name: '{name}_create_meta_pkg_sets' +- job-template: + defaults: reproducible + name: '{name}_nodes_info' + - job-template: defaults: reproducible name: '{name}_json' @@ -740,6 +744,12 @@ my_shell: '/srv/jenkins/bin/reproducible_create_meta_pkg_sets.sh' my_recipients: 'qa-jenkins-scm@lists.alioth.debian.org' my_node: '' + - '{name}_nodes_info': + my_description: 'Collect various information from build nodes used for reproducible builds.' + my_timed: '37 13 * * *' + my_shell: '/srv/jenkins/bin/reproducible_nodes_info.sh' + my_recipients: 'qa-jenkins-scm@lists.alioth.debian.org' + my_node: '' - '{name}_breakages': my_description: 'Generate an HTML page with CI issues (packages with incoherent status or files that should or should not be there).' my_timed: '30 0 * * *' -- cgit v1.2.3-70-g09d2