SlideShare a Scribd company logo
1 of 16
Node.js with Vagrant and Chef
@ Benetech
April 24, 2014
Chris Bumgardner
Why Vagrant?
 Speed and Portability
 Get a working uniform development environment
running in about 15 minutes while getting a coffee.
 This often takes hours or days for a modern environment
getting specific libraries, tools, and versions for a specific
operating system.
 Open source and mature. Around since 2010.
Advantages to a VM Image
 Vagrant is small: just text files in source control
 A snapshot is typically around 0.5GB – 1GB. Hard to host and
transfer.
 A snapshot is binary: changing a version of a library is hard,
but in Vagrant it is just a configuration change.
 Abstraction: Vagrant can run on top of different providers,
such as AWS, Docker or Azure in addition to a local virtual
machine.
 https://github.com/mitchellh/vagrant-aws
 https://github.com/10thmagnitude/vagrant-azure
Installing Vagrant & VirtualBox
 Install Vagrant here:
http://www.vagrantup.com/downloads.html
 Install VirtualBox here:
https://www.virtualbox.org/wiki/Downloads
 Cloud boxes are automatically downloaded and
installed with Vagrant 1.5+
 Be sure to upgrade Vagrant if you have an older version.
Configuration Management via Chef
 Idempotent
 You can run Chef multiple times on the same system with
identical results.
 Not the case with shell scripts: running more than once will
usually lead to unpredictable results.
 Cross-platform
 Chef supports Linux, Mac, Windows
 Shell scripts are system dependent
 Existing ecosystem of cookbooks: don’t reinvent the wheel.
 Chef Solo: runs on local machine, does not require server
infrastructure.
Docker, Packer, etc: More DevOps
 DevOps tools appear daily.
 Chef alternatives: Puppet, Ansible, Salt, etc.
 Docker.io
 Promising tool that contains and virtualizes processes.
 Think of Vagrant but for a specific process.
 Example: turn a server application into a portable image.
 Packer.io
 Automates creation of machine images.
 A meta layer above a tool like Vagrant.
Mathoid using Vagrant
 https://github.com/cbumgard/mathoid-vagrant
 Once running you can access at localhost:10042
 Built on Ubuntu Precise 12.04 64-bit base box. Found 14.04
not compatible yet with Mathoid.
 First time you “vagrant up” it has to download the base
box (~300MB). Boxes are cached locally however.
 Added Chef cookbooks as Git submodules. Requires just
an extra two commands the first time you clone the repo,
makes for a cleaner repository.
Mathoid + Vagrant continued
 All configuration done in the Vagrantfile:
https://github.com/cbumgard/mathoid-
vagrant/blob/master/Vagrantfile
 Non-provisioning changes to Vagrantfile, such as
networking configuration, will take effect on a “vagrant
reload” (halt + up).
 Provisioning changes will not run unless you destroy and
re-up, or do a “vagrant provision”.
 This Vagrantfile is a combination of shell, file, and chef
provisioning.
Vagrant: Things to Note
 Pick your base box carefully.
 Ideally has the configuration manager (e.g. Chef) installed that you will
use for provisioning.
 Avoid anything else if possible. For example a base box with Node.js built
in will be trickier to upgrade to a new version than if you add Node.js as
a Chef cookbook.
 You can always see installed boxes via “vagrant box list”
 When creating a Vagrantfile test incrementally via “vagrant
provision”
 Vagrant commands you should learn:
 init, up, ssh, suspend, resume, halt, destroy
 reload: halt + up
Vagrant: continued
 When switching networks on the host (e.g. changing WIFI
networks on your laptop) you may need to “vagrant reload”
for the guest VM networking.
 If you want to access files from your host machine inside the
guest vm, be sure to use NFS:true in your synchronized folder
setup.
 Gives ~10x performance accessing files. Noticeable if running a
webserver like Node.js in the VM on files on your host.
 Requires nfs-common installed.
 Requires password on “vagrant up”. Fix for that at:
https://gist.github.com/GUI/2864683
Vagrant: continued
 When shell provisioning keep in mind:
 Your script is running as root. No need for sudo.
 Interactive prompts will hang and timeout. Make sure to add
flags like “-y” to command-line calls like “apt-get”.
 You can enable a GUI from the Vagrantfile if you want to do
graphical work in the VM
 Provisioning usually requires download files from many
sources: occasionally there will be intermitent problems
downloading from certain sources.
 Check out Vagrant Shares. New in 1.5. Allows giving others
outside your local network access to your running machine.
Node.js: Lessons Learned
 Node.js runs all Javascript code on a single thread.
 So you can’t do heavy operations in the JS layer.
 Consider message queues or pub/sub like Redis.io
 Thinking asynchronously takes getting used to. Learn libraries
like async at the start: https://github.com/caolan/async.
 Flow control is very important.
 Also greatly helps exception handling.
 Control your versioning carefully for dependencies.
 Follow semantic versioning: http://semver.org/.
 If your versioning isn’t specific enough a deployment can break.
 Often best to package dependencies during deployment.
Node.js: Lessons Continued
 Amazing ecosystem: always check for an existing npm
module before writing something new.
 I strongly recommend Grunt for building your project, and
Bower for client-side web package management.
 http://gruntjs.com/
 http://bower.io/
 Yeoman generators are a great way to bootstrap a project:
http://yeoman.io/
 Daemonize your app with tools like forever:
https://github.com/nodejitsu/forever
Node.js: Lessons Continued
 Use clustering module: will run a copy of your Node
process on each available core.
 Think stateless: in general for web apps, and especially
here so you can scale out.
 Follow CommonJS module for code organization:
http://www.commonjs.org/specs/modules/1.0/
 Don’t expect to share a lot of code between the browser
and the server. However the lack of context switching (all
JS all the time) is the real benefit.
Thanks!
 Chris Bumgardner
 https://github.com/cbumgard
 https://www.linkedin.com/in/chrisbumgardner
 Please don’t hesitate to contact me 
Links
 http://www.slideshare.net/chrisbumgardner/benetech-nodejsvagrant
 https://github.com/cbumgard/mathoid-vagrant
 http://www.vagrantup.com/downloads.html
 https://www.virtualbox.org/wiki/Downloads
 https://github.com/mitchellh/vagrant-aws
 https://github.com/10thmagnitude/vagrant-azure
 https://gist.github.com/GUI/2864683
 https://github.com/caolan/async
 http://semver.org/

More Related Content

What's hot

It Works On My Machine: Vagrant for Software Development
It Works On My Machine: Vagrant for Software DevelopmentIt Works On My Machine: Vagrant for Software Development
It Works On My Machine: Vagrant for Software DevelopmentCarlos Perez
 
Automated Infrastructure and Application Management
Automated Infrastructure and Application ManagementAutomated Infrastructure and Application Management
Automated Infrastructure and Application ManagementClark Everetts
 
Vagrant 101 Workshop
Vagrant 101 WorkshopVagrant 101 Workshop
Vagrant 101 WorkshopLiora Milbaum
 
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG DortmundVagrant-Binding JUG Dortmund
Vagrant-Binding JUG DortmundHendrik Ebbers
 
VCCW - Vagrant based WordPress development environment
VCCW - Vagrant based WordPress development environmentVCCW - Vagrant based WordPress development environment
VCCW - Vagrant based WordPress development environmentTakayuki Miyauchi
 
Wocker @WordBench Osaka No.41
Wocker @WordBench Osaka No.41Wocker @WordBench Osaka No.41
Wocker @WordBench Osaka No.41Kite Koga
 
Virtualization for Developers
Virtualization for DevelopersVirtualization for Developers
Virtualization for DevelopersJohn Coggeshall
 
Virtualization for Developers
Virtualization for DevelopersVirtualization for Developers
Virtualization for DevelopersJohn Coggeshall
 
6 Years of Docker: The Good, the Bad and Python Packaging at PyCon.DE&PyData ...
6 Years of Docker: The Good, the Bad and Python Packaging at PyCon.DE&PyData ...6 Years of Docker: The Good, the Bad and Python Packaging at PyCon.DE&PyData ...
6 Years of Docker: The Good, the Bad and Python Packaging at PyCon.DE&PyData ...Sebastian Neubauer
 
Dev to Delivery with Puppet, Vagrant and AWS
Dev to Delivery with Puppet, Vagrant and AWSDev to Delivery with Puppet, Vagrant and AWS
Dev to Delivery with Puppet, Vagrant and AWSPuppet
 
Getting Started with Docker (For Developers)
Getting Started with Docker (For Developers)Getting Started with Docker (For Developers)
Getting Started with Docker (For Developers)ColdFusionConference
 
Vagrant - Version control your dev environment
Vagrant - Version control your dev environmentVagrant - Version control your dev environment
Vagrant - Version control your dev environmentbocribbz
 
Local development environment through virtualisation
Local development environment through virtualisationLocal development environment through virtualisation
Local development environment through virtualisationRadu Barbu
 
Vagrant up-and-running
Vagrant up-and-runningVagrant up-and-running
Vagrant up-and-runningJoe Ferguson
 

What's hot (20)

It Works On My Machine: Vagrant for Software Development
It Works On My Machine: Vagrant for Software DevelopmentIt Works On My Machine: Vagrant for Software Development
It Works On My Machine: Vagrant for Software Development
 
Intro to vagrant
Intro to vagrantIntro to vagrant
Intro to vagrant
 
Vagrant
Vagrant Vagrant
Vagrant
 
Vagrant
VagrantVagrant
Vagrant
 
Automated Infrastructure and Application Management
Automated Infrastructure and Application ManagementAutomated Infrastructure and Application Management
Automated Infrastructure and Application Management
 
Vagrant 101 Workshop
Vagrant 101 WorkshopVagrant 101 Workshop
Vagrant 101 Workshop
 
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG DortmundVagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
 
Vagrant to-aws-flow
Vagrant to-aws-flowVagrant to-aws-flow
Vagrant to-aws-flow
 
VCCW - Vagrant based WordPress development environment
VCCW - Vagrant based WordPress development environmentVCCW - Vagrant based WordPress development environment
VCCW - Vagrant based WordPress development environment
 
Vagrant
VagrantVagrant
Vagrant
 
Wocker @WordBench Osaka No.41
Wocker @WordBench Osaka No.41Wocker @WordBench Osaka No.41
Wocker @WordBench Osaka No.41
 
Virtualization for Developers
Virtualization for DevelopersVirtualization for Developers
Virtualization for Developers
 
Virtualization for Developers
Virtualization for DevelopersVirtualization for Developers
Virtualization for Developers
 
6 Years of Docker: The Good, the Bad and Python Packaging at PyCon.DE&PyData ...
6 Years of Docker: The Good, the Bad and Python Packaging at PyCon.DE&PyData ...6 Years of Docker: The Good, the Bad and Python Packaging at PyCon.DE&PyData ...
6 Years of Docker: The Good, the Bad and Python Packaging at PyCon.DE&PyData ...
 
Dev to Delivery with Puppet, Vagrant and AWS
Dev to Delivery with Puppet, Vagrant and AWSDev to Delivery with Puppet, Vagrant and AWS
Dev to Delivery with Puppet, Vagrant and AWS
 
GlassFish Embedded API
GlassFish Embedded APIGlassFish Embedded API
GlassFish Embedded API
 
Getting Started with Docker (For Developers)
Getting Started with Docker (For Developers)Getting Started with Docker (For Developers)
Getting Started with Docker (For Developers)
 
Vagrant - Version control your dev environment
Vagrant - Version control your dev environmentVagrant - Version control your dev environment
Vagrant - Version control your dev environment
 
Local development environment through virtualisation
Local development environment through virtualisationLocal development environment through virtualisation
Local development environment through virtualisation
 
Vagrant up-and-running
Vagrant up-and-runningVagrant up-and-running
Vagrant up-and-running
 

Similar to Node.js, Vagrant, Chef, and Mathoid @ Benetech

Vagrant for local and team WordPress Development
Vagrant for local and team WordPress DevelopmentVagrant for local and team WordPress Development
Vagrant for local and team WordPress DevelopmentAnthony Alvarez
 
DevOps Camp 2017 NYC Local Development using Vagrant by Anthony Alvarez
DevOps Camp 2017 NYC Local Development using Vagrant by Anthony AlvarezDevOps Camp 2017 NYC Local Development using Vagrant by Anthony Alvarez
DevOps Camp 2017 NYC Local Development using Vagrant by Anthony AlvarezAnthony Alvarez
 
Take Home Your Very Own Free Vagrant CFML Dev Environment
Take Home Your Very Own Free Vagrant CFML Dev Environment Take Home Your Very Own Free Vagrant CFML Dev Environment
Take Home Your Very Own Free Vagrant CFML Dev Environment ColdFusionConference
 
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....Gavin Pickin
 
Oracle Developers APAC Meetup #1 - Working with Wercker Worksheets
Oracle Developers APAC Meetup #1 -  Working with Wercker WorksheetsOracle Developers APAC Meetup #1 -  Working with Wercker Worksheets
Oracle Developers APAC Meetup #1 - Working with Wercker WorksheetsDarrel Chia
 
Vagrant are you still develop in a non-virtual environment-
Vagrant  are you still develop in a non-virtual environment-Vagrant  are you still develop in a non-virtual environment-
Vagrant are you still develop in a non-virtual environment-Anatoly Bubenkov
 
Using Docker to build and test in your laptop and Jenkins
Using Docker to build and test in your laptop and JenkinsUsing Docker to build and test in your laptop and Jenkins
Using Docker to build and test in your laptop and JenkinsMicael Gallego
 
Puppet and Vagrant in development
Puppet and Vagrant in developmentPuppet and Vagrant in development
Puppet and Vagrant in developmentAdam Culp
 
codemotion-docker-2014
codemotion-docker-2014codemotion-docker-2014
codemotion-docker-2014Carlo Bonamico
 
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...
Why everyone is excited about Docker (and you should too...) -  Carlo Bonamic...Why everyone is excited about Docker (and you should too...) -  Carlo Bonamic...
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...Codemotion
 
Create Development and Production Environments with Vagrant
Create Development and Production Environments with VagrantCreate Development and Production Environments with Vagrant
Create Development and Production Environments with VagrantBrian Hogan
 
Docker navjot kaur
Docker navjot kaurDocker navjot kaur
Docker navjot kaurNavjot Kaur
 
Warden @ Meet magento Romania 2021
Warden @ Meet magento Romania 2021Warden @ Meet magento Romania 2021
Warden @ Meet magento Romania 2021alinalexandru
 
Linux containers and docker
Linux containers and dockerLinux containers and docker
Linux containers and dockerFabio Fumarola
 
Vagrant Binding JayDay 2013
Vagrant Binding JayDay 2013Vagrant Binding JayDay 2013
Vagrant Binding JayDay 2013Hendrik Ebbers
 
Foundation of starting your drupal project to vagrant environment
Foundation of starting your drupal project to vagrant environmentFoundation of starting your drupal project to vagrant environment
Foundation of starting your drupal project to vagrant environmentEleison Cruz
 
AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...
AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...
AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...Artefactual Systems - AtoM
 

Similar to Node.js, Vagrant, Chef, and Mathoid @ Benetech (20)

Vagrant for local and team WordPress Development
Vagrant for local and team WordPress DevelopmentVagrant for local and team WordPress Development
Vagrant for local and team WordPress Development
 
DevOps Camp 2017 NYC Local Development using Vagrant by Anthony Alvarez
DevOps Camp 2017 NYC Local Development using Vagrant by Anthony AlvarezDevOps Camp 2017 NYC Local Development using Vagrant by Anthony Alvarez
DevOps Camp 2017 NYC Local Development using Vagrant by Anthony Alvarez
 
Keep calm and vagrant up
Keep calm and vagrant upKeep calm and vagrant up
Keep calm and vagrant up
 
Take Home Your Very Own Free Vagrant CFML Dev Environment
Take Home Your Very Own Free Vagrant CFML Dev Environment Take Home Your Very Own Free Vagrant CFML Dev Environment
Take Home Your Very Own Free Vagrant CFML Dev Environment
 
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
 
Oracle Developers APAC Meetup #1 - Working with Wercker Worksheets
Oracle Developers APAC Meetup #1 -  Working with Wercker WorksheetsOracle Developers APAC Meetup #1 -  Working with Wercker Worksheets
Oracle Developers APAC Meetup #1 - Working with Wercker Worksheets
 
Vagrant are you still develop in a non-virtual environment-
Vagrant  are you still develop in a non-virtual environment-Vagrant  are you still develop in a non-virtual environment-
Vagrant are you still develop in a non-virtual environment-
 
Using Docker to build and test in your laptop and Jenkins
Using Docker to build and test in your laptop and JenkinsUsing Docker to build and test in your laptop and Jenkins
Using Docker to build and test in your laptop and Jenkins
 
Puppet and Vagrant in development
Puppet and Vagrant in developmentPuppet and Vagrant in development
Puppet and Vagrant in development
 
codemotion-docker-2014
codemotion-docker-2014codemotion-docker-2014
codemotion-docker-2014
 
Security Testing Using Infrastructure-As-Code
Security Testing Using Infrastructure-As-CodeSecurity Testing Using Infrastructure-As-Code
Security Testing Using Infrastructure-As-Code
 
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...
Why everyone is excited about Docker (and you should too...) -  Carlo Bonamic...Why everyone is excited about Docker (and you should too...) -  Carlo Bonamic...
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...
 
Vagrant Up in 5 Easy Steps
Vagrant Up in 5 Easy StepsVagrant Up in 5 Easy Steps
Vagrant Up in 5 Easy Steps
 
Create Development and Production Environments with Vagrant
Create Development and Production Environments with VagrantCreate Development and Production Environments with Vagrant
Create Development and Production Environments with Vagrant
 
Docker navjot kaur
Docker navjot kaurDocker navjot kaur
Docker navjot kaur
 
Warden @ Meet magento Romania 2021
Warden @ Meet magento Romania 2021Warden @ Meet magento Romania 2021
Warden @ Meet magento Romania 2021
 
Linux containers and docker
Linux containers and dockerLinux containers and docker
Linux containers and docker
 
Vagrant Binding JayDay 2013
Vagrant Binding JayDay 2013Vagrant Binding JayDay 2013
Vagrant Binding JayDay 2013
 
Foundation of starting your drupal project to vagrant environment
Foundation of starting your drupal project to vagrant environmentFoundation of starting your drupal project to vagrant environment
Foundation of starting your drupal project to vagrant environment
 
AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...
AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...
AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...
 

Recently uploaded

"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
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
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 

Recently uploaded (20)

"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
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
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 

Node.js, Vagrant, Chef, and Mathoid @ Benetech

  • 1. Node.js with Vagrant and Chef @ Benetech April 24, 2014 Chris Bumgardner
  • 2. Why Vagrant?  Speed and Portability  Get a working uniform development environment running in about 15 minutes while getting a coffee.  This often takes hours or days for a modern environment getting specific libraries, tools, and versions for a specific operating system.  Open source and mature. Around since 2010.
  • 3. Advantages to a VM Image  Vagrant is small: just text files in source control  A snapshot is typically around 0.5GB – 1GB. Hard to host and transfer.  A snapshot is binary: changing a version of a library is hard, but in Vagrant it is just a configuration change.  Abstraction: Vagrant can run on top of different providers, such as AWS, Docker or Azure in addition to a local virtual machine.  https://github.com/mitchellh/vagrant-aws  https://github.com/10thmagnitude/vagrant-azure
  • 4. Installing Vagrant & VirtualBox  Install Vagrant here: http://www.vagrantup.com/downloads.html  Install VirtualBox here: https://www.virtualbox.org/wiki/Downloads  Cloud boxes are automatically downloaded and installed with Vagrant 1.5+  Be sure to upgrade Vagrant if you have an older version.
  • 5. Configuration Management via Chef  Idempotent  You can run Chef multiple times on the same system with identical results.  Not the case with shell scripts: running more than once will usually lead to unpredictable results.  Cross-platform  Chef supports Linux, Mac, Windows  Shell scripts are system dependent  Existing ecosystem of cookbooks: don’t reinvent the wheel.  Chef Solo: runs on local machine, does not require server infrastructure.
  • 6. Docker, Packer, etc: More DevOps  DevOps tools appear daily.  Chef alternatives: Puppet, Ansible, Salt, etc.  Docker.io  Promising tool that contains and virtualizes processes.  Think of Vagrant but for a specific process.  Example: turn a server application into a portable image.  Packer.io  Automates creation of machine images.  A meta layer above a tool like Vagrant.
  • 7. Mathoid using Vagrant  https://github.com/cbumgard/mathoid-vagrant  Once running you can access at localhost:10042  Built on Ubuntu Precise 12.04 64-bit base box. Found 14.04 not compatible yet with Mathoid.  First time you “vagrant up” it has to download the base box (~300MB). Boxes are cached locally however.  Added Chef cookbooks as Git submodules. Requires just an extra two commands the first time you clone the repo, makes for a cleaner repository.
  • 8. Mathoid + Vagrant continued  All configuration done in the Vagrantfile: https://github.com/cbumgard/mathoid- vagrant/blob/master/Vagrantfile  Non-provisioning changes to Vagrantfile, such as networking configuration, will take effect on a “vagrant reload” (halt + up).  Provisioning changes will not run unless you destroy and re-up, or do a “vagrant provision”.  This Vagrantfile is a combination of shell, file, and chef provisioning.
  • 9. Vagrant: Things to Note  Pick your base box carefully.  Ideally has the configuration manager (e.g. Chef) installed that you will use for provisioning.  Avoid anything else if possible. For example a base box with Node.js built in will be trickier to upgrade to a new version than if you add Node.js as a Chef cookbook.  You can always see installed boxes via “vagrant box list”  When creating a Vagrantfile test incrementally via “vagrant provision”  Vagrant commands you should learn:  init, up, ssh, suspend, resume, halt, destroy  reload: halt + up
  • 10. Vagrant: continued  When switching networks on the host (e.g. changing WIFI networks on your laptop) you may need to “vagrant reload” for the guest VM networking.  If you want to access files from your host machine inside the guest vm, be sure to use NFS:true in your synchronized folder setup.  Gives ~10x performance accessing files. Noticeable if running a webserver like Node.js in the VM on files on your host.  Requires nfs-common installed.  Requires password on “vagrant up”. Fix for that at: https://gist.github.com/GUI/2864683
  • 11. Vagrant: continued  When shell provisioning keep in mind:  Your script is running as root. No need for sudo.  Interactive prompts will hang and timeout. Make sure to add flags like “-y” to command-line calls like “apt-get”.  You can enable a GUI from the Vagrantfile if you want to do graphical work in the VM  Provisioning usually requires download files from many sources: occasionally there will be intermitent problems downloading from certain sources.  Check out Vagrant Shares. New in 1.5. Allows giving others outside your local network access to your running machine.
  • 12. Node.js: Lessons Learned  Node.js runs all Javascript code on a single thread.  So you can’t do heavy operations in the JS layer.  Consider message queues or pub/sub like Redis.io  Thinking asynchronously takes getting used to. Learn libraries like async at the start: https://github.com/caolan/async.  Flow control is very important.  Also greatly helps exception handling.  Control your versioning carefully for dependencies.  Follow semantic versioning: http://semver.org/.  If your versioning isn’t specific enough a deployment can break.  Often best to package dependencies during deployment.
  • 13. Node.js: Lessons Continued  Amazing ecosystem: always check for an existing npm module before writing something new.  I strongly recommend Grunt for building your project, and Bower for client-side web package management.  http://gruntjs.com/  http://bower.io/  Yeoman generators are a great way to bootstrap a project: http://yeoman.io/  Daemonize your app with tools like forever: https://github.com/nodejitsu/forever
  • 14. Node.js: Lessons Continued  Use clustering module: will run a copy of your Node process on each available core.  Think stateless: in general for web apps, and especially here so you can scale out.  Follow CommonJS module for code organization: http://www.commonjs.org/specs/modules/1.0/  Don’t expect to share a lot of code between the browser and the server. However the lack of context switching (all JS all the time) is the real benefit.
  • 15. Thanks!  Chris Bumgardner  https://github.com/cbumgard  https://www.linkedin.com/in/chrisbumgardner  Please don’t hesitate to contact me 
  • 16. Links  http://www.slideshare.net/chrisbumgardner/benetech-nodejsvagrant  https://github.com/cbumgard/mathoid-vagrant  http://www.vagrantup.com/downloads.html  https://www.virtualbox.org/wiki/Downloads  https://github.com/mitchellh/vagrant-aws  https://github.com/10thmagnitude/vagrant-azure  https://gist.github.com/GUI/2864683  https://github.com/caolan/async  http://semver.org/

Editor's Notes

  1. My first experience with Vagrant was on the Obama 2012 campaign with the West Coast TFO.
  2. Give demo of working instance
  3. Walk through the Vagrant fileExplain private network & synced folder options
  4. I have been experiencing difficulty with official Ubuntu boxes (ubuntu/*) lately. Downloads aren’t working.
  5. Grunt: asset pipeline, packaging, tests, etc.