-
Notifications
You must be signed in to change notification settings - Fork 1.5k
add graph subcommand that ouputs the installer's internal dependency graph #432
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
add graph subcommand that ouputs the installer's internal dependency graph #432
Conversation
|
/retest |
cmd/openshift-install/graph.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To stay DRY, we should put these lists under variables in targets.go. Maybe:
type target struct {
name string
command *cobra.Command
assets []asset.Asset
}
var targets := map[string]target{
"install-config": {
name: "Install Config",
command: &cobra.Command{
Use: "install-config",
Short: "Generates the Install Config asset",
},
assets: {&installconfig.InstallConfig{}},
},
...
}Then in main():
for key, target := range targets { // maybe after sorting?
target.command.RunE = runTargetCmd(target.assets...)
subCmds = append(subCmds, target.command)
}There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
cmd/openshift-install/graph.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need PkgPath? elem.Name seems fairly unique on its own. Or maybe make the displayed name elem.Name, but make the node href point to the associated godocs? For SVG output (and anything else that supports hrefs) that would give you a compact display with fully-qualified names available as needed to clickers and hoverrers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It adds context if anybody wants to find the asset.
ff38a6c to
772c014
Compare
cmd/openshift-install/targets.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This still duplicates the assets peoperty two lines below. Not a big deal, because they're so close together, but does building RunE on the fly not work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed, forgot to remove that.
cmd/openshift-install/graph.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The trim leaves this without the required leading quote. And I'd still prefer context via URL. Something like:
InstallConfig [URL="https://godoc.org/github.com/openshift/installer/pkg/asset/installconfig#InstallConfig"]For private classes, maybe just link to the package?
To make it easier to tune this, maybe add a new commit updating our dependency SVG and dropping our current hand-coded dot source?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dropped the name to just name of elem for now. we can iterate over the url stuff later.
Also adding the commit for replacing existing graph in docs.
bb81795 to
9d5d1a9
Compare
|
@wking updated to include doc. |
docs/design/resource_dep.dot
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
github.com/awalterschulze/gographviz cannot print strict digraph.
9d5d1a9 to
7abcdc9
Compare
docs/design/assetgeneration.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can drop resource_dep.dot from version control and just use:
bin/openshift-install graph | dot -Tsvg >docs/design/resource_dep.svgAlso, with sh highlighting, you don't want the $ prompts (more on sh vs. console in #27.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wking done.
```sh bin/openshift-install graph | dot -Tsvg >docs/design/resource_dep.svg ```
7abcdc9 to
08daace
Compare
wking
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: abhinavdahiya, wking The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/test e2e-aws |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
e2e: |
/cc @wking @crawford