Skip to content

Run an Experiment with Docker and ChaosIQ

Running with ChaosIQ

To connect the image to ChaosIQ the Chaos Toolkit on hte Docker image will need to be signed in to ChaosIQ. The Signing in to ChaosIQ page describes the sign-in in full. The only difference here is, we will not use the default settings file by using following command for the sign-in step:

chaos --settings `pwd`/ctk_config/settings.yaml signin
The chaos signin will prompt is similar to the following, when the prompt for the token shows, paste in the ChaosIQ token:

Note

The file path for the settings.yaml in the above will be your local working directory.

Run Docker Image with your Settings File

Having created the settings file in the ./ctk_config subdirectory you can now run:

docker run  -e "ENDPOINT_URL=https://httpstat.us/200?sleep=2000" \
-v `pwd`/ctk:/home/svc  -v `pwd`/ctk_config:/tmp/settings chaosiq/chaostoolkit \
 --settings /tmp/settings/settings.yaml run experiment.json

Here we setup a volume share with the ./ctk_config subdirectory on the host and /tmp/settings on the guest with the -v option.

Then we use the --setttings option with the chaos run command to use those settings.

The result of running the command will result in the experiment being published to ChaosIQ. If you login to ChaosIQ and navigate to the Executions page you will see the running execution:

Execution Running

If the execution has completed, you can see the completed executions by selecting the Finished tab:

Execution Running

If you select the details button on the most recently finished execution, you will see the execution detail:

Execution Detail

Within the execution detail page if you expand the General label you can see the details of the execution and the Experiment Steady-State Hypothesis which shows the details of the Steady-State Hypothesis.

General and SSH view