Giter VIP home page Giter VIP logo

congress's Introduction

Installing dependencies

The docsplit gem (PDF text extraction) requires some system dependencies.

Running tasks

There is a rake task generated for each task folder in the tasks directory. Example:

rake task:house_live

This will assume that by loading tasks/house_live/house_live.rb, a class named HouseLive will be defined, and the "run" method will be called on it. The run method is passed a hash of options.

options[:config] is the contents of config/config.yml in the form of a Ruby hash. Command line parameters in the form of "key=value" get put into the options hash in the form of options[:key] => value.

Reporting

Tasks can file "reports" by appending new documents to the "reports" table. A report needs to have a status ("SUCCESS", "FAILURE", "WARNING", "NOTE"), a source name that should be unique to each task, and text describing what happened. Since this is Mongo, any other useful data can simply be dumped onto the report document.

WARNING reports will cause an email to be sent, whereas NOTE reports will not.

If an exception is raised during a task, it is caught and a FAILURE report is filed. If a task successfully completes, a COMPLETE message is filed (a task should not file one of these on its own), that records an "elapsed_time" field with the number of seconds it took the task to complete.

Any task that encounters an error, or something worth warning the developers about, it should file a report during its operation. After a task completes, the reports table will be examined for any "unread" WARNING or FAILURE reports and an email will be sent to the email addresses specified in config/config.yml.

Deployment

For the Ruby side of this project, it uses the Bundler dependency management system. Gems are packaged in the repository, so no system gems are required. Use "bundle install --local" to install these gems into a local bundle, or use "bundle install [path to desired bundle folder] --local" to install it to a particular directory.

Make sure you add the directory you use to the .gitignore file if it's not there already. "vendor/gems" has already been set aside for this purpose, in accordance with Bundler convention.

For the Python tasks, Python 2.7 or higher is required. Tasks have not been tested for Python 3 compatibility. To install third party Python dependencies, use pip and the requirements file: "pip install -r requirements.txt"

= Running the development server

This is a Rack app with a config.ru, so running "unicorn" or "rackup" are fine ways to launch the app. Using a Rack-based server that processes the config.ru file will automatically include the gem bundle. Otherwise, you'll need to do "bundle exec" before the command (such as "bundle exec api.rb" to execute the API directly).

congress's People

Contributors

konklone avatar luigi avatar jcarbaugh avatar kaitlin avatar sbai avatar

Watchers

James Cloos avatar

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.