cosmos-sdk/container/testdata/example_error.svg
Aaron Craelius 7a31a28e24
refactor(container)!: remove dependency on C graphviz (#11934)
## Description

Closes: #11925 

This replace the dependency on https://pkg.go.dev/github.com/goccy/go-graphviz which wraps the whole C Graphviz library and is causing ARM build problems in #11924 and generally probably shouldn't be used because it's a heavyweight dependency just used for debugging.

It adds:
* a custom `graphviz` package that does just what we need for `container`
* updates to graphviz rendering to make it nicer and a README with some examples
* golden tests for graphviz and log debugging
* a `StderrLogger` `DebugOption` which is now the default for `Debug`/`AutoDebug`



---

### Author Checklist

*All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.*

I have...

- [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] added `!` to the type prefix if API or client breaking change
- [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/main/CONTRIBUTING.md#pr-targeting))
- [ ] provided a link to the relevant issue or specification
- [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/main/docs/building-modules)
- [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/main/CONTRIBUTING.md#testing)
- [ ] added a changelog entry to `CHANGELOG.md`
- [ ] included comments for [documenting Go code](https://blog.golang.org/godoc)
- [ ] updated the relevant documentation or specification
- [ ] reviewed "Files changed" and left comments if necessary
- [ ] confirmed all CI checks have passed

### Reviewers Checklist

*All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.*

I have...

- [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] confirmed `!` in the type prefix if API or client breaking change
- [ ] confirmed all author checklist items have been addressed 
- [ ] reviewed state machine logic
- [ ] reviewed API design and naming
- [ ] reviewed documentation is accurate
- [ ] reviewed tests and test coverage
- [ ] manually tested (if applicable)
2022-05-12 17:00:55 +00:00

180 lines
15 KiB
XML

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.40.1 (20161225.0304)
-->
<!-- Pages: 1 -->
<svg width="1992pt" height="406pt"
viewBox="0.00 0.00 1992.49 406.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 402)">
<polygon fill="#ffffff" stroke="transparent" points="-4,4 -4,-402 1988.4891,-402 1988.4891,4 -4,4"/>
<g id="clust1" class="cluster">
<title>cluster_a</title>
<path fill="none" stroke="#000000" stroke-width=".5" d="M489.7809,-136C489.7809,-136 863.7809,-136 863.7809,-136 869.7809,-136 875.7809,-142 875.7809,-148 875.7809,-148 875.7809,-197 875.7809,-197 875.7809,-203 869.7809,-209 863.7809,-209 863.7809,-209 489.7809,-209 489.7809,-209 483.7809,-209 477.7809,-203 477.7809,-197 477.7809,-197 477.7809,-148 477.7809,-148 477.7809,-142 483.7809,-136 489.7809,-136"/>
<text text-anchor="middle" x="676.7809" y="-195.4" font-family="Times,serif" font-size="12.00" fill="#000000">Module: a</text>
</g>
<g id="clust2" class="cluster">
<title>cluster_b</title>
<path fill="none" stroke="#000000" stroke-width=".5" d="M989.7809,-136C989.7809,-136 1363.7809,-136 1363.7809,-136 1369.7809,-136 1375.7809,-142 1375.7809,-148 1375.7809,-148 1375.7809,-197 1375.7809,-197 1375.7809,-203 1369.7809,-209 1363.7809,-209 1363.7809,-209 989.7809,-209 989.7809,-209 983.7809,-209 977.7809,-203 977.7809,-197 977.7809,-197 977.7809,-148 977.7809,-148 977.7809,-142 983.7809,-136 989.7809,-136"/>
<text text-anchor="middle" x="1176.7809" y="-195.4" font-family="Times,serif" font-size="12.00" fill="#000000">Module: b</text>
</g>
<g id="clust3" class="cluster">
<title>cluster_runtime</title>
<path fill="none" stroke="#000000" stroke-width=".5" d="M731.7809,-281C731.7809,-281 1121.7809,-281 1121.7809,-281 1127.7809,-281 1133.7809,-287 1133.7809,-293 1133.7809,-293 1133.7809,-342 1133.7809,-342 1133.7809,-348 1127.7809,-354 1121.7809,-354 1121.7809,-354 731.7809,-354 731.7809,-354 725.7809,-354 719.7809,-348 719.7809,-342 719.7809,-342 719.7809,-293 719.7809,-293 719.7809,-287 725.7809,-281 731.7809,-281"/>
<text text-anchor="middle" x="926.7809" y="-340.4" font-family="Times,serif" font-size="12.00" fill="#000000">Module: runtime</text>
</g>
<!-- github.com/cosmos/cosmos&#45;sdk/container_test.ModuleA.Provide -->
<g id="node1" class="node">
<title>github.com/cosmos/cosmos&#45;sdk/container_test.ModuleA.Provide</title>
<polygon fill="none" stroke="#d3d3d3" stroke-width=".5" points="867.7809,-180 485.7809,-180 485.7809,-144 867.7809,-144 867.7809,-180"/>
<text text-anchor="middle" x="676.7809" y="-158.3" font-family="Times,serif" font-size="14.00" fill="#696969">github.com/cosmos/cosmos&#45;sdk/container_test.ModuleA.Provide</text>
</g>
<!-- []github.com/cosmos/cosmos&#45;sdk/container_test.Command -->
<!-- auto&#45;group -->
<g id="node4" class="node">
<title>[]github.com/cosmos/cosmos&#45;sdk/container_test.Command</title>
<ellipse fill="none" stroke="#d3d3d3" stroke-width=".5" cx="676.7809" cy="-90" rx="226.6599" ry="18"/>
<text text-anchor="middle" x="676.7809" y="-86.3" font-family="Times,serif" font-size="14.00" fill="#696969">[]github.com/cosmos/cosmos&#45;sdk/container_test.Command</text>
</g>
<!-- github.com/cosmos/cosmos&#45;sdk/container_test.ModuleA.Provide&#45;&gt;[]github.com/cosmos/cosmos&#45;sdk/container_test.Command -->
<g id="edge7" class="edge">
<title>github.com/cosmos/cosmos&#45;sdk/container_test.ModuleA.Provide&#45;&gt;[]github.com/cosmos/cosmos&#45;sdk/container_test.Command</title>
<path fill="none" stroke="#000000" d="M676.7809,-143.8314C676.7809,-136.131 676.7809,-126.9743 676.7809,-118.4166"/>
<polygon fill="#000000" stroke="#000000" points="680.281,-118.4132 676.7809,-108.4133 673.281,-118.4133 680.281,-118.4132"/>
</g>
<!-- github.com/cosmos/cosmos&#45;sdk/container_test.KeeperA -->
<g id="node8" class="node">
<title>github.com/cosmos/cosmos&#45;sdk/container_test.KeeperA</title>
<ellipse fill="none" stroke="#d3d3d3" stroke-width=".5" cx="215.7809" cy="-90" rx="215.5619" ry="18"/>
<text text-anchor="middle" x="215.7809" y="-86.3" font-family="Times,serif" font-size="14.00" fill="#696969">github.com/cosmos/cosmos&#45;sdk/container_test.KeeperA</text>
</g>
<!-- github.com/cosmos/cosmos&#45;sdk/container_test.ModuleA.Provide&#45;&gt;github.com/cosmos/cosmos&#45;sdk/container_test.KeeperA -->
<g id="edge5" class="edge">
<title>github.com/cosmos/cosmos&#45;sdk/container_test.ModuleA.Provide&#45;&gt;github.com/cosmos/cosmos&#45;sdk/container_test.KeeperA</title>
<path fill="none" stroke="#000000" d="M561.3433,-143.9707C489.9131,-132.8146 398.6553,-118.5617 327.8594,-107.5047"/>
<polygon fill="#000000" stroke="#000000" points="327.9877,-103.9824 317.5674,-105.8972 326.9075,-110.8985 327.9877,-103.9824"/>
</g>
<!-- map[string]github.com/cosmos/cosmos&#45;sdk/container_test.Handler -->
<!-- one&#45;per&#45;module -->
<g id="node12" class="node">
<title>map[string]github.com/cosmos/cosmos&#45;sdk/container_test.Handler</title>
<ellipse fill="none" stroke="#d3d3d3" stroke-width=".5" cx="1176.7809" cy="-90" rx="254.555" ry="18"/>
<text text-anchor="middle" x="1176.7809" y="-86.3" font-family="Times,serif" font-size="14.00" fill="#696969">map[string]github.com/cosmos/cosmos&#45;sdk/container_test.Handler</text>
</g>
<!-- github.com/cosmos/cosmos&#45;sdk/container_test.ModuleA.Provide&#45;&gt;map[string]github.com/cosmos/cosmos&#45;sdk/container_test.Handler -->
<g id="edge6" class="edge">
<title>github.com/cosmos/cosmos&#45;sdk/container_test.ModuleA.Provide&#45;&gt;map[string]github.com/cosmos/cosmos&#45;sdk/container_test.Handler</title>
<path fill="none" stroke="#000000" d="M801.9843,-143.9707C879.0828,-132.8685 977.4789,-118.6995 1054.1053,-107.6653"/>
<polygon fill="#000000" stroke="#000000" points="1054.8918,-111.0882 1064.2909,-106.1986 1053.8941,-104.1597 1054.8918,-111.0882"/>
</g>
<!-- github.com/cosmos/cosmos&#45;sdk/container_test.ModuleB.Provide -->
<g id="node2" class="node">
<title>github.com/cosmos/cosmos&#45;sdk/container_test.ModuleB.Provide</title>
<polygon fill="none" stroke="#ff0000" stroke-width=".5" points="1367.7809,-180 985.7809,-180 985.7809,-144 1367.7809,-144 1367.7809,-180"/>
<text text-anchor="middle" x="1176.7809" y="-158.3" font-family="Times,serif" font-size="14.00" fill="#ff0000">github.com/cosmos/cosmos&#45;sdk/container_test.ModuleB.Provide</text>
</g>
<!-- github.com/cosmos/cosmos&#45;sdk/container_test.ModuleB.Provide&#45;&gt;[]github.com/cosmos/cosmos&#45;sdk/container_test.Command -->
<g id="edge11" class="edge">
<title>github.com/cosmos/cosmos&#45;sdk/container_test.ModuleB.Provide&#45;&gt;[]github.com/cosmos/cosmos&#45;sdk/container_test.Command</title>
<path fill="none" stroke="#000000" d="M1051.5774,-143.9707C973.51,-132.729 873.6063,-118.3429 796.5778,-107.2508"/>
<polygon fill="#000000" stroke="#000000" points="796.7417,-103.7383 786.345,-105.7772 795.744,-110.6669 796.7417,-103.7383"/>
</g>
<!-- github.com/cosmos/cosmos&#45;sdk/container_test.KeeperB -->
<g id="node9" class="node">
<title>github.com/cosmos/cosmos&#45;sdk/container_test.KeeperB</title>
<ellipse fill="none" stroke="#ff0000" stroke-width=".5" cx="1664.7809" cy="-90" rx="215.2619" ry="18"/>
<text text-anchor="middle" x="1664.7809" y="-86.3" font-family="Times,serif" font-size="14.00" fill="#ff0000">github.com/cosmos/cosmos&#45;sdk/container_test.KeeperB</text>
</g>
<!-- github.com/cosmos/cosmos&#45;sdk/container_test.ModuleB.Provide&#45;&gt;github.com/cosmos/cosmos&#45;sdk/container_test.KeeperB -->
<g id="edge10" class="edge">
<title>github.com/cosmos/cosmos&#45;sdk/container_test.ModuleB.Provide&#45;&gt;github.com/cosmos/cosmos&#45;sdk/container_test.KeeperB</title>
<path fill="none" stroke="#000000" d="M1298.9794,-143.9707C1375.4434,-132.6891 1473.371,-118.2408 1548.6579,-107.1329"/>
<polygon fill="#000000" stroke="#000000" points="1549.2757,-110.5797 1558.6577,-105.6575 1548.2539,-103.6547 1549.2757,-110.5797"/>
</g>
<!-- github.com/cosmos/cosmos&#45;sdk/container_test.ModuleB.Provide&#45;&gt;map[string]github.com/cosmos/cosmos&#45;sdk/container_test.Handler -->
<g id="edge12" class="edge">
<title>github.com/cosmos/cosmos&#45;sdk/container_test.ModuleB.Provide&#45;&gt;map[string]github.com/cosmos/cosmos&#45;sdk/container_test.Handler</title>
<path fill="none" stroke="#000000" d="M1176.7809,-143.8314C1176.7809,-136.131 1176.7809,-126.9743 1176.7809,-118.4166"/>
<polygon fill="#000000" stroke="#000000" points="1180.281,-118.4132 1176.7809,-108.4133 1173.281,-118.4133 1180.281,-118.4132"/>
</g>
<!-- github.com/cosmos/cosmos&#45;sdk/container_test.ProvideKVStoreKey -->
<g id="node3" class="node">
<title>github.com/cosmos/cosmos&#45;sdk/container_test.ProvideKVStoreKey</title>
<polygon fill="none" stroke="#000000" stroke-width="1.5" points="1125.7809,-325 727.7809,-325 727.7809,-289 1125.7809,-289 1125.7809,-325"/>
<text text-anchor="middle" x="926.7809" y="-303.3" font-family="Times,serif" font-size="14.00" fill="#000000">github.com/cosmos/cosmos&#45;sdk/container_test.ProvideKVStoreKey</text>
</g>
<!-- github.com/cosmos/cosmos&#45;sdk/container_test.KVStoreKey -->
<g id="node7" class="node">
<title>github.com/cosmos/cosmos&#45;sdk/container_test.KVStoreKey</title>
<ellipse fill="none" stroke="#000000" stroke-width="1.5" cx="926.7809" cy="-235" rx="230.9593" ry="18"/>
<text text-anchor="middle" x="926.7809" y="-231.3" font-family="Times,serif" font-size="14.00" fill="#000000">github.com/cosmos/cosmos&#45;sdk/container_test.KVStoreKey</text>
</g>
<!-- github.com/cosmos/cosmos&#45;sdk/container_test.ProvideKVStoreKey&#45;&gt;github.com/cosmos/cosmos&#45;sdk/container_test.KVStoreKey -->
<g id="edge2" class="edge">
<title>github.com/cosmos/cosmos&#45;sdk/container_test.ProvideKVStoreKey&#45;&gt;github.com/cosmos/cosmos&#45;sdk/container_test.KVStoreKey</title>
<path fill="none" stroke="#000000" d="M926.7809,-288.8314C926.7809,-281.131 926.7809,-271.9743 926.7809,-263.4166"/>
<polygon fill="#000000" stroke="#000000" points="930.281,-263.4132 926.7809,-253.4133 923.281,-263.4133 930.281,-263.4132"/>
</g>
<!-- github.com/cosmos/cosmos&#45;sdk/container.ModuleKey -->
<g id="node5" class="node">
<title>github.com/cosmos/cosmos&#45;sdk/container.ModuleKey</title>
<ellipse fill="none" stroke="#000000" stroke-width="1.5" cx="926.7809" cy="-380" rx="209.0631" ry="18"/>
<text text-anchor="middle" x="926.7809" y="-376.3" font-family="Times,serif" font-size="14.00" fill="#000000">github.com/cosmos/cosmos&#45;sdk/container.ModuleKey</text>
</g>
<!-- github.com/cosmos/cosmos&#45;sdk/container.ModuleKey&#45;&gt;github.com/cosmos/cosmos&#45;sdk/container_test.ProvideKVStoreKey -->
<g id="edge1" class="edge">
<title>github.com/cosmos/cosmos&#45;sdk/container.ModuleKey&#45;&gt;github.com/cosmos/cosmos&#45;sdk/container_test.ProvideKVStoreKey</title>
<path fill="none" stroke="#000000" d="M926.7809,-361.9551C926.7809,-353.8828 926.7809,-344.1764 926.7809,-335.1817"/>
<polygon fill="#000000" stroke="#000000" points="930.281,-335.0903 926.7809,-325.0904 923.281,-335.0904 930.281,-335.0903"/>
</g>
<!-- github.com/cosmos/cosmos&#45;sdk/container.OwnModuleKey -->
<g id="node6" class="node">
<title>github.com/cosmos/cosmos&#45;sdk/container.OwnModuleKey</title>
<ellipse fill="none" stroke="#d3d3d3" stroke-width=".5" cx="450.7809" cy="-235" rx="226.6599" ry="18"/>
<text text-anchor="middle" x="450.7809" y="-231.3" font-family="Times,serif" font-size="14.00" fill="#696969">github.com/cosmos/cosmos&#45;sdk/container.OwnModuleKey</text>
</g>
<!-- github.com/cosmos/cosmos&#45;sdk/container.OwnModuleKey&#45;&gt;github.com/cosmos/cosmos&#45;sdk/container_test.ModuleA.Provide -->
<g id="edge4" class="edge">
<title>github.com/cosmos/cosmos&#45;sdk/container.OwnModuleKey&#45;&gt;github.com/cosmos/cosmos&#45;sdk/container_test.ModuleA.Provide</title>
<path fill="none" stroke="#000000" d="M504.9135,-217.5147C536.7663,-207.2259 577.2772,-194.1405 610.9672,-183.2584"/>
<polygon fill="#000000" stroke="#000000" points="612.2896,-186.5094 620.7297,-180.105 610.138,-179.8482 612.2896,-186.5094"/>
</g>
<!-- github.com/cosmos/cosmos&#45;sdk/container_test.KVStoreKey&#45;&gt;github.com/cosmos/cosmos&#45;sdk/container_test.ModuleA.Provide -->
<g id="edge3" class="edge">
<title>github.com/cosmos/cosmos&#45;sdk/container_test.KVStoreKey&#45;&gt;github.com/cosmos/cosmos&#45;sdk/container_test.ModuleA.Provide</title>
<path fill="none" stroke="#000000" d="M867.2172,-217.6074C831.5542,-207.1938 785.9946,-193.8904 748.3799,-182.9069"/>
<polygon fill="#000000" stroke="#000000" points="749.0792,-179.465 738.499,-180.0217 747.1171,-186.1844 749.0792,-179.465"/>
</g>
<!-- github.com/cosmos/cosmos&#45;sdk/container_test.KVStoreKey&#45;&gt;github.com/cosmos/cosmos&#45;sdk/container_test.ModuleB.Provide -->
<g id="edge8" class="edge">
<title>github.com/cosmos/cosmos&#45;sdk/container_test.KVStoreKey&#45;&gt;github.com/cosmos/cosmos&#45;sdk/container_test.ModuleB.Provide</title>
<path fill="none" stroke="#000000" d="M986.3445,-217.6074C1022.0075,-207.1938 1067.5671,-193.8904 1105.1818,-182.9069"/>
<polygon fill="#000000" stroke="#000000" points="1106.4446,-186.1844 1115.0627,-180.0217 1104.4825,-179.465 1106.4446,-186.1844"/>
</g>
<!-- github.com/cosmos/cosmos&#45;sdk/container_test.TestGraphAndLogOutput -->
<g id="node11" class="node">
<title>github.com/cosmos/cosmos&#45;sdk/container_test.TestGraphAndLogOutput</title>
<polygon fill="none" stroke="#ff0000" stroke-width=".5" points="1984.6974,-18 1824.7391,-36 1504.8226,-36 1344.8643,-18 1504.8226,0 1824.7391,0 1984.6974,-18"/>
<text text-anchor="middle" x="1664.7809" y="-14.3" font-family="Times,serif" font-size="14.00" fill="#ff0000">github.com/cosmos/cosmos&#45;sdk/container_test.TestGraphAndLogOutput</text>
</g>
<!-- github.com/cosmos/cosmos&#45;sdk/container_test.KeeperB&#45;&gt;github.com/cosmos/cosmos&#45;sdk/container_test.TestGraphAndLogOutput -->
<g id="edge13" class="edge">
<title>github.com/cosmos/cosmos&#45;sdk/container_test.KeeperB&#45;&gt;github.com/cosmos/cosmos&#45;sdk/container_test.TestGraphAndLogOutput</title>
<path fill="none" stroke="#000000" d="M1664.7809,-71.8314C1664.7809,-64.131 1664.7809,-54.9743 1664.7809,-46.4166"/>
<polygon fill="#000000" stroke="#000000" points="1668.281,-46.4132 1664.7809,-36.4133 1661.281,-46.4133 1668.281,-46.4132"/>
</g>
<!-- github.com/cosmos/cosmos&#45;sdk/container_test.MsgClientA -->
<g id="node10" class="node">
<title>github.com/cosmos/cosmos&#45;sdk/container_test.MsgClientA</title>
<ellipse fill="none" stroke="#ff0000" stroke-width=".5" cx="1403.7809" cy="-235" rx="228.2596" ry="18"/>
<text text-anchor="middle" x="1403.7809" y="-231.3" font-family="Times,serif" font-size="14.00" fill="#ff0000">github.com/cosmos/cosmos&#45;sdk/container_test.MsgClientA</text>
</g>
<!-- github.com/cosmos/cosmos&#45;sdk/container_test.MsgClientA&#45;&gt;github.com/cosmos/cosmos&#45;sdk/container_test.ModuleB.Provide -->
<g id="edge9" class="edge">
<title>github.com/cosmos/cosmos&#45;sdk/container_test.MsgClientA&#45;&gt;github.com/cosmos/cosmos&#45;sdk/container_test.ModuleB.Provide</title>
<path fill="none" stroke="#000000" d="M1349.4087,-217.5147C1317.4149,-207.2259 1276.7248,-194.1405 1242.8858,-183.2584"/>
<polygon fill="#000000" stroke="#000000" points="1243.6714,-179.8346 1233.08,-180.105 1241.5283,-186.4985 1243.6714,-179.8346"/>
</g>
</g>
</svg>