Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Info command #141

Closed
dansondergaard opened this issue Feb 15, 2017 · 11 comments
Closed

Info command #141

dansondergaard opened this issue Feb 15, 2017 · 11 comments
Assignees
Milestone

Comments

@dansondergaard
Copy link
Collaborator

A lot of flexibility could be gained by allowing some common filtering operations (should run, completed, failed, submitted, running) and allowing the user to provide a format string to print various information in a space/comma-separated format.

@dansondergaard dansondergaard added this to the 1.1.0 milestone Feb 15, 2017
@dansondergaard
Copy link
Collaborator Author

@kaspermunch A specification/set of requirements for this would be nice so that we can make sure that the implementation fulfils your needs.

@kaspermunch
Copy link
Contributor

It would be nice to be able to have complete freedom in what to print (not only space/comma separated fields). Like "This {jobid} depends on {inputs} and produces {outputs}".

@dansondergaard
Copy link
Collaborator Author

Target inputs and outputs are not really status information. I think stuff like that would fit better under a different subcommand such as "gwf info".

@kaspermunch
Copy link
Contributor

But it would be very convenient to be able to query status and info at the same time. I often find myself looking for the output files of the targets that failed.

@dansondergaard
Copy link
Collaborator Author

Maybe that could be solved through chaining, if we could make something like this possible:

$ gwf status --failed --name-only | gwf info --format "{name} {outputs}"

I'm just concerned that the status subcommand becomes a huge beast because people want it to print everything imaginable.

@dansondergaard
Copy link
Collaborator Author

So, I've implemented the first part of this. Please, please, please test it! :)

▸ gwf status --help                                                                                                                                                                                master gwf env 13:29:11
Usage: gwf status [OPTIONS] [TARGETS]...

  Show the status of targets.

  By default, shows a progress bar for each endpoint in the workflow. If one
  or more target names are supplied, progress bars are shown for these
  targets.

  A progress bar represents the target and its dependencies, and shows how
  many of the dependencies either should run (magenta, .), are submitted
  (yellow, S), are running (blue, R), are completed (green, C), or have
  failed (red, F).

Options:
  -n, --names-only
  --all / --endpoints             Whether to show all targets or only
                                  endpoints if no targets are specified.
  -s, --status [shouldrun|submitted|running|completed]
  --help

It took some time since I had to iron out a bunch of confusing bugs and misunderstandings in the way status is reported. The changes benefited all of gwf, so I think it was worth it. I've tested with a small workflow (not unit tests yet) using the local and slurm backends, and status seems to be accurately reported now.

Next step is to implement a info command so that @kaspermunch can get the information he wants :)

@dansondergaard dansondergaard self-assigned this May 2, 2017
@dansondergaard dansondergaard changed the title Status command output formatting Info command May 25, 2017
@dansondergaard
Copy link
Collaborator Author

@kaspermunch suggested that the gwf info command could be even simpler, e.g.

$ gwf info TargetName
name: TargetName
options:
    cores: 2
    memory: 8g
    ...
spec:
    THIS IS THE SPEC
dependencies:
    - dep1
    - dep2
    - dep3
    ...
dependents:
    - dep1
    - dep2
    ...

@mailund
Copy link
Member

mailund commented Aug 12, 2017

That output is simple YAML, and I like that. There are lots of libraries for parsing it if people want to write tools they can pipe the info into, and it is very readable for humans as well.

@dansondergaard
Copy link
Collaborator Author

I (very) intentionally wrote it as YAML ;)

@kaspermunch
Copy link
Contributor

kaspermunch commented Aug 15, 2017 via email

@dansondergaard
Copy link
Collaborator Author

Nope, see #181.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants