Giter Club home page Giter Club logo

gorgon's Introduction

Gorgon Build Status Gem Version Code Climate

About

Gorgon provides a method for distributing the workload of running ruby test suites. It relies on amqp for message passing, and rsync for the synchronization of source code.

Installing Gorgon

This tutorial explains how to install gorgon in a sample app.

Installing listener as a Daemon process (Ubuntu 9.10 or later)

  1. run gorgon install_listener from the directory where gorgon.json is
  2. run gorgon ping to check if the listener is running

Gotchas

  • if you get cannot load such file -- qrack/qrack (LoadError), just add gem 'gorgon', '~> 0.8.4' , :group => :remote_test to your Gemfile, and run tests using bundle exec gorgon
  • If gorgon install_listener didn't work for you, you can try these steps

Also note that the steps in the tutorial are not meant to work on every project, they will only give you initial settings. You will probably have to modify the following files:

  • gorgon.json
  • gorgon_secret.json
  • {test, spec}/gorgon_callbacks/gorgon_callbacks.rb
  • gorgon_listener.json (located in your project root or in ~/.gorgon/)

If you modify ~/.gorgon/gorgon_listener.json, make sure you restart the listener.

Configuration

gorgon.json

This file contains project-specific settings for gorgon, such as:

  • The connection information for AMQP
  • The connection information for File Server
  • Information about how clients can rsync the working directory (optional). See more info here
  • Files that can be excluded by rsync
  • Callback file containing Ruby code to be used as callbacks
  • A glob for generating the list of test files
  • The file used for Originator's logs

See gorgon.json example for an example file.

gorgon_secret.json (optional)

This optional file contains sensitive information such as passwords that cannot be put in gorgon.json.

See gorgon_secret.json example for an example file.

gorgon_listener.json

This file contains the listener-specific settings, such as:

  • The connection information for AMQP
  • How many worker slots are provided by this listener
  • The file used for logs

See gorgon_listener.json example for more details.

Contributing

Read overview architecture

Requirements:

Prepare your environment

  • Execute ./run_dev_environment.sh
  • In a new terminal tab, execute ./run_listener.sh

NOTE: If you make changes changes to listener code, you must restart ./run_listener.sh for those changes to take effect

Running all tests

  • ./run_test.sh

Running gorgon using the spec/dummy project

  • ./run_gorgon.sh

Releasing to RubyGems

  1. Update version.rb
  2. Run rake release

Credits

Gorgon is maintained by:

  • Justin Fitzsimmons
  • Arturo Pie

Gorgon is funded by Nulogy Corp. Thank you to all the contributors.

gorgon's People

Contributors

arturopie avatar clemensp avatar fitzsimmons avatar jakxz avatar jmks avatar jonerikdsuero avatar sskirby avatar vsavkin avatar waseem avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gorgon's Issues

Allow users to 'ping' listeners

Create 'gorgon ping' command to check what listeners are running waiting for jobs and what version of gorgon each listener is running

Use Timeouts for each callback and rsync

Allow the user to specify timeouts for each callback in gorgon.json. Use the timeout, so the processes do not hang for ever if one of the callbacks blocks for ever.

Better report of exceptions

How to reproduce: raise an exception from after_sync callback. The message shown in originator is ugly and hard to read. Output 'exception' messages in a similar way to gorgon 'crash' messages

Create 'gorgon install' command

'gorgon install' will:

mkdir ~/.gorgon
cd ~/.gorgon
cp src/packmanager/gorgon_listener.json.example gorgon_listener.json
(probably ask for number of worker_slots, or find out how many cores the PC has)
create Procfile
sudo foreman export to upstart
sudo start gorgon-listener
add 'start on runlevel [2345]' to '/etc/init/gorgon-listener.conf'

(http://michaelvanrooijen.com/articles/2011/06/08-managing-and-monitoring-your-ruby-application-with-foreman-and-upstart/)

NOTE: We will have to add 'foreman' dependency to gorgon

EDIT: It ended up doing:

mkdir -p ~/.gorgon
cd ~/.gorgon
creates gorgon_listener.json in this directory
creates /etc/init/gorgon.conf
sudo start gorgon

I realized we don't need foreman

Redirect Woker Manager and workers output to files.

Worker Manager is receiving all the output generated by all workers when they invoke task 'db:reset'. This is filling up listener-worker_manager pipe very quick, and blocks workers writes. The work around was to use 'min_messages: warning' in database.yml for remote_test environment, so the output is minimized.

The final solution should be to redirect standard output and error of worker manager and worker to a temporary file. Then, if a crash happens, sends few last lines of the file to originator

Remove rake and replace it with a execuatable

The current rake architecture requires us to ship a Rakefile with the source directory. It would be much easier and more generic to simply use the executable infrastructure that's included with rubygems.

Rewrite worker and listener to use polling

The eventmachine-based API currently in use adds a lot of complexity and makes Gorgon very difficult to test. It would significantly reduce the complexity of the programming to use a polling/synchronous style of API, and this will not significantly affect the performance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.