-
Notifications
You must be signed in to change notification settings - Fork 6
VOC Deployment Requirements Guide 2.0
RVM is the industry standard method of supporting multiple ruby environments on the same application server or virtual machine while keeping each of them in complete isolation from each other. RVM enables the deployment of multiple projects, each with its own completely self-contained and dedicated ruby environment, from the specific version of ruby, all the way down to the precise set of required application gems. RVM prevents the issue of gem version conflicts between projects. RVM permits easy testing of gems and gemsets for upgrades, by switching to a new clean set of gems to test with, while leaving the original current live set intact. It is flexible enough to even to maintain a set of gems per environment, or per development branch, or even per individual developer's taste!
Ruby version 1.9.3, which includes Bundler v. 1.3.5, which is a standard gem used to manage and build gemsets for Ruby projects. Bundler is installed by RVM when installing most Ruby versions.
- Rails 3.0.20 – Ruby on Rails web framework
- jQuery-rails 2.1.4 – jQuery javascript library bridge for Ruby on Rails Kaminari 0.14.1 – Pagination plugin
- Authlogic 3.2.0 – Authentication plugin
- Memcache-client 1.8.5 – Memcached interface for Ruby on Rails
- Paperclip 3.4.0 – Document attachment management
- Resque 1.24.1 – Asynchronous jobs processor
- Resque_mailer 2.2.3 – Asynchronous Mailer processor
- Resque-status 0.4.1 – Makes redis/resque jobs trackable
- Bson_ext 1.9.0 – Provides BSON support for mongo database
- Escape_utils 0.3.2 – Fast string escaping for rails
- Mongoid 2.2.6– Provides ORM support for mongo database Open_uri_redirections 0.1.1 – Handles redirection between http / https fluidly Ranked-model 0.2.1 – Database row sorting library
- Redis-objects 0.7.0 – Redis Queue Integration
- Pdfkit 0.5.4 – PDF generation utility
- Best_in_place 0.2.4– Javascript / support for in place editing of tables
MySQL 5.5 or later should be installed with a custom application user with read/write and create table permissions.
MongoDB 2.2.0 or later should be installed with a custom application user with read/write/create permissions.
Redis 2.8 or later should be installed.
Redis is an open source, BSD licensed, advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets. Redis runs as a deamon like MySQL or MongoDB. Full documentation can be found at http://redis.io/
Redis installation directions http://redis.io/topics/quickstart.
-
wget http://download.redis.io/releases/redis-2.8.5.tar.gz
other versions available here, (http://redis.io/download) tar xzf redis-2.8.5.tar.gz
cd redis-2.8.5.tar.gz
make
- run with
src/redis-server
For configuration details, see http://redis.io/topics/config
A build server, independent of existing host infrastructure, should be used to pull updates of the deployed code from the source controlled code repository. The code repository will initially be the HHS Open Source VOC Github, uri to be launched mid-December by HHS. The server will need internet access only to Github, as all dependent gems and gemsets, will be included at their appropriate version levels within the repository. Since there is no compilation process for Ruby, the resulting code pulled from the Github is ready for deployment. This code may then be compressed and transferred to the development/staging/production environment so that those environments may be kept secure from outside connections.
Private Githubs:
https://github.com/HHS/voc-public.git https://github.com/HHS/voc-admin.git
The file structure on the Application Server in each environment should look similar to the structure below.
app/
config/
db/
doc/
lib/
log/
public/
script/
tmp/
vendor/
config.ru
Gemfile
Gemfile.lock
README
Rakefile
sync_public_folder.sh*
The public folder contains all of the html and html support static files, which should be pushed to the front facing web server/CDN.
The build server can most easily constructed on top of any of the modern flavors of Linux.
RVM should have a configuration file for each project directory generated by the command line:
rvm use ruby-1.9.3 --rvmrc
Validation can be done by switching to the project directory in the terminal and reading the ruby version report string output upon the directory switch.
Once the Github code tree is deployed to Application Server, run the bundle install from the root of the project directory to install the required gems via the command line:
bundle install –local
In the VOC/config directory the files database.yml, unicorn.rb, and app_config.yml should be modified in the following ways. (The Github repository will have *.example files for reference and syntax requirements.)
- database.yml – Change the User/Database connection information.
- mongoid.yml - Change the user/database connection information.
- unicorn.rb – Set working directory, pid directory, and error log path.
- app_config.yml – Set the url to target of the ajax calls for each distinct environment dev/staging/production.
- mailer_settings.yml - Set options for email delivery.
- secret_settings.yml – Uncomment (delete the hash symbol) and generate a new secret on the command line. This is used to hash cookies for users.
VOC consists of two distinct applications, each of which should have its own virtual host section. These virtual host sections will segment these applications away from existing and future Ruby applications running on the same server. Do not include any reference to Phusion Passenger in the virtual host section. Passenger applications can co-exist with VOC in the isolation of their own virtual host environments.
Run the initialization rake tasks in a single command line:
rake db:create db:migrate db:seed
Assuming the settings in database.yml are correct rake will create the database, load the schema, and populate with the required seed data.
Run the rake task to start the unicorn processes in a single command line:
rake unicorn:start
The number of workers will be determined by the configuration in VPC/config/unicorn.rb.
The VOC User Guide will tell them how to create a survey. All surveys will have a survey ID associated with them.