SlideShare a Scribd company logo
1 of 35
Deploying Node.js
           and staying sane




  SYDJS   2011-02-16 18:00:00   MICHEIL SMITH
Quick Introduction

Micheil Smith
 •   An Engineer at Votizen (votizen.com)
 •   A core contributor to Node.js
 •   Current Node.js Documentation Lead
 •   Author of ‘node-websocket-server’
 •   Twittter: @miksago
 •   Email: micheil@votizen.com

        SYDJS   2011-02-16 18:00:00   MICHEIL SMITH
What is Node.js

• Evented I/O For V8 JavaScript
• http://github.com/ry/node
• http://nodejs.org




         SYDJS   2011-02-16 18:00:00   MICHEIL SMITH
In other words, you can build
 some really awesome shit.




   SYDJS   2011-02-16 18:00:00   MICHEIL SMITH
BUT!


SYDJS   2011-02-16 18:00:00   MICHEIL SMITH
Deployment can be an
 utter pain in the ass.




SYDJS   2011-02-16 18:00:00   MICHEIL SMITH
Why?


SYDJS   2011-02-16 18:00:00   MICHEIL SMITH
• Git based deployment honestly sucks
• Existing solutions do work, but aren’t perfect
• Rolling it ourselves is too much work




          SYDJS   2011-02-16 18:00:00   MICHEIL SMITH
Git based deployment
honestly sucks
•   Having multiple remotes isn’t much fun
•   Repositories become out of sync
•   Writing post-receive hooks is awful
•   Can only really push to one server at a time




         SYDJS   2011-02-16 18:00:00   MICHEIL SMITH
Existing solutions do
work, but aren’t perfect
Existing tools require you to work outside of
JavaScript & don’t integrate with the node.js
ecosystem.




        SYDJS   2011-02-16 18:00:00   MICHEIL SMITH
Rolling it ourselves is
too much work
Nobody honestly wants to spend heaps of time
writing stuff just so they can get their code into
production.




       SYDJS   2011-02-16 18:00:00   MICHEIL SMITH
A Way
Forward

SYDJS   2011-02-16 18:00:00   MICHEIL SMITH
Look, Learn, Create
• Other platforms have solutions
• What do we need in deployment?
• NPM exists, make use of it




        SYDJS   2011-02-16 18:00:00   MICHEIL SMITH
Other platforms have
solutions
Java: CruiseControl
Ruby: Capistrano, Bundler
Twitter: Murder
Python: Fabric




       SYDJS   2011-02-16 18:00:00   MICHEIL SMITH
What do we need in
    deployment?
•   Simple Configuration
•   Versioning & Rollbacks
•   Logs (well, duh, right?)
•   Integration with NPM




           SYDJS   2011-02-16 18:00:00   MICHEIL SMITH
NPM exists, make
use of it
NPM is great:
 • It’s in the background
 • It can handle a lot of the hard work
 • Package.json files are great, use them




       SYDJS   2011-02-16 18:00:00   MICHEIL SMITH
The
Proposal

SYDJS   2011-02-16 18:00:00   MICHEIL SMITH
`npm install deploy`
The idea is to have a tool that:
 •   Doesn’t require too much setup
 •   Makes use of existing standards & extends them
 •   Doesn’t get in the way; you can do without it
 •   Stand-alone, not part of an existing tool




        SYDJS   2011-02-16 18:00:00   MICHEIL SMITH
How’s it work? (part 1)

• Made up of two components:
 • client-side CLI
 • server-side daemon




        SYDJS   2011-02-16 18:00:00   MICHEIL SMITH
How’s it work? (part 2)
Client-side: (Developer side)
• The application directory has a deploy.json
• A user or global .deployrc file

Server-side:
• A daemon for accepting deploys is running
• A global .deployrc file

       SYDJS   2011-02-16 18:00:00   MICHEIL SMITH
deploy.json
Much like package.json, but contains:
 • which servers to deploy to
 • any dependencies that can’t be found on NPM
 • any scripts to be run at different phases of
    deployment
 • location of the source code repository


       SYDJS   2011-02-16 18:00:00   MICHEIL SMITH
Example
{
    "name": "brandedcode-blog",
    "repository": {
       "type": "git",
       "url": "git@github.com:miksago/brandedcode.git",
       "path": "./blog"
    },
    "servers": [{
       "host": "blog.brandedcode.com",
       "port": 49700,
    }],
    "dependencies": {
       "brandedcode-common": {
         "type": "git",
         "url": "git@github.com:miksago/brandedcode.git",
         "path": "./brandedcode-common"
       }
    },
    "scripts": {
       "deploy": "scripts/deploy.js"
    }
}


              SYDJS    2011-02-16 18:00:00        MICHEIL SMITH
Server-side .deployrc
A json file, telling the daemon the following:
 • where to place code for certain sites
 • users from which to accept deploys
 • various other configuration




       SYDJS   2011-02-16 18:00:00   MICHEIL SMITH
Example
{
    "users": {
       "micheil": {
          "salt": "...", "password": "..."
       },
       "mikeal": {
          "salt": "...", "password": "..."
       }
    },
    "servers": {
       "brandedcode.com": {
          "users": ["micheil"],
          "path": "/home/micheil/sites/brandedcode.com/"
       },
       "thenoded.com": {
          "users": ["mikeal", "micheil"],
          "path": "/home/deploy/sites/thenoded.com/"
       }
    },
    "daemon": { "port": 4970 }
}

             SYDJS    2011-02-16 18:00:00        MICHEIL SMITH
The server-side daemon

•   A thin node net.Server
•   Uses a protocol similar to netstrings + json
•   Uses gzipped tarballs to transfer files
•   Maintains logs and handles user management
•   Could use alternative file-transfer methods




           SYDJS   2011-02-16 18:00:00   MICHEIL SMITH
When?


SYDJS   2011-02-16 18:00:00   MICHEIL SMITH
Not yet.

Over the next few months.

https://github.com/votizen/deploy




 SYDJS   2011-02-16 18:00:00   MICHEIL SMITH
Other issues in deployment

• Ensuring your server is always up
• Managing settings & configuration
• Binding to privileged ports but not running as root?




          SYDJS   2011-02-16 18:00:00   MICHEIL SMITH
Ensuring your server is
  always up
• Use the tools that come with your OS, eg:
 • Ubuntu has upstart
 • Solaris has SMF
 • Debian has Sysvconfig (can probably get Upstart)

• Monitor your processes
 • Just to keep resources in check really.
         SYDJS   2011-02-16 18:00:00   MICHEIL SMITH
Managing settings &
configuration
A few options available on the modules wiki page:


https://github.com/ry/node/wiki/Modules




       SYDJS   2011-02-16 18:00:00   MICHEIL SMITH
Another way for Settings
  Management
• Keep settings & commonly done stuff as a central
  module.
• Use something like settings.js:
 • https://gist.github.com/824688

Ask me after the talk and I can go into further detail


          SYDJS   2011-02-16 18:00:00   MICHEIL SMITH
Binding to privileged ports
  but not running as root?
• Fairly easy to do with Node:
 • first start with a umask of 007
 • bind to the privileged port
 • use process.setgid() and process.setuid() to drop
    down privileges




         SYDJS   2011-02-16 18:00:00   MICHEIL SMITH
Thanks for
 listening

SYDJS   2011-02-16 18:00:00   MICHEIL SMITH
• Votizen.com
• Twittter: @miksago
• Email: micheil@votizen.com




     SYDJS   2011-02-16 18:00:00   MICHEIL SMITH
Any
thoughts or
 questions?
 SYDJS   2011-02-16 18:00:00   MICHEIL SMITH

More Related Content

What's hot

Securing open stack for compliance
Securing open stack for complianceSecuring open stack for compliance
Securing open stack for complianceTomasz Zen Napierala
 
Case Study - IPv6 Challenges for Cloud Service Providers
Case Study - IPv6 Challenges for Cloud Service ProvidersCase Study - IPv6 Challenges for Cloud Service Providers
Case Study - IPv6 Challenges for Cloud Service ProvidersManuel Schweizer
 
Open Source Monitoring with Icinga at Fossasia 2015
Open Source Monitoring with Icinga at Fossasia 2015Open Source Monitoring with Icinga at Fossasia 2015
Open Source Monitoring with Icinga at Fossasia 2015Icinga
 
Icinga2 - Apify them all
Icinga2 - Apify them allIcinga2 - Apify them all
Icinga2 - Apify them allIcinga
 
Web application I have always dreamt of
Web application I have always dreamt ofWeb application I have always dreamt of
Web application I have always dreamt ofVictor_Cr
 
OpenNebulaConf2019 - 6 years (+) OpenNebula - Lessons learned - Sebastian Man...
OpenNebulaConf2019 - 6 years (+) OpenNebula - Lessons learned - Sebastian Man...OpenNebulaConf2019 - 6 years (+) OpenNebula - Lessons learned - Sebastian Man...
OpenNebulaConf2019 - 6 years (+) OpenNebula - Lessons learned - Sebastian Man...OpenNebula Project
 
Get Your **IT Together: Log Retention, Clean-Up, & Compliance
Get Your **IT Together: Log Retention, Clean-Up, & ComplianceGet Your **IT Together: Log Retention, Clean-Up, & Compliance
Get Your **IT Together: Log Retention, Clean-Up, & ComplianceSolarWinds
 
SaltStack - An open source software story
SaltStack - An open source software storySaltStack - An open source software story
SaltStack - An open source software storySaltStack
 
Neues aus dem Docker-Universum
Neues aus dem Docker-UniversumNeues aus dem Docker-Universum
Neues aus dem Docker-UniversumNicholas Dille
 
VPS Hosting for Speed and Security
VPS Hosting for Speed and SecurityVPS Hosting for Speed and Security
VPS Hosting for Speed and SecurityMike Little
 
Why favour Icinga over Nagios @ OSDC 2015
Why favour Icinga over Nagios @ OSDC 2015Why favour Icinga over Nagios @ OSDC 2015
Why favour Icinga over Nagios @ OSDC 2015Icinga
 
Governance beyond ESB
Governance beyond ESBGovernance beyond ESB
Governance beyond ESBWSO2
 
Icinga Camp Berlin 2017 - Icinga Web 2 - How to Write Modules
Icinga Camp Berlin 2017 - Icinga Web 2 - How to Write ModulesIcinga Camp Berlin 2017 - Icinga Web 2 - How to Write Modules
Icinga Camp Berlin 2017 - Icinga Web 2 - How to Write ModulesIcinga
 
Hackweek 20 Open Door - Support Windows clients in Uyuni/SUSE Manager
Hackweek 20 Open Door - Support Windows clients in Uyuni/SUSE ManagerHackweek 20 Open Door - Support Windows clients in Uyuni/SUSE Manager
Hackweek 20 Open Door - Support Windows clients in Uyuni/SUSE ManagerPau Garcia Quiles
 
Journey to a multi-tenant e commerce solution in the cloud with Kubernetes - ...
Journey to a multi-tenant e commerce solution in the cloud with Kubernetes - ...Journey to a multi-tenant e commerce solution in the cloud with Kubernetes - ...
Journey to a multi-tenant e commerce solution in the cloud with Kubernetes - ...Vlad Stanescu
 
Microsoft <3 Open Source
Microsoft <3 Open SourceMicrosoft <3 Open Source
Microsoft <3 Open SourceDavide Benvegnù
 

What's hot (20)

Securing open stack for compliance
Securing open stack for complianceSecuring open stack for compliance
Securing open stack for compliance
 
Case Study - IPv6 Challenges for Cloud Service Providers
Case Study - IPv6 Challenges for Cloud Service ProvidersCase Study - IPv6 Challenges for Cloud Service Providers
Case Study - IPv6 Challenges for Cloud Service Providers
 
Open Source Monitoring with Icinga at Fossasia 2015
Open Source Monitoring with Icinga at Fossasia 2015Open Source Monitoring with Icinga at Fossasia 2015
Open Source Monitoring with Icinga at Fossasia 2015
 
Icinga2 - Apify them all
Icinga2 - Apify them allIcinga2 - Apify them all
Icinga2 - Apify them all
 
Web application I have always dreamt of
Web application I have always dreamt ofWeb application I have always dreamt of
Web application I have always dreamt of
 
OpenNebulaConf2019 - 6 years (+) OpenNebula - Lessons learned - Sebastian Man...
OpenNebulaConf2019 - 6 years (+) OpenNebula - Lessons learned - Sebastian Man...OpenNebulaConf2019 - 6 years (+) OpenNebula - Lessons learned - Sebastian Man...
OpenNebulaConf2019 - 6 years (+) OpenNebula - Lessons learned - Sebastian Man...
 
Get Your **IT Together: Log Retention, Clean-Up, & Compliance
Get Your **IT Together: Log Retention, Clean-Up, & ComplianceGet Your **IT Together: Log Retention, Clean-Up, & Compliance
Get Your **IT Together: Log Retention, Clean-Up, & Compliance
 
SaltStack - An open source software story
SaltStack - An open source software storySaltStack - An open source software story
SaltStack - An open source software story
 
Bitnami Bootcamp. OpenStack
Bitnami Bootcamp. OpenStackBitnami Bootcamp. OpenStack
Bitnami Bootcamp. OpenStack
 
Neues aus dem Docker-Universum
Neues aus dem Docker-UniversumNeues aus dem Docker-Universum
Neues aus dem Docker-Universum
 
VPS Hosting for Speed and Security
VPS Hosting for Speed and SecurityVPS Hosting for Speed and Security
VPS Hosting for Speed and Security
 
Why favour Icinga over Nagios @ OSDC 2015
Why favour Icinga over Nagios @ OSDC 2015Why favour Icinga over Nagios @ OSDC 2015
Why favour Icinga over Nagios @ OSDC 2015
 
Nexus
NexusNexus
Nexus
 
Docker presentation for sharing
Docker presentation   for sharingDocker presentation   for sharing
Docker presentation for sharing
 
Ntxissacsc5 yellow 1-beginnerslinux bill-petersen
Ntxissacsc5 yellow 1-beginnerslinux bill-petersenNtxissacsc5 yellow 1-beginnerslinux bill-petersen
Ntxissacsc5 yellow 1-beginnerslinux bill-petersen
 
Governance beyond ESB
Governance beyond ESBGovernance beyond ESB
Governance beyond ESB
 
Icinga Camp Berlin 2017 - Icinga Web 2 - How to Write Modules
Icinga Camp Berlin 2017 - Icinga Web 2 - How to Write ModulesIcinga Camp Berlin 2017 - Icinga Web 2 - How to Write Modules
Icinga Camp Berlin 2017 - Icinga Web 2 - How to Write Modules
 
Hackweek 20 Open Door - Support Windows clients in Uyuni/SUSE Manager
Hackweek 20 Open Door - Support Windows clients in Uyuni/SUSE ManagerHackweek 20 Open Door - Support Windows clients in Uyuni/SUSE Manager
Hackweek 20 Open Door - Support Windows clients in Uyuni/SUSE Manager
 
Journey to a multi-tenant e commerce solution in the cloud with Kubernetes - ...
Journey to a multi-tenant e commerce solution in the cloud with Kubernetes - ...Journey to a multi-tenant e commerce solution in the cloud with Kubernetes - ...
Journey to a multi-tenant e commerce solution in the cloud with Kubernetes - ...
 
Microsoft <3 Open Source
Microsoft <3 Open SourceMicrosoft <3 Open Source
Microsoft <3 Open Source
 

Viewers also liked

digital culture for drp
digital culture for drpdigital culture for drp
digital culture for drpslidemeup
 
The blurs are lining
The blurs are liningThe blurs are lining
The blurs are liningslidemeup
 
Designing A Library In Second Life For April 8 2010 Fla
Designing A Library In Second Life For April 8 2010 FlaDesigning A Library In Second Life For April 8 2010 Fla
Designing A Library In Second Life For April 8 2010 FlaIlene Frank
 
Excursion Coruña
Excursion CoruñaExcursion Coruña
Excursion Coruñacri2lu
 
Hype vs. Reality: The AI Explainer
Hype vs. Reality: The AI ExplainerHype vs. Reality: The AI Explainer
Hype vs. Reality: The AI ExplainerLuminary Labs
 

Viewers also liked (7)

digital culture for drp
digital culture for drpdigital culture for drp
digital culture for drp
 
The blurs are lining
The blurs are liningThe blurs are lining
The blurs are lining
 
Andy photos
Andy photosAndy photos
Andy photos
 
galway
galwaygalway
galway
 
Designing A Library In Second Life For April 8 2010 Fla
Designing A Library In Second Life For April 8 2010 FlaDesigning A Library In Second Life For April 8 2010 Fla
Designing A Library In Second Life For April 8 2010 Fla
 
Excursion Coruña
Excursion CoruñaExcursion Coruña
Excursion Coruña
 
Hype vs. Reality: The AI Explainer
Hype vs. Reality: The AI ExplainerHype vs. Reality: The AI Explainer
Hype vs. Reality: The AI Explainer
 

Similar to Sydjs – Deploying Node.js and Staying Sane

Free Mongo on OpenShift
Free Mongo on OpenShiftFree Mongo on OpenShift
Free Mongo on OpenShiftSteven Pousty
 
Reusing your existing software on Android
Reusing your existing software on AndroidReusing your existing software on Android
Reusing your existing software on AndroidTetsuyuki Kobayashi
 
A Schema Migration Tool for the Neo4j Database(Pavel_Kutac).pptx
A Schema Migration Tool for the Neo4j Database(Pavel_Kutac).pptxA Schema Migration Tool for the Neo4j Database(Pavel_Kutac).pptx
A Schema Migration Tool for the Neo4j Database(Pavel_Kutac).pptxNeo4j
 
Untangling spring week10
Untangling spring week10Untangling spring week10
Untangling spring week10Derek Jacoby
 
20161103 Serverless Italy Meetup
20161103   Serverless Italy Meetup20161103   Serverless Italy Meetup
20161103 Serverless Italy MeetupLuca Bianchi
 
Serverless On Stage - Serverless URL Shortener
Serverless On Stage - Serverless URL ShortenerServerless On Stage - Serverless URL Shortener
Serverless On Stage - Serverless URL ShortenerLuca Bianchi
 
What's New in Oracle BI for Developers
What's New in Oracle BI for DevelopersWhat's New in Oracle BI for Developers
What's New in Oracle BI for DevelopersDatavail
 
Apache HttpD Web Server - Hardening and other Security Considerations
Apache HttpD Web Server - Hardening and other Security ConsiderationsApache HttpD Web Server - Hardening and other Security Considerations
Apache HttpD Web Server - Hardening and other Security ConsiderationsAndrew Carr
 
CICS TS v5.5 support for Node.js applications
CICS TS v5.5 support for Node.js applicationsCICS TS v5.5 support for Node.js applications
CICS TS v5.5 support for Node.js applicationsMark Cocker
 
Instalacion de windows server 2012
Instalacion de windows server 2012Instalacion de windows server 2012
Instalacion de windows server 2012Salazar Jorge
 
Websockets: Pushing the web forward
Websockets: Pushing the web forwardWebsockets: Pushing the web forward
Websockets: Pushing the web forwardMark Roden
 
ATT&CK Updates- ATT&CK's Open Source
ATT&CK Updates- ATT&CK's Open SourceATT&CK Updates- ATT&CK's Open Source
ATT&CK Updates- ATT&CK's Open SourceMITRE ATT&CK
 
Automate IBM Connections Installations and more
Automate IBM Connections Installations and moreAutomate IBM Connections Installations and more
Automate IBM Connections Installations and moreLetsConnect
 
Automate IBM Connections Installations and more
Automate IBM Connections Installations and moreAutomate IBM Connections Installations and more
Automate IBM Connections Installations and morepanagenda
 
Solutions to reduce Total Cost of Setup (TCS) and simplify your life! - #iJac...
Solutions to reduce Total Cost of Setup (TCS) and simplify your life! - #iJac...Solutions to reduce Total Cost of Setup (TCS) and simplify your life! - #iJac...
Solutions to reduce Total Cost of Setup (TCS) and simplify your life! - #iJac...Andrea Fontana
 
You're monitoring Kubernetes Wrong
You're monitoring Kubernetes WrongYou're monitoring Kubernetes Wrong
You're monitoring Kubernetes WrongSysdig
 
Introducing to git
Introducing to gitIntroducing to git
Introducing to gitSajjad Rad
 
CloudFest 2018 Hackathon Project Results Presentation - CFHack18
CloudFest 2018 Hackathon Project Results Presentation - CFHack18CloudFest 2018 Hackathon Project Results Presentation - CFHack18
CloudFest 2018 Hackathon Project Results Presentation - CFHack18Jeffrey J. Hardy
 

Similar to Sydjs – Deploying Node.js and Staying Sane (20)

Free Mongo on OpenShift
Free Mongo on OpenShiftFree Mongo on OpenShift
Free Mongo on OpenShift
 
Reusing your existing software on Android
Reusing your existing software on AndroidReusing your existing software on Android
Reusing your existing software on Android
 
A Schema Migration Tool for the Neo4j Database(Pavel_Kutac).pptx
A Schema Migration Tool for the Neo4j Database(Pavel_Kutac).pptxA Schema Migration Tool for the Neo4j Database(Pavel_Kutac).pptx
A Schema Migration Tool for the Neo4j Database(Pavel_Kutac).pptx
 
Untangling spring week10
Untangling spring week10Untangling spring week10
Untangling spring week10
 
20161103 Serverless Italy Meetup
20161103   Serverless Italy Meetup20161103   Serverless Italy Meetup
20161103 Serverless Italy Meetup
 
Serverless On Stage - Serverless URL Shortener
Serverless On Stage - Serverless URL ShortenerServerless On Stage - Serverless URL Shortener
Serverless On Stage - Serverless URL Shortener
 
What's New in Oracle BI for Developers
What's New in Oracle BI for DevelopersWhat's New in Oracle BI for Developers
What's New in Oracle BI for Developers
 
Apache HttpD Web Server - Hardening and other Security Considerations
Apache HttpD Web Server - Hardening and other Security ConsiderationsApache HttpD Web Server - Hardening and other Security Considerations
Apache HttpD Web Server - Hardening and other Security Considerations
 
CICS TS v5.5 support for Node.js applications
CICS TS v5.5 support for Node.js applicationsCICS TS v5.5 support for Node.js applications
CICS TS v5.5 support for Node.js applications
 
Instalacion de windows server 2012
Instalacion de windows server 2012Instalacion de windows server 2012
Instalacion de windows server 2012
 
Websockets: Pushing the web forward
Websockets: Pushing the web forwardWebsockets: Pushing the web forward
Websockets: Pushing the web forward
 
ATT&CK Updates- ATT&CK's Open Source
ATT&CK Updates- ATT&CK's Open SourceATT&CK Updates- ATT&CK's Open Source
ATT&CK Updates- ATT&CK's Open Source
 
Automate IBM Connections Installations and more
Automate IBM Connections Installations and moreAutomate IBM Connections Installations and more
Automate IBM Connections Installations and more
 
How to Enterprise Node
How to Enterprise NodeHow to Enterprise Node
How to Enterprise Node
 
Automate IBM Connections Installations and more
Automate IBM Connections Installations and moreAutomate IBM Connections Installations and more
Automate IBM Connections Installations and more
 
Solutions to reduce Total Cost of Setup (TCS) and simplify your life! - #iJac...
Solutions to reduce Total Cost of Setup (TCS) and simplify your life! - #iJac...Solutions to reduce Total Cost of Setup (TCS) and simplify your life! - #iJac...
Solutions to reduce Total Cost of Setup (TCS) and simplify your life! - #iJac...
 
You're monitoring Kubernetes Wrong
You're monitoring Kubernetes WrongYou're monitoring Kubernetes Wrong
You're monitoring Kubernetes Wrong
 
Introducing to git
Introducing to gitIntroducing to git
Introducing to git
 
CloudFest 2018 Hackathon Project Results Presentation - CFHack18
CloudFest 2018 Hackathon Project Results Presentation - CFHack18CloudFest 2018 Hackathon Project Results Presentation - CFHack18
CloudFest 2018 Hackathon Project Results Presentation - CFHack18
 
Scribe insight 04 insight 7.9.0
Scribe insight 04   insight 7.9.0Scribe insight 04   insight 7.9.0
Scribe insight 04 insight 7.9.0
 

Recently uploaded

New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 

Recently uploaded (20)

New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 

Sydjs – Deploying Node.js and Staying Sane

  • 1. Deploying Node.js and staying sane SYDJS 2011-02-16 18:00:00 MICHEIL SMITH
  • 2. Quick Introduction Micheil Smith • An Engineer at Votizen (votizen.com) • A core contributor to Node.js • Current Node.js Documentation Lead • Author of ‘node-websocket-server’ • Twittter: @miksago • Email: micheil@votizen.com SYDJS 2011-02-16 18:00:00 MICHEIL SMITH
  • 3. What is Node.js • Evented I/O For V8 JavaScript • http://github.com/ry/node • http://nodejs.org SYDJS 2011-02-16 18:00:00 MICHEIL SMITH
  • 4. In other words, you can build some really awesome shit. SYDJS 2011-02-16 18:00:00 MICHEIL SMITH
  • 5. BUT! SYDJS 2011-02-16 18:00:00 MICHEIL SMITH
  • 6. Deployment can be an utter pain in the ass. SYDJS 2011-02-16 18:00:00 MICHEIL SMITH
  • 7. Why? SYDJS 2011-02-16 18:00:00 MICHEIL SMITH
  • 8. • Git based deployment honestly sucks • Existing solutions do work, but aren’t perfect • Rolling it ourselves is too much work SYDJS 2011-02-16 18:00:00 MICHEIL SMITH
  • 9. Git based deployment honestly sucks • Having multiple remotes isn’t much fun • Repositories become out of sync • Writing post-receive hooks is awful • Can only really push to one server at a time SYDJS 2011-02-16 18:00:00 MICHEIL SMITH
  • 10. Existing solutions do work, but aren’t perfect Existing tools require you to work outside of JavaScript & don’t integrate with the node.js ecosystem. SYDJS 2011-02-16 18:00:00 MICHEIL SMITH
  • 11. Rolling it ourselves is too much work Nobody honestly wants to spend heaps of time writing stuff just so they can get their code into production. SYDJS 2011-02-16 18:00:00 MICHEIL SMITH
  • 12. A Way Forward SYDJS 2011-02-16 18:00:00 MICHEIL SMITH
  • 13. Look, Learn, Create • Other platforms have solutions • What do we need in deployment? • NPM exists, make use of it SYDJS 2011-02-16 18:00:00 MICHEIL SMITH
  • 14. Other platforms have solutions Java: CruiseControl Ruby: Capistrano, Bundler Twitter: Murder Python: Fabric SYDJS 2011-02-16 18:00:00 MICHEIL SMITH
  • 15. What do we need in deployment? • Simple Configuration • Versioning & Rollbacks • Logs (well, duh, right?) • Integration with NPM SYDJS 2011-02-16 18:00:00 MICHEIL SMITH
  • 16. NPM exists, make use of it NPM is great: • It’s in the background • It can handle a lot of the hard work • Package.json files are great, use them SYDJS 2011-02-16 18:00:00 MICHEIL SMITH
  • 17. The Proposal SYDJS 2011-02-16 18:00:00 MICHEIL SMITH
  • 18. `npm install deploy` The idea is to have a tool that: • Doesn’t require too much setup • Makes use of existing standards & extends them • Doesn’t get in the way; you can do without it • Stand-alone, not part of an existing tool SYDJS 2011-02-16 18:00:00 MICHEIL SMITH
  • 19. How’s it work? (part 1) • Made up of two components: • client-side CLI • server-side daemon SYDJS 2011-02-16 18:00:00 MICHEIL SMITH
  • 20. How’s it work? (part 2) Client-side: (Developer side) • The application directory has a deploy.json • A user or global .deployrc file Server-side: • A daemon for accepting deploys is running • A global .deployrc file SYDJS 2011-02-16 18:00:00 MICHEIL SMITH
  • 21. deploy.json Much like package.json, but contains: • which servers to deploy to • any dependencies that can’t be found on NPM • any scripts to be run at different phases of deployment • location of the source code repository SYDJS 2011-02-16 18:00:00 MICHEIL SMITH
  • 22. Example { "name": "brandedcode-blog", "repository": { "type": "git", "url": "git@github.com:miksago/brandedcode.git", "path": "./blog" }, "servers": [{ "host": "blog.brandedcode.com", "port": 49700, }], "dependencies": { "brandedcode-common": { "type": "git", "url": "git@github.com:miksago/brandedcode.git", "path": "./brandedcode-common" } }, "scripts": { "deploy": "scripts/deploy.js" } } SYDJS 2011-02-16 18:00:00 MICHEIL SMITH
  • 23. Server-side .deployrc A json file, telling the daemon the following: • where to place code for certain sites • users from which to accept deploys • various other configuration SYDJS 2011-02-16 18:00:00 MICHEIL SMITH
  • 24. Example { "users": { "micheil": { "salt": "...", "password": "..." }, "mikeal": { "salt": "...", "password": "..." } }, "servers": { "brandedcode.com": { "users": ["micheil"], "path": "/home/micheil/sites/brandedcode.com/" }, "thenoded.com": { "users": ["mikeal", "micheil"], "path": "/home/deploy/sites/thenoded.com/" } }, "daemon": { "port": 4970 } } SYDJS 2011-02-16 18:00:00 MICHEIL SMITH
  • 25. The server-side daemon • A thin node net.Server • Uses a protocol similar to netstrings + json • Uses gzipped tarballs to transfer files • Maintains logs and handles user management • Could use alternative file-transfer methods SYDJS 2011-02-16 18:00:00 MICHEIL SMITH
  • 26. When? SYDJS 2011-02-16 18:00:00 MICHEIL SMITH
  • 27. Not yet. Over the next few months. https://github.com/votizen/deploy SYDJS 2011-02-16 18:00:00 MICHEIL SMITH
  • 28. Other issues in deployment • Ensuring your server is always up • Managing settings & configuration • Binding to privileged ports but not running as root? SYDJS 2011-02-16 18:00:00 MICHEIL SMITH
  • 29. Ensuring your server is always up • Use the tools that come with your OS, eg: • Ubuntu has upstart • Solaris has SMF • Debian has Sysvconfig (can probably get Upstart) • Monitor your processes • Just to keep resources in check really. SYDJS 2011-02-16 18:00:00 MICHEIL SMITH
  • 30. Managing settings & configuration A few options available on the modules wiki page: https://github.com/ry/node/wiki/Modules SYDJS 2011-02-16 18:00:00 MICHEIL SMITH
  • 31. Another way for Settings Management • Keep settings & commonly done stuff as a central module. • Use something like settings.js: • https://gist.github.com/824688 Ask me after the talk and I can go into further detail SYDJS 2011-02-16 18:00:00 MICHEIL SMITH
  • 32. Binding to privileged ports but not running as root? • Fairly easy to do with Node: • first start with a umask of 007 • bind to the privileged port • use process.setgid() and process.setuid() to drop down privileges SYDJS 2011-02-16 18:00:00 MICHEIL SMITH
  • 33. Thanks for listening SYDJS 2011-02-16 18:00:00 MICHEIL SMITH
  • 34. • Votizen.com • Twittter: @miksago • Email: micheil@votizen.com SYDJS 2011-02-16 18:00:00 MICHEIL SMITH
  • 35. Any thoughts or questions? SYDJS 2011-02-16 18:00:00 MICHEIL SMITH

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. examples: heroku, no.de, hosting it yourself\n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n