You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A slightly more customized variant of this is also available as an example
62
-
[docker-compose.yml](./examples/docker-compose.yml) usecase for Workspaces.
94
+
```sh
95
+
docker run --cap-add=SYS_ADMIN -dit -p 5000:5000 -v <path>:/data:ro <dockerhub_username>/blast-radius:v1
96
+
```
63
97
64
98
### Docker configurations
65
99
66
100
*Terraform* module links are saved as _absolute_ paths in relative to the
67
101
project root (note `.terraform/modules/<uuid>`). Given these paths will vary
68
-
betwen Docker and the host, we mount the volume as read-only, assuring we don't
69
-
ever interfere with your real environment.
102
+
betwen Docker and the host, we mount the volume as read-only, assuring we don't ever interfere with your real environment.
70
103
71
-
However, in order for *Blast Radius* to actually work with *Terraform*, it needs
72
-
to be initialized. To accomplish this, the container creates an [overlayfs][]
73
-
that exists within the container, overlaying your own, so that it can operate
104
+
However, in order for *Blast Radius* to actually work with *Terraform*, it needs to be initialized as well as planned compulsory. To accomplish this, the container creates an [overlayfs][] that exists within the container, overlaying your own, so that it can operate
74
105
independently. To do this, certain runtime privileges are required --
75
106
specifically `--cap-add=SYS_ADMIN`.
76
107
77
-
For more information on how this works and what it means for your host, check
78
-
out the [runtime privileges][privileges] documentation.
79
108
80
-
####Docker & Subdirectories
109
+
### Docker & Subdirectories
81
110
82
111
If you organized your *Terraform* project using stacks and modules,
83
112
*Blast Radius* must be called from the project root and reference them as
@@ -101,14 +130,12 @@ It consists of 3 modules `foo`, `bar` and `dead`, followed by one `beef` stack.
101
130
To apply *Blast Radius* to the `beef` stack, you would want to run the container
102
131
with the following:
103
132
104
-
```sh
105
-
$ cd project
106
-
$ docker run --rm -it -p 5000:5000 \
107
-
-v $(pwd):/data:ro \
108
-
--security-opt apparmor:unconfined \
109
-
--cap-add=SYS_ADMIN \
110
-
28mm/blast-radius --serve stacks/beef
111
-
```
133
+
```sh
134
+
$ cd project
135
+
$ docker run --cap-add=SYS_ADMIN -dit -p 5000:5000 -v <pathofdirectory>:/data:ro <dockerhub_username>/blast-radius:v1
136
+
```
137
+
138
+
---
112
139
113
140
## Embedded Figures
114
141
@@ -121,11 +148,14 @@ You will need the following:
121
148
122
149
You can read more details in the [documentation](doc/embedded.md)
123
150
151
+
---
152
+
124
153
## Implementation Details
125
154
126
155
*Blast Radius* uses the [Graphviz][] package to layout graph diagrams,
127
-
[PyHCL](https://github.com/virtuald/pyhcl) to parse [Terraform][] configuration,
128
-
and [d3.js](https://d3js.org/) to implement interactive features and animations.
156
+
[hcl] to parse [Terraform][] configuration, and [d3.js](https://d3js.org/) to implement interactive features and animations.
output_group.add_argument('--dot', action='store_const', const=True, default=False, help='print the graphviz/dot representation of the Terraform graph')
29
31
output_group.add_argument('--svg', action='store_const', const=True, default=False, help='print the svg representation of the Terraform graph')
30
32
output_group.add_argument('--serve', action='store_const', const=True, default=False, help='spins up a webserver with an interactive Terraform graph')
31
-
33
+
output_group.add_argument('--svg-ext', action='store_const', const=True, default=False, help='download the simple svg of modified svg representation of the Terraform graph')
34
+
32
35
parser.add_argument('--graph', type=str, help='`terraform graph` output (defaults to stdin)', default=sys.stdin)
33
36
34
37
# options to limit, re-focus, and re-center presentation of larger graphs.
@@ -49,11 +52,11 @@ def main():
49
52
app.run(host='0.0.0.0',port=args.port)
50
53
sys.exit(0)
51
54
52
-
elifargs.jsonorargs.dotorargs.svg:
55
+
elifargs.jsonorargs.dotorargs.svgorargs.svg_ext:
53
56
ifargs.graphissys.stdin:
54
57
dot=DotGraph('', file_contents=sys.stdin.read())
55
58
else:
56
-
dot=DotGraph(args.graph)
59
+
dot=DotGraph('',file_contents=simple_graph())
57
60
58
61
# we might not want to show every node in the depedency graph
59
62
# specifying --module-depth is an easy way to limit detail
0 commit comments