SlideShare a Scribd company logo
Node.js !

in a heterogeneous system

Alexey Migutsky : Senior Software Developer @ Lohika
What do we do?
What do we do?

Ubix.io
PaaS for BigData analytics in cloud
environments.
What do we use?
Scala
Python

What do we use?

Bash
Javascript
BDAS (Spark + Shark)
AWS

What do we use?

Black Voodoo Magic™
Velocipede™
Brains
What’s next?
Node & Maven

Jenkins & Node testing

What’s next?

Velocipede™
CI
?
Why Node.js?
Why Node.js?
Fast and easy
Easy websockets support
Plays nice with AWS
We use it as a web-tier orchestrator
Node & Maven
Node & Maven
We use maven (pom.xml)
We use npm (packege.json)
We have node+maven projects!
Project structure
Node.js in a heterogeneous system
Project structure
+ Subprojects are maven modules
+ Subprojects use common code base
+ Easy « build process »
+ Easy deployments
- Uber root package.json
- Mangled dependencies
Custom modules
Custom modules
Live in root /node_modules right now
Planning to move to separate git repos
Tested with subprojects
Tests
Tests
Mocha + Sinon + Chai
Sinon-chai + mocha-sinon
Chai-as-promised
Rewired
Jenkins TAP plugin
Test example
describe('##getConfiguration', function () {!
it('should return promise and resolve with data ', function (done) {!
var promise = sysStore.getConfiguration('somekey');!
promise.should.eventually.become({key: 'somekey'})!
" .then(function () {!
mockDb.getItem.should.be.calledWithMatch(!
!
mockTables.system, !
"
" {key: sinon.match.string}!
"
");!
})!
.should.notify(done);!
});!
}); 	
  
Test Env How-to
Test Env How-to
Goals:
- 
- 
- 
- 
- 

run from root using mvn test
run from sub using npm test
human-readable result logs
result >> in console and file
Jenkins support
http://www.mindmeister.com/346337860
Test Env How-to
package.json
"devDependencies": {	
  
"mocha": "*",	
  
"sinon": "1.6.*",	
  
"chai": "*",	
  
"sinon-chai": "*",	
  
"mocha-sinon": "*",	
  
"chai-as-promised" : "*",	
  
"rewire" : "*"	
  
},	
  
"scripts" : {	
  
"test" : "./runtest.sh"	
  
}	
  
Test Env How-to
runtest.sh

#!/bin/bash!
mocha $(find test -name '*.js') -R tap | !
tee test/testresults.tap; (exit ${PIPESTATUS[0]})

	
  

The whole command runs in a single line. Wrapped here for display purpose J
Test Env How-to
pom.xml (maven-antrun-plugin)

<execution>!
<id>test-nodejs</id>!
<phase>test</phase>!
<configuration>!
<tasks name="Run mocha tests">!
<exec dir="${basedir}”!
executable="npm”!
failonerror="true">!
<arg value="test"/>!
</exec>!
</tasks>!
</configuration>!
<goals>!
<goal>run</goal>!
</goals>!
</execution> 	
  
Build process
Build process
-  No npm install on build server (too slooow)
-  Fixed deps versions (update by-hand)
-  All deployable deps are checked in!
-  Build phase only copies deps in subprojects

http://www.futurealoof.com/posts/nodemodules-in-git.html
Deployment
Deployment
-  Builds are stored at S3
-  Copied to instances by orchestration tools
-  Managed by upstart
Deployment
upstart (server.conf)
	
  	
  

#this should be put in /etc/init/server.conf on Ubuntu !
description ”Node.js server" !
author
"Alexey Migutsky" !
!
# used to be: start on startup !
# until we found some mounts weren't ready yet while booting: !
start on started mountall !
stop on shutdown !
!
# Automatically Respawn: !
respawn !
respawn limit 20 5 !
!

# Max open files are @ 1024 by default. Bit few.!
limit nofile 32768 32768 !
!

!

script
!
"# Not sure why $HOME is needed, but we found that it is:
"!
"export HOME="/root”!
"exec /usr/local/bin/node /usr/local/server/app.js >> /var/log/server-err.log 2>&1 !
end script !
post-start script
end script

!

http://kvz.io/blog/2009/12/15/run-nodejs-as-a-service-on-ubuntu-karmic/
Deployment hint
Have a look at http://pm2.io/
Continuous Integration
Node.js in a heterogeneous system
« hack some node.js »
npm test
de
h co
pus
de
h co
pus
de
h co
pus

build & test
de
h co
pus

build & test
store
de
h co
pus

build & test
store
de
h co
pus

build & test
store
de
h co
pus

build & test
store

deplo

y
That’s it!
That’s it!
Thanks

@mr_mig_by
bit.ly/mr_mig

More Related Content

What's hot (20)

PDF
Introduction to Node.js: What, why and how?
Christian Joudrey
 
PDF
Modern frontend workflow
Revath S Kumar
 
PDF
Webconf nodejs-production-architecture
Ben Lin
 
PPTX
Build RESTful API Using Express JS
Cakra Danu Sedayu
 
PDF
OSGi in Action - How we use OSGi to build Open Liberty - Alasdair Nottingham ...
mfrancis
 
KEY
Nodejs web,db,hosting
Kenu, GwangNam Heo
 
PPTX
Create Rest API in Nodejs
Irfan Maulana
 
PDF
Running JavaScript Efficiently in a Java World
irbull
 
PDF
Complete MVC on NodeJS
Hüseyin BABAL
 
PPTX
Packing for the Web with Webpack
Thiago Temple
 
PDF
CasperJS and PhantomJS for Automated Testing
X-Team
 
PDF
Site Testing with CasperJS
Joseph Scott
 
PDF
Create a RESTful API with NodeJS, Express and MongoDB
Hengki Sihombing
 
PDF
Modernizing Your WordPress Workflow with Grunt & Bower
Alan Crissey
 
PDF
[Js hcm] Deploying node.js with Forever.js and nginx
Nicolas Embleton
 
PPTX
Java script at backend nodejs
Amit Thakkar
 
PDF
Server-Side JavaScript with Nashorn
Daniel Woods
 
PPTX
When a Sassquatch and a Board get together (or how to use Grunt to chew Sass)
Ricardo Castelhano
 
PDF
Git+jenkins+rex presentation
Dwi Sasongko Supriyadi
 
PPT
Sails js
Andrey Kolodnitsky
 
Introduction to Node.js: What, why and how?
Christian Joudrey
 
Modern frontend workflow
Revath S Kumar
 
Webconf nodejs-production-architecture
Ben Lin
 
Build RESTful API Using Express JS
Cakra Danu Sedayu
 
OSGi in Action - How we use OSGi to build Open Liberty - Alasdair Nottingham ...
mfrancis
 
Nodejs web,db,hosting
Kenu, GwangNam Heo
 
Create Rest API in Nodejs
Irfan Maulana
 
Running JavaScript Efficiently in a Java World
irbull
 
Complete MVC on NodeJS
Hüseyin BABAL
 
Packing for the Web with Webpack
Thiago Temple
 
CasperJS and PhantomJS for Automated Testing
X-Team
 
Site Testing with CasperJS
Joseph Scott
 
Create a RESTful API with NodeJS, Express and MongoDB
Hengki Sihombing
 
Modernizing Your WordPress Workflow with Grunt & Bower
Alan Crissey
 
[Js hcm] Deploying node.js with Forever.js and nginx
Nicolas Embleton
 
Java script at backend nodejs
Amit Thakkar
 
Server-Side JavaScript with Nashorn
Daniel Woods
 
When a Sassquatch and a Board get together (or how to use Grunt to chew Sass)
Ricardo Castelhano
 
Git+jenkins+rex presentation
Dwi Sasongko Supriyadi
 

Similar to Node.js in a heterogeneous system (20)

PPTX
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
Jesse Gallagher
 
KEY
From Dev to DevOps - FOSDEM 2012
Carlos Sanchez
 
PDF
From Dev to DevOps - Codemotion ES 2012
Carlos Sanchez
 
PDF
Server Side Apocalypse, JS
Md. Sohel Rana
 
PDF
Node.js Development Workflow Automation with Grunt.js
kiyanwang
 
PPTX
Windows Azure Web Sites - Things they don’t teach kids in school - BuildStuffLT
Maarten Balliauw
 
PDF
Continous UI testing with Espresso and Jenkins
Sylwester Madej
 
PPTX
Azure Web SItes - Things they don't teach kids in school - Multi-Mania
Maarten Balliauw
 
PDF
Jazoon12 355 aleksandra_gavrilovska-1
Netcetera
 
PDF
The Ultimate Node.js Resource Cheat Sheet 📝: Learn Everything Free
Tapp AI
 
PPTX
Riga Dev Day - Automated Android Continuous Integration
Nicolas Fränkel
 
PPTX
Node.js on Azure
Sasha Goldshtein
 
PDF
JavaScript development methodology
Aleksander Fabijan
 
PDF
The Modern Developer Toolbox
Pablo Godel
 
PDF
[devoxx2025] NodeJs Can do that !!!!.pdf
moassiongbon
 
PDF
Ansible is the simplest way to automate. MoldCamp, 2015
Alex S
 
PDF
Ansible Introduction
Robert Reiz
 
PPTX
introduction to node.js
orkaplan
 
PPTX
Introduction to node.js By Ahmed Assaf
Ahmed Assaf
 
PDF
Cloud Best Practices
Eric Bottard
 
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
Jesse Gallagher
 
From Dev to DevOps - FOSDEM 2012
Carlos Sanchez
 
From Dev to DevOps - Codemotion ES 2012
Carlos Sanchez
 
Server Side Apocalypse, JS
Md. Sohel Rana
 
Node.js Development Workflow Automation with Grunt.js
kiyanwang
 
Windows Azure Web Sites - Things they don’t teach kids in school - BuildStuffLT
Maarten Balliauw
 
Continous UI testing with Espresso and Jenkins
Sylwester Madej
 
Azure Web SItes - Things they don't teach kids in school - Multi-Mania
Maarten Balliauw
 
Jazoon12 355 aleksandra_gavrilovska-1
Netcetera
 
The Ultimate Node.js Resource Cheat Sheet 📝: Learn Everything Free
Tapp AI
 
Riga Dev Day - Automated Android Continuous Integration
Nicolas Fränkel
 
Node.js on Azure
Sasha Goldshtein
 
JavaScript development methodology
Aleksander Fabijan
 
The Modern Developer Toolbox
Pablo Godel
 
[devoxx2025] NodeJs Can do that !!!!.pdf
moassiongbon
 
Ansible is the simplest way to automate. MoldCamp, 2015
Alex S
 
Ansible Introduction
Robert Reiz
 
introduction to node.js
orkaplan
 
Introduction to node.js By Ahmed Assaf
Ahmed Assaf
 
Cloud Best Practices
Eric Bottard
 
Ad

More from GeeksLab Odessa (20)

PDF
DataScience Lab2017_Коррекция геометрических искажений оптических спутниковых...
GeeksLab Odessa
 
PDF
DataScience Lab 2017_Kappa Architecture: How to implement a real-time streami...
GeeksLab Odessa
 
PDF
DataScience Lab 2017_Блиц-доклад_Турский Виктор
GeeksLab Odessa
 
PDF
DataScience Lab 2017_Обзор методов детекции лиц на изображение
GeeksLab Odessa
 
PDF
DataScienceLab2017_Сходство пациентов: вычистка дубликатов и предсказание про...
GeeksLab Odessa
 
PDF
DataScienceLab2017_Блиц-доклад
GeeksLab Odessa
 
PDF
DataScienceLab2017_Блиц-доклад
GeeksLab Odessa
 
PDF
DataScienceLab2017_Блиц-доклад
GeeksLab Odessa
 
PDF
DataScienceLab2017_Cервинг моделей, построенных на больших данных с помощью A...
GeeksLab Odessa
 
PDF
DataScienceLab2017_BioVec: Word2Vec в задачах анализа геномных данных и биоин...
GeeksLab Odessa
 
PDF
DataScienceLab2017_Data Sciences и Big Data в Телекоме_Александр Саенко
GeeksLab Odessa
 
PDF
DataScienceLab2017_Высокопроизводительные вычислительные возможности для сист...
GeeksLab Odessa
 
PDF
DataScience Lab 2017_Мониторинг модных трендов с помощью глубокого обучения и...
GeeksLab Odessa
 
PDF
DataScience Lab 2017_Кто здесь? Автоматическая разметка спикеров на телефонны...
GeeksLab Odessa
 
PDF
DataScience Lab 2017_From bag of texts to bag of clusters_Терпиль Евгений / П...
GeeksLab Odessa
 
PDF
DataScience Lab 2017_Графические вероятностные модели для принятия решений в ...
GeeksLab Odessa
 
PDF
DataScienceLab2017_Оптимизация гиперпараметров машинного обучения при помощи ...
GeeksLab Odessa
 
PDF
DataScienceLab2017_Как знать всё о покупателях (или почти всё)?_Дарина Перемот
GeeksLab Odessa
 
PDF
JS Lab 2017_Mapbox GL: как работают современные интерактивные карты_Владимир ...
GeeksLab Odessa
 
PPTX
JS Lab2017_Под микроскопом: блеск и нищета микросервисов на node.js
GeeksLab Odessa
 
DataScience Lab2017_Коррекция геометрических искажений оптических спутниковых...
GeeksLab Odessa
 
DataScience Lab 2017_Kappa Architecture: How to implement a real-time streami...
GeeksLab Odessa
 
DataScience Lab 2017_Блиц-доклад_Турский Виктор
GeeksLab Odessa
 
DataScience Lab 2017_Обзор методов детекции лиц на изображение
GeeksLab Odessa
 
DataScienceLab2017_Сходство пациентов: вычистка дубликатов и предсказание про...
GeeksLab Odessa
 
DataScienceLab2017_Блиц-доклад
GeeksLab Odessa
 
DataScienceLab2017_Блиц-доклад
GeeksLab Odessa
 
DataScienceLab2017_Блиц-доклад
GeeksLab Odessa
 
DataScienceLab2017_Cервинг моделей, построенных на больших данных с помощью A...
GeeksLab Odessa
 
DataScienceLab2017_BioVec: Word2Vec в задачах анализа геномных данных и биоин...
GeeksLab Odessa
 
DataScienceLab2017_Data Sciences и Big Data в Телекоме_Александр Саенко
GeeksLab Odessa
 
DataScienceLab2017_Высокопроизводительные вычислительные возможности для сист...
GeeksLab Odessa
 
DataScience Lab 2017_Мониторинг модных трендов с помощью глубокого обучения и...
GeeksLab Odessa
 
DataScience Lab 2017_Кто здесь? Автоматическая разметка спикеров на телефонны...
GeeksLab Odessa
 
DataScience Lab 2017_From bag of texts to bag of clusters_Терпиль Евгений / П...
GeeksLab Odessa
 
DataScience Lab 2017_Графические вероятностные модели для принятия решений в ...
GeeksLab Odessa
 
DataScienceLab2017_Оптимизация гиперпараметров машинного обучения при помощи ...
GeeksLab Odessa
 
DataScienceLab2017_Как знать всё о покупателях (или почти всё)?_Дарина Перемот
GeeksLab Odessa
 
JS Lab 2017_Mapbox GL: как работают современные интерактивные карты_Владимир ...
GeeksLab Odessa
 
JS Lab2017_Под микроскопом: блеск и нищета микросервисов на node.js
GeeksLab Odessa
 
Ad

Recently uploaded (20)

PDF
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
PDF
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PDF
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
PPTX
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
PDF
Researching The Best Chat SDK Providers in 2025
Ray Fields
 
PDF
Build with AI and GDG Cloud Bydgoszcz- ADK .pdf
jaroslawgajewski1
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PPTX
Simple and concise overview about Quantum computing..pptx
mughal641
 
PDF
The Future of Artificial Intelligence (AI)
Mukul
 
PDF
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
PDF
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PPTX
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
PDF
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
PDF
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
PDF
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
Researching The Best Chat SDK Providers in 2025
Ray Fields
 
Build with AI and GDG Cloud Bydgoszcz- ADK .pdf
jaroslawgajewski1
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
Simple and concise overview about Quantum computing..pptx
mughal641
 
The Future of Artificial Intelligence (AI)
Mukul
 
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 

Node.js in a heterogeneous system