Installation

Datacube core

datacube-ows depends on datacube-core. Ensure you have a working version of the OpenDatacube (including ingested data products) before attempting to install and configure datacube-ows.

Stable release

datacube-ows is released to PyPI and the latest release can be found on https://pypi.org/project/datacube-ows/.

Install Postgis

In addition to the database installed for Datacube Core, datacube-ows also require postgis installed.

$ sudo apt-get install postgis

Download datacube-ows source

The sources for datacube-ows can be downloaded from the Github repo.

You can either clone the public repository:

$ git clone git://github.com/opendatacube/datacube-ows

Or download the zip:

$ curl  -OL https://github.com/opendatacube/datacube-ows/archive/master.zip

From sources ( Natively )

Once you have a copy of the source, you need to create a local version of the config file, and edit it to reflect your requirements.

$ cp datacube_ows/ows_test_cfg.py datacube_ows/ows_local_cfg.py
$ DATACUBE_OWS_CFG=ows_local_cfg.ows_cfg
  • We currently recommend using pip with pre-built binary packages. Create a new python 3.6 or 3.7 virtualenv and run pip install against the supplied requirements.txt:

    pip install --pre -r requirements.txt
    

To install datacube-ows, run:

$ python3 setup.py install

Update_range natively

Refer to the database documentation documentation for information on how to setup and maintain a Datacube OWS database.

From sources ( within Docker )

Build a docker image in the local registry:

$ docker build -t ows-dev .

Run docker image to start gunicorn with ows. Here the DB parameters noted previously are forwarded to the docker image entrypoint. Note: the default PYTHONPATH is pointed to /env, place ows_cfg.py here.

$ docker run -e DB_DATABASE=datacube -e DB_HOSTNAME=localhost -e DB_USERNAME=ubuntu -e DB_PASSWORD=ubuntu -e DATACUBE_OWS_CFG=config.ows_cfg.ows_cfg --network=host --mount type=bind,source=/pathtocfg/ows_local_cfg.py,target=/env/config/ows_cfg.py ows-dev

From sources ( with Docker Compose and local db)

Once you have a copy of the source, you need to create a local version of the config file, and edit it to reflect your requirements.

$ vi .env

Create an external PostgreSQL Database for OWS use. (See the database documentation for more information.) jUse this as a sidecar docker or natively on the host system. The following steps assume the database is on the host system for networking purposes. Take note of the credentials of the database for use as parameters to run OWS.

Run docker compose to start gunicorn with ows. Here the DB parameters noted previously are forwarded to the docker image entrypoint.

$ docker-compose up

Update_range via docker

Connect to the running docker to run datacube-ows-update/update_range.py commands (see the database documentation for more information).

E.g. to set up a new database:

$ docker exec -it datacube-ows_ows_1 bash
ows_1$ datacube system init
ows_1$ datacube-ows-update --schema --role ubuntu
ows_1$ datacube-ows-update

Validate setup

Exit the docker environment and use curl to validate the GetCapabilities form OWS works:

$ curl "localhost:8000/?service=wms&request=getcapabilities"