All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH OSSTEST v8 1/2] cr-publish-flight-logs: allow publishing only the Results
@ 2015-07-09 14:30 Ian Campbell
  2015-07-09 14:30 ` [PATCH OSSTEST v8 2/2] mg-all-branch-statuses: Show how up to date each branch is Ian Campbell
  2015-07-09 15:34 ` [PATCH OSSTEST v8 1/2] cr-publish-flight-logs: allow publishing only the Results Ian Jackson
  0 siblings, 2 replies; 5+ messages in thread
From: Ian Campbell @ 2015-07-09 14:30 UTC (permalink / raw)
  To: ian.jackson; +Cc: Ian Campbell, xen-devel

Removing the requirement that a flight be provided allows this to be
used to publish the results directory even in contexts which have no
flight.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
v7: New patch

v8: No need for a list of files, just allow to omit publishing flight.
    Therefore flight becomes optional.

    Renamed from : cr-publish-flight-logs: support publishing files from $HOME/public_html
---
 cr-publish-flight-logs | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/cr-publish-flight-logs b/cr-publish-flight-logs
index 94c74c8..8a19d88 100755
--- a/cr-publish-flight-logs
+++ b/cr-publish-flight-logs
@@ -31,10 +31,10 @@ if (@ARGV && $ARGV[0] eq '--push-harness') {
     $push_harness = 1;
 }
 
-die "usage: ./cr-publish-flight-logs <flight>" unless @ARGV==1;
+my $flight= shift @ARGV // '';
+die unless $flight =~ m/^\d*$/;
 
-my $flight= shift @ARGV;
-die unless $flight =~ m/^\d+$/;
+die "usage: ./cr-publish-flight-logs [flight]" unless @ARGV==0;
 
 open LOCK, "> $c{GlobalLockDir}/publish-lock" or die $!;
 flock LOCK, LOCK_EX or die $!;
@@ -59,5 +59,6 @@ sub copydir ($$) {
     $!=0; $?=0; system @cmd; die "rsync $? $!" if $? or $!;
 }
 
-copydir("$c{Logs}/$flight/", "$c{LogsPublish}/$flight") if $c{LogsPublish};
+copydir("$c{Logs}/$flight/", "$c{LogsPublish}/$flight")
+    if $flight && $c{LogsPublish};
 copydir("$c{Results}/", "$c{ResultsPublish}") if $c{ResultsPublish};
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH OSSTEST v8 2/2] mg-all-branch-statuses: Show how up to date each branch is
  2015-07-09 14:30 [PATCH OSSTEST v8 1/2] cr-publish-flight-logs: allow publishing only the Results Ian Campbell
@ 2015-07-09 14:30 ` Ian Campbell
  2015-07-09 15:35   ` Ian Jackson
  2015-07-13 11:41   ` Ian Campbell
  2015-07-09 15:34 ` [PATCH OSSTEST v8 1/2] cr-publish-flight-logs: allow publishing only the Results Ian Jackson
  1 sibling, 2 replies; 5+ messages in thread
From: Ian Campbell @ 2015-07-09 14:30 UTC (permalink / raw)
  To: ian.jackson; +Cc: Ian Campbell, xen-devel

Using report_find_push_age_info allows us to provide counts of
attempts since the last baseline on current tip as well as the first
attempt of each of those.

Since everything serialises on the repo lock I didn't bother trying to
parallelise anything.

It's a little terse to keep it in 80 chars.

cron infrastructure is added to run this in a new
$HOME/for-maintjobs.git on a daily basis and push the output to the
location given in the Publish config variable, if it is set (it is set
in production but not for cambridge).

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
v2: Use new report_find_push_age_info functionality, output condensed.

v3: - Correctly quote parameters to printf, so empty ones don't misalign the
      rest.
    - Drop dates in favour of number of days, and n/a in those cases
    - Print "Error!" if no tip is available and "UpToDate" if tip==basis.

v4: - Simplify $onevar, dropping $dflt, dropping export, subsuming
      $oneflightvar.
    - Right justify some stuff
    - s/UpToDate/same/
    - Simplify some pointless or complex shell conditionals

v5: - Add cron infrastructure

v6: - Propagate cron output to logs (untested apart from "bash -n" due
      to lack of local infra).

v7: - Use cr-publish-flight-logs.

v8: - Output to $c{Results}

time with an recently updates set of Repos says:

57.34user 28.28system 5:34.16elapsed 25%CPU (0avgtext+0avgdata 47256maxresident)k
100216inputs+600outputs (673major+2332436minor)pagefaults 0swaps

So it's not quick...

Example output:
Branch                       Basis    Tip      #Tip #Tot 1stTip     1stNew
libvirt                      d10a5f58 28540794    0   11   n/a          9 days
linux-3.0                    e1c63f9f 5dba9ddd    2    9     3 days   870 days
linux-3.10                   b3d78448 same
linux-3.14                   762167f9 same
linux-3.16                   26749e75 same
linux-3.18                   d048c068 ea5dd38e    5    5     3 days     3 days
linux-3.4                    bb4a05a0 cf1b3dad   17  163    12 days   213 days
linux-4.1                    b953c0d2 6a010c0a    0    0   n/a        n/a
linux-arm-xen                64972ceb same
linux-linus                  6aaf0da8 9bdc771f    0    1   n/a          1 day
linux-mingo-tip-master       d935d0f7 21316d69    0   16   n/a       1175 days
linux-next                            e58c2435    0  219   n/a        448 days
osstest                      15d2dd50 Error!      0    -   n/a        n/a
ovmf                         3735017c 0bb5d7a5    0    1   n/a          0 days
qemu-mainline                d2966f80 35360642    0    1   n/a          0 days
qemu-upstream-4.2-testing    d2382550 same
qemu-upstream-4.3-testing    efae5e0f same
qemu-upstream-4.4-testing    32226f42 same
qemu-upstream-4.5-testing    d9552b0a same
qemu-upstream-unstable       c4a962ec same
rumpuserxen                  30d72f3f 3b91e449   62  114    78 days   150 days
seabios                      f24eb2f8 6cfebb4e    0    0   n/a        n/a
xen-4.0-testing              2692df2a same
xen-4.1-testing              40feff87 same
xen-4.2-testing              38fcda22 same
xen-4.3-testing              e7c02297 same
xen-4.4-testing              6c1cb3db same
xen-4.5-testing              e3bd3cef same
xen-unstable                 c40317f1 9379af08    0    5   n/a          3 days
---
 cr-all-branch-statuses |  32 +++++++++++++
 crontab                |   1 +
 crontab-cambridge      |   1 +
 mg-all-branch-statuses | 120 +++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 154 insertions(+)
 create mode 100755 cr-all-branch-statuses
 create mode 100755 mg-all-branch-statuses

diff --git a/cr-all-branch-statuses b/cr-all-branch-statuses
new file mode 100755
index 0000000..f9885db
--- /dev/null
+++ b/cr-all-branch-statuses
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+# This is part of "osstest", an automated testing framework for Xen.
+# Copyright (C) 2015 Citrix Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+set -ex
+
+. cri-args-hostlists
+branch=$1; shift
+
+check_stop all-branch-statuses.
+
+results=`getconfig Results`
+
+abs=$results/all-branch-statuses.txt
+( date ; echo ; bash -x ./mg-all-branch-statuses ) > $abs.new
+mv $abs.new $abs
+
+./cr-publish-flight-logs
diff --git a/crontab b/crontab
index 5dc8675..436645b 100644
--- a/crontab
+++ b/crontab
@@ -7,4 +7,5 @@ MAILTO=ian.jackson@citrix.com,ian.campbell@eu.citrix.com
 18		4	* * *		cd testing.git && BRANCHES='linux-linus linux-mingo-tip-master linux-3.0 libvirt rumpuserxen' ./cr-for-branches branches -w "./cr-daily-branch --real"
 6-59/15   	*	* * *		cd testing.git && EXTRA_BRANCHES='linux-linus linux-3.0 rumpuserxen libvirt' ./cr-for-branches bisects -w "./cr-try-bisect --real"
 #8-59/5		*	* * *		cd bisects/adhoc.git &&	with-lock-ex -q data-tree-lock bash -c "./cr-try-bisect-adhoc; exit $?"
+22		8	* * *		cd testing.git && BRANCHES=maintjobs		./cr-for-branches . -w ./cr-all-branch-statuses ''
 3		4	* * *		savelog -c28 testing.git/tmp/cr-for-branches.log >/dev/null
diff --git a/crontab-cambridge b/crontab-cambridge
index 60bb4fd..2146311 100644
--- a/crontab-cambridge
+++ b/crontab-cambridge
@@ -2,4 +2,5 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
 MAILTO=ian.jackson@citrix.com,ian.campbell@eu.citrix.com
 # m            h       dom mon dow     command
 4-59/30        *       * * *           cd testing.git && BRANCHES=osstest              ./cr-for-branches branches -q "./cr-daily-branch --real"
+22		8	* * *		cd testing.git && BRANCHES=maintjobs		./cr-for-branches . -w ./cr-all-branch-statuses ''
 3              4       * * *           savelog -c28 testing.git/tmp/cr-for-branches.log >/dev/null
diff --git a/mg-all-branch-statuses b/mg-all-branch-statuses
new file mode 100755
index 0000000..8b86e3b
--- /dev/null
+++ b/mg-all-branch-statuses
@@ -0,0 +1,120 @@
+#!/bin/bash
+# -*- bash -*-
+#
+# Prints the status of each branch
+#
+# Usage:
+#    ./mg-all-branch-statuses [BRANCH....]
+#
+# If no BRANCHes specified, does all that are normally run by
+# cr-daily-branch or out of crontab.
+
+# This is part of "osstest", an automated testing framework for Xen.
+# Copyright (C) 2009-2014 Citrix Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+set -e
+
+. cri-common
+
+mkdir -p tmp
+
+if [ $# = 0 ]; then
+   set `./mg-list-all-branches`
+fi
+
+gather_info()
+{
+    local branch=$1; shift
+    local basis=$1;  shift
+    local tip=$1;    shift
+
+    select_xenbranch
+
+    local info=`perl -we '
+	use Osstest::Executive;
+	use Osstest;
+	use Data::Dumper;
+	open DEBUG, ">/dev/null" or die $!;
+	#open DEBUG, ">&STDERR" or die $!;
+	csreadconfig();
+	my ($branch,$tree,$basis,$tip) = @ARGV;
+	print DEBUG "branch=$branch tree=$tree basis=$basis tip=$tip\n";
+	my $info = report_find_push_age_info([qw(real adhoc play)],
+					      undef, [($branch)],
+					      $tree, $basis, $tip);
+	print DEBUG Dumper $info;
+	my $onevar = sub {
+		my ($var,$val) = @_;
+		$val //= "";
+		print uc($var)."=\"$val\";\n";
+	};
+	$onevar->($_, $info->{$_}//"-")
+		foreach qw(CountTip CountAfterBasis);
+	foreach my $flight (qw(Basis FirstAfterBasis FirstTip)) {
+		$onevar->("${flight}_${_}", $info->{$flight}{$_})
+			foreach qw(flight started);
+	}
+' "$branch" "$tree" "$basis" "$tip"`
+    eval $info
+}
+
+days_since() # Must output 10 characters
+{
+    then=$1 ; shift
+
+    if [ -z "$then" ] ; then
+	echo "  n/a     "
+	return
+    fi
+
+    local now=$(date +%s)
+    local days=$(( ($now - $then) / 86400 ))
+
+    if [ $days -eq 1 ] ; then
+	printf "%5d day " $days
+    else
+	printf "%5d days" $days
+    fi
+}
+
+printf "%-28s %-8s %-8s %-9s %-10s %-10s\n" \
+	"Branch" "Basis" "Tip" "#Tip #Tot" "1stTip" "1stNew"
+
+for branch in $@; do
+    basis=`./ap-fetch-version-old $branch 2>/dev/null || true`
+    tip=`./ap-fetch-version $branch 2>/dev/null || true`
+
+    gather_info "$branch" "$basis" "$tip"
+
+    basis=${basis:0:8}
+
+    tip=${tip:0:8}
+    : ${tip:=Error!}
+
+    printf "%-28s %-8s " "${branch}" "${basis}"
+
+    if [ x$basis != x$tip ] ; then
+	tipsince=$(days_since "$FIRSTTIP_STARTED")
+	newsince=$(days_since "$FIRSTAFTERBASIS_STARTED")
+
+	printf "%-8s  %3s  %3s %10s %10s" "${tip}" \
+	       "$COUNTTIP" "$COUNTAFTERBASIS" "$tipsince" "$newsince"
+    else
+	printf "same"
+    fi
+
+    printf "\n"
+done
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH OSSTEST v8 1/2] cr-publish-flight-logs: allow publishing only the Results
  2015-07-09 14:30 [PATCH OSSTEST v8 1/2] cr-publish-flight-logs: allow publishing only the Results Ian Campbell
  2015-07-09 14:30 ` [PATCH OSSTEST v8 2/2] mg-all-branch-statuses: Show how up to date each branch is Ian Campbell
@ 2015-07-09 15:34 ` Ian Jackson
  1 sibling, 0 replies; 5+ messages in thread
From: Ian Jackson @ 2015-07-09 15:34 UTC (permalink / raw)
  To: Ian Campbell; +Cc: xen-devel

Ian Campbell writes ("[PATCH OSSTEST v8 1/2] cr-publish-flight-logs: allow publishing only the Results"):
> Removing the requirement that a flight be provided allows this to be
> used to publish the results directory even in contexts which have no
> flight.

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH OSSTEST v8 2/2] mg-all-branch-statuses: Show how up to date each branch is
  2015-07-09 14:30 ` [PATCH OSSTEST v8 2/2] mg-all-branch-statuses: Show how up to date each branch is Ian Campbell
@ 2015-07-09 15:35   ` Ian Jackson
  2015-07-13 11:41   ` Ian Campbell
  1 sibling, 0 replies; 5+ messages in thread
From: Ian Jackson @ 2015-07-09 15:35 UTC (permalink / raw)
  To: Ian Campbell; +Cc: xen-devel

Ian Campbell writes ("[PATCH OSSTEST v8 2/2] mg-all-branch-statuses: Show how up to date each branch is"):
> Using report_find_push_age_info allows us to provide counts of
> attempts since the last baseline on current tip as well as the first
> attempt of each of those.
> 
> Since everything serialises on the repo lock I didn't bother trying to
> parallelise anything.

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH OSSTEST v8 2/2] mg-all-branch-statuses: Show how up to date each branch is
  2015-07-09 14:30 ` [PATCH OSSTEST v8 2/2] mg-all-branch-statuses: Show how up to date each branch is Ian Campbell
  2015-07-09 15:35   ` Ian Jackson
@ 2015-07-13 11:41   ` Ian Campbell
  1 sibling, 0 replies; 5+ messages in thread
From: Ian Campbell @ 2015-07-13 11:41 UTC (permalink / raw)
  To: ian.jackson; +Cc: xen-devel

On Thu, 2015-07-09 at 15:30 +0100, Ian Campbell wrote:
> Using report_find_push_age_info allows us to provide counts of
> attempts since the last baseline on current tip as well as the first
> attempt of each of those.
> 
> Since everything serialises on the repo lock I didn't bother trying to
> parallelise anything.
> 
> It's a little terse to keep it in 80 chars.
> 
> cron infrastructure is added to run this in a new
> $HOME/for-maintjobs.git on a daily basis and push the output to the
> location given in the Publish config variable, if it is set (it is set
> in production but not for cambridge).

This is now live at:
http://logs.test-lab.xenproject.org/osstest/results/all-branch-statuses.txt

It includes:
maintjobs                             Error!      0    -   n/a        n/a

I'm considering giving mg-all-branch-statuses a new optional argument
which if present will be a path to a directory which will be used to
filter the branches by checking that a for-$branch.git directory exists
there. cr-all-branch-statuses would pass $HOME/branches.

What do you think?

Ian.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-07-13 11:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-09 14:30 [PATCH OSSTEST v8 1/2] cr-publish-flight-logs: allow publishing only the Results Ian Campbell
2015-07-09 14:30 ` [PATCH OSSTEST v8 2/2] mg-all-branch-statuses: Show how up to date each branch is Ian Campbell
2015-07-09 15:35   ` Ian Jackson
2015-07-13 11:41   ` Ian Campbell
2015-07-09 15:34 ` [PATCH OSSTEST v8 1/2] cr-publish-flight-logs: allow publishing only the Results Ian Jackson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.