Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Node.js Build, Deploy and Scale Webinar

499 views

Published on

Topics covered in this webinar:

Automating builds directly from GitHub
Scaling processes horizontally and vertically
Working with Nginix load-balancer
Managing Node.js processes with Docker containers
Microservices deployment and Docker orchestration

Published in: Software
  • Be the first to comment

Node.js Build, Deploy and Scale Webinar

  1. 1. Shubhra Kar | Products & Education twitter:@shubhrakar Build, deploy & scale node
  2. 2. About me u J2EE and SOA architect u Performance architect u Node, mBaaS & APIs
  3. 3. These guys sent me ! Bert Belder Ben Noordhuis Node/io Core Raymond Feng Ritchie Martori LoopBack & Express Core Sam Roberts Miroslav Bajtos Ryan Graham
  4. 4. For a mature runtime; lets start with Process Managers
  5. 5. What is a Process Manager   Secure Deployment   Lifecycle Manager   HA, Hot Deploys   Log Aggregation   Vertical scaling   Hooks for monitoring & profiling   Traditionally Open Source
  6. 6. StrongLoop open source Process Manager
  7. 7. StrongLoop open source Process Manager in Docker $ curl -ssl https://strong-pm.io/docker.sh | sudo /bin/sh
  8. 8. Dockerized the App for removing flab (trimming) Node.js App Process Manager Containers $ sudo sl-pm-install –driver docker Orchestrate
  9. 9. Build
  10. 10. Building a node.js app •  Install: install dependencies, run custom build steps, and prune development dependencies. Avoids issues with npm shrinkwrap •  Bundle: modify the package.json and .npmignore configuration files so dependencies will be packed. •  Create deployable package, either: create a deployable .tgz package file. commit the build onto a Git branch.
  11. 11. Install Dependencies $ slc build --install Automates below •  npm install -- ignore-scripts Install Node dependencies without running scripts to build binary add-ons. •  npm run build Specify custom build steps such as grunt build or bower in the package’s scripts.build property •  npm prune -- production Remove development only tools and runs npm rebuild (system addons), npm install (any install scripts)
  12. 12. Bundling Dependencies $ slc build --bundle Automates below •  configure package.json •  configure .npmignore, backup is .gitignore
  13. 13. Creating Archive or Pushing to Git $ slc build –pack •  uses npm pack •  creates .tgz outside workspace with version control $ slc build –commit •  commits to a deployment branch •  shows merge changes $ slc build --onto deploy –install --commit (deploy branch is default)
  14. 14. Build using StrongLoop Arc
  15. 15. Deploy
  16. 16. Deploy to Process Manager (standalone or dockerized) $ slc deploy [ [ -s | --service] <service> ] http:// <server>:<port> [ package | branch ] Example : $ slc deploy http://myserver.myco.com:8701 Multi-App Deploy $ slc deploy -s appone http://prod.foo.com:7777 ../ app1-1.0.0.tgz Deployed `../app1-1.0.0.tgz` to `http://prod.foo.com:7777` $ slc deploy -s apptwo http://prod.foo.com:7777 ../ app2-1.0.0.tgz Deployed `../app2-1.0.0.tgz` to `http://prod.foo.com:7777`
  17. 17. Multi-App on Process Manager (standalone or dockerized) $ slc ctl -C http://prod.foo.com:7777 Service ID: 1 Service Name: appone Environment variables: No environment variables defined Instances: Version Agent version Cluster size 4.0.30 1.4.15 4 Processes: ID PID WID Listening Ports Tracking objects? CPU profiling? 1.1.22555 22555 0 1.1.22741 22741 5 prod.foo.com:3001 1.1.22748 22748 6 prod.foo.com:3001 1.1.22773 22773 7 prod.foo.com:3001 1.1.22793 22793 8 prod.foo.com:3001 Service ID: 2 Service Name: apptwo Environment variables: No environment variables defined Instances: Version Agent version Cluster size 4.0.30 1.4.15 4 Processes: ID PID WID Listening Ports Tracking objects? CPU profiling? 2.1.22984 22984 0 2.1.22985 22985 1 prod.foo.com:3002 2.1.22986 22986 2 prod.foo.com:3002 2.1.22987 22987 3 prod.foo.com:3002 2.1.22988 22988 4 prod.foo.com:3002
  18. 18. Deploy Dockerized Apps Linux Only $ sudo sl-pm-install --driver docker $ slc pm --driver docker
  19. 19. Deploy using StrongLoop Arc to Process Managers
  20. 20. Scale
  21. 21. Vertical Scaling 21
  22. 22. Vertical Clustering   $ slc ctl set-size my-app 4   $ slc ctl Service ID: 1 Service Name: my-app Environment variables: No environment variables defined Instances: Version Agent version Cluster size 4.1.0 1.5.1 10 Processes: ID PID WID Listening Ports Tracking objects? CPU profiling? 1.1.50320 50320 0 1.1.50321 50321 1 0.0.0.0:3001 1.1.50322 50322 2 0.0.0.0:3001 1.1.50323 50323 3 0.0.0.0:3001 1.1.50324 50324 4 0.0.0.0:3001
  23. 23. Vertical Clustering at deploy time with Arc
  24. 24. Cluster Control
  25. 25. Horizontal and Vertical Scaling with Process Manager
  26. 26. Horizontal Scaling using Arc
  27. 27. Auto-Configure Nginx   $ npm install -g strong-nginx-controller   $ sl-nginx-ctl-install to install as a service Example sl-nginx-ctl -x /usr/local/bin/nginx -l http://:8081
  28. 28. Micro services scaling 28
  29. 29. Hyper-scale & Micro-services Deployment
  30. 30. StrongLoop – node.js Development to Production Build and Deploy Automate Lifecycle Performance Metrics Real-time production monitoring Profiler Root cause CPU & Memory API Composer Visual modeling StrongLoop Arc Process Manager Scale applications" Q2 2015 Mesh Deploy containerized ORM, mBaaS, Realtime

×