This is a continuation of the post Writing a PaaS (using Node.js) in 1 week – Monday.
Well Friday is done, and it was one of those days where a stupid bug eats hours of the day. Pushed through it though (went to lunch – my favorite technique)
I failed to get everything done that I wanted to in 5 days, but at the same time I have met all of my original goals, except for an Amazon AMI image for hosting the front-end proxy.
The Good
All of the components are now functioning together. The code is split into the following:
- Service registry – a single service which is responsible for maintaining all of the information about the installed services
- Machine proxy – a self configuring reverse proxy running on each host machine
- Machine host – a self configuring service host running on each host machine. When it finds an eligible service, it installs it. Also doubles as a command line interface to register applications (when run on a client machine)
- Front-end proxy – a pre-configured pound reverse proxy running in front of the machines hosts, directing traffic and terminating the SSL endpoint (https).
I was able to use the CLI to register multiple apps, and the machine host and proxy services picked them up, installed them and exposed them correctly via the reverse proxy. That is awesome! Its just the happy path, but it makes me happy
I have an Amazon AMI ready for the host machine. It is ami-114b9b78. Login as user `ubuntu`. There is a readme.txt in the home folder with further instructions to configure the services. But its not much use without a server running the machine registry
The Bad
I realized that the frontend proxy needs to be self-configuring too, in order to direct the traffic to the correct machine(s). So I’ll have to write another component. The good part is that it can re-use a lot of the logic of the machine proxy code.
I also realized that I am not handling configuration for the services, which is an essential piece. For example, if I install a service that depends on another, then I need to configure the endpoint for that other. Perfectapi allows for service configuration through environment variables, but the service registry and the machine host do not yet have a way to make use of that technique. I’ll have to add some code for that.
The Ugly
The code is not production ready. It handles the happy path ok, but needs more work to be able to recover from problems (e.g. when a service fails to install).