Will Woods wrote:
On Fri, 2009-06-05 at 11:53 -0400, Bill Peck wrote:
> Hello Everyone,
>
> There is plenty more work to do on the inventory piece of beaker but I
> wanted to share some of my thoughts on the scheduler to let everyone
> know how I think things will work.
>
> First a rough idea on how all these pieces will fit together:
>
[snip]
Thanks for the really useful overview - this info should probably end up
in the wiki for other curious folks.
Yes, I was thinking this along with a diagram would be helpful.
> The Harness
> ---------------------------
> - This piece is still under design.
> - Whatever this is it will be in charge of running the chosen tests on
> the chosen system.
> - The results should go back to the scheduler. But they may also go to
> a Test Case Management system.
>
I'd assume we'd want to provide A Default Harness but allow a way for
people to use other harnesses if they so choose..
Yes, But it may not be that easy. Some harnesses would require the
tests to be written with knowledge of the harness. So if you pick a
different harness you would be limited to the tests that know how to use
that harness. But maybe thats the point and its ok.
> Ok, Now that the basics are out of the way I'm going to brain dump how
> I think the scheduler should work. The current scheduler we use does
> not scale well at all. The design I'm planning to implement will only
> filter recipe requirements once and then loop on queued recipes and free
> systems. If no systems are free then we won't see any of the queued
> recipes. It should scale very well. There is quite a bit of
> python/sqlalchemy code below. Its mostly pseudo code, but the ideas
> should be sound.
>
> States
> --------
> New <- Recipes start in this state
> Queued <- After initial filtering happens (what systems match)
> Assigned <- The Recipe has been assigned a machine
> Running <- The Recipe is actually running on the system
> Completed <- Were done.
> InComplete <- Were done but didn't finish.
>
>
It seems like we could do pull-based testing by providing methods to let
machines a) list jobs in the New or Queued state, and b) claim a test
(i.e. assign it to themselves). Sounds deceptively easy! :)
Almost. If the recipe is simple enough to say I just need an i386 for
this test then I agree. But I think we want to support pull tests on
more complicated recipes which say I want an i386 with an Intel
processor and at least 4 gigs of ram. I think the best way to support
this is to have remote test systems register in beaker and then the
Scheduler can pick them as potential machines. Then those jobs can get
scheduled by whatever machine happens to pick up the recipe first,
either a machine under our control (push method) or a machine checking
in from remote (pull method).
The cool thing is when a remote machine checks in it can simply do the
following to get a job to run.
class System:
def give_me_recipe(self, system_name):
myrecipe = None
for recipe in self.recipes:
# For now lets skip multi-host tests
if len(recipe.recipeset.recipes) > 1:
continue
# Again, Atomic operation in case the scheduler assigns
this recipe to a push machine.
# Or another pull machine gets it.
# Notice we go right to Running state, skipping Assigned.
if session.connection(Recipe).execute(recipe_table.update(
and_(recipe_table.c.id==recipe.id,
recipe_table.c.status_id==TestStatus.by_name(u'Queued').id),
status_id=TestStatus.by_name(u'Running').id).rowcount == 1:
myrecipe = recipe
break
if myrecipe:
myrecipe.system = system
return myrecipe.to_xml()
else:
return None
Assuming we have some order clauses in there (order by recipe priority
and then recipe id).
> Any thoughts? Suggestions? I'll be branching current beaker into a 0.4
> branch so that I can make bug fix releases if need be.
>
Really like the plans here - and thanks again for the explanation.
-w
_______________________________________________
Beaker-devel mailing list
Beaker-devel(a)lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/beaker-devel