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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(workflow): add dot output on workflow visualize #3032

Merged
merged 9 commits into from Jul 25, 2022

Conversation

lorenzo-cavazzi
Copy link
Member

Description

Add a --format option on the renku workflow visualize command. The output can now be either console or dot.
Maybe instead of -i would it make sense to add an extra format? Something like console, interactive, dot?


This also fixes an error when providing non-existing column names

E.G. renku workflow visualize <path> --columns aaa was triggering

renku workflow visualize results.txt --columns aaa 
Ahhhhhhhh! You have found a bug. 馃悶
[...]
File "/[...]/renku/command/view_model/activity_graph.py", line 113, in <listcomp>
    columns = [ACTIVITY_GRAPH_COLUMNS[c] for c in columns.split(",")]
KeyError: 'aaa'

Now it prints

Error: Invalid parameter value for columns 'aaa': you can use any of 'command,id,date,plan'

fix #2376

- Fixes also a bug when providing wrong columns

fix #2376
@lorenzo-cavazzi lorenzo-cavazzi marked this pull request as ready for review July 21, 2022 08:49
@lorenzo-cavazzi lorenzo-cavazzi requested a review from a team as a code owner July 21, 2022 08:49
Copy link
Member

@Panaetius Panaetius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, this looks a lot simpler than the pygraphviz approach!

.. code-block:: console

$ renku workflow visualize --format dot <path>

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe write a sentence that this would print dot format, which could be accepted by the dot command

Comment on lines 926 to 935
'"Y" -> "bash -c \\"cat X Y | tee R S\\"";' in result.output
'"X" -> "bash -c \\"cat X Y | tee R S\\"";' in result.output
'"bash -c \\"cat X Y | tee R S\\"" -> "R";' in result.output
'"bash -c \\"cat X Y | tee R S\\"" -> "S";' in result.output
4 == result.output.count('"bash -c \\"cat X Y | tee R S\\"')

1 == result.output.count('"echo other > H" -> "H"')
1 == result.output.count('-> "H"')
0 == result.output.count('"H" -->')
1 == result.output.count('"H"')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of these statements need an assert in front of them.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ouch! 馃う

Copy link
Member

@Panaetius Panaetius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@lorenzo-cavazzi lorenzo-cavazzi enabled auto-merge (squash) July 25, 2022 15:36
@lorenzo-cavazzi lorenzo-cavazzi merged commit c85790b into develop Jul 25, 2022
@lorenzo-cavazzi lorenzo-cavazzi deleted the 2376c-workflow-dot branch July 25, 2022 17:11
Panaetius added a commit that referenced this pull request Jul 28, 2022
- Fixes also a bug when providing the wrong columns

fix #2376

Co-authored-by: Ralf Grubenmann <ralf.grubenmann@sdsc.ethz.ch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add option to produce dot output in renku workflow visualize
2 participants