CSC/ECE 517 Fall 2013/ch1 1w09 hs: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
Line 9: Line 9:
Deployment is a process of transferring your application onto a production server to make it available for other users. This process involves various activities and transitions between them. Though the general guidelines remain the same, the specific requirements vary with each software system. The different deployment activities include release, install and activate, deactivate, adapt, update, bulit-in, version tracking, uninstall and retire.
Deployment is a process of transferring your application onto a production server to make it available for other users. This process involves various activities and transitions between them. Though the general guidelines remain the same, the specific requirements vary with each software system. The different deployment activities include release, install and activate, deactivate, adapt, update, bulit-in, version tracking, uninstall and retire.


Release management is a software engineering process intended to oversee the development, testing, deployment and support of software releases. Release management usually begins in the development cycle with requests for changes or new features. If the request is approved, the new release is planned and designed. The new design enters the testing or quality assurance phase, in which the release is built, reviewed, tested and tweaked until it is ultimately accepted as a release candidate. The release then enters the deployment phase, where it is implemented and made available. Once deployed, the release enters a support phase, where bug reports and other issues are collected; this leads to new requests for changes, and the cycle starts all over again.
Release management is a software process which takes care of the development, testing, deployment and support stages of software releases. The start of release management happens in the development phase, where it requests for new features or changes in the existing. When the request is accepted, a new release is planned and designed. This design then enters the testing phase, where the release is built and tested until it is accepted. After the release is accepted as a candidate, it enters the deployment phase where it is implemented. Once deployed, the release is made available and sent to support phase for collection of bug reports. Once the support phase is done, the bugs and other issues lead to the requests for changes and the cycle is then repeated.


[[File:Deployment Process.jpg|center]]
[[File:Deployment Process.jpg|center]]

Revision as of 00:30, 17 September 2013

Code Deployment and Release Management with Rails

Code Deployment or Software Deployment and Release management with Ruby on Rails uses various tools such as Capistrano, Heroku, Mina, Vlad, Inploy etc. These automated tools are frameworks used to write and execute commands in parallel remote machines and thus ease the process of deployment and management of various applications.

Introduction

Deployment is a process of transferring your application onto a production server to make it available for other users. This process involves various activities and transitions between them. Though the general guidelines remain the same, the specific requirements vary with each software system. The different deployment activities include release, install and activate, deactivate, adapt, update, bulit-in, version tracking, uninstall and retire.

Release management is a software process which takes care of the development, testing, deployment and support stages of software releases. The start of release management happens in the development phase, where it requests for new features or changes in the existing. When the request is accepted, a new release is planned and designed. This design then enters the testing phase, where the release is built and tested until it is accepted. After the release is accepted as a candidate, it enters the deployment phase where it is implemented. Once deployed, the release is made available and sent to support phase for collection of bug reports. Once the support phase is done, the bugs and other issues lead to the requests for changes and the cycle is then repeated.

Why Automation?

Manual deployments are slow and error prone Deployment of a real world application is a complex and all-too-often manual process. IT deployment instructions are typically found in multiple documents, spread across several groups and may be incomplete, requiring tribal knowledge in order to be executed successfully. Components of the application may need to be deployed in some specific order to any number of environments, from early testing, user acceptance, and staging, to production, performance, and disaster recovery. The manual deployment process must be repeated for each environment. Manually-introduced errors are common and costly.

Deployment Automation Deliver your applications faster and with fewer errors using UrbanCode's software deployment automation tool: UrbanCode Deploy. Define your software deployment process and apply it across all of your environments consistently every time. With UrbanCode Deploy's automated application deployment platform, manual deployments become a thing of the past.

Deployment Automation tools

Various automated tools that are widely used for the process of deployment are

  • Capistrano
  • Heroku
  • Vlad

Capistrano

Capistrano is a Ruby program that gives you a set of advanced tools to deploy web applications to your servers. With Capistrano it’s also possible to deploy to many machines at once. Capistrano offers many advanced options and can be used to deploy many kinds of applications.

It supports the scripting and execution of arbitrary tasks, and includes a set of sane-default deployment workdflows.

Capistrano can be used to:

Reliably deploy web application to any number of machines simultaneously, in sequence or as a rolling set

  • To automate audits of any number of machines (checking login logs, enumerating uptimes, and/or applying security patches)
  • To script arbitrary workflows over SSH
  • To automate common tasks in software teams.
  • To drive infrastructure provisioning tools such as chef-solo, Ansible or similar.

Capistrano is also very scriptable, and can be integrated with any other Ruby software to form part of a larger too.

Installing Capistrano

General Usage

The following commands will clone Capistrano at the latest v3 revision, and will build the gem and install it locally.

$ gem install capistrano --pre --trust-policy HighSecurity

Or grab the bleeding edge head from:

$ git clone -b v3 https://github.com/capistrano/capistrano.git
$ cd capistrano
$ gem build *.gemspec
$ gem install *.gem

Signed Rubygems

As Capistrano is a signed gem, you should always be careful to use the --trust-policy flag when installing Gems, or since Bundler 1.3 you should use the same flag:

$ gem install capistrano --pre --trust-policy HighSecurity
$ bundle install --trust-policy HighSecurity

If you get a message that looks like:

ERROR:  While executing gem ... (Gem::Security::Exception)
unsigned gems are not allowed by the High Security policy

Then please complain to your Gem author, and have them start signing their Gems.

Usage in a Rails project

Add the following lines to the Gemfile to the :development group ideally.

group :development do
  gem 'capistrano-rails', '~> 0.0.7'
end

Heroku

Heroku is a cloud platform as a service (PaaS) supporting several programming languages. Heroku was acquired by Salesforce.com in 2010. Heroku, one of the first cloud platforms, has been in development since June 2007, when it supported only the Ruby programming language, but has since added support for Java, Node.js, Scala, Clojure and Python and (undocumented) PHP and Perl. The base operating system is Debian or, in the newest stack, the Debian-based Ubuntu.

Heroku lets you manage environment-specific configurations (such as credentials for backing services) separately from your source code for greater safety and portability. In Heroku, this data can be managed with config vars, which are made available to your running application as simple environment variables.

Heroku CLI

The Heroku CLI is used to manage Heroku apps from the command line.

Once installed, you'll have access to the heroku command from your command shell. Log in using the email address and password you used when creating your Heroku account:

$ heroku login
Enter your Heroku credentials.
Email: adam@example.com
Password:
Could not find an existing public key.
Would you like to generate one? [Yn]
Generating new SSH public key.
Uploading SSH public key /Users/adam/.ssh/id_rsa.pub

Deploying Apllications

The Heroku platform uses git as the primary means for deploying applications. When you create an application on Heroku, it associates a new git remote, typically named heroku, with the local git repository for your application. As a result, deploying code is just the familiar git push, but to the heroku remote instead:

$ git push heroku master

Vlad

Vlad the Deployer is pragmatic application deployment automation, without mercy. Much like Capistrano, but with 1/10th the complexity. Vlad integrates seamlessly with Rake, and uses familiar and standard tools like ssh and rsync.

Features

  • Full deployment automation stack.
  • Turnkey deployment for passenger+apache+svn.
  • Supports single server deployment with just 3 variables defined.
  • Built on rake. Easy. Engine is small.
  • Very few dependencies. All simple.
  • Uses ssh with your ssh settings already in place.
  • Uses rsync for efficient transfers.
  • Run remote commands on one or more servers.
  • Mix and match local and remote tasks.
  • Compatible with all of your tab completion shell script rake-tastic goodness.
  • Ships with tests that actually pass in 0.028 seconds!

Comparison between Capistrano/Heroku/Vlad

Criteria Capistrano Heroku Vlad
"Take some more [[tea]]," the March Hare said to Alice, very earnestly.

"I've had '''nothing''' yet," Alice replied in an offended tone, "so I can't take more."

"You mean you can't take ''less''?" said the Hatter. "It's very easy to take ''more'' than nothing."
<p>"Take some more <a title="Tea" href="/wiki/Tea">tea</a>," the March Hare said to Alice, very earnestly.</p>

<p>"I've had <strong>nothing</strong> yet," Alice replied in an offended tone, "so I can't take more."</p>

<p>"You mean you can't take <em>less</em>?" said the Hatter. "It's very easy to take <em>more</em> than nothing."</p>

"Take some more tea," the March Hare said to Alice, very earnestly.

"I've had nothing yet," Alice replied in an offended tone, "so I can't take more."

"You mean you can't take less?" said the Hatter. "It's very easy to take more than nothing."

Conclusion

We compare and contrast between various deployment automated tools such as Capistrano, Heroku and Vlad. Among the three tools, Vlad is the one of the newest tools which is highly automated and faster in deploying applications than the other tools. It is the highly pragmatic tool which automates the entire process of code deployment and release management with Rails.

References

http://technet.microsoft.com

http://searchitchannel.techtarget.com/definition/release-management

http://www.capistranorb.com/documentation/getting-started/installation/

http://www.urbancode.com/html/solutions/deployment-automation.html

https://devcenter.heroku.com/articles/how-heroku-works#deploying-applications

https://github.com/heroku/heroku

http://docs.seattlerb.org/vlad/index.html

<references/>

See Also