[Beaker-devel] API design for harness independent system reservations
Nick Coghlan
ncoghlan at redhat.com
Wed May 14 06:06:46 UTC 2014
Amit has been working on the implementation of a "<reservesys/>" element
for recipes ([1,2]) and we haven't really liked either of the approaches
we have tried so far. So, bringing it to the list to summarise what
we've tried so far and get feedback on a new proposal.
Background
==========
Status quo:
- system reservation for recipes is handled as a Beaker task
- only works for harnesses that can run Beaker tasks
- doesn't work at all for aborted recipes
- due to the now asynchronous nature of recipe status updates
RESERVE_IF_FAIL may not trigger if the only failing task is
the one immediately before the reservesys task
- this approach will continue to work (and remains the only
way to pause in the *middle* of a recipe)
- the new mechanism for leaving a system provisioned for a
while after the recipe ends is in *addition* to the
reservesys task
First attempt:
- enum for "onpass", "onfail", "onwarn" and "onabort"
- not suitable, since it didn't allow combinations
Second attempt:
- independent boolean flags with those names
- not suitable, since it allows nonsensical combinations and makes the
implementation and testing of the feature annoyingly complicated
- (this was my suggestion in the BZ, but after seeing it implemented,
my reaction was "bleargh")
New proposal
============
- go back to Amit's enum idea, but make it an *ordered* list.
- under this model, we'd have the following enum options:
* never
* onabort
* onfail
* onwarn
* always
- each level would implicitly include the levels above, so if you say
"onwarn", it will also reserve the system for failures and aborts,
and "onfail" will also reserve the system for aborts
The UI in the XML for this would look similar to Amit's original idea:
<reservesys when="onwarn" duration="86400">
If "when" is not given, it would default to "always", if there was no
reservesys element in the recipe at all, this would be recorded on the
server as "never".
Open question: do we allow 'when="never"' in the XML schema? (I say no:
the reservesys element should just be omitted for that case)
The question of "what about kernel panics and installation failures?"
also came up and Dan and I agreed that is covered by "onabort" - if the
recipe is configured to ignore kernel panics and installation failures
in general, then this reservation mechanism will also ignore them,
otherwise it will handle them like any other recipe that is killed by
the external watchdog.
Cheers,
Nick.
[1] https://bugzilla.redhat.com/show_bug.cgi?id=639938
[2] http://gerrit.beaker-project.org/#/c/3075/
--
Nick Coghlan
Red Hat Hosted & Shared Services
Software Engineering & Development, Brisbane
Testing Solutions Team Lead
More information about the Beaker-devel
mailing list