Download and Install
Pre-Requisites:
- Docker for Mac v1.12 or higher
- Bash shell
- Docker for Windows v1.12 or higher
- Docker for Linux environments
- Familar with Unix CLI (macOS) or Window Powershell
Tugbot in your environment
Download Tugbot to run in your own cluster. Tugbot consists of 3 services:
Example - DockerCon 2016 Voting App with Tugbot
Standalone
See Pre-Requisites
Example Voting App DEMO
- Go to the gaia-docker/example-voting-app repo
- Copy the URL by clicking on the Clone or Download
- Run
git clone https://github.com/gaia-docker/example-voting-app.git
cd example-voting-app/
Follow the instructions in the DEMO_FLOW.md file to run the demo scripts in the following order:
- run
./1_deploy.sh
- This deploys the voting app. The first time, it will automatically pull the relevant Docker images. It consists of 5 services. You can check that the 5 services are running by doing adocker ps
. You should see 5 services running. - run
./2_deploy_tugbot.sh
- This deploys 5 additional services. 3 Tugbot services (Run, Collect, Results) and 2 additional services (ElasticSearch and Kibana). The first time, it will automatically pull the relevant Docker images. Running `docker ps
should show 10 services running. - run
./3_configure_kibana.sh
to setup ElasticSearch and Kibana - run
./4_run_tests.sh
to run tugbot. Please note the 1st run needs to be triggered. Normally, this would be executed by an orchestration engine like Swarm, Kubernetes, or Mesos-Marathon. - run
./5_bug_on_off.sh
to introduce failures by deploying bad and good code. You can pass a parameter on the command like./5.bug_on_off 3
to run 3 iterations. - run
./7_pumba.sh
to introduce chaos in the system - run
./8_tugbot_clean.sh
to cleanup by removing pumba, tests, and Tugbot - run
./9_clean.sh
to remove volume and networks. The volumes will remain in the filesystem. Theall
parameter will also delete the volumes.
- run
Swarm
See Pre-Requisites
Follow the instructions in the DEMO-FLOW-SWARM.md
From the cloned directory -
cd swarm
- run
./0_swarm_cluster_mac.sh
(macOS)- This will create a new Swarm cluster on localhost. To control the number of worker nodes, use theNUM_WORKERS
environment variable. Note: in case of failure try to run this script once again. - To see your Swarm cluster, open Swarm Visualizer. You will need to download the ManoMarks visualizer
- The voting app will run at
http://localhost:<x>5000
- The results app will run at
http://localhost:<x>5001
- where
x
represent worker index: 1,2,3… (check Swarm Visuzalizer for right index)
- run
Deploy Voting application:
Run
./1_deploy.sh
Deploy Tugbot Testing Framework:
Run
./2_deploy_tugbot.sh
- The following Docker services will run:es
,kibana,
tugbot-leader
,tugbot-run
,tugbot-collect
andtugbot-result-service-es
.Import Dashboard Setting Into Kibana:
Run
./3_configure_kibana.sh
- Kibana dashboard is now accessible at
http://localhost:<x>5601
. NOTE: The UI is still not usable untiltugbot
sends at least 1 result to Elasticsearch.
- Kibana dashboard is now accessible at
Execute Integration and Functional Tests:
Run
./4_run_tests.sh
- Expected: ALL test must pass now. You should see now the test results in Kibana Dashboard
- Expected: ALL test must pass now. You should see now the test results in Kibana Dashboard
Modify Application by injecting and fixing failures:
Run
./5_bug_on_off.sh
- NOTE: This script will re
./1_deploy.sh
with bad and good version of Vote app
- NOTE: This script will re
Fix Application:
Run
./1_deploy.sh
- Expected: We returned the “Good” image, hence - All tests should pass now. You should see now the test results in Kibana Dashboard at http://localhost:5601
- Expected: We returned the “Good” image, hence - All tests should pass now. You should see now the test results in Kibana Dashboard at http://localhost:5601
Simulate network chaos: Run Pumba (as “interactive” Docker container) to introduce 3 seconds delay for all egress traffic from
result-app
container. Network emulation is activated every minute and lasts for 30 seconds only, after that connection is restored to work normally.Run
./7_run_pumba.sh
- Use Ctrl-C to stop Pumba- Expected: some test might fail now, but should pass, once network emulation stopped.
- Expected: some test might fail now, but should pass, once network emulation stopped.
Clean up Tugbot only:
Run
./8_clean_tugbot.sh
Clean up Tugbot and the voting app:
Run
./9_clean.sh
To destroy local Swarm cluster:
Run
./9_x_clean_swarm_mac.sh
(macOS)
NOTE: The scripts above will leave the volume on the docker host that is used by ElasticSearch.
You can verify the volume’s existence by running: docker volume ls
. To remove the volume, run docker volume rm
volume name.