Giter VIP home page Giter VIP logo

chaos's Introduction

Chaos

Chaos is the web service which can feed Navitia with real-time disruptions. It can work together with Kirin which can feed Navitia with real-time delays.

Installation

The hard way

Clone the Chaos repository

git clone [email protected]:CanalTP/Chaos.git
cd Chaos

Python requirements

  • Install Python sudo apt-get install python2.7 python2.7-dev
  • Install pip
  • Install virtualenv
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt

Build protobufs

  • Install protoc sudo apt-get install protobuf-compiler (or build it from source: protobuf v2.6.1)
  • Build protobufs
git submodule init
git submodule update
./setup.py build_pbf

Create the database

sudo apt-get install postgresql libpq-dev
sudo -i -u postgres
# Create a user
createuser -P navitia (password "navitia")

# Create database
createdb -O navitia chaos

# Create database for tests
createdb -O navitia chaos_testing
ctrl + d

Cache configuration

To improve its performance Chaos can use Redis.

Install Redis

Installing Redis

Using Chaos without Redis

You can deactivate Redis usage in default_settings.py by changing 'CACHE_TYPE' to 'simple'

Using Chaos without cache

For development purpose you can deactivate cache usage in default_settings.py by forcing 'CACHE_TYPE' to 'null'

Run Chaos with honcho (optional)

Install honcho

You can use honcho for managing Procfile-based applications.

pip install honcho
create a .env file

Write this line inside

CHAOS_CONFIG_FILE=default_settings.py
Upgrade database
honcho run ./manage.py db upgrade
RabbitMQ (optional)

RabbitMQ is optional and you can deactivate it if you don't want to send disruptions to a queue.

# chaos/default_settings.py
ENABLE_RABBITMQ = False
Run Chaos
honcho start

The easy way (with Docker)

git clone [email protected]:CanalTP/Chaos.git
cd Chaos
git submodule init
git submodule update
docker-compose up -d

To watch logs output:

docker-compose logs -f

Chaos will be accessible on http://chaos_ws_1.docker if you are using the docker-gen-hosts tool, it will also be accessible on http://chaos-ws.local.canaltp.fr

Tests

The following commands for tests are also working in Docker environment, you just have to run before:

docker-compose exec ws bash
cd tests

Unit tests

honcho run nosetests

Functional tests

cd tests
honcho run lettuce

To stop directly on faulty test

honcho run lettuce --failfast

chaos's People

Contributors

antoine-de avatar azime avatar bbonnesoeur avatar datanel avatar djerrah avatar dvdn avatar kinnou02 avatar kun2985 avatar l-vincent-l avatar lrochewb avatar mihaibalint avatar nberard avatar netmisa avatar pthegner avatar stifoon avatar tchevily avatar thierrymarianne avatar vchabot avatar vpassama avatar

Watchers

 avatar  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.