The microservices architecture is a powerful way to organize and run large codebases - however, without appropriate tooling, it can also introduce tremendous complexity.
At Hailo, we already have that tooling, and as avid users of free and open source software, thought about giving back to the community and encourage people dive into the amazing world of microservices.
This project is still in its infancy, but - we hope - it is already useful enough for people who are willing to get their hands dirty!
What's the use of services if you can't call them, huh? You can run a service, connect to your h2 cluster (or to anyone else's if they are reckless enough), call other services, call your service or any other from the outside world (through http), etc.
Cassandra? NSQ? A thin wrapper around these libraries are provided, to make them autoload config, and listen to config changes.
A config service and its pair, a config dashboard, provide you an easy way to set or read config data either manually or from services.
The login service handles authentication, user roles, sessions and more. Users web is an easy way to manage users.
Hshell is the goto tool to interact with services and their endpoints. List services, their endpoints, call the endpoints and see the returned data.
A debugger only works within a single process, where is your god now? Fear not, distributed tracing enables you to visualize all the service calls happening on your cluster!
How to know that your services are healthy? The monitoring service collects metrics from standard and custom healthchecks and the monitoring web visualizes the information.
View and search services logs from your browser.
Your system is flooded with errors but reading the logs is very hard, needles are getting lost in the haystack... but the errors service groups and counts messages so you easily see what's going on.
You get a call from a robot at 3am telling you that you won't get more sleep tonight, what do you do? Platform events let you see all config changes, deployments and more.
You don't have time to build a fully fledged frontend for your app? The playground let's you write and share short frontend scripts that talk to the backend easily.
- Git
- Install Go and configure your GOPATH. If you don't know how to you can follow https://golang.org/doc/code.html
- Bazaar - Go needs it
- Cassandra CLI tool named cqlsh. You can install it via pip.
- Docker
sudo easy_install pip
sudo pip install cqlsh
- Run
docker-machine create --driver virtualbox --virtualbox-memory "2048" h2
to create docker machine. (The amount of memory is important - Cassandra might fail to start with less.)
- Get its ip by typing
docker-machine ip h2
. - Update your
/etc/hosts
file with the ip of h2 machine to enable the web apps.
192.168.59.103 hlabs.com
192.168.59.103 hshell.hlabs.com
192.168.59.103 login.hlabs.com
192.168.59.103 homescreen.hlabs.com
192.168.59.103 playground.hlabs.com
192.168.59.103 dev-config.hlabs.com
192.168.59.103 users.hlabs.com
Replace 192.168.59.103 with your h2 machine's ip.
- Checkout the h2 repo to your local.
- Go to
docker
folder and run
bash docker/build.sh
docker-compose up
- You have to run some Cassandra CQL commands once the cassandra container is running (you can try running the cassandra container only with
docker-compose up cassandra
)
cqlsh $(docker-machine ip h2) -f bootstrap/schemas.cql
Go to scripts
directory.
source setenv.sh $(docker-machine ip h2)
sudo bash copy.sh
Step into example
directory and run
go get
sudo -E go run main.go
Once you get everything up and running successfully, you should be able to access http://hshell.hlabs.com ( default username is admin and password is Password1 )
Try listing all services running using ls
command. You should see com.hailocab.service.template
in the list. To run the example endpoint of it
- Run
cd com.hailocab.service.template
- Run
execute foo {}
- You should get a response like
{
"baz": "There are 7 services running on your h2 cluster"
}
- The homescreen & users web login page does not work. Use the hshell one to get around this.
- The hlabs domain is hardcoded in the nginx config and in the web discovery binary.
You can see the problems and solutions in docs/troubleshooting.md
file.