Skip to content

Commit

Permalink
Merge pull request #29 from bird-house/update-processes-20190416
Browse files Browse the repository at this point in the history
updated processes
  • Loading branch information
cehbrecht committed Apr 16, 2019
2 parents 17035e5 + 9f56732 commit b99f9b3
Show file tree
Hide file tree
Showing 34 changed files with 77 additions and 1,089 deletions.
6 changes: 2 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
dist: xenial # required for Python >= 3.7
language: python
python:
#- "2.7"
- "3.6"
# branches:
# only:
# - master
- "3.7"
os:
- linux
# - osx
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ RUN ["/bin/bash", "-c", "source activate wps && python setup.py develop"]
# Start WPS service on port 5000 on 0.0.0.0
EXPOSE 5000
ENTRYPOINT ["/bin/bash", "-c"]
CMD ["source activate wps && exec emu start -b 0.0.0.0 -config /opt/wps/etc/demo.cfg"]
CMD ["source activate wps && exec hummingbird start -b 0.0.0.0 -c /opt/wps/etc/demo.cfg"]

# docker build -t bird-house/hummingbird .
# docker run -p 5000:5000 bird-house/hummingbird
Expand Down
16 changes: 14 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ help:
@echo " install to install $(APP_NAME) by running 'python setup.py develop'."
@echo " start to start $(APP_NAME) service as daemon (background process)."
@echo " stop to stop $(APP_NAME) service."
@echo " restart to restart $(APP_NAME) service."
@echo " status to show status of $(APP_NAME) service."
@echo " clean to remove *all* files that are not controlled by 'git'. WARNING: use it *only* if you know what you do!"
@echo "\nTesting targets:"
Expand All @@ -31,8 +32,10 @@ help:
@echo " pep8 to run pep8 code style checks."
@echo "\nSphinx targets:"
@echo " docs to generate HTML documentation with Sphinx."
@echo "\nDeployment targets:"
@echo " spec to generate Conda spec file."

## Anaconda targets
## Conda targets

.PHONY: check_conda
check_conda:
Expand All @@ -50,6 +53,11 @@ envclean: check_conda
@echo "Removing conda env $(CONDA_ENV)"
@-"$(CONDA)" remove -n $(CONDA_ENV) --yes --all

.PHONY: spec
spec: check_conda
@echo "Updating conda environment specification file ..."
@-"$(CONDA)" list -n $(CONDA_ENV) --explicit > spec-file.txt

## Build targets

.PHONY: bootstrap
Expand All @@ -59,7 +67,7 @@ bootstrap: check_conda conda_env bootstrap_dev
.PHONY: bootstrap_dev
bootstrap_dev:
@echo "Installing development requirements for tests and docs ..."
@-bash -c "$(CONDA) install -y -n $(CONDA_ENV) -c conda-forge pytest flake8 sphinx bumpversion"
@-bash -c "$(CONDA) install -y -n $(CONDA_ENV) pytest flake8 sphinx gunicorn psycopg2"
@-bash -c "source $(ANACONDA_HOME)/bin/activate $(CONDA_ENV) && pip install -r requirements_dev.txt"

.PHONY: install
Expand All @@ -78,6 +86,10 @@ stop: check_conda
@echo "Stopping application ..."
@-bash -c "source $(ANACONDA_HOME)/bin/activate $(CONDA_ENV) && $(APP_NAME) stop"

.PHONY: restart
restart: stop start
@echo "Restarting application ..."

.PHONY: status
status: check_conda
@echo "Show status ..."
Expand Down
5 changes: 3 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ Hummingbird (the bird)
*Hummingbirds are among the smallest of birds. They hover in mid-air at rapid wing flapping rates,
typically around 50 times per second, but possibly as high as 200 times per second,
allowing them also to fly at speeds exceeding 15 m/s (54 km/h; 34 mph),
backwards or upside down. [..].* (`Wikipedia https://en.wikipedia.org/wiki/Hummingbird`_).
backwards or upside down. [..].* (Wikipedia_).

A Web Processing Service for general tools used in the climate science community like cdo and cfchecker.
A Web Processing Service for metadata compliance checks used in the climate science community.

Hummingbird is part of the `Birdhouse <http://bird-house.github.io>`_ project.

Expand All @@ -42,3 +42,4 @@ This package was created with Cookiecutter_ and the `bird-house/cookiecutter-bir

.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`bird-house/cookiecutter-birdhouse`: https://github.com/bird-house/cookiecutter-birdhouse
.. _Wikipedia: https://en.wikipedia.org/wiki/Hummingbird
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: '3'
services:
emu:
wps:
build: .
image: bird-house/hummingbird
ports:
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

# General information about the project.
project = u'Hummingbird'
copyright = u"2018, Carsten Ehbrecht"
copyright = u"2019, Carsten Ehbrecht"
author = u"Carsten Ehbrecht"

# The version info for the project you're documenting, acts as replacement
Expand Down
31 changes: 25 additions & 6 deletions docs/source/dev_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ Developer Guide
:local:
:depth: 1

.. WARNING:: To create new processes look at examples in Emu_.

Building the docs
-----------------

First install dependencies for the documentation:

.. code-block:: sh
.. code-block:: console
$ make bootstrap_dev
$ make docs
Expand All @@ -26,26 +28,26 @@ Run tests using `pytest`_.

First activate the ``hummingbird`` Conda environment and install ``pytest``.

.. code-block:: sh
.. code-block:: console
$ source activate hummingbird
$ conda install pytest flake8 # if not already installed
Run quick tests (skip slow and online):

.. code-block:: sh
.. code-block:: console
$ pytest -m 'not slow and not online'"
Run all tests:

.. code-block:: sh
.. code-block:: console
$ pytest
Check pep8:

.. code-block:: sh
.. code-block:: console
$ flake8
Expand All @@ -54,12 +56,28 @@ Run tests the lazy way

Do the same as above using the ``Makefile``.

.. code-block:: sh
.. code-block:: console
$ make test
$ make testall
$ make pep8
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.

.. code-block:: console
$ make clean
$ make install
$ make spec
.. _`environments`: https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#building-identical-conda-environments


Bump a new version
------------------

Expand All @@ -77,3 +95,4 @@ See the bumpversion_ documentation for details.

.. _bumpversion: https://pypi.org/project/bumpversion/
.. _pytest: https://docs.pytest.org/en/latest/
.. _Emu: https://github.com/bird-house/emu
48 changes: 0 additions & 48 deletions docs/source/processes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,54 +7,6 @@ Processes
:local:
:depth: 1

CDO BBox
--------

.. autoprocess:: hummingbird.processes.wps_cdo_bbox.CDOBBox
:docstring:
:skiplines: 1

CDO Copy
--------

.. autoprocess:: hummingbird.processes.wps_cdo_copy.CDOCopy
:docstring:
:skiplines: 1

CDO Ensembles
-------------

.. autoprocess:: hummingbird.processes.wps_cdo_ensembles.CDOEnsembles
:docstring:
:skiplines: 1

CDO Indices
-----------

.. autoprocess:: hummingbird.processes.wps_cdo_indices.CDOClimateIndices
:docstring:
:skiplines: 1

CDO Remapping
-------------

.. autoprocess:: hummingbird.processes.wps_cdo_remapping.CDOinter_MPI
:docstring:
:skiplines: 1

CDO Operation
-------------

.. autoprocess:: hummingbird.processes.wps_cdo_op.CDOOperation
:docstring:
:skiplines: 1

CDO Info
--------

.. autoprocess:: hummingbird.processes.wps_cdo_sinfo.CDOInfo
:docstring:
:skiplines: 1

Compliance Checker
------------------
Expand Down
15 changes: 7 additions & 8 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
name: hummingbird
channels:
- birdhouse
- conda-forge
- defaults
dependencies:
- python=3.6
- six
- pip
# pywps
- pywps=4.2
- jinja2
- click
- psutil
# cdo
- cdo=1.9.4
- python-cdo
- xarray
- netcdf4=1.4.1
- netcdf4
# compliance checker ioos
- compliance-checker=4.1
- compliance-checker
# tests
- pytest
- pip:
- -e git+https://github.com/geopython/pywps@master#egg=pywps
3 changes: 3 additions & 0 deletions etc/debug.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
[logging]
level = DEBUG

[server]
cleantempdir = false
2 changes: 0 additions & 2 deletions etc/sample-custom.cfg
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
[server]
url = http://demo.org:5000/wps
outputurl = http://demo.org:5000/outputs
outputpath = /var/lib/pywps/outputs
workdir = /var/lib/pywps/tmp

[logging]
level = DEBUG
2 changes: 1 addition & 1 deletion hummingbird/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from pywps import configuration

from . import wsgi
from six.moves.urllib.parse import urlparse
from urllib.parse import urlparse

PID_FILE = os.path.abspath(os.path.join(os.path.curdir, "pywps.pid"))

Expand Down
2 changes: 1 addition & 1 deletion hummingbird/default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ provider_url=http://hummingbird.readthedocs.org/en/latest/
url = http://localhost:5000/wps
outputurl = http://localhost:5000/outputs
allowedinputpaths = /
maxsingleinputsize = 500mb
maxsingleinputsize = 200mb
maxprocesses = 10
parallelprocesses = 2

Expand Down
3 changes: 0 additions & 3 deletions hummingbird/hummingbird.py

This file was deleted.

22 changes: 0 additions & 22 deletions hummingbird/processes/__init__.py
Original file line number Diff line number Diff line change
@@ -1,32 +1,10 @@
from .wps_ncdump import NCDump
from .wps_compliance_checker import CChecker
from .wps_spotchecker import SpotChecker
from .wps_cdo_sinfo import CDOInfo
from .wps_cdo_op import CDOOperation
from .wps_cdo_copy import CDOCopy
from .wps_cdo_bbox import CDOBBox
from .wps_cdo_indices import CDOClimateIndices
from .wps_cdo_ensembles import CDOEnsembles
from .wps_cdo_remapping import CDOinter_MPI
from .wps_cfchecker import CFChecker
from .wps_hdh_cfchecker import HDHCFChecker
from .wps_hdh_qachecker import QualityChecker
from .wps_cmor_checker import CMORChecker


processes = [
NCDump(),
CChecker(),
SpotChecker(),
# CFChecker(),
# CMORChecker(),
# HDHCFChecker(),
# QualityChecker(),
CDOInfo(),
CDOOperation(),
CDOCopy(),
CDOBBox(),
CDOClimateIndices(),
CDOEnsembles(),
CDOinter_MPI(),
]
Loading

0 comments on commit b99f9b3

Please sign in to comment.