Not a toy OS anymore

Image
@piranna

12:11 - 3 Mar 2016

With the release of the release candidate it would seems that this repository has been somewhat quiet, but the fact is that there has been a lot of progress lately on other areas of NodeOS (and I’m not talking only about the new 700 stargazers or the repercussion on Twitter of the project and the publication of several articles on Internet… ;-) ) like my bachelor thesis or the rewrite of nsh (still in progress, but when I get to rid the stdin problems it will be really awesome :-D ) and specially thanks to the work of @lite20, @Coretool and @formula1 here on the issues but also on projects like noGUI (keep rocking guys!!! ;-) ).

But last February 29th (what a charismatic date ;-) ) something “magic” happened, that by the way while I’m writting this there are some spies asking me for details ;-)

The suggestion of @Xe about using an independent C-based init process didn’t worked as expected but at least it helped to have an init process that shutdown gracefully the system when no more processes are running.

But I was thinking: Node.js can run on regular Linux systems, so something happens between starting the system init and executing Node.js that allow latest ones to run correctly that was not needed before. Maybe the kernel filesystems like /proc or more probably /sys (that I was not using before)? So trying to isolate it I made a copy of my Ubuntu initrd.img file and included it Node.js and its needed libraries. Later booted my computer using it and disabling my hard disk to force to keep into the initram and there I was able to run Node.js. Cool! Time to clean the init script. Mount root partition, NFS, parsing Linux command line… at the end I get only three suspects: the mounting of /sys, /proc and /dev filesystems, of course.

But I was afraid. What if I was wrong? What if by removing them Node.js still runs on the Ubuntu initram? Could be the problem be somewhere else? And ironically, that would have been the time I most enjoyed something doesn’t work :-P After checking it found the culprit: /dev, the system devices filesystem. WTF? What could have changed on v8 that makes uses of the system devices that’s missing and makes it consume the full CPU? Anyway I didn’t wanted to fix the Ubuntu initram but instead to make NodeOS to boot with newer versions by mounting /dev before executing Node.js, so now that I have an independent init process that would be a good candidate to do it. Just a couple of lines, and check that everything was working. Ok, let’s go for the real deal. Use Node.js 0.12.10 (one of the closests to the 0.11.14 one used by NodeOS) as I was using on my tests with the Ubuntu initram? No, let’s go crazy, run before walk, fail with a lot of noise and use the latest 4.3.1 stable. And after 30 minutes compiling… magic:

img-20160229-wa0003 NodeOS barebones layer. Using Node.js 4.3.1. For real

I don’t have words to explain that moment beyond the fact my cat run scaried and my parents though I got insane :-P One year and a half looking back for a bug… that would turn mad to anybody :-P

After the exctatic moment and some well gained nice tea drinking (not pun intended, I still don’t sell hats :-P ), I needed to update all the NodeOS dependencies that use a compiled module due to the fact I was using outdated ones that were compatible with Node.js 0.11.14. Really a lot (8 of them just only on the NodeOS organization…). It was greatly useful the previous work done by @heavyk (since I’ve never used nan before), and after two days now we have NodeOS fully working with Node.js 4.3.1 and ready for the upcoming ones :-)

There are not prebuild images yet because the build process has got to be really huge and fat and the CI server is not capable to manage so much downloads and compiling steps. I’m thinking about moving to another more capable alternative, but there are also son discussions and pull-requests to remove some functionality from the build process and move it to another independent projects that could more easily be tested and generated and also get it faster to generate NodeOS itself by using prebuild binaries.

Anyway, the code is already available in master branch, and whatever direction the project carry on from now, keep this sentence in your mind: NodeOS is not a toy OS anymore, and it’s very capable to be used on production environments for real use cases from now on. F*ck yeah B-)


14 Comments

NodeOS is made possible by its many contributors around the world. Source code licensed under the MIT license.

Made with ❤️
and 🍺