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
* Refactor/experiment contributing (#470)
* docs: add instructions for building litmus-sdk binary
Non Linux AMD64 users will need to build the binary for their target
platform.
Signed-off-by: Nic Johnson <[email protected]>
* docs: update generated code & docs to aid experiment contribution
It wasn't very clear what generated code needed to be kept, and what
generated code needed to be replaced with experiment-specific code.
Attempt to make that more clear by expanding README & adding grep-able
tags inside generated code.
Signed-off-by: Nic Johnson <[email protected]>
* fix issue-3350 (#468)
Signed-off-by: Andrew Hu <[email protected]>
Co-authored-by: Udit Gaurav <[email protected]>
* Remove the stress process on timeout without failure (#472)
Signed-off-by: udit <[email protected]>
* update image tag
Signed-off-by: udit <[email protected]>
Co-authored-by: Nic Johnson <[email protected]>
Co-authored-by: Andrew Hu <[email protected]>
Copy file name to clipboardExpand all lines: contribute/developer-guide/README.md
+25-7Lines changed: 25 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,6 +34,12 @@ The *generate_experiment.go* script is a simple way to bootstrap your experiment
34
34
$ cd litmus-go/contribute/developer-guide
35
35
```
36
36
37
+
- Build litmus-sdk
38
+
39
+
```
40
+
go build -o ./litmus-sdk ./bin/main.go
41
+
```
42
+
37
43
- Populate the `attributes.yaml` with details of the chaos experiment (or chart). Use the [attributes.yaml.sample](/contribute/developer-guide/attributes.yaml.sample) as reference.
38
44
39
45
As an example, let us consider an experiment to kill one of the replicas of a nginx deployment. The attributes.yaml can be constructed like this:
@@ -158,17 +164,29 @@ The *generate_experiment.go* script is a simple way to bootstrap your experiment
158
164
drwxr-xr-x 2 shubham shubham 4096 Jun 10 22:41 icons/
159
165
```
160
166
161
-
- Proceed with construction of business logic inside the `sample-exec-chaos.go` file, by making
162
-
the appropriate modifications listed below to achieve the desired effect:
163
167
164
-
- variables
165
-
- entry & exit criteria checks for the experiment
166
-
- helper utils in either [pkg](/pkg/) or new [base chaos libraries](/chaoslib)
168
+
- Proceed with construction of business logic, by making the appropriate modifications listed below
169
+
to achieve the desired effect:
170
+
171
+
- Pre-Chaos Checks: Additional experiment-specific checks to run before chaos. Checks should be
172
+
added at the `@TODO: user PRE-CHAOS-CHECK` marker in the
- Library Modifications: This is where the low level chaos execution code should live. Populate
181
+
the `runChaos`, `experimentExecution`, and `injectChaos` functions as appropriate in the
182
+
`chaosLib/litmus/<name>/lib/<name>.go` file.
168
183
169
-
- The chaoslib is created at `chaoslib/litmus/sample-exec-chaos/lib/sample-exec-chaos.go` path. It contains some pre-defined steps which runs the `ChaosInject` command (explicitly provided as an ENV var in the experiment CR). Which will induce chaos in the target application. It will wait for the given chaos duration and finally runs the `ChaosKill` command (also provided as an ENV var) for cleanup purposes. Update this chaoslib to achieve the desired effect based on the use-case or reuse the other existing chaoslib.
184
+
- Post-Chaos Checks: Additional experiment-specific checks to run after achos. Checks should be
185
+
added at the `@TODO: user POST-CHAOS-CHECK` marker in the
0 commit comments