Skip to content
This repository has been archived by the owner on Jul 23, 2019. It is now read-only.
/ tugbot-leader Public archive

Testing in Production (TiP) Framework for Docker Swarm

License

Notifications You must be signed in to change notification settings

gaia-docker/tugbot-leader

Repository files navigation

tugbot-leader

CircleCI codecov Go Report Card Docker Docker Image Layers

Tugbot Leader is a Continuous Testing Framework for Docker Swarm based production/staging/testing environment. Tugbot Leader executes Docker Swarm Test Services upon some event.

Test Service

Test Service is a regular Docker swarm service. Docker LABEL is used to discover test service and Tugbot related test metadata. These labels can be specified at runtime, using --label of docker service create option. Tugbot Leader will trigger a sequential test service execution upon event (see tugbot-swarm-events label). In order to collect test results and depoly those results to elasticsearch, for example, you should add tugbot-collect related labels (see tugbot-results-dir label).

Tugbot labels

All Tugbot labels must be prefixed with tugbot- to avoid potential conflict with other labels. Tugbot labels are divided into:

  1. Container labels:
  • tugbot-results-dir - directory, where test container reports test results; default to /var/tests/results
  1. Swarm Service labels:
  • tugbot-swarm-events - list of comma separated Docker Swarm events (currently only service update is supported)

#####Example Docker Swarm Test Service creation:

docker service create --network my_net --replicas 1 --restart-condition none --label tugbot-swarm-events=update --name mytest my-test-img

It is highly recommended to determain --restart-condition none when creating a test service. Otherwise, Swarm will restart test service all the time (default “any”).

Use --label tugbot-swarm-events=update to tell tugbot framework that this is a test service that should be updated each time an application service is updated.

Running Tugbot Leader inside a Docker container

docker run -d -e DOCKER_HOST=<Address> -e DOCKER_CERT_PATH=<Docker Certificate Path> --log-driver=json-file --name tugbot-leader gaiadocker/tugbot-leader
  • DOCKER_HOST - Docker Swarm Master host address (Tugbot Leader should run as part of Docker Swarm Master in order to update Docker Swarm Services).
  • DOCKER_CERT_PATH - dirctory should contain: ca.pem, cert.pem and key.pem. While using Docker secure communication.
  • DOCKER_TLS_VERIFY - Use TLS when connecting to the Docker socket and verify the server's certificate.
  • TUGBOT_LEADER_INTERVAL - Interval time between polling Docker Swarm for list of updated services (currently docker is not exposing Swarm events, this is why Tugbot Leader is polling the Swarm master node). An interval string is a possibly signed sequence of decimal numbers, each with optional fraction and a time unit suffix, such as "300s", "1.5h" or "2h45m". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
  • TUGBOT_LEADER_LOG_LEVEL - Enable debug mode. When this option set to debug you'll see more verbose logging in the Tugbot Leader log file.

About

Testing in Production (TiP) Framework for Docker Swarm

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages