Public | Automated Build

Last pushed: 2 years ago
Short Description
Short description is empty for this repo.
Full Description


Sarpa is a poor man's service discovery system. It is made to be used
with Docker instances. So when an Docker instance is started up it
reports itself on etcd with the public ip and port to connect
to. Sarpa watches for these key changes. And updates a file in S3
which has key values of service to machines.


export AWS_ACCESS_KEY_ID=<your access key id>
export AWS_SECRET_ACCESS_KEY=<your secret key>
export ETCD_HOSTS=""
export SARPA_BUCKET=""

Etcd Keys

The keys for the discovery looks like the following. It always looks
in the /sarpa directory. The next key is the s3 bucket to push the
configuration file to. The value after that is the service short name.

In that directory you can create children which include the public_host:port
so the clients can connect to them.



etcdctl set /sarpa/treely/1 ""

Example of a service reporting to sarpa

Here is a an example for treemap. It is a fleet script which runs the
service on a CoreOS cluster.


ExecStartPre=-/usr/bin/docker pull forestly/treely
ExecStartPre=-/usr/bin/docker kill treemap-%i
ExecStartPre=-/usr/bin/docker rm treemap-%i
ExecStart=/usr/bin/docker run --rm --name treemap-%i -p 3001:3001 forestly/treely
ExecStartPost=/usr/bin/etcdctl set /sarpa/treemap/%m http://%H:3001
ExecStop=/usr/bin/docker stop treemap-%i
ExecStopPost=/usr/bin/etcdctl rm /sarpa/treemap/%m


Usage in Javascript

<script src=""></script>

Network Diagram

Docker Pull Command
Source Repository