Category Archives: NodeJS

More work on Ngramatic

Past night I took a break and went early to bed (during the weekend I drink less coffee than usual, and probably that has something to do with my sleepiness). But tonight I fired the machine again after dinner, working into Ngramatic to get a fresh version out.

Right now I am cleaning the code and adding a new set of HTTP controls to fire the processes from a web client. Monitoring and orchestration are more valuable than usual with a mesh architecture, and I am trying to cover as much as I can outside the working day.

Facebooktwittergoogle_plusredditpinterestlinkedinmailby feather

Domains and hosting

Nothing too exciting tonight. I was checking hostings outside AWS, because the prices don’t fly too well with me if it is only for a messing around after working hours.

In the end I picked up a VPS Classic from OVH. For 6.5 euros I get two cores, 2GB of RAM and 25 GB of disk, which should be enough to do some experiments. The contract goes monthly, then I can stop it for the price of three coffees. Not too bad.

Then I was busy with administrivia, a few of my registered domains are close to be renewed, and I am consolidating all those operations with the guys in Blacknight.

Tomorrow I will try to deploy Ghost there, and see how it works.

Facebooktwittergoogle_plusredditpinterestlinkedinmailby feather

Binding mistake

OK, in the end my problem with port forwarding was the binding I was using in my test application. Interesting enough, it is a time now since I was using Vagrant and NodeJS every day, and it showed up in my confusion.

I did a little application to test why I wasn’t able to reach my guest server from my host machine. I tried changing the forwarded port number and enabled firewalls, but nothing happened. Initially I assumed that there was a problem between Vagrant and Ubuntu, then I tried with different OSs, different versions of Ubuntu, but there was no improvement.

Here is the code I used, blindly taken from the NodeJS page:

Then I tried using Apache as a test application and it worked fine. That removed Vagrant as the problem, but i wasn’t that sure about Ubuntu. I tried with the firewalls again, but no luck. Finally, after reading the same documentation again and again, I noticed the details about binding the NodeJS application. I was using localhost as the server, but I needed to replace it with 0.0.0.0 A second later, my test was passing, I slapped my face (because I read that, and have done it many times before), and I am now writing and heading to bed. It was frustrating, but I am happy in the end. Tomorrow I should be able to deploy Ghost properly, meanwhile, the little test is here:

 

Facebooktwittergoogle_plusredditpinterestlinkedinmailby feather

Liveish in AWS

A short post today, because I am ready to go to sleep.

Putting an hour here and there today, finally the servers are live in Amazon, and doing part of the trick. I realised that there are problems with the data, but I am sure we will be able to sort them out tomorrow.

The site is not open to the public yet, but hopefully it will be out soon. I am a very happy monkey today! And now it is time to go back to side projects for real!

Facebooktwittergoogle_plusredditpinterestlinkedinmailby feather

Getting the product ready

Tonight, instead of being in a side project I am finishing the last few items to get Ngramatic‘s product ready to start demoing. It wasn’t a project as the last previous few, because there were too many moving parts to be able to go straight to production from day one, but after two months of hard work it should be deployed in AWS by Monday.

The process involves a number of Java servers, an Angular front end and NodeJS in the middle of two, all using ZeroMQ as the channel. Deployment is done with Python Fabric, and it runs in Ubuntu in AWS. For development we were using the local machines, but soon we will move to Vagrant. I wonder if I should try to use Docker, but I am not that comfortable with it yet.

Now, I have to finish the last monitoring calls, and sort out CORS in Restify. Piece of cake (from Conor’s birthday past week).

Facebooktwittergoogle_plusredditpinterestlinkedinmailby feather

NodeJS meetup

Past night I went to a NodeJS meetup about micro servers and Docker instead of working at home. It was very interesting to see their approach to data distribution. I find it similar to NServiceBus, which I was trying to use at emuse, but with a more lightweight approach.

What I like is the lack of network structure definition upfront (which is heavy enough in the things I am doing). In my case, I need to define each endpoint, and then annotate them on each client server. Instead, the demo was about sending all data to a bus and detecting the pattern of each message, and acting based on its details. Then, every server receive every message, and if the message has details saying that a given server has to process it, the server will work on the data and post the results back on the bus for the next service.

Work pipeline definition should then be simple and easy to change. My only concern is about network traffic (how many messages are you going to have around?), but I can think of a couple of ways to address that (probably the SenecaJS code has some solutions too, I will have to check).

The talk about Docker was more in line with its documentation, and I didn’t get too much out of it because I was going through in the previous days, but still it was good to align it with the bus architecture.

All in all, it was an evening well spent.

Facebooktwittergoogle_plusredditpinterestlinkedinmailby feather

Ghost continued

Vagrant is up and running, and I completed the script to deploy Ghost on it. But still it isn’t running. I mapped the port 3168 from Vagrant to 8080 in my laptop, but there is no ghost jumping around in my browser. I can do a curl in the terminal during an ssh into Vagrant, but if I try to cal from outside I get a ‘connection reset by peer’ error message.

The problem seems to be with VirtualBox. After a good amount of googling, I found a message pointing to a problem with VirtualBox Guest Addditions, but I couldn’t fix it yet, and it is late enough to go to bed. There are a few updates on the project, but they are still not good.

Facebooktwittergoogle_plusredditpinterestlinkedinmailby feather

Ghost blog

Although I am using WordPress to host this blog, I never felt too comfortable with it. For me it looks too complicated, I cannot make sense of the source code, writing plugins has too many turns for my likeness, the whole thing is great if you know it, but too much trouble if you don’t. WordPress feels like my own big applications, while I retained them in RAM I was  productive, but as soon as I left them alone for a few months I always wanted to rewrite each of them because I couldn’t made head from tail.

But the alternatives were not better and my hosting providers know it well, then it did the trick and I forgot about blog hosting and did some programming, until now.

Being messing with NodeJS for more than a year now, I wouldn’t mind to convert many things to it, and a blogging application is one of the prime candidates. I played with the idea of making one, but in the end I got engaged with other things and left the open source effort for others.

There are a few blogging platforms in NodeJS already, but the best candidate in my eyes is Ghost. The author run a Kickstarter campaign, exceeded his target and got the product on time, which speaks volumes for me..

The code is available, and although I don’t really know how it works, I feel a lot more confident reading it and trying to make sense about what is going on. I believe that if I spend the time I should be able to make things with Ghost.

Then, the first step is to deploy it. I am using my traditional approach, fired a Vagrant machine and started following the instructions (my scripts are hosted in Github). I am halfway through it, it is too late now to do any testing.

As a side result, I just found Flightplan, which is an attempt to replicate Python Fabric but in NodeJS.

Facebooktwittergoogle_plusredditpinterestlinkedinmailby feather