rubystack: the easiest way to deploy ruby on rails

Post on 26-May-2015

1.480 Views

Category:

Technology

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

 

 

 

 

RubyStack: the easiest way to deploy Ruby on Rails

  

Who is danoo ... ?• Daniel Liszka, Polish• started with Linux: 10 years ago• Linux security labs, Linux Security final project in high 

school• studied at Silesian University of Technology, Gliwice• organized conference Open Source in Organization – 

Interinfo_2004, Gliwice

  

I met www.BitRock.com

And  everything really started ...

  

Meet BitRock          • Founded in 2003, privately held with offices in Seville, Spain and 

San Francisco, USA

• Develops packaging, installation and update tools to provide a complete Open Source Application Deployment solution 

• Clients span the globe, and include Fortune 100 corporations, governments, educational institutions, and the leading open source companies 

• Recent honors include Red Herring 100 Winner and Red Herring Open Source 20 Winner

OPEN SOURCE 20

  

www.BitRock.com

• BitRock makes open source software easier to use by providing a complete automated solution for Open Source Application Deployment.

• Makes it fun• brings it to people 

  

Ruby• “Ruby is a dynamic, object­oriented programming 

language. It combines syntax inspired by Perl with Smalltalk­like object­oriented features, and also shares some features with Python, Lisp, Dylan, and CLU. Its official implementation is free software written in C.”

• Beautiful• FUN !!!

  

Ruby# In an object instance variable (denoted with '@'), 

remember a block.

def remember(&a_block)

        @block = a_block

end

 

# Invoke the above method, giving it a block that takes a name.

remember {|name| puts "Hello, #{name}!"}

 

# When the time is right (for the object) ­­ call the closure!

@block.call("Jon")

# => "Hello, Jon!"

  

Ruby on Rails• “web application framework that aims to increase the 

speed and ease with which database­driven web sites can be created and offers skeleton code frameworks (scaffolding) from the outset. Often shortened to Rails, or RoR, Ruby on Rails is an open source project written in the Ruby programming language and applications using the Rails framework are developed using the Model­View­Controller design pattern”

• Beautifull• FUN !!!

  

It is my story• We decided to start with RoR• Lovely !• me as a developer, I need development environment• My team needs development environment – it would 

be cool if both are the same • My graphics designer needs it as well • They have different operating systems, different 

requirements (GUI,text mode,...) and skills • I want to use several environments on one machine 

  

It is my story• DEMO day is coming !!!• deployment• scale your application ­ > several servers• deployment on many servers 

– chroot– Vmware, XEN– Solaris Zones– Amazon EC2

  

We need• Ruby and Ruby Gems• RoR• MySQL, SQLite• Apache• Subversion• libraries

  

We need at least that . . . (RubyStack Features)

• completely self­contained• re­locatable• not interfere with existing software• works on different operating systems • easy to install

  

TOOLS

  

RubyStack Installer• created using BitRock InstallBuilder• easy to use• multiplatform • native look and feel• GUI, text and unattended modes• Platforms: Linux, Mac OS X, Windows, Solaris, ...• No External Dependencies

  

Apart from that ....• Desktop Integration• RPM and DEB generation (beta)• Optimized : BitRock installers are optimized in size and 

speed• Ease of Development• Support for Qt® GUI Frontend• Uninstall Functionality• LZIP• Multiple Language Support

  

InstallBuilder (RubyStack Installer)

  

InstallBuilder (RubyStack Installer)

  

InstallBuilder (RubyStack Installer)

  

InstallBuilder (RubyStack Installer)

  

Unattended modeMany different options:# rubystack­1.0­linux­installer.bin ­­mode unattended ­­

prefix /secure/tmp/ruby_unatended ­­rubystack_version production ­­apache_server_port 4568 ­­mysql_port 4321 ­­mysql_db_name blabla

  

Take a look at Capistrano tool (capify.org)  desc "Install RubyStack"

  task :install do

    run "! test ­d #{rubystack_path}"

    install_string = "./#{rubystack_binary}

         ­­mode unattended

         ­­prefix #{rubystack_path}

         ­­rubystack_version production

         ­­apache_server_port #{rubystack_apache_port}

         ­­mysql_port #{rubystack_mysql_port}

         ­­mysql_db_name #{application}

         ­­mysql_db_username #{application}­user"

  if rubystack_apache_port < 1024

      sudo install_string

    else

      run install_string

    end

    run "echo \". #{rubystack_path}/scripts/setenv.sh\" >> ~/.bashrc"

  end

  

Take a look at Capistrano tool (capify.org)• “Great for automating tasks via SSH on remote servers, 

like software installation, application deployment, configuration management, ad hoc server monitoring, and more.

• Ideal for system administrators, whether professional or incidental.

• Easy to customize.• Easy to extend. Capistrano is written in the Ruby”

 

 

 

 

Conclusions (for the RubyStack Installer)

­ let's start demo

 

 

 

 

It is not the end ­ do you remember the components we need ?

­ and very specific features ?(completely self­contained,re­locatable

not interfere with existing software)

  

RubyStack Componentszlib version: 1.2.3

libiconv version: 1.9.2

openssl version: 0.9.7l

sqlite version: 3.3.6

httpd version: 2.2.4

mysql version: 5.0.45

libpng version: 1.2.10

jpegsrc version: v6b

freetype version: 2.3.4

libwmf version: 0.2.8.4

ghostscript version: 8.56

ImageMagick version: 6.3.4

expat version: 2.0.0

neon version: 0.25.5

subversion version: 1.4.4

ncurses version: 5.6

readline version: 5.2

ruby version: 1.8.6

rubygems version: 0.9.4

rake version: 0.7.3

rails version: 1.2.3

fastthread version: 1.0

mongrel version: 1.0.1

rmagick version: 1.15.6

mongrel_cluster version: 1.0.2

gruff version: 0.2.8

capistrano version: 2.0.0

  

Lets take a look inside

• Building & testing system• Integration• logic inside XML files• Wrappers ?!?

  

Lets take a look inside

• Examples: svn and ruby binaries and wrappers• Lets try to run them• LD_LIBRARY_PATH ­> wrappers• what about the shebang line• rubyconsole & rubystackctl.sh

 

 

 

 

Conclusions­ RubyStack is great platform

­ not finished yet­ but already tested in production

 

 

 

 

Questions ???

 

 

 

 

Thank you !Daniel Liszka

danoo@BitRock.com

top related