Babybird¶
- Babybird (the bird)
Babybird is a bird …
A Web Processing Service for Climate Data Analysis.
Free software: Apache Software License 2.0
Documentation: https://babybird.readthedocs.io.
Credits¶
This package was created with Cookiecutter and the bird-house/cookiecutter-birdhouse project template.
Installation¶
Install from Conda¶
Warning
TODO: Prepare Conda package.
Install from GitHub¶
Check out code from the Babybird GitHub repo and start the installation:
$ git clone https://github.com/bird-house/babybird.git
$ cd babybird
Create Conda environment named babybird:
$ conda env create -f environment.yml
$ source activate babybird
Install Babybird app:
$ pip install -e .
OR
make install
For development you can use this command:
$ pip install -e .[dev]
OR
$ make develop
Start Babybird PyWPS service¶
After successful installation you can start the service using the babybird
command-line.
$ babybird --help # show help
$ babybird start # start service with default configuration
OR
$ babybird start --daemon # start service as daemon
loading configuration
forked process id: 42
The deployed WPS service is by default available on:
http://localhost:5000/wps?service=WPS&version=1.0.0&request=GetCapabilities.
Note
Remember the process ID (PID) so you can stop the service with kill PID
.
You can find which process uses a given port using the following command (here for port 5000):
$ netstat -nlp | grep :5000
Check the log files for errors:
$ tail -f pywps.log
… or do it the lazy way¶
You can also use the Makefile
to start and stop the service:
$ make start
$ make status
$ tail -f pywps.log
$ make stop
Run Babybird as Docker container¶
You can also run Babybird as a Docker container.
Warning
TODO: Describe Docker container support.
Use Ansible to deploy Babybird on your System¶
Use the Ansible playbook for PyWPS to deploy Babybird on your system.
Configuration¶
Command-line options¶
You can overwrite the default PyWPS configuration by using command-line options. See the Babybird help which options are available:
$ babybird start --help
--hostname HOSTNAME hostname in PyWPS configuration.
--port PORT port in PyWPS configuration.
Start service with different hostname and port:
$ babybird start --hostname localhost --port 5001
Use a custom configuration file¶
You can overwrite the default PyWPS configuration by providing your own
PyWPS configuration file (just modifiy the options you want to change).
Use one of the existing sample-*.cfg
files as example and copy them to etc/custom.cfg
.
For example change the hostname (demo.org) and logging level:
$ cd babybird
$ vim etc/custom.cfg
$ cat etc/custom.cfg
[server]
url = http://demo.org:5000/wps
outputurl = http://demo.org:5000/outputs
[logging]
level = DEBUG
Start the service with your custom configuration:
# start the service with this configuration
$ babybird start -c etc/custom.cfg
Developer Guide¶
Warning
To create new processes look at examples in Emu.
Building the docs¶
First install dependencies for the documentation:
$ make develop
Run the Sphinx docs generator:
$ make docs
Running tests¶
Run tests using pytest.
First activate the babybird
Conda environment and install pytest
.
$ source activate babybird
$ pip install -r requirements_dev.txt # if not already installed
OR
$ make develop
Run quick tests (skip slow and online):
$ pytest -m 'not slow and not online'"
Run all tests:
$ pytest
Check pep8:
$ flake8
Run tests the lazy way¶
Do the same as above using the Makefile
.
$ make test
$ make test-all
$ make lint
Prepare a release¶
Update the Conda specification file to build identical environments on a specific OS.
Note
You should run this on your target OS, in our case Linux.
$ conda env create -f environment.yml
$ source activate babybird
$ make clean
$ make install
$ conda list -n babybird --explicit > spec-file.txt
Bump a new version¶
Make a new version of Babybird in the following steps:
Make sure everything is commit to GitHub.
Update
CHANGES.rst
with the next version.Dry Run:
bumpversion --dry-run --verbose --new-version 0.8.1 patch
Do it:
bumpversion --new-version 0.8.1 patch
… or:
bumpversion --new-version 0.9.0 minor
Push it:
git push
Push tag:
git push --tags
See the bumpversion documentation for details.