[Qa-jenkins-scm] [jenkins.debian.net] 01/02: reproducible: add new job, nodes_info, to collect environment variables from build nodes

Holger Levsen holger at moszumanska.debian.org
Wed Sep 9 13:39:16 UTC 2015


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch master
in repository jenkins.debian.net.

commit d59690bcecfdf97111b91b4fad8017b2b2efcf16
Author: Holger Levsen <holger at layer-acht.org>
Date:   Wed Sep 9 15:35:55 2015 +0200

    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(-)

diff --git a/bin/jenkins_node_wrapper.sh b/bin/jenkins_node_wrapper.sh
index cf2dd3b..054ea2a 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 41a4c63..e6d0bb5 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 0000000..6c6ab7e
--- /dev/null
+++ b/bin/reproducible_nodes_info.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+# Copyright © 2015 Holger Levsen <holger at layer-acht.org>
+# 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 64370e4..d241415 100644
--- a/job-cfg/reproducible.yaml
+++ b/job-cfg/reproducible.yaml
@@ -350,6 +350,10 @@
 
 - job-template:
     defaults: reproducible
+    name: '{name}_nodes_info'
+
+- job-template:
+    defaults: reproducible
     name: '{name}_json'
 
 - job-template:
@@ -740,6 +744,12 @@
             my_shell: '/srv/jenkins/bin/reproducible_create_meta_pkg_sets.sh'
             my_recipients: 'qa-jenkins-scm at 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 at 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 * * *'

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git



More information about the Qa-jenkins-scm mailing list