xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Ian Campbell <ian.campbell@citrix.com>
To: ian.jackson@eu.citrix.com, xen-devel@lists.xen.org
Cc: Ian Campbell <ian.campbell@citrix.com>
Subject: [PATCH OSSTEST] Tollerate outages of git://git.sv.gnu.org/gnulib.git
Date: Tue, 20 May 2014 11:54:36 +0100	[thread overview]
Message-ID: <1400583276-6873-1-git-send-email-ian.campbell@citrix.com> (raw)

gnulib is a bit special in that it isn't part of a push gate and therefore
doesn't have an output repo on xenbits. This means that if git.sv.gnu.org is
down for some reason then any flight which uses it will potentially fail, even
ones which are not specifically trying to test gnulib.git. Normally unrelated
flights are isolated from 3rd party failures because they use the relevant push
gates' outputs.

The git-proxy which we use supports passing [fetch=try] as an option which will
cause it to try and fetch from upstream and fall back to the cached version if
upstream does not respond. This is exactly what we want for gnulib.git. Proxy
options in the URL are separate with a space which we encode here as %20 to
avoid having to go around adding quotes to all the uses of shell variables
which contain a URL.

Provide a helper shell function cached_repo which conditionally arranges for
the given repo to be cached with the given options only if the osstest config
sets GitCacheProxy, so as not to break uses of osstest outside of the
production environment where a cache may not be available (of course such uses
will then be subject to outages of 3rd party repos)

It was also necessary to make repo_tree_rev_fetch_git idempotent WRT the proxy
prefix to avoid trying to clone
git://proxy/git://proxy/git://some.real.domain/foo.git.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 README.dev |  6 +++++-
 ap-common  |  2 +-
 cri-common | 17 ++++++++++++++++-
 3 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/README.dev b/README.dev
index 68fbe67..fd09766 100644
--- a/README.dev
+++ b/README.dev
@@ -21,7 +21,11 @@ $ ./mg-allocate \!marilith-n5
 Removing machines for servicing/outage
 ======================================
 
-mg-blockage
+mg-blockage <date-from> <date-to> <hostflag> [<extra-xinfo>]
+OSSTEST_CONFIG=production-config ./mg-blockage '2014-05-21 0955' '2014-05-21 1400' equiv-marilith
+
+
+Keeps running for the duration, so run it in a screen on the osstest VM.
 
 Commisioning a new machine
 ==========================
diff --git a/ap-common b/ap-common
index 537f605..b4b3310 100644
--- a/ap-common
+++ b/ap-common
@@ -37,7 +37,7 @@
 : ${PUSH_TREE_LIBVIRT:=$XENBITS:/home/xen/git/libvirt.git}
 : ${BASE_TREE_LIBVIRT:=git://xenbits.xen.org/libvirt.git}
 
-: ${TREE_GNULIB_LIBVIRT:=git://git.sv.gnu.org/gnulib.git}
+: ${TREE_GNULIB_LIBVIRT:=$(cached_repo git://git.sv.gnu.org/gnulib.git \[fetch=try\])}
 
 : ${TREE_RUMPUSERXEN:=https://github.com/rumpkernel/rumpuser-xen}
 : ${TREEVCS_RUMPUSERXEN:=git}
diff --git a/cri-common b/cri-common
index ea312f2..9cbf0d8 100644
--- a/cri-common
+++ b/cri-common
@@ -21,14 +21,29 @@
 
 umask 002
 
+cached_repo () {
+	local repo=$1
+	local options=$2
+	local cache=`getconfig GitCacheProxy`
+
+	if [ x$cache != x ] ; then
+		echo "$cache$repo%20$options"
+	else
+		echo "$repo"
+	fi
+}
+
 repo_tree_rev_fetch_git () {
 	local treename=$1
 	local remoteurl=$2
 	local remotetag=$3
 	local localtag=$4
+	local proxy=`getconfig GitCacheProxy`
 	case $remoteurl in
+	$proxy*)
+		local realurl="$remoteurl" ;;
 	git://*|http://*|https://*)
-		local realurl="`getconfig GitCacheProxy`$remoteurl" ;;
+		local realurl="$proxy$remoteurl" ;;
 	*)
 		local realurl="$remoteurl" ;;
 	esac
-- 
1.9.0

                 reply	other threads:[~2014-05-20 10:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1400583276-6873-1-git-send-email-ian.campbell@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).