Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update readme and pin pywps #56

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ language: python
dist: xenial

python:
- "2.7"
- "3.4"
- "3.6"
- "3.7"

# Handle git submodules yourself
git:
Expand Down
43 changes: 24 additions & 19 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Installation
============

The app depends on PyWPS and several other libraries that are listed in
``requirements.txt``. It is advisable to run it using a python virtualenv to prevent package instalation problems::
``requirements.txt``. It is advisable to run it using a python virtualenv to prevent package installation problems::

$ virtualenv -p python3 pywps_flask_env
$ cd pywps_flask_dir
Expand All @@ -12,8 +12,15 @@ The app depends on PyWPS and several other libraries that are listed in
$ cd pywps-flask
$ pip3 install -r requirements.txt

Alternatively you can also use a conda environment::

If python virtualenv is not an option::
$ conda create -n pywps-flask python=3.6 pip psutil
$ conda activate pywps-flask
$ git clone https://github.com/geopython/pywps-flask
$ cd pywps-flask
$ pip install -r requirements.txt

If python virtualenv or conda is not an option::

$ git clone https://github.com/geopython/pywps-flask
$ cd pywps-flask
Expand Down Expand Up @@ -54,10 +61,10 @@ The `-d` option will run pywps-flask as daemon and to stop it is necessary to d
Docker images
==============

The docker folder contains 2 subfolders, each subfolder contains a differente pywps implementation.
The docker folder contains 2 subfolders, each subfolder contains a differente pywps implementation.

Folder ``flask`` has the default pywps-flask implementation using only Flask while folder ``nginx`` implements pywps using Nginx and Green unicorn as WSGI server. While folder ``ubuntu`` has the same images but using phusion image (ubuntu 18.04)



Flask-Alpine (basic)
Expand All @@ -67,18 +74,18 @@ Basic pywps image is based on Alpine 3.8 and will run the native Flask service,



To build the image (inside the folder with the Dockerfile)::
To build the image (inside the folder with the Dockerfile)::

$ docker build -t pywps/flask-alpine .

And to run it::
And to run it::

$ docker run -p 5000:5000 pywps/flask-alpine:latest


Pywps will be available in the following URL::

$ http://localhost:5000
$ http://localhost:5000



Expand All @@ -94,9 +101,9 @@ This image implements the previous ``flask-alpine image`` (you need to build it

Gunicorn-Alpine is locate in folder ``docker/alpine/gunicorn/Dockerfile``

This image can already be implemented in production but it is advisable to use Nginx for HTTP load balance and Gunicorn as WSGI server (see below)
This image can already be implemented in production but it is advisable to use Nginx for HTTP load balance and Gunicorn as WSGI server (see below)

To build the image (inside the folder with the Dockerfile)::
To build the image (inside the folder with the Dockerfile)::

$ docker build -t pywps/gunicorn-alpine:latest .

Expand All @@ -106,19 +113,19 @@ And to run it::
$ docker run -p 8081:8081 -it pywps/gunicorn-alpine:latest

or::

$ docker run -e GU_WORKERS=10 -e GU_PORT=8082 -p 8082:8082 -it pywps/gunicorn-alpine:latest

Pywps will be available at the following URL::

$ http://localhost:8082
$ http://localhost:8082


Nginx-Alpine
------------

This is the complete stack intented for production, to have a stack we require to use ``docker-compose``
to build two images: ``pywps/gunicorn-alpine:latest`` and ``pywps/nginx-alpine:latest``
This is the complete stack intented for production, to have a stack we require to use ``docker-compose``
to build two images: ``pywps/gunicorn-alpine:latest`` and ``pywps/nginx-alpine:latest``

Those images will be pulled from dockerhub, but they can compiled locally by building Flask-Alpine, Gunicron-Alpine and Nginx-Alpine, in this case only showing for nginx::

Expand Down Expand Up @@ -147,7 +154,7 @@ The same as ``Flask-Ubuntu`` but using phusion image (ubuntu 18.04)::
$ docker build -t pywps/flask-ubuntu:latest .

And to run it::

$ docker run -p 5000:5000 pywps/flask-ubuntu


Expand Down Expand Up @@ -185,14 +192,14 @@ Named volumes allow for container content to be available in the host system. Th
* /pywps-flask/processes

And file:
* /pywps-flask/pywps.cfg
* /pywps-flask/pywps.cfg

Named volumes need to be created prior to ``docker run``::

$ docker volume create pywps_logs
$ docker volume create pywps_outputs
$ docker volume create pywps_processes

To check the path on the host to volume and other information::


Expand All @@ -201,13 +208,11 @@ To check the path on the host to volume and other information::

To run a docker will all the volumes available in the host::

$ docker run -p 5000:5000 -v pywps_logs:/pywps-flask/pywps_logs \
$ docker run -p 5000:5000 -v pywps_logs:/pywps-flask/pywps_logs \
-v pywps_outputs:/pywps-flask/pywps_outputs \
-v pywps_processes:/pywps-flask/pywps_processes \
-v pywps_cfg:/pywps-flask/pywps.cfg pywps/flask-alpine:latest


THE END
=======


2 changes: 1 addition & 1 deletion pywps.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ maxprocesses=10
parallelprocesses=2

[processing]
mode=docker
mode=default
port_min=5050
port_max=5070
docker_img=container
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ Shapely
Werkzeug
SQLAlchemy
psutil
pywps
pywps<4.3