Bug 1165960 - [RFE] Add "bkr workflow-reserve" subcommand
Summary: [RFE] Add "bkr workflow-reserve" subcommand
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Retired
Component: command line
Version: 0.17
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: 25.1
Assignee: Matt Tyson 🤬
QA Contact: Roman Joost
URL:
Whiteboard:
Depends On:
Blocks: 1319988
TreeView+ depends on / blocked
 
Reported: 2014-11-20 05:22 UTC by Nick Coghlan
Modified: 2018-04-11 05:20 UTC (History)
8 users (show)

Fixed In Version:
Clone Of:
: 1319988 (view as bug list)
Environment:
Last Closed: 2018-04-11 05:20:01 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Beaker Project Gerrit 6051 0 'None' MERGED Remove release notes for workflow-reserve command 2020-08-19 19:08:03 UTC

Description Nick Coghlan 2014-11-20 05:22:14 UTC
The current command for reserving an Automated system via the command line is:

    bkr simple-workflow --task /distribution/reservesys --arch x86_64 --family <distro>"

To reserve a specific Manual or Broken system it is:

    bkr simple-workflow --task /distribution/reservesys --ignore-system-status --machine <FQDN> --family <distro>"

That's not particularly discoverable, especially as the simple-workflow documentation doesn't mention this use case.

This RFE proposes simplifying the Automated case to "bkr reserve-workflow --family <distro>" and the Manual/Broken case to "bkr reserve-workflow --machine <FQDN> --family <distro>"

Relative to simple-workflow, I'm suggesting the following adjustments (but am open to discussion on all of them):

* additional --task options would not be accepted
* if "--arch" is missing and --machine is not given, then --arch defaults to "x86_64" rather than "all known arches"
* if "--machine" is given, then "--ignore-system-status" is implied

The man page for the new command can then tie it together with the common host filtering options through some examples.

A dedicated command should make this capability more discoverable, without cluttering up the simple-workflow page with reserve-workflow specific guidance.

A follow on change can then update the Reserve Workflow page with a link to the documentation.

Comment 1 Nick Coghlan 2014-11-20 05:23:49 UTC
Increased complexity estimate a bit, as there's a bit of design work involved, as well as the usage examples to put together.

Comment 2 matt jia 2016-03-22 03:59:09 UTC
 > To reserve a specific Manual or Broken system it is:
> 
>     bkr simple-workflow --task /distribution/reservesys
> --ignore-system-status --machine <FQDN> --family <distro>"
> 

This does not work because of bug https://bugzilla.redhat.com/show_bug.cgi?id=1319988#c0

Comment 3 matt jia 2016-03-22 04:01:20 UTC
> Relative to simple-workflow, I'm suggesting the following adjustments (but
> am open to discussion on all of them):
> 
> * additional --task options would not be accepted
> * if "--arch" is missing and --machine is not given, then --arch defaults to
> "x86_64" rather than "all known arches"
> * if "--machine" is given, then "--ignore-system-status" is implied
> 
> The man page for the new command can then tie it together with the common
> host filtering options through some examples.
> 
> A dedicated command should make this capability more discoverable, without
> cluttering up the simple-workflow page with reserve-workflow specific
> guidance.
> 
> A follow on change can then update the Reserve Workflow page with a link to
> the documentation.

I like the proposed ideas. @Dan, @Roman, what do you guys think?

Comment 4 Roman Joost 2016-10-10 23:44:53 UTC
Go ahead Matt. Do it!

Comment 5 matt jia 2017-01-11 22:25:51 UTC
(In reply to Nick Coghlan from comment #0)
> Relative to simple-workflow, I'm suggesting the following adjustments (but
> am open to discussion on all of them):
> 
> * additional --task options would not be accepted
> * if "--arch" is missing and --machine is not given, then --arch defaults to
> "x86_64" rather than "all known arches"

If "--arch" is missing and --machine is given, I think "--arch" should default to "x86_64" as well.

Comment 6 matt jia 2017-01-12 05:10:55 UTC
On Gerrit:

   https://gerrit.beaker-project.org/#/c/5581/

Comment 7 Roman Joost 2018-02-08 00:12:52 UTC
Matt is moving to another team and there is currently no one who immediately can continue on this patch. Moving this back to NEW.

Comment 8 Dalibor Pospíšil 2018-02-21 09:03:50 UTC
What about using bkr worflow-tomorow? I think it already supports most of the desired features.
If no task is specified --reserve is implied. I you need just one arch you can use --free or simply specify --arch x86_64 e.g.

For example to reserve all supported architectures with latest released rhel7 you simply run:
bkr workflow-tomorrow rhel7

Personally I think it is not worth reinventing the wheel.

Comment 9 Dan Callaghan 2018-02-21 23:19:38 UTC
workflow-tomorrow is unfortunately not open source.

Comment 10 Dalibor Pospíšil 2018-02-22 10:37:01 UTC
So maybe we should make it open source. If there is some sensitive data it might be separated, I guess.
CCing Petr and Lukáš to let them know.

Comment 11 Roman Joost 2018-02-23 00:03:32 UTC
(In reply to Dalibor Pospíšil from comment #10)
> So maybe we should make it open source. If there is some sensitive data it
> might be separated, I guess.
> CCing Petr and Lukáš to let them know.
Would you be able to give us feedback on this as soon as possible, since Matt is already working on finishing up the contributed patch. As Dalibor noted, it'll save us quite a bit of duplication.

Comment 12 Lukáš Zachar 2018-02-23 08:34:16 UTC
Please do not wait on workflow-tomorrow. 
Of course feel free to get inspiration from there, internal stuff hidden in qe module. 

It would take some time to decouple it, until yesterday it wasn't even on the radar and priorities are elsewhere.

Comment 13 Roman Joost 2018-02-26 02:37:49 UTC
Dear Lukas,

Cheers for the updated. We'll keep going with this one.

Comment 14 Matt Tyson 🤬 2018-03-14 01:38:33 UTC
Sorry for the spam, there was a bit of confusion over milestones.

Comment 15 Roman Joost 2018-04-06 03:18:29 UTC
This went originally into develop (26.0) but we decided to backport it to release it ASAP, therefore back to 25.1.

Comment 17 Roman Joost 2018-04-09 06:38:36 UTC
Played around with: 

beaker-client 25.1 0.git.9.47e53f9c5.el6eng against beaker-devel

Used some of the examples in the man page, as well as picked a job with a custom family. Result all ended up in correctly provisioned jobs and reservations.

https://beaker-devel.app.eng.bos.redhat.com/jobs/14158
https://beaker-devel.app.eng.bos.redhat.com/jobs/14161
https://beaker-devel.app.eng.bos.redhat.com/jobs/14175

Comment 18 Roman Joost 2018-04-11 05:20:01 UTC
Beaker 25.1 has been released:

https://beaker-project.org/docs/whats-new/release-25.html#beaker-25-1


Note You need to log in before you can comment on or make changes to this bug.