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

Dependency Graph Output Enhancment #1545

Closed
nathanhaigh opened this issue Jan 13, 2016 · 6 comments
Closed

Dependency Graph Output Enhancment #1545

nathanhaigh opened this issue Jan 13, 2016 · 6 comments

Comments

@nathanhaigh
Copy link
Contributor

Depenedency graph files can be generated for an easyconfig file using something like:

eb --dep-graph tool1-version-toolchain-toolchain_version.dot -r

The resulting .dot file contains a directed graph (digraph) defining nodes and directed edges between nodes.

Lines defining a node look like this:

"tool_1/version-toolchain-toolchain_version";

Lines defining directed edges look like this:

"tool_1/version-toolchain-toolchain_version" -> "tool_2/version-toolchain-toolchain_version";

This output could be enhanced by:

  • Distinguish between build dependencies and normal dependencies.

This could be done using edge attributes. For example, the use of label could be used to add text (e.g. build dep) to an edge. Thus a line in the .dot file defining a build dependency could look like:

digraph graphname {
// node definitions
"tool_1/version-toolchain-toolchain_version";
"tool_2/version-toolchain-toolchain_version"
"tool_3/version-toolchain-toolchain_version"

// edge definition for build dependency
"tool_1/version-toolchain-toolchain_version" -> "tool_2/version-toolchain-toolchain_version" [label="build dep"];
// edge definition for normal dependency
"tool_1/version-toolchain-toolchain_version" -> "tool_3/version-toolchain-toolchain_version"
}

Alternatives, to keep visual clutter to a minimum, it might be best to change the style or colour of the edge; or even the style of the arrowhead. The following example, illustrates the use of all these:

digraph graphname {
// node definitions
"tool_1/version-toolchain-toolchain_version";
"tool_2/version-toolchain-toolchain_version"
"tool_3/version-toolchain-toolchain_version"

// edge definition for build dependency
"tool_1/version-toolchain-toolchain_version" -> "tool_2/version-toolchain-toolchain_version" [label="build dep",style="dotted",color="blue",arrowhead="diamond"];
// edge definition for normal dependency
"tool_1/version-toolchain-toolchain_version" -> "tool_3/version-toolchain-toolchain_version"
}
@boegel
Copy link
Member

boegel commented Jan 14, 2016

Thanks for the detailed overview @nathanhaigh!

To whomever wants to look into this: you'll need to play around with the dep_graph function in the easybuild.framework.easyconfig.tools module.

The .dot file is generated via the dot.write() function provided by the python-graph-dot package.

Whether @nathanhaigh's suggestions can be implemented easily depends on whether python-graph-dot supports these type of tinkering with edges and labels...

@nathanhaigh
Copy link
Contributor Author

According to http://pydoc.net/Python/python-graph-core/1.8.0/pygraph.classes.digraph/ edge attributes can be added like so:

add_edge(edge, wt = 1, label="", attrs = []):

Where attrs is:

@type attrs: list
@param attrs: List of node attributes specified as (attribute, value) tuples.

So @boegel, I guess I just need to know what's available via specs.

@boegel
Copy link
Member

boegel commented Jan 14, 2016

@nathanhaigh: it looks like you should be able to check with dep.get('build_only', False) where add_edge is being used to figure out whether dep is a build dependency

@boegel
Copy link
Member

boegel commented Jan 15, 2016

fixed in #1548, thanks a lot @nathanhaigh for tackling this!

@boegel boegel closed this as completed Jan 15, 2016
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

No branches or pull requests

2 participants