Skip to content
This repository has been archived by the owner on Feb 7, 2020. It is now read-only.

Installation & Deployment

jkingdon edited this page Sep 9, 2013 · 21 revisions

Configuring data stores

The Kochiku web server requires two data stores: MySQL (5.0 or later) and Redis (2.2 or later). Installation instructions for these data stores are available on their respective project websites. Kochiku worker machines do not require these data stores.

MySQL

After you install MySQL on the machine that will run the Kochiku web server:

  1. Create a kochiku database and a kochiku MySQL user on the server machine.
  2. On your own machine, copy the sample configuration file from config/database.production.yml.sample to config/database.production.yml and edit it to include your database's connection details.

When you deploy the Kochiku web server, config/database.production.yml is copied from your machine to the server machine at config/database.yml.

Redis

Kochiku uses Resque for its job system, which depends on Redis.

After you install Redis on the server machine, you don't need to configure it beyond ensuring that it's running on the default port (6379).

Javascript

Kochiku (like other Rails applications using the asset pipeline) uses execjs for the javascript requirements and you will need to have one of the javascript environments listed on the web server.

Installing the web server

Kochiku is a Ruby on Rails project that is deployed with Capistrano. Configuration information is specified in kochiku/config/application.yml. You need to maintain changes to this file on your Kochiku server. You can do this with any of the following methods:

  • Put application.yml in Capistrano's shared directory and create a symlink to it from kochiku/config/application.yml.
  • Fork Kochiku to your private git server and commit your modifications to application.yml.

Before you deploy the web server, copy kochiku/config/deploy.custom.rb.sample to kochiku/config/deploy.custom.rb and set the host value for kochiku_host to point to your server machine.

If you need to customize the deploy, edit kochiku/config/deploy.custom.rb to specify additional Capistrano tasks or override the existing tasks in kochiku/config/deploy.rb.

Basic web server deployment steps
git clone https://github.com/square/kochiku.git
cd kochiku
gem install bundler
bundle install
# Edit config/application.yml
# Edit config/deploy.custom.rb
cap deploy

Installing workers

Note: The Kochiku worker implementation lives in a separate repository: square/kochiku-worker. You need to clone that repository in addition to the main Kochiku repository.

Like the web server, Kochiku workers are deployed with Capistrano. To deploy, you need to provide the following information in kochiku-worker/config/deploy_hosts.yml:

  • The location of the Kochiku web server
  • The location of the Kochiku Redis server
  • The hostnames of all worker machines

When you deploy workers, the values in kochiku-worker/config/deploy_hosts.yml on your local machine are used to create a new config/kochiku-worker.yml file on each worker host.

If you need to customize the deploy, copy kochiku-worker/config/deploy.custom.rb.sample to kochiku-worker/config/deploy.custom.rb and specify additional Capistrano tasks or override the existing tasks in kochiku-worker/config/deploy.rb.

Basic worker deployment steps
git clone https://github.com/square/kochiku-worker.git
cd kochiku-worker
gem install bundler
bundle install
# Edit config/deploy_hosts.yml
# Edit config/deploy.custom.rb (optional)
cap deploy
Clone this wiki locally