Web service which feeds Navitia with real-time disruptions

Overview

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.

chaos schema global

API Documentation

OpenAPI

Published on https://canaltp.github.io/Chaos

How to contribute?

The documentation is maintained in OpenAPI format in documentation/swagger.yml. To test the website which will be published on GitHub pages, use the tool Act and run

act -W .github/workflows/publish_documentation.yml

The last step (publication to GitHub) will fail as intended since it is a local test. The website has been built during previous steps. Browse the documentation by opening the file documentation/slate/build/index.html.

FAQ

For french users, you can see this FAQ

Installation

The hard way

Clone the Chaos repository

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

Requirements

  • PostgreSQL 9.6 sudo apt-get install postgresql-9.6 postgresql-server-dev-9.6 libpq-dev
  • RabbitMQ
Python
  • Install Python2.7 sudo apt-get install python2.7 python2.7-dev

    or sudo apt install python2 python2-dev on recent linux release

  • Install pip

  • Install virtualenv

virtualenv venv
source venv/bin/activate
pip install -r requirements.txt

Install & build protobuf

  • Install protobuf

You can use sudo apt-get install protobuf-compiler if you're sure it won't install version 3.x.x (incompatible).

Or install protoc building it from source : protobuf v2.6.1. After download, from inside the unziped folder :

./configure
make
make install
ldconfig
make clean

Check your version

protoc --version
  • Build protobuf, back into Chaos project folder
git submodule init
git submodule update
./setup.py build_pbf

Create the database

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
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 The database will be accessible at 'chaos_database_1.docker' and default RabbitMQ interface at 'http://chaos_rabbitmq_1.docker:15672'.

Security (optional)

If you want to add more security, you can add a file chaos/clients_tokens.json with the client code and navitia tokens like:

{
   "client_code": [
     "navitia_token1",
     "navitia_token2"
   ]
 }

client_code should be the same as the value of X-Customer-Id header in HTTP request and token should be the same as the value of Authorization header in HTTP request If the file doesn't exist, the security will be disabled.

You can add a 'master' key in the file. It will allow you to access all resources for all clients.

Tests

Unit tests

cd tests
honcho run nosetests

Functional tests

cd tests
honcho run lettuce

To stop directly on faulty test

cd tests
honcho run lettuce --failfast

With docker

docker-compose -f docker-compose.test.yml build --pull
docker-compose -f docker-compose.test.yml up -d
docker-compose -f docker-compose.test.yml exec -T chaos /bin/sh ./docker/tests.sh
docker-compose -f docker-compose.test.yml down --remove-orphans

Copyright

Copyright © since 2001, Kisio Digital and/or its affiliates. All rights reserved. This project is part of Navitia surround, the sprawling API to build cool stuff with public transport.

Hope you'll enjoy and contribute to this project, powered by Kisio Digital (www.kisio.com).

Help us simplify mobility and open public transport: a non ending quest to the responsive locomotion way of traveling !

Licence

This program is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Stay tuned

Twitter @navitia

Tchat channel #navitia on riot

Forum Navitia on googlegroups

www.navitia.io

You might also like...
Simple web application, which has a single endpoint, dedicated to annotation parsing and convertion.

Simple web application, which has a single endpoint, dedicated to annotation parsing and conversion.

A "multiclipboards" script for an efficient way to improve the original clipboards which are only able to save one string at a time

A "multiclipboards" script for an efficient way to improve the original clipboards which are only able to save one string at a time. Works on both Windows and Linux.

Flask-built web application that simulates a time and cost calculator for charging Electric Vehicles.

ev_charging_calculator Flask-built web application that simulates a time and cost calculator for charging Electric Vehicles. The project aims to simul

OnTime is a small python that you set a time and on that time, app will send you notification and also play an alarm.

OnTime Always be OnTime! What is OnTime? OnTime is a small python that you set a time and on that time, app will send you notification and also play a

Shutdown Time - A pretty much useless application that allows you to shut your computer down in x time with a GUI.
Shutdown Time - A pretty much useless application that allows you to shut your computer down in x time with a GUI.

A pretty much useless application that allows you to shut your computer down in x time with a GUI. Should eventually support Windows (all versions), Linux (v2.0+), MacOS (probably with Linux, idk)

A simple service that allows you to run commands on the server using text

Server Text A simple flask service that allows you to run commands on the server/computer over sms. Think of it as a shell where you run commands over

VirtualBox Power Driver for MAAS (Metal as a Service)
VirtualBox Power Driver for MAAS (Metal as a Service)

vboxpower VirtualBox Power Driver for MAAS (Metal as a Service) A way to manage the power of VirtualBox virtual machines via the MAAS webhook driver.

An alternative site to emplea.do due to inconsistent service of the app.

feline a agile and fast alternative to emplea.do License: MIT Settings Moved to settings. Basic Commands Setting Up Your Users To create a normal user

Simple Denial of Service Program yang di bikin menggunakan bahasa pemograman Python,

Peringatan Tujuan kami share code Indo-DoS hanya untuk bertujuan edukasi / pembelajaran! Dilarang memperjual belikan source ini / memperjual-belikan s

Releases(v1.4.1)
  • v1.4.1(Mar 25, 2022)

    What's Changed

    • Proto share message notification false by @dvdn in https://github.com/CanalTP/Chaos/pull/522

    Full Changelog: https://github.com/CanalTP/Chaos/compare/v1.4.0...v1.4.1

    Source code(tar.gz)
    Source code(zip)
  • v1.4.0(Mar 23, 2022)

    What's Changed

    • Add sorting feature on disruptions/_search API by @tchevily in https://github.com/CanalTP/Chaos/pull/504
    • [DOC] Message notification_date addition by @dvdn in https://github.com/CanalTP/Chaos/pull/505
    • DOC: "status" removed from PUT and POST /disruptions. by @Msaglier in https://github.com/CanalTP/Chaos/pull/507
    • [Notification Date] manage notification_date by message by @dvdn in https://github.com/CanalTP/Chaos/pull/506
    • Swagger doc version++ by @Msaglier in https://github.com/CanalTP/Chaos/pull/509
    • Feature notification_date by Message by @dvdn in https://github.com/CanalTP/Chaos/pull/508
    • [Feature] multi messages on same channel by @dvdn in https://github.com/CanalTP/Chaos/pull/510
    • Filter impacts with severities by @tchevily in https://github.com/CanalTP/Chaos/pull/515
    • Bump protobuf from 2.6.0 to 3.15.0 by @dependabot in https://github.com/CanalTP/Chaos/pull/513
    • chaos proto update by @dvdn in https://github.com/CanalTP/Chaos/pull/514
    • Protobuff downgrade by @Msaglier in https://github.com/CanalTP/Chaos/pull/518
    • Add id field to impact messages by @tchevily in https://github.com/CanalTP/Chaos/pull/516
    • Add read only by @pthegner in https://github.com/CanalTP/Chaos/pull/519
    • Now send_notification accept null value by @Fahmus in https://github.com/CanalTP/Chaos/pull/520

    Full Changelog: https://github.com/CanalTP/Chaos/compare/v1.3.5...v1.4.0

    Source code(tar.gz)
    Source code(zip)
  • v1.3.5(Dec 27, 2021)

    What's Changed

    • Redoc integration by @martinraynov in https://github.com/CanalTP/Chaos/pull/489
    • Add Navitia Logo in the swagger file by @martinraynov in https://github.com/CanalTP/Chaos/pull/490
    • Documentation generation GitHub action by @martinraynov in https://github.com/CanalTP/Chaos/pull/491
    • Push to gh-pages by @martinraynov in https://github.com/CanalTP/Chaos/pull/492
    • Fix sonarcloud errors by @Fahmus in https://github.com/CanalTP/Chaos/pull/493
    • [documentation] use slate engine by @pascal-vs in https://github.com/CanalTP/Chaos/pull/495
    • Update test.jenkinsfile by @pthegner in https://github.com/CanalTP/Chaos/pull/496
    • Add drafts API by @pthegner in https://github.com/CanalTP/Chaos/pull/503

    New Contributors

    • @martinraynov made their first contribution in https://github.com/CanalTP/Chaos/pull/489
    • @pascal-vs made their first contribution in https://github.com/CanalTP/Chaos/pull/495

    Full Changelog: https://github.com/CanalTP/Chaos/compare/v1.3.4...v1.3.5

    Source code(tar.gz)
    Source code(zip)
  • v1.3.4(Sep 13, 2021)

  • v1.3.3(Sep 7, 2021)

  • v1.3.2(Aug 19, 2021)

    Fix order severity and updated impact #486

    :exclamation: Note : this release includes a data migration on Severity. From now-on default value is '0'. All existing 'NULL' values in this table is transformed into '0'.

    Source code(tar.gz)
    Source code(zip)
  • v1.3.1(Aug 16, 2021)

  • v1.3.0(Jun 17, 2021)

  • v1.2.33(Jun 17, 2021)

    #472 : Disable the requirement of line_section id #473 : Update documentation on install protobuff #477 : Add index that improve some performance #483 : Add new disruption type "unexpected" (use only for filter / display)

    Source code(tar.gz)
    Source code(zip)
  • v1.2.32(Mar 23, 2021)

  • v1.2.31(Feb 8, 2021)

    Persist 'timezone' information into 'pattern' #460 Chaos: Publish application period period pattern if present #454

    [exports api] order for export list #452

    [Tests auto] new JDR data #451 [Tests auto] Refs #BOT-2230 Now we use test.jenkinsfile for test #449

    Return error from authorization navitia #450 Doc: application_periods required for impact creation #453

    Clean line_section (step 3/3) update chaos-proto (#444)

    Source code(tar.gz)
    Source code(zip)
  • v1.2.30(Aug 25, 2020)

    #443 : Clean line section with migrate file #442 : Fix empty pt object filter on impacts/_search API #439 : [docker] patch UWSGI to allow http 'chunked' #438 : DOC: x-contributors and x-customer-id update. #437 : [Doc] Install on recent linux distro #436 : Doc explaining Client Contributor

    Source code(tar.gz)
    Source code(zip)
  • v1.2.29(Apr 6, 2020)

  • v1.2.28(Mar 16, 2020)

  • v1.2.27(Feb 19, 2020)

  • v1.2.26(Feb 3, 2020)

  • v1.2.25(Jan 21, 2020)

    https://github.com/CanalTP/Chaos/pull/429 Newrelic update https://github.com/CanalTP/Chaos/pull/428 Add single quote in ptobject not found error message https://github.com/CanalTP/Chaos/pull/430 #BOT-1795 - Bugfix when we post or put a disruption with invalid cause id

    Source code(tar.gz)
    Source code(zip)
  • v1.2.24(Dec 17, 2019)

    new route POST contributor (#427)

    Channels required resolution (#426) Add single quote in ptobject not found error message (#428) Bugfix when we POST or PUT disruption with cause of another client (#425)

    Source code(tar.gz)
    Source code(zip)
  • v1.2.23(Nov 25, 2019)

    #420 GET [Disruptions] native SQL requests

    #424 [Disruptions] Display 20 impacts by default instead of 10 #422 [Disruptions] Display all impacts but non archived #423 Patch some comments copyrights

    Source code(tar.gz)
    Source code(zip)
  • v1.2.22(Nov 15, 2019)

  • v1.2.21(Nov 13, 2019)

    #419 feature-bot-1652-delete-cause

    #413 #418 Update swagger 2 to openapi 3

    #411 feature-BOT-1306-simplify-export CSV

    #414 Add line_section validation entry #417 patch-wording-resol

    Source code(tar.gz)
    Source code(zip)
  • v1.2.20(Oct 25, 2019)

  • v1.2.18(Sep 23, 2019)

    https://github.com/CanalTP/Chaos/pull/404 Update the key cache ptobject navitia search https://github.com/CanalTP/Chaos/pull/405 Return ptobject error on stoparea of line_section

    Source code(tar.gz)
    Source code(zip)
  • v1.2.17(Sep 9, 2019)

  • v1.2.16(Aug 22, 2019)

  • v1.2.15(Jul 23, 2019)

  • v1.2.14(Jun 18, 2019)

  • v1.2.13(Jun 7, 2019)

  • v1.2.12(Jun 6, 2019)

  • v1.2.11(May 29, 2019)

Owner
KISIO Digital
Captain of Navitia
KISIO Digital
Code repository for the Pytheas submersible observation platform

Pytheas Main repository for the Pytheas submersible probe system. List of Acronyms/Terms USP - Underwater Sensor Platform - The primary platform in th

UltraChip 2 Nov 19, 2022
A wide AOI generator tool.

Dark Generator A wide AOI generator tool. Information Installation To Install you have to have python 3.x and pip installed on your system. If you hav

Darkest Surface 12 Dec 26, 2022
A Snakemake workflow for standardised sc/snRNAseq analysis

single_snake_sequencing - sc/snRNAseq Snakemake Workflow A Snakemake workflow for standardised sc/snRNAseq analysis. Every single cell analysis is sli

IMS Bio2Core Facility 1 Nov 02, 2021
fetchmesh is a tool to simplify working with Atlas anchoring mesh measurements

A Python library for working with the RIPE Atlas anchoring mesh. fetchmesh is a tool to simplify working with Atlas anchoring mesh measurements. It ca

2 Aug 30, 2022
Wisdom Tree is a concentration app i am working on.

Wisdom Tree Wisdom Tree is a tui concentration app I am working on. Inspired by the wisdom tree in Plants vs. Zombies which gives in-game tips when it

NO ONE 241 Jan 01, 2023
A simple calculator made with tkinter.

Simple Calculator A simple calculator made with tkinter. Requirements None, only you need to have windows 😉 ...Enjoy! Installation Clone this reposit

Abhyush 2 Jan 11, 2022
YourCity is a platform to match people to their prefect city.

YourCity YourCity is a city matching App that matches users to their ideal city. It is a fullstack React App made with a Redux state manager and a bac

Nico G Pierson 6 Sep 25, 2021
🤡 Multiple Discord selfbot src deobfuscated !

Deobfuscated selfbot sources About. If you whant to add src, please make pull requests. If you whant to deobfuscate src, send mail to

Sreecharan 5 Sep 13, 2021
This is the Code Institute student template for Gitpod.

Welcome AnaG0307, This is the Code Institute student template for Gitpod. We have preinstalled all of the tools you need to get started. It's perfectl

0 Feb 02, 2022
Example platform plugin that fixes fentry calls in Binja

Example Binja Platform Plugin This is an example Binja platform plugin which fixes up linux kernel module calls to __fentry__. __fentry__ is the linux

_yrp 2 Oct 07, 2021
Tutor plugin for integration of Open edX with a Richie course catalog

Richie plugin for Tutor This is a plugin to integrate Richie, the learning portal CMS, with Open edX. The integration takes the form of a Tutor plugin

Overhang.IO 2 Sep 08, 2022
ThnoolBox - A thneed is a multi-use versatile object

ThnoolBox Have you ever wanted a collection of bodged desktop apps that are Lorax themed ? No ? Sucks to suck I guess Apps & their downsides CalculaTh

pocoyo 1 Jan 21, 2022
HogwartsRegister - A Hogwarts Register With Python

A Hogwarts Register Installation download code git clone https://github.com/haor

0 Feb 12, 2022
A simple weather app.

keather A simple weather app. This is currently not finished. Dependencies: yay -S python-beautifulsoup4 tk

1 Jan 09, 2022
Create standalone, installable R Shiny apps using Electron

WARNING This is still very much a work in progress and nothing can be assumed stable in any way Temp notes: Two types of created installer, based on w

Chase Clark 5 Dec 24, 2021
Library to generate random strings from regular expressions.

Xeger Library to generate random strings from regular expressions. To install, type: pip install xeger To use, type: from xeger import Xeger

Colm O'Connor 101 Nov 15, 2022
Delayed iteration for polling and retries.

Does Python need yet another retry / poll library? It needs at least one that isn't coupled to decorators and functions. Decorators prevent the caller

A. Coady 22 Dec 29, 2022
A corona information module

A corona information module

Fayas Noushad 3 Nov 28, 2021
Hartree-Fock Workshop for the Han-sur-Lesse Winterschool of 2021

Hartree-Fock course for the Han-sur-Lesse Winterschool of 2021 Requirements For going through these exercises, please install the Anaconda suite. Next

Ivo Filot 2 Nov 16, 2022
Chalice - A tool to facilitate Python based lambda deployment

Chalice is a tool to facilitate Python based lambda deployment. This repo contains the output of my basic exploration of this tool.

Csilla Bessenyei 1 Feb 03, 2022