A sample service to see Diffy in action
2.4K
If you like the service, give us a star on this image or github :)
This is a sample service that is meant to test out the Diffy service.
> docker pull diffy/example-service
> docker run -d --name exd-primary -p 9990:5000 diffy/example-service:production
> docker run -d --name exd-secondary -p 9991:5000 diffy/example-service:production
> docker run -d --name exd-candidate -p 9992:5000 diffy/example-service:candidate
# run diffy
> docker run -d --name diffy-01 \
--link exd-candidate:candidate --link exd-primary:primary --link exd-secondary:secondary
-p 8880:8880 -p 8881:8881 -p 8888:8888 diffy/diffy \
-candidate=candidate:5000 -master.primary=primary:5000 -master.secondary=secondary:5000
-service.protocol=http -serviceName=Test-Service
-proxy.port=:8880 -admin.port=:8881 -http.port=:8888 -rootUrl=localhost:8888
# start sending diffy some data
> curl -s -i -H Canonical-Resource : endpoint-test http://localhost:8880/success?value=happy-tester
> curl -s -i -H Canonical-Resource : endpoint-test http://localhost:8880/noise?value=happy-tester
> curl -s -i -H Canonical-Resource : endpoint-test http://localhost:8880/regression?value=happy-tester
> curl -s -i -H Canonical-Resource : endpoint-test http://localhost:8880/noisy_regression?value=happy-tester
Visit: http://localhost:8888
This image is for a service that spins up a server serving 4 endpoints:
Once data from all 4 endpoints is sent to diffy, you can enable the noise cancellation feature to see the real behavioural difference views.
This is the production service we expect to be stable.
> docker pull diffy/example-service:production
> docker run -d --name exd-primary -p 9990:5000 diffy/example-service:production
> curl -s -i -H Canonical-Resource : endpoint-test http://localhost:9990/success?value=happy-tester
> curl -s -i -H Canonical-Resource : endpoint-test http://localhost:9990/noise?value=happy-tester
> curl -s -i -H Canonical-Resource : endpoint-test http://localhost:9990/regression?value=happy-tester
> curl -s -i -H Canonical-Resource : endpoint-test http://localhost:9990/noisy_regression?value=happy-tester
For Diffy we need 2 instances of this service running simultaneously (your primary and secondary services).
> docker pull diffy/example-service:production
> docker run -d --name exd-secondary -p 9991:5000 diffy/example-service:production
> curl -s -i -H Canonical-Resource : endpoint-test http://localhost:9991/success?value=happy-tester
> curl -s -i -H Canonical-Resource : endpoint-test http://localhost:9991/noise?value=happy-tester
> curl -s -i -H Canonical-Resource : endpoint-test http://localhost:9991/regression?value=happy-tester
> curl -s -i -H Canonical-Resource : endpoint-test http://localhost:9991/noisy_regression?value=happy-tester
The candidate service contains the changes you wish to push out in production, but should get a Diffy run in to get a clear picture of your behaviour changes.
> docker pull diffy/example-service:candidate
> docker run -d --name exd-candidate -p 9992:5000 diffy/example-service:candidate
> curl -s -i -H Canonical-Resource : endpoint-test http://localhost:9992/success?value=happy-tester
> curl -s -i -H Canonical-Resource : endpoint-test http://localhost:9992/noise?value=happy-tester
> curl -s -i -H Canonical-Resource : endpoint-test http://localhost:9992/regression?value=happy-tester
> curl -s -i -H Canonical-Resource : endpoint-test http://localhost:9992/noisy_regression?value=happy-tester
Finally we have all our service up and running, so we're ready to deploy a Diffy instance to test the candidate out:
> docker run -d --name diffy-01 \
--link exd-candidate:candidate --link exd-primary:primary --link exd-secondary:secondary
-p 8880:8880 -p 8881:8881 -p 8888:8888 diffy/diffy \
-candidate=candidate:5000 -master.primary=primary:5000 -master.secondary=secondary:5000
-service.protocol=http -serviceName=Test-Service
-proxy.port=:8880 -admin.port=:8881 -http.port=:8888 -rootUrl=localhost:8888
OR feel free to build your own image from the code and use that.
Feel free to use the following script to generate some traffic:
#!/usr/bin/env bash
echo "Send some traffic to your Diffy instance"
declare -a endpoints=("success" "noise" "regression" "noisy_regression")
declare -a values=("mixpanel" "twitter" "airbnb" "paytm" "baidu")
for i in {1..10}
do
for k in "${endpoints[@]}"
do
for v in "${values[@]}"
do
sleep 0.1
curl -s -i -H "Canonical-Resource : endpoint-$k" http://localhost:8880/$k?value=$v > /dev/null
done
done
done
Content type
Image
Digest
Size
34.1 MB
Last updated
about 8 years ago
docker pull diffy/example-service:candidate