Web service that extend and wrap NextBus public XML feed as a RESTful HTTP API
- Python 2.7
- Tornado Web Server
- Redis
- Metrics: Statsd client, Telegraf, InfluxDB and Grafana
- Docker and Docker Compose
- tox
- nose
$ brew install python
$ sudo pip install --upgrade pip
$ pip install tox virtualenv virtualenvwrapper
$ cp ~/.bash_profile ~/.bash_profile.bak
$ printf '\n%s\n%s\n%s' '# virtualenv' 'export WORKON_HOME=~/virtualenvs' \
'source /usr/local/bin/virtualenvwrapper.sh' >> ~/.bash_profile
Report: ci/reports/pylint/index.html
$ tox -e pylint
Report: ci/reports/flake8/index.txt
$ tox -e flake8
Coverage report in ci/reports/unit-tests/coverage/index.html Test results in xunit format in ci/reports/unit-tests/nosetests.xml
$ tox -e unit-tests
$ tox -r -e <env>
$ tox -e runservice
$ docker-compose build
$ docker-compose up
Image version is defined in build-and-push-pubtrans.sh
$ docker login
$ ./build-and-push-pubtrans.sh
$ curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.11.0/minikube-darwin-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
$ curl -Lo kubectl http://storage.googleapis.com/kubernetes-release/release/v1.3.0/bin/darwin/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
$ minikube start
$ kubectl create -f deploy/k8s
$ minikube service pubtrans --url
http://192.168.99.100:32395
$ curl http://192.168.99.100:32395/health
$ kubectl delete -f deploy/k8s
docker run --log-driver gelf --log-opt gelf-address=udp://127.0.0.1:12201 --rm alpine echo hello world