SlideShare a Scribd company logo
1 of 19
1




Moonshine
190 Proof Deployment



Jarin Udom, Robot Mode LLC
http://robotmo.de
2




Introduction
3




Deployment Sucks!
    Install Ubuntu

    Update packages

    Configure SSH

    Configure iptables

    Build and install Apache, MySQL/Postgres, Ruby Enterprise Edition,
    RubyGems, Passenger, ImageMagick, PostFix, Cron, logrotate, NTP, Rails, gems, git, etc. etc.…

    Finally deploy!
4




What Moonshine does
    Update packages

    Configure SSH

    Configure iptables

    Build and install Apache, MySQL/Postgres, Ruby Enterprise Edition,
    RubyGems, Passenger, ImageMagick, PostFix, cron, logrotate, NTP, Rails, gems, git, etc. etc.…

    Deploy!

    Manage!

    …and more!
5




What Moonshine is built on

    Made by Rails Machine

    Puppet

    ShadowPuppet (extracted from Moonshine)

    Capistrano
6




Moonshine Plugins
    ar_mailer

    Local and Amazon S3 backups

    god

    iptables

    memcached

    sphinx

    ssh

    Wordpress (?!)
7




Getting Started
8




What you need


    A server running Ubuntu 8.10

    A user on the server who can sudo and
    access your Git repository

    A beer (optional)
9




Install Plugins
    script/plugin install git://github.com/railsmachine/moonshine.git

    script/plugin install git://github.com/railsmachine/moonshine_ssh.git

    script/plugin install git://github.com/railsmachine/
    moonshine_iptables.git

    Install any other Moonshine plugins you want

    script/generate moonshine

      Generates config/moonshine.yml and app/manifests/
10




Gems

     Make sure all of your gems are declared in environment.rb

     rake moonshine:gems

       Generates gems.yml

       You need to do this any time you add/remove/change the gems
11




Edit moonshine.yml
:ruby: ree
:application: ultranetweb
:user: rails
:time_zone: UTC
:deploy_to: /srv/ultranetweb
:domain: ultranetweb.com
:domain_aliases:
  - www.ultranetweb.com
  - assets1.ultranetweb.com

# The entries in shared_children are created in #{application}/shared
:shared_children:
- system
- log
- pids
- config

:repository: git@github.com:robotmode/ultranetweb.git
12




Edit moonshine.yml
:local_config:
 - config/database.yml

:ssh
   :port: 9022
   :allow_users:
     - jarin
     - rails

:apt_gems:
 :paperclip:
   - imagemagick

:passenger:
  :max_pool_size: 3
  :use_global_queue: true
:mysql:
  :innodb_buffer_pool_size: 128M
13




Edit application_manifest.rb
  Located in app/manifests/

# Installs Rails, Apache, Passenger, the database from database.yml, Postfix,
# Cron, logrotate and NTP.
recipe :default_stack

plugin :ssh
recipe :ssh

plugin :iptables
recipe :iptables
14




Edit application_manifest.rb
  Located in app/manifests/
def application_packages
 send_weekly_emails = "/usr/bin/rake -f #{configuration[:deploy_to]}/
current/Rakefile mailer:send_weekly_emails RAILS_ENV=#{ENV['RAILS_ENV']}"

 cron 'notifications:send_weekly_emails',
    :command => send_weekly_emails,
    :user => configuration[:user],
    :minute => 0,
    :hour => 3,
    :weekday => 1

 # Only run the following on the 'staging' stage using capistrano-ext.
 on_stage 'staging' do
  file '/etc/motd', :ensure => :file, :content => "!!! STAGING SERVER !!!"
 end
end
15




Capify and go!
     capify .

 config/deploy.rb:
     server "ultranetweb.com", :app, :web, :db, :primary =>
     true
 Add to git
     git add . && git commit -am "added moonshine" && git
     push
 Bootstrap!
     cap
     deploy:setup
 Deploy!
     cap
     deploy
16




Now, cap deploy will…
 Verify your system config on each deploy

 Run migrations

 Install gems

     …and their system dependencies!

 Pull down submodules

 Keep your system configuration in
 version control!
17




But what about other servers?

      You can have per-server manifests for your app servers, database
      servers, memcache, etc.

     set :moonshine_manifest, 'memcached_manifest'

      By default, Moonshine sets your database auto-increment to 10 to
      allow for easier database sharding later

      Check the Moonshine Google Group for more info
18




Resources

     Source/wiki: http://github.com/railsmachine/moonshine

     Docs: http://railsmachine.github.com/moonshine/

     Mailing list: http://groups.google.com/group/railsmachine-
     moonshine

     Slides will be up at http://jarinheit.com in the next couple of days
19




Questions?

More Related Content

What's hot

Fun with containers: Use Ansible to build Docker images
Fun with containers: Use Ansible to build Docker imagesFun with containers: Use Ansible to build Docker images
Fun with containers: Use Ansible to build Docker imagesabadger1999
 
Using rbenv in Production
Using rbenv in ProductionUsing rbenv in Production
Using rbenv in ProductionNic Benders
 
Keep Your Servers in GitHub
Keep Your Servers in GitHubKeep Your Servers in GitHub
Keep Your Servers in GitHubYegor Bugayenko
 
EuroPython 2014 - How we switched our 800+ projects from Apache to uWSGI
EuroPython 2014 - How we switched our 800+ projects from Apache to uWSGIEuroPython 2014 - How we switched our 800+ projects from Apache to uWSGI
EuroPython 2014 - How we switched our 800+ projects from Apache to uWSGIMax Tepkeev
 
Building and Testing from Scratch a Puppet Environment with Docker - PuppetCo...
Building and Testing from Scratch a Puppet Environment with Docker - PuppetCo...Building and Testing from Scratch a Puppet Environment with Docker - PuppetCo...
Building and Testing from Scratch a Puppet Environment with Docker - PuppetCo...Puppet
 
How to contribute Apache CloudStack
How to contribute Apache CloudStackHow to contribute Apache CloudStack
How to contribute Apache CloudStackGo Chiba
 
Git, gitHub, Azure and Visual Studio
Git, gitHub, Azure and Visual StudioGit, gitHub, Azure and Visual Studio
Git, gitHub, Azure and Visual StudioSalvatore Sorrentino
 
Deploy node.js app with capistrano
Deploy node.js app with capistranoDeploy node.js app with capistrano
Deploy node.js app with capistranoGergely Németh
 
Develop - Project Scaffolding
Develop - Project ScaffoldingDevelop - Project Scaffolding
Develop - Project ScaffoldingKevin Cao
 
Deploying PHP Applications with Ansible
Deploying PHP Applications with AnsibleDeploying PHP Applications with Ansible
Deploying PHP Applications with AnsibleOrestes Carracedo
 
Painless Deployment with Capistrano
Painless Deployment with CapistranoPainless Deployment with Capistrano
Painless Deployment with CapistranoNick Kugaevsky
 
WordPress workflow of the future
WordPress workflow of the futureWordPress workflow of the future
WordPress workflow of the futureEli McMakin
 
Gitlab installation
Gitlab installationGitlab installation
Gitlab installationRaiful Hasan
 
Wocker @WordBench Osaka No.41
Wocker @WordBench Osaka No.41Wocker @WordBench Osaka No.41
Wocker @WordBench Osaka No.41Kite Koga
 
Cloud focker を試してみた public
Cloud focker を試してみた   publicCloud focker を試してみた   public
Cloud focker を試してみた publicTakehiko Amano
 
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
 
Custom Non-RDS Multi-AZ Mysql Replication
Custom Non-RDS Multi-AZ Mysql ReplicationCustom Non-RDS Multi-AZ Mysql Replication
Custom Non-RDS Multi-AZ Mysql ReplicationMichael H. Oshita
 
asyncio community, one year later
asyncio community, one year laterasyncio community, one year later
asyncio community, one year laterVictor Stinner
 
AWS 기반 Docker, Kubernetes
AWS 기반 Docker, KubernetesAWS 기반 Docker, Kubernetes
AWS 기반 Docker, Kubernetes정빈 권
 
Docker in Action
Docker in ActionDocker in Action
Docker in ActionAlper Kanat
 

What's hot (20)

Fun with containers: Use Ansible to build Docker images
Fun with containers: Use Ansible to build Docker imagesFun with containers: Use Ansible to build Docker images
Fun with containers: Use Ansible to build Docker images
 
Using rbenv in Production
Using rbenv in ProductionUsing rbenv in Production
Using rbenv in Production
 
Keep Your Servers in GitHub
Keep Your Servers in GitHubKeep Your Servers in GitHub
Keep Your Servers in GitHub
 
EuroPython 2014 - How we switched our 800+ projects from Apache to uWSGI
EuroPython 2014 - How we switched our 800+ projects from Apache to uWSGIEuroPython 2014 - How we switched our 800+ projects from Apache to uWSGI
EuroPython 2014 - How we switched our 800+ projects from Apache to uWSGI
 
Building and Testing from Scratch a Puppet Environment with Docker - PuppetCo...
Building and Testing from Scratch a Puppet Environment with Docker - PuppetCo...Building and Testing from Scratch a Puppet Environment with Docker - PuppetCo...
Building and Testing from Scratch a Puppet Environment with Docker - PuppetCo...
 
How to contribute Apache CloudStack
How to contribute Apache CloudStackHow to contribute Apache CloudStack
How to contribute Apache CloudStack
 
Git, gitHub, Azure and Visual Studio
Git, gitHub, Azure and Visual StudioGit, gitHub, Azure and Visual Studio
Git, gitHub, Azure and Visual Studio
 
Deploy node.js app with capistrano
Deploy node.js app with capistranoDeploy node.js app with capistrano
Deploy node.js app with capistrano
 
Develop - Project Scaffolding
Develop - Project ScaffoldingDevelop - Project Scaffolding
Develop - Project Scaffolding
 
Deploying PHP Applications with Ansible
Deploying PHP Applications with AnsibleDeploying PHP Applications with Ansible
Deploying PHP Applications with Ansible
 
Painless Deployment with Capistrano
Painless Deployment with CapistranoPainless Deployment with Capistrano
Painless Deployment with Capistrano
 
WordPress workflow of the future
WordPress workflow of the futureWordPress workflow of the future
WordPress workflow of the future
 
Gitlab installation
Gitlab installationGitlab installation
Gitlab installation
 
Wocker @WordBench Osaka No.41
Wocker @WordBench Osaka No.41Wocker @WordBench Osaka No.41
Wocker @WordBench Osaka No.41
 
Cloud focker を試してみた public
Cloud focker を試してみた   publicCloud focker を試してみた   public
Cloud focker を試してみた public
 
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 ...
 
Custom Non-RDS Multi-AZ Mysql Replication
Custom Non-RDS Multi-AZ Mysql ReplicationCustom Non-RDS Multi-AZ Mysql Replication
Custom Non-RDS Multi-AZ Mysql Replication
 
asyncio community, one year later
asyncio community, one year laterasyncio community, one year later
asyncio community, one year later
 
AWS 기반 Docker, Kubernetes
AWS 기반 Docker, KubernetesAWS 기반 Docker, Kubernetes
AWS 기반 Docker, Kubernetes
 
Docker in Action
Docker in ActionDocker in Action
Docker in Action
 

Viewers also liked

Viewers also liked (6)

President Estrada’s BW Resources Scandal
President Estrada’s BW Resources ScandalPresident Estrada’s BW Resources Scandal
President Estrada’s BW Resources Scandal
 
Philippine presidents
Philippine presidentsPhilippine presidents
Philippine presidents
 
Fidel ramos
Fidel ramosFidel ramos
Fidel ramos
 
Philippine Presidents
Philippine PresidentsPhilippine Presidents
Philippine Presidents
 
Fidel v ramos 2
Fidel v ramos 2Fidel v ramos 2
Fidel v ramos 2
 
Joseph Estrada
Joseph EstradaJoseph Estrada
Joseph Estrada
 

Similar to Deploying Rails applications with Moonshine

Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)Fabrice Bernhard
 
Ruby and Rails Packaging to Production
Ruby and Rails Packaging to ProductionRuby and Rails Packaging to Production
Ruby and Rails Packaging to ProductionFabio Kung
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.catPablo Godel
 
Infrastructureascode slideshare-160331143725
Infrastructureascode slideshare-160331143725Infrastructureascode slideshare-160331143725
Infrastructureascode slideshare-160331143725miguel dominguez
 
Infrastructureascode slideshare-160331143725
Infrastructureascode slideshare-160331143725Infrastructureascode slideshare-160331143725
Infrastructureascode slideshare-160331143725MortazaJohari
 
Infrastructure as code: running microservices on AWS using Docker, Terraform,...
Infrastructure as code: running microservices on AWS using Docker, Terraform,...Infrastructure as code: running microservices on AWS using Docker, Terraform,...
Infrastructure as code: running microservices on AWS using Docker, Terraform,...Yevgeniy Brikman
 
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis OverviewLeo Lorieri
 
Deploying your rails application to a clean ubuntu 10
Deploying your rails application to a clean ubuntu 10Deploying your rails application to a clean ubuntu 10
Deploying your rails application to a clean ubuntu 10Maurício Linhares
 
A Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy SystemA Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy Systemadrian_nye
 
Cloud meets Fog & Puppet A Story of Version Controlled Infrastructure
Cloud meets Fog & Puppet A Story of Version Controlled InfrastructureCloud meets Fog & Puppet A Story of Version Controlled Infrastructure
Cloud meets Fog & Puppet A Story of Version Controlled InfrastructureHabeeb Rahman
 
How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...
How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...
How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...Puppet
 
Capistrano, Puppet, and Chef
Capistrano, Puppet, and ChefCapistrano, Puppet, and Chef
Capistrano, Puppet, and ChefDavid Benjamin
 
Large-scaled Deploy Over 100 Servers in 3 Minutes
Large-scaled Deploy Over 100 Servers in 3 MinutesLarge-scaled Deploy Over 100 Servers in 3 Minutes
Large-scaled Deploy Over 100 Servers in 3 MinutesHiroshi SHIBATA
 
K8s, Amazon EKS - 유재석, AWS 솔루션즈 아키텍트
K8s, Amazon EKS - 유재석, AWS 솔루션즈 아키텍트K8s, Amazon EKS - 유재석, AWS 솔루션즈 아키텍트
K8s, Amazon EKS - 유재석, AWS 솔루션즈 아키텍트Amazon Web Services Korea
 
Virtualize and automate your development environment for fun and profit
Virtualize and automate your development environment for fun and profitVirtualize and automate your development environment for fun and profit
Virtualize and automate your development environment for fun and profitAndreas Heim
 
Setting up Notifications, Alerts & Webhooks with Flux v2 by Alison Dowdney
Setting up Notifications, Alerts & Webhooks with Flux v2 by Alison DowdneySetting up Notifications, Alerts & Webhooks with Flux v2 by Alison Dowdney
Setting up Notifications, Alerts & Webhooks with Flux v2 by Alison DowdneyWeaveworks
 
AWS 고객사를 위한 ‘AWS 컨테이너 교육’ - 유재석, AWS 솔루션즈 아키텍트
AWS 고객사를 위한 ‘AWS 컨테이너 교육’ - 유재석, AWS 솔루션즈 아키텍트AWS 고객사를 위한 ‘AWS 컨테이너 교육’ - 유재석, AWS 솔루션즈 아키텍트
AWS 고객사를 위한 ‘AWS 컨테이너 교육’ - 유재석, AWS 솔루션즈 아키텍트Amazon Web Services Korea
 
Laravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionLaravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionJoe Ferguson
 
From Code to Cloud - PHP on Red Hat's OpenShift
From Code to Cloud - PHP on Red Hat's OpenShiftFrom Code to Cloud - PHP on Red Hat's OpenShift
From Code to Cloud - PHP on Red Hat's OpenShiftEric D. Schabell
 
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, OrchestrationThe Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, OrchestrationErica Windisch
 

Similar to Deploying Rails applications with Moonshine (20)

Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
 
Ruby and Rails Packaging to Production
Ruby and Rails Packaging to ProductionRuby and Rails Packaging to Production
Ruby and Rails Packaging to Production
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.cat
 
Infrastructureascode slideshare-160331143725
Infrastructureascode slideshare-160331143725Infrastructureascode slideshare-160331143725
Infrastructureascode slideshare-160331143725
 
Infrastructureascode slideshare-160331143725
Infrastructureascode slideshare-160331143725Infrastructureascode slideshare-160331143725
Infrastructureascode slideshare-160331143725
 
Infrastructure as code: running microservices on AWS using Docker, Terraform,...
Infrastructure as code: running microservices on AWS using Docker, Terraform,...Infrastructure as code: running microservices on AWS using Docker, Terraform,...
Infrastructure as code: running microservices on AWS using Docker, Terraform,...
 
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
 
Deploying your rails application to a clean ubuntu 10
Deploying your rails application to a clean ubuntu 10Deploying your rails application to a clean ubuntu 10
Deploying your rails application to a clean ubuntu 10
 
A Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy SystemA Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy System
 
Cloud meets Fog & Puppet A Story of Version Controlled Infrastructure
Cloud meets Fog & Puppet A Story of Version Controlled InfrastructureCloud meets Fog & Puppet A Story of Version Controlled Infrastructure
Cloud meets Fog & Puppet A Story of Version Controlled Infrastructure
 
How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...
How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...
How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...
 
Capistrano, Puppet, and Chef
Capistrano, Puppet, and ChefCapistrano, Puppet, and Chef
Capistrano, Puppet, and Chef
 
Large-scaled Deploy Over 100 Servers in 3 Minutes
Large-scaled Deploy Over 100 Servers in 3 MinutesLarge-scaled Deploy Over 100 Servers in 3 Minutes
Large-scaled Deploy Over 100 Servers in 3 Minutes
 
K8s, Amazon EKS - 유재석, AWS 솔루션즈 아키텍트
K8s, Amazon EKS - 유재석, AWS 솔루션즈 아키텍트K8s, Amazon EKS - 유재석, AWS 솔루션즈 아키텍트
K8s, Amazon EKS - 유재석, AWS 솔루션즈 아키텍트
 
Virtualize and automate your development environment for fun and profit
Virtualize and automate your development environment for fun and profitVirtualize and automate your development environment for fun and profit
Virtualize and automate your development environment for fun and profit
 
Setting up Notifications, Alerts & Webhooks with Flux v2 by Alison Dowdney
Setting up Notifications, Alerts & Webhooks with Flux v2 by Alison DowdneySetting up Notifications, Alerts & Webhooks with Flux v2 by Alison Dowdney
Setting up Notifications, Alerts & Webhooks with Flux v2 by Alison Dowdney
 
AWS 고객사를 위한 ‘AWS 컨테이너 교육’ - 유재석, AWS 솔루션즈 아키텍트
AWS 고객사를 위한 ‘AWS 컨테이너 교육’ - 유재석, AWS 솔루션즈 아키텍트AWS 고객사를 위한 ‘AWS 컨테이너 교육’ - 유재석, AWS 솔루션즈 아키텍트
AWS 고객사를 위한 ‘AWS 컨테이너 교육’ - 유재석, AWS 솔루션즈 아키텍트
 
Laravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionLaravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello Production
 
From Code to Cloud - PHP on Red Hat's OpenShift
From Code to Cloud - PHP on Red Hat's OpenShiftFrom Code to Cloud - PHP on Red Hat's OpenShift
From Code to Cloud - PHP on Red Hat's OpenShift
 
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, OrchestrationThe Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
 

Recently uploaded

A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 

Recently uploaded (20)

A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 

Deploying Rails applications with Moonshine

  • 1. 1 Moonshine 190 Proof Deployment Jarin Udom, Robot Mode LLC http://robotmo.de
  • 3. 3 Deployment Sucks! Install Ubuntu Update packages Configure SSH Configure iptables Build and install Apache, MySQL/Postgres, Ruby Enterprise Edition, RubyGems, Passenger, ImageMagick, PostFix, Cron, logrotate, NTP, Rails, gems, git, etc. etc.… Finally deploy!
  • 4. 4 What Moonshine does Update packages Configure SSH Configure iptables Build and install Apache, MySQL/Postgres, Ruby Enterprise Edition, RubyGems, Passenger, ImageMagick, PostFix, cron, logrotate, NTP, Rails, gems, git, etc. etc.… Deploy! Manage! …and more!
  • 5. 5 What Moonshine is built on Made by Rails Machine Puppet ShadowPuppet (extracted from Moonshine) Capistrano
  • 6. 6 Moonshine Plugins ar_mailer Local and Amazon S3 backups god iptables memcached sphinx ssh Wordpress (?!)
  • 8. 8 What you need A server running Ubuntu 8.10 A user on the server who can sudo and access your Git repository A beer (optional)
  • 9. 9 Install Plugins script/plugin install git://github.com/railsmachine/moonshine.git script/plugin install git://github.com/railsmachine/moonshine_ssh.git script/plugin install git://github.com/railsmachine/ moonshine_iptables.git Install any other Moonshine plugins you want script/generate moonshine Generates config/moonshine.yml and app/manifests/
  • 10. 10 Gems Make sure all of your gems are declared in environment.rb rake moonshine:gems Generates gems.yml You need to do this any time you add/remove/change the gems
  • 11. 11 Edit moonshine.yml :ruby: ree :application: ultranetweb :user: rails :time_zone: UTC :deploy_to: /srv/ultranetweb :domain: ultranetweb.com :domain_aliases: - www.ultranetweb.com - assets1.ultranetweb.com # The entries in shared_children are created in #{application}/shared :shared_children: - system - log - pids - config :repository: git@github.com:robotmode/ultranetweb.git
  • 12. 12 Edit moonshine.yml :local_config: - config/database.yml :ssh :port: 9022 :allow_users: - jarin - rails :apt_gems: :paperclip: - imagemagick :passenger: :max_pool_size: 3 :use_global_queue: true :mysql: :innodb_buffer_pool_size: 128M
  • 13. 13 Edit application_manifest.rb Located in app/manifests/ # Installs Rails, Apache, Passenger, the database from database.yml, Postfix, # Cron, logrotate and NTP. recipe :default_stack plugin :ssh recipe :ssh plugin :iptables recipe :iptables
  • 14. 14 Edit application_manifest.rb Located in app/manifests/ def application_packages send_weekly_emails = "/usr/bin/rake -f #{configuration[:deploy_to]}/ current/Rakefile mailer:send_weekly_emails RAILS_ENV=#{ENV['RAILS_ENV']}" cron 'notifications:send_weekly_emails', :command => send_weekly_emails, :user => configuration[:user], :minute => 0, :hour => 3, :weekday => 1 # Only run the following on the 'staging' stage using capistrano-ext. on_stage 'staging' do file '/etc/motd', :ensure => :file, :content => "!!! STAGING SERVER !!!" end end
  • 15. 15 Capify and go! capify . config/deploy.rb: server "ultranetweb.com", :app, :web, :db, :primary => true Add to git git add . && git commit -am "added moonshine" && git push Bootstrap! cap deploy:setup Deploy! cap deploy
  • 16. 16 Now, cap deploy will… Verify your system config on each deploy Run migrations Install gems …and their system dependencies! Pull down submodules Keep your system configuration in version control!
  • 17. 17 But what about other servers? You can have per-server manifests for your app servers, database servers, memcache, etc. set :moonshine_manifest, 'memcached_manifest' By default, Moonshine sets your database auto-increment to 10 to allow for easier database sharding later Check the Moonshine Google Group for more info
  • 18. 18 Resources Source/wiki: http://github.com/railsmachine/moonshine Docs: http://railsmachine.github.com/moonshine/ Mailing list: http://groups.google.com/group/railsmachine- moonshine Slides will be up at http://jarinheit.com in the next couple of days