incident2chaos 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- incident2chaos-0.1.0/LICENSE +201 -0
- incident2chaos-0.1.0/NOTICE +16 -0
- incident2chaos-0.1.0/PKG-INFO +141 -0
- incident2chaos-0.1.0/README.md +120 -0
- incident2chaos-0.1.0/pyproject.toml +36 -0
- incident2chaos-0.1.0/setup.cfg +4 -0
- incident2chaos-0.1.0/src/incident2chaos/__init__.py +3 -0
- incident2chaos-0.1.0/src/incident2chaos/__main__.py +5 -0
- incident2chaos-0.1.0/src/incident2chaos/badge.py +36 -0
- incident2chaos-0.1.0/src/incident2chaos/cli.py +134 -0
- incident2chaos-0.1.0/src/incident2chaos/codebook.py +47 -0
- incident2chaos-0.1.0/src/incident2chaos/coverage.py +80 -0
- incident2chaos-0.1.0/src/incident2chaos/data/__init__.py +0 -0
- incident2chaos-0.1.0/src/incident2chaos/data/blind_sample.csv +46 -0
- incident2chaos-0.1.0/src/incident2chaos/data/corpus.csv +498 -0
- incident2chaos-0.1.0/src/incident2chaos/data/fault_classes.json +163 -0
- incident2chaos-0.1.0/src/incident2chaos/data/pilot_check.csv +51 -0
- incident2chaos-0.1.0/src/incident2chaos/data/triggers.json +72 -0
- incident2chaos-0.1.0/src/incident2chaos/generate.py +144 -0
- incident2chaos-0.1.0/src/incident2chaos/recipes.py +251 -0
- incident2chaos-0.1.0/src/incident2chaos/templates/__init__.py +0 -0
- incident2chaos-0.1.0/src/incident2chaos/templates/litmus/__init__.py +0 -0
- incident2chaos-0.1.0/src/incident2chaos/templates/litmus/disk-fill.yaml +40 -0
- incident2chaos-0.1.0/src/incident2chaos/templates/litmus/k6-loadgen.yaml +41 -0
- incident2chaos-0.1.0/src/incident2chaos/templates/litmus/node-drain.yaml +26 -0
- incident2chaos-0.1.0/src/incident2chaos/templates/litmus/pod-cpu-hog.yaml +36 -0
- incident2chaos-0.1.0/src/incident2chaos/templates/litmus/pod-delete.yaml +35 -0
- incident2chaos-0.1.0/src/incident2chaos/templates/litmus/pod-dns-error.yaml +43 -0
- incident2chaos-0.1.0/src/incident2chaos/templates/litmus/pod-http-status-code.yaml +54 -0
- incident2chaos-0.1.0/src/incident2chaos/templates/litmus/pod-memory-hog.yaml +38 -0
- incident2chaos-0.1.0/src/incident2chaos/templates/litmus/pod-network-latency.yaml +43 -0
- incident2chaos-0.1.0/src/incident2chaos/templates/litmus/pod-network-loss.yaml +40 -0
- incident2chaos-0.1.0/src/incident2chaos/templates/litmus/pod-network-partition.yaml +23 -0
- incident2chaos-0.1.0/src/incident2chaos/templates/litmus/pod-network-rate-limit.yaml +83 -0
- incident2chaos-0.1.0/src/incident2chaos.egg-info/PKG-INFO +141 -0
- incident2chaos-0.1.0/src/incident2chaos.egg-info/SOURCES.txt +39 -0
- incident2chaos-0.1.0/src/incident2chaos.egg-info/dependency_links.txt +1 -0
- incident2chaos-0.1.0/src/incident2chaos.egg-info/entry_points.txt +2 -0
- incident2chaos-0.1.0/src/incident2chaos.egg-info/requires.txt +5 -0
- incident2chaos-0.1.0/src/incident2chaos.egg-info/top_level.txt +1 -0
- incident2chaos-0.1.0/tests/test_incident2chaos.py +289 -0
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "{}"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright {}
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
incident2chaos
|
|
2
|
+
Copyright 2026 Yogesh Ramaswamy
|
|
3
|
+
|
|
4
|
+
This product includes the ChaosEngine templates (engine.yaml) of the LitmusChaos
|
|
5
|
+
chaos-charts repository, https://github.com/litmuschaos/chaos-charts, commit b2662c23,
|
|
6
|
+
in src/incident2chaos/templates/litmus/, licensed under the Apache License 2.0.
|
|
7
|
+
Copyright The LitmusChaos Authors.
|
|
8
|
+
|
|
9
|
+
The tests include resource schemas from Chaos Mesh, https://github.com/chaos-mesh/chaos-mesh,
|
|
10
|
+
commit e636338c (config/crd/bases), and from the LitmusChaos chaos-operator,
|
|
11
|
+
https://github.com/litmuschaos/chaos-operator, commit 01a76ca (deploy/chaos_crds.yaml),
|
|
12
|
+
both licensed under the Apache License 2.0. Copyright The Chaos Mesh Authors and
|
|
13
|
+
The LitmusChaos Authors.
|
|
14
|
+
|
|
15
|
+
The data files (src/incident2chaos/data/*.csv and *.json, data/codebook.md) are licensed
|
|
16
|
+
under the Creative Commons Attribution 4.0 International license, see data/LICENSE.
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: incident2chaos
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Chaos Mesh and LitmusChaos experiments derived from real cloud incident reports
|
|
5
|
+
Author: Yogesh Ramaswamy
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: Repository, https://github.com/yogeshramaswamy608/incident2chaos
|
|
8
|
+
Keywords: chaos engineering,fault injection,incident analysis,postmortems,Chaos Mesh,LitmusChaos
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Topic :: System :: Distributed Computing
|
|
11
|
+
Classifier: Topic :: Software Development :: Testing
|
|
12
|
+
Requires-Python: >=3.9
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
License-File: LICENSE
|
|
15
|
+
License-File: NOTICE
|
|
16
|
+
Requires-Dist: PyYAML>=6
|
|
17
|
+
Provides-Extra: test
|
|
18
|
+
Requires-Dist: pytest>=7; extra == "test"
|
|
19
|
+
Requires-Dist: jsonschema>=4; extra == "test"
|
|
20
|
+
Dynamic: license-file
|
|
21
|
+
|
|
22
|
+
# incident2chaos
|
|
23
|
+
|
|
24
|
+
Chaos experiments derived from real cloud incidents.
|
|
25
|
+
|
|
26
|
+
A post-incident report, coded under a published codebook, goes in. A ready-to-run Chaos Mesh or LitmusChaos experiment for the failure it describes comes out, marked as a direct injection, an approximation, or not injectable.
|
|
27
|
+
|
|
28
|
+
The tool comes with the coded corpus of the study “Do Chaos Experiments Match Real Cloud Incidents? Mapping 497 Public Postmortems to Fault-Injection Coverage”: 497 public post-incident reports from AWS, Microsoft Azure, Google Cloud, Cloudflare and GitHub, 2011 to 2026, each coded for its trigger and its fault classes. Its `coverage` command reruns the study's measurement: of the 484 in-scope reports that state their primary fault, 274 (56.6 percent, Wilson 95 percent interval 52.2 to 61.0 percent) have a primary fault that Chaos Mesh or LitmusChaos can inject directly.
|
|
29
|
+
|
|
30
|
+
## Worked example, under five minutes
|
|
31
|
+
|
|
32
|
+
You need Python 3.9 or later.
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
pip install git+https://github.com/yogeshramaswamy608/incident2chaos@v0.1.0
|
|
36
|
+
incident2chaos faults
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
`faults` lists the 20 fault classes of the codebook and what the two tools can inject for each (A direct, P approximation only, N not injectable).
|
|
40
|
+
|
|
41
|
+
Take the AWS DynamoDB disruption of Oct 19, 2025 in US-EAST-1. Its report is coded in `examples/aws-dynamodb-2025-10-19.yaml`: trigger T6 (a latent defect activated), primary fault F9 (DNS resolution failure), then F19, F16, F20 and F18.
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
curl -sLO https://raw.githubusercontent.com/yogeshramaswamy608/incident2chaos/v0.1.0/examples/aws-dynamodb-2025-10-19.yaml
|
|
45
|
+
incident2chaos generate --report aws-dynamodb-2025-10-19.yaml --all-faults \
|
|
46
|
+
--namespace shop --label app=checkout --dependency-label app=orders-db \
|
|
47
|
+
--host dynamodb.us-east-1.amazonaws.com --out dynamodb-experiments.yaml
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
The file holds three Chaos Mesh experiments: a DNSChaos that fails the lookups of the DynamoDB endpoint for the `app=checkout` pods (F9, direct), an IOChaos that corrupts data reads (F19, approximation), and a NetworkChaos partition from the `app=orders-db` pods (F16, direct). For F20 and F18 it says that Chaos Mesh has no fault for the class and points to `--tool litmus`, which writes a k6 load generator, joined for F20 by an HTTP error fault on the dependency.
|
|
51
|
+
|
|
52
|
+
The end-to-end test (workflow `end-to-end`) builds a Kubernetes cluster with kind, installs Chaos Mesh, and applies every Chaos Mesh experiment the tool writes: all 17 reached the injected state. Every LitmusChaos experiment it writes is accepted by the Kubernetes API server with the LitmusChaos resource definitions installed; running them needs the LitmusChaos operator.
|
|
53
|
+
|
|
54
|
+
Every experiment carries the report's link, the fault class and the injectability as annotations, so a team can trace each experiment to the incident behind it.
|
|
55
|
+
|
|
56
|
+
To run the experiments, install [Chaos Mesh](https://chaos-mesh.org/docs/quick-start/) or [LitmusChaos](https://docs.litmuschaos.io/) in a test cluster, read the file, set the targets to your own services, and apply it with `kubectl apply -f dynamodb-experiments.yaml`. Run chaos experiments only on systems you own and are allowed to test.
|
|
57
|
+
|
|
58
|
+
A report from the released corpus can be used directly by its number:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
incident2chaos generate --corpus-id 1 --tool litmus
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Coverage
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
incident2chaos coverage # the whole corpus
|
|
68
|
+
incident2chaos coverage --by source
|
|
69
|
+
incident2chaos coverage --by trigger
|
|
70
|
+
incident2chaos coverage --by year --json
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Each report's injectability is derived from its primary fault class and its provider under the codebook's mapping, and checked against the value stored in the corpus. Give `--corpus FILE` to measure another corpus coded with the same columns.
|
|
74
|
+
|
|
75
|
+
## A coverage badge for your own postmortems
|
|
76
|
+
|
|
77
|
+
Code your team's postmortems as YAML files like the example above, in one folder, and add this step to a GitHub Actions workflow:
|
|
78
|
+
|
|
79
|
+
```yaml
|
|
80
|
+
- uses: yogeshramaswamy608/incident2chaos@v0.1.0
|
|
81
|
+
with:
|
|
82
|
+
reports: postmortems/coded
|
|
83
|
+
badge: .github/badges/chaos-coverage.svg
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
The step writes a badge with the share of your incidents whose primary failure Chaos Mesh or LitmusChaos can inject directly. Give `min-share: 0.5` to fail the step below 50 percent. The same works locally: `incident2chaos badge --reports postmortems/coded --out chaos-coverage.svg`.
|
|
87
|
+
|
|
88
|
+
## Coding a new report
|
|
89
|
+
|
|
90
|
+
Write a YAML file like the example:
|
|
91
|
+
|
|
92
|
+
```yaml
|
|
93
|
+
id: my-incident-2026-11-01
|
|
94
|
+
title: Summary of the incident
|
|
95
|
+
url: https://example.com/postmortem
|
|
96
|
+
source: AWS PES # optional; zone loss (F3) is directly injectable on AWS only
|
|
97
|
+
trigger: T2 # T1 to T13, T99 when the report does not state it
|
|
98
|
+
faults: [F15, F14, F20] # every failure the report states, primary first
|
|
99
|
+
primary_fault: F15
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Code only what the report states. The codes, their definitions and the coding rules are in [data/codebook.md](data/codebook.md).
|
|
103
|
+
|
|
104
|
+
## What is in this repository
|
|
105
|
+
|
|
106
|
+
| Path | What it is |
|
|
107
|
+
|---|---|
|
|
108
|
+
| `src/incident2chaos/` | The command line tool (Apache 2.0) |
|
|
109
|
+
| `src/incident2chaos/data/corpus.csv` | The coded corpus: link, title, date and labels for each of 497 reports (CC BY 4.0) |
|
|
110
|
+
| `src/incident2chaos/data/blind_sample.csv` | The 45-report blind agreement sample, both codings (CC BY 4.0) |
|
|
111
|
+
| `src/incident2chaos/data/pilot_check.csv` | The 50-report pilot: the proposed labels, the author's verdict and the final labels (CC BY 4.0) |
|
|
112
|
+
| `data/codebook.md` | Codebook version 2: 13 trigger codes, 20 fault classes, the mapping to Chaos Mesh and LitmusChaos, the coding rules (CC BY 4.0) |
|
|
113
|
+
| `data/site_terms.md` | The site terms of each provider, read before collection |
|
|
114
|
+
| `data/README.md` | The columns of the data files |
|
|
115
|
+
| `dataset/` | The files of the Zenodo dataset record, as uploaded there |
|
|
116
|
+
| `tests/` | Tests that rerun the figures of the paper's Tables 1 to 3 and its agreement figures, and validate every experiment against the Chaos Mesh and LitmusChaos resource schemas |
|
|
117
|
+
|
|
118
|
+
No report text is redistributed. The corpus holds each report's link, its title and date as the provider's index lists them, and our labels with short evidence notes in our own words.
|
|
119
|
+
|
|
120
|
+
## Versions the mapping was read from
|
|
121
|
+
|
|
122
|
+
- Chaos Mesh, commit e636338c (Nov 3, 2026), the API types under `api/v1alpha1`
|
|
123
|
+
- LitmusChaos chaos-charts, commit b2662c23 (Apr 16, 2026), 60 fault folders
|
|
124
|
+
|
|
125
|
+
A fault added to either tool after these commits may change a class from approximation to direct.
|
|
126
|
+
|
|
127
|
+
## How to cite
|
|
128
|
+
|
|
129
|
+
Cite the paper and the software. The `CITATION.cff` file gives the software citation, and GitHub shows it under "Cite this repository".
|
|
130
|
+
|
|
131
|
+
> Ramaswamy Y (2026) Do Chaos Experiments Match Real Cloud Incidents? Mapping 497 Public Postmortems to Fault-Injection Coverage.
|
|
132
|
+
|
|
133
|
+
The dataset on Zenodo: https://doi.org/10.5281/zenodo.23973151 (corpus, codebook, pilot and blind samples, CC BY 4.0). The software's Zenodo DOI is added here when release 0.1.0 is archived.
|
|
134
|
+
|
|
135
|
+
## How this was made
|
|
136
|
+
|
|
137
|
+
The author designed the study and the codebook, checked every pilot label, coded the blind agreement sample, and checked every figure against the scripts that produce it. A large language model from Anthropic (Claude Opus 5.5) drafted the code, the tests and this documentation under the author's direction and proposed the first-pass labels of the 447 reports outside the pilot under the frozen codebook; those labels were not revised afterwards. The model is not an author.
|
|
138
|
+
|
|
139
|
+
## License
|
|
140
|
+
|
|
141
|
+
The code is under the Apache License 2.0 (`LICENSE`). The LitmusChaos experiment templates in `src/incident2chaos/templates/litmus/` come from the LitmusChaos project under the same license (`NOTICE`). The data files and the codebook are under the Creative Commons Attribution 4.0 International license (`data/LICENSE`).
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# incident2chaos
|
|
2
|
+
|
|
3
|
+
Chaos experiments derived from real cloud incidents.
|
|
4
|
+
|
|
5
|
+
A post-incident report, coded under a published codebook, goes in. A ready-to-run Chaos Mesh or LitmusChaos experiment for the failure it describes comes out, marked as a direct injection, an approximation, or not injectable.
|
|
6
|
+
|
|
7
|
+
The tool comes with the coded corpus of the study “Do Chaos Experiments Match Real Cloud Incidents? Mapping 497 Public Postmortems to Fault-Injection Coverage”: 497 public post-incident reports from AWS, Microsoft Azure, Google Cloud, Cloudflare and GitHub, 2011 to 2026, each coded for its trigger and its fault classes. Its `coverage` command reruns the study's measurement: of the 484 in-scope reports that state their primary fault, 274 (56.6 percent, Wilson 95 percent interval 52.2 to 61.0 percent) have a primary fault that Chaos Mesh or LitmusChaos can inject directly.
|
|
8
|
+
|
|
9
|
+
## Worked example, under five minutes
|
|
10
|
+
|
|
11
|
+
You need Python 3.9 or later.
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pip install git+https://github.com/yogeshramaswamy608/incident2chaos@v0.1.0
|
|
15
|
+
incident2chaos faults
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
`faults` lists the 20 fault classes of the codebook and what the two tools can inject for each (A direct, P approximation only, N not injectable).
|
|
19
|
+
|
|
20
|
+
Take the AWS DynamoDB disruption of Oct 19, 2025 in US-EAST-1. Its report is coded in `examples/aws-dynamodb-2025-10-19.yaml`: trigger T6 (a latent defect activated), primary fault F9 (DNS resolution failure), then F19, F16, F20 and F18.
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
curl -sLO https://raw.githubusercontent.com/yogeshramaswamy608/incident2chaos/v0.1.0/examples/aws-dynamodb-2025-10-19.yaml
|
|
24
|
+
incident2chaos generate --report aws-dynamodb-2025-10-19.yaml --all-faults \
|
|
25
|
+
--namespace shop --label app=checkout --dependency-label app=orders-db \
|
|
26
|
+
--host dynamodb.us-east-1.amazonaws.com --out dynamodb-experiments.yaml
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
The file holds three Chaos Mesh experiments: a DNSChaos that fails the lookups of the DynamoDB endpoint for the `app=checkout` pods (F9, direct), an IOChaos that corrupts data reads (F19, approximation), and a NetworkChaos partition from the `app=orders-db` pods (F16, direct). For F20 and F18 it says that Chaos Mesh has no fault for the class and points to `--tool litmus`, which writes a k6 load generator, joined for F20 by an HTTP error fault on the dependency.
|
|
30
|
+
|
|
31
|
+
The end-to-end test (workflow `end-to-end`) builds a Kubernetes cluster with kind, installs Chaos Mesh, and applies every Chaos Mesh experiment the tool writes: all 17 reached the injected state. Every LitmusChaos experiment it writes is accepted by the Kubernetes API server with the LitmusChaos resource definitions installed; running them needs the LitmusChaos operator.
|
|
32
|
+
|
|
33
|
+
Every experiment carries the report's link, the fault class and the injectability as annotations, so a team can trace each experiment to the incident behind it.
|
|
34
|
+
|
|
35
|
+
To run the experiments, install [Chaos Mesh](https://chaos-mesh.org/docs/quick-start/) or [LitmusChaos](https://docs.litmuschaos.io/) in a test cluster, read the file, set the targets to your own services, and apply it with `kubectl apply -f dynamodb-experiments.yaml`. Run chaos experiments only on systems you own and are allowed to test.
|
|
36
|
+
|
|
37
|
+
A report from the released corpus can be used directly by its number:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
incident2chaos generate --corpus-id 1 --tool litmus
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Coverage
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
incident2chaos coverage # the whole corpus
|
|
47
|
+
incident2chaos coverage --by source
|
|
48
|
+
incident2chaos coverage --by trigger
|
|
49
|
+
incident2chaos coverage --by year --json
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Each report's injectability is derived from its primary fault class and its provider under the codebook's mapping, and checked against the value stored in the corpus. Give `--corpus FILE` to measure another corpus coded with the same columns.
|
|
53
|
+
|
|
54
|
+
## A coverage badge for your own postmortems
|
|
55
|
+
|
|
56
|
+
Code your team's postmortems as YAML files like the example above, in one folder, and add this step to a GitHub Actions workflow:
|
|
57
|
+
|
|
58
|
+
```yaml
|
|
59
|
+
- uses: yogeshramaswamy608/incident2chaos@v0.1.0
|
|
60
|
+
with:
|
|
61
|
+
reports: postmortems/coded
|
|
62
|
+
badge: .github/badges/chaos-coverage.svg
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
The step writes a badge with the share of your incidents whose primary failure Chaos Mesh or LitmusChaos can inject directly. Give `min-share: 0.5` to fail the step below 50 percent. The same works locally: `incident2chaos badge --reports postmortems/coded --out chaos-coverage.svg`.
|
|
66
|
+
|
|
67
|
+
## Coding a new report
|
|
68
|
+
|
|
69
|
+
Write a YAML file like the example:
|
|
70
|
+
|
|
71
|
+
```yaml
|
|
72
|
+
id: my-incident-2026-11-01
|
|
73
|
+
title: Summary of the incident
|
|
74
|
+
url: https://example.com/postmortem
|
|
75
|
+
source: AWS PES # optional; zone loss (F3) is directly injectable on AWS only
|
|
76
|
+
trigger: T2 # T1 to T13, T99 when the report does not state it
|
|
77
|
+
faults: [F15, F14, F20] # every failure the report states, primary first
|
|
78
|
+
primary_fault: F15
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Code only what the report states. The codes, their definitions and the coding rules are in [data/codebook.md](data/codebook.md).
|
|
82
|
+
|
|
83
|
+
## What is in this repository
|
|
84
|
+
|
|
85
|
+
| Path | What it is |
|
|
86
|
+
|---|---|
|
|
87
|
+
| `src/incident2chaos/` | The command line tool (Apache 2.0) |
|
|
88
|
+
| `src/incident2chaos/data/corpus.csv` | The coded corpus: link, title, date and labels for each of 497 reports (CC BY 4.0) |
|
|
89
|
+
| `src/incident2chaos/data/blind_sample.csv` | The 45-report blind agreement sample, both codings (CC BY 4.0) |
|
|
90
|
+
| `src/incident2chaos/data/pilot_check.csv` | The 50-report pilot: the proposed labels, the author's verdict and the final labels (CC BY 4.0) |
|
|
91
|
+
| `data/codebook.md` | Codebook version 2: 13 trigger codes, 20 fault classes, the mapping to Chaos Mesh and LitmusChaos, the coding rules (CC BY 4.0) |
|
|
92
|
+
| `data/site_terms.md` | The site terms of each provider, read before collection |
|
|
93
|
+
| `data/README.md` | The columns of the data files |
|
|
94
|
+
| `dataset/` | The files of the Zenodo dataset record, as uploaded there |
|
|
95
|
+
| `tests/` | Tests that rerun the figures of the paper's Tables 1 to 3 and its agreement figures, and validate every experiment against the Chaos Mesh and LitmusChaos resource schemas |
|
|
96
|
+
|
|
97
|
+
No report text is redistributed. The corpus holds each report's link, its title and date as the provider's index lists them, and our labels with short evidence notes in our own words.
|
|
98
|
+
|
|
99
|
+
## Versions the mapping was read from
|
|
100
|
+
|
|
101
|
+
- Chaos Mesh, commit e636338c (Nov 3, 2026), the API types under `api/v1alpha1`
|
|
102
|
+
- LitmusChaos chaos-charts, commit b2662c23 (Apr 16, 2026), 60 fault folders
|
|
103
|
+
|
|
104
|
+
A fault added to either tool after these commits may change a class from approximation to direct.
|
|
105
|
+
|
|
106
|
+
## How to cite
|
|
107
|
+
|
|
108
|
+
Cite the paper and the software. The `CITATION.cff` file gives the software citation, and GitHub shows it under "Cite this repository".
|
|
109
|
+
|
|
110
|
+
> Ramaswamy Y (2026) Do Chaos Experiments Match Real Cloud Incidents? Mapping 497 Public Postmortems to Fault-Injection Coverage.
|
|
111
|
+
|
|
112
|
+
The dataset on Zenodo: https://doi.org/10.5281/zenodo.23973151 (corpus, codebook, pilot and blind samples, CC BY 4.0). The software's Zenodo DOI is added here when release 0.1.0 is archived.
|
|
113
|
+
|
|
114
|
+
## How this was made
|
|
115
|
+
|
|
116
|
+
The author designed the study and the codebook, checked every pilot label, coded the blind agreement sample, and checked every figure against the scripts that produce it. A large language model from Anthropic (Claude Opus 5.5) drafted the code, the tests and this documentation under the author's direction and proposed the first-pass labels of the 447 reports outside the pilot under the frozen codebook; those labels were not revised afterwards. The model is not an author.
|
|
117
|
+
|
|
118
|
+
## License
|
|
119
|
+
|
|
120
|
+
The code is under the Apache License 2.0 (`LICENSE`). The LitmusChaos experiment templates in `src/incident2chaos/templates/litmus/` come from the LitmusChaos project under the same license (`NOTICE`). The data files and the codebook are under the Creative Commons Attribution 4.0 International license (`data/LICENSE`).
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=77"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "incident2chaos"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Chaos Mesh and LitmusChaos experiments derived from real cloud incident reports"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "Apache-2.0"
|
|
11
|
+
license-files = ["LICENSE", "NOTICE"]
|
|
12
|
+
requires-python = ">=3.9"
|
|
13
|
+
authors = [{ name = "Yogesh Ramaswamy" }]
|
|
14
|
+
keywords = ["chaos engineering", "fault injection", "incident analysis", "postmortems", "Chaos Mesh", "LitmusChaos"]
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Programming Language :: Python :: 3",
|
|
17
|
+
"Topic :: System :: Distributed Computing",
|
|
18
|
+
"Topic :: Software Development :: Testing",
|
|
19
|
+
]
|
|
20
|
+
dependencies = ["PyYAML>=6"]
|
|
21
|
+
|
|
22
|
+
[project.optional-dependencies]
|
|
23
|
+
test = ["pytest>=7", "jsonschema>=4"]
|
|
24
|
+
|
|
25
|
+
[project.scripts]
|
|
26
|
+
incident2chaos = "incident2chaos.cli:main"
|
|
27
|
+
|
|
28
|
+
[project.urls]
|
|
29
|
+
Repository = "https://github.com/yogeshramaswamy608/incident2chaos"
|
|
30
|
+
|
|
31
|
+
[tool.setuptools.packages.find]
|
|
32
|
+
where = ["src"]
|
|
33
|
+
|
|
34
|
+
[tool.setuptools.package-data]
|
|
35
|
+
"incident2chaos.data" = ["*.csv", "*.json"]
|
|
36
|
+
"incident2chaos.templates.litmus" = ["*.yaml"]
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"""Coverage of a team's own coded postmortems, and an SVG badge for a README."""
|
|
2
|
+
|
|
3
|
+
import glob
|
|
4
|
+
import os
|
|
5
|
+
|
|
6
|
+
from .codebook import injectability
|
|
7
|
+
from .coverage import wilson
|
|
8
|
+
from .generate import load_report
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def reports_coverage(folder):
|
|
12
|
+
"""Share of a folder's coded reports (YAML or JSON) whose primary fault a chaos tool injects directly."""
|
|
13
|
+
paths = sorted(p for ext in ("*.yaml", "*.yml", "*.json")
|
|
14
|
+
for p in glob.glob(os.path.join(folder, "**", ext), recursive=True))
|
|
15
|
+
counts = {"A": 0, "P": 0, "N": 0, "NS": 0}
|
|
16
|
+
for path in paths:
|
|
17
|
+
report = load_report(path)
|
|
18
|
+
counts[injectability(report.primary_fault or "F99", report.source)] += 1
|
|
19
|
+
stated = counts["A"] + counts["P"] + counts["N"]
|
|
20
|
+
low, high = wilson(counts["A"], stated)
|
|
21
|
+
return {"reports": len(paths), "stated": stated, **counts,
|
|
22
|
+
"A_share": counts["A"] / stated if stated else 0.0, "A_low": low, "A_high": high}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def badge_svg(share, label="chaos coverage"):
|
|
26
|
+
"""A flat badge: the label on grey, the directly injectable share on a colour by band."""
|
|
27
|
+
value = f"{round(100 * share)}%"
|
|
28
|
+
colour = "#1F7A3D" if share >= 0.75 else "#B7791F" if share >= 0.5 else "#B42318"
|
|
29
|
+
left, right = 6 * len(label) + 12, 6 * len(value) + 12
|
|
30
|
+
width = left + right
|
|
31
|
+
return (f'<svg xmlns="http://www.w3.org/2000/svg" width="{width}" height="20" role="img" '
|
|
32
|
+
f'aria-label="{label}: {value}"><title>{label}: {value}</title>'
|
|
33
|
+
f'<rect width="{left}" height="20" fill="#555"/>'
|
|
34
|
+
f'<rect x="{left}" width="{right}" height="20" fill="{colour}"/>'
|
|
35
|
+
f'<g fill="#fff" text-anchor="middle" font-family="Verdana,DejaVu Sans,sans-serif" font-size="11">'
|
|
36
|
+
f'<text x="{left / 2}" y="14">{label}</text><text x="{left + right / 2}" y="14">{value}</text></g></svg>')
|