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
Cc: Ian Campbell <ian.campbell@citrix.com>, xen-devel@lists.xen.org
Subject: [PATCH OSSTEST v2 1/5] ms-planner: Propagate a booking's Job to the plan
Date: Tue, 14 Jul 2015 14:58:48 +0100	[thread overview]
Message-ID: <1436882332-6978-1-git-send-email-ian.campbell@citrix.com> (raw)
In-Reply-To: <1436882318.25044.75.camel@citrix.com>

This needs to be done in several places:

- When booking resources (cmd: book-resources), to initially propagate
  from the booking (e.g. from ts-hosts-allocate-Executive's input).
- On reset (cmd: reset) so that the Events corresponding to actual
  allocations retain there Job.
- When retrieving the plan (cmd: get-plan), so it would be available
  for logging etc (I don't think this is currently used)

This patch has been deployed on the Cambridge instance for testing
with no ill-effects.

cmd_reset does not include a ->Job for jobs which are "(preparing)",
corresponding to a job which is going to use a shared host which is
currently being installed by another job. I was unable to figure out a
way to include these.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 README.planner |  2 ++
 ms-planner     | 10 +++++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/README.planner b/README.planner
index ec4dce8..73e97ea 100644
--- a/README.planner
+++ b/README.planner
@@ -213,6 +213,7 @@ Plan is:
 			End	abs planned end time, *
 				 omitted for rogue tasks
 			Live	boolean, for reporting purposes only
+			Job	flight.job which made the allocation
 
 	Events
 		map from
@@ -231,6 +232,7 @@ Plan is:
 						Shareix
 						Task
 						Live
+			Job	flight.job which made the allocation
 
 	* = internal to plan
 	** = computed by launder_check_plan
diff --git a/ms-planner b/ms-planner
index 1dd01a9..02a5464 100755
--- a/ms-planner
+++ b/ms-planner
@@ -350,16 +350,19 @@ END
                      Shareix => $shareix,
                      Live => $alloc->{Live},
                     );
-        
+
+	my $job = $alloc->{Job};
 	push @{ $plan->{Events}{$reso} }, {
 	    Time => $alloc->{Start},
 	    Info => $alloc->{Info},
+	    ($job ? (Job => $job) : ()),
 	    Type => Start,
 	    ($share ? (Share => { %$share }) : ()),
 	    Allocated => { @ealloc },
 	}, {
 	    Time => $end_exptd,
 	    Info => $alloc->{Info},
+	    ($job ? (Job => $job) : ()),
 	    Type => End,
 	    ($share ? (Share => { %$share }) : ()),
 	    Allocated => { @ealloc },
@@ -385,10 +388,12 @@ sub cmd_get_plan () {
 	my @jevts;
 	foreach my $evt (@$evts) {
 	    my $share= $evt->{Share};
+	    my $job= $evt->{Job};
 	    push @jevts, {
 		Time => $evt->{Time} - $plan->{Start},
 		Type => $evt->{Type},
 		Avail => $evt->{Avail},
+		($job ? (Job => $job) : ()),
 		($share ? (Share => $share) : ()),
 	    };
 	}
@@ -450,6 +455,7 @@ sub cmd_book_resources () {
 	my $starttime= parse_reltime2abs($jbook->{Start});
 	my $endtime= parse_reltime2abs($jbook->{End});
 	my $reso= parse_reso($jbook->{Reso});
+	my $job= $jbook->{Job};
 
 	die unless $starttime < $endtime;
 
@@ -483,6 +489,7 @@ sub cmd_book_resources () {
                 Start => $starttime,
                 End => $endtime,
                 Live => 1,
+                ($job ? (Job => $job) : ()),
             };
 	}
 
@@ -491,6 +498,7 @@ sub cmd_book_resources () {
 		Info => $info,
 		(@share ? (Share => { @share }) : ()),
 		(@alloc ? (Allocated => { @alloc }) : ()),
+		($job ? (Job => $job) : ()),
 		@_,
 	    };
 	};
-- 
2.1.4

  reply	other threads:[~2015-07-14 13:58 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-14 13:58 [PATCH OSSTEST v2 0/5] add a flight summary html report Ian Campbell
2015-07-14 13:58 ` Ian Campbell [this message]
2015-07-31 15:39   ` [PATCH OSSTEST v2 1/5] ms-planner: Propagate a booking's Job to the plan Ian Jackson
2015-07-14 13:58 ` [PATCH OSSTEST v2 2/5] ms-planner: Expose the plan start in json Ian Campbell
2015-07-31 15:38   ` Ian Jackson
2015-07-14 13:58 ` [PATCH OSSTEST v2 3/5] ts-hosts-allocate-Executive: Add the requesting Job to the booking Ian Campbell
2015-07-31 15:41   ` Ian Jackson
2015-07-14 13:58 ` [PATCH OSSTEST v2 4/5] Osstest::Executive: Export get_plan Ian Campbell
2015-07-31 15:42   ` Ian Jackson
2015-07-14 13:58 ` [PATCH OSSTEST v2 5/5] ms-flights-summary: Produce an HTML report of all active flights Ian Campbell
2015-07-16 16:55   ` Ian Campbell
2015-07-31 15:50   ` Ian Jackson
2015-07-31 15:58     ` Ian Campbell
2015-07-31 16:04       ` Ian Jackson

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=1436882332-6978-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).