Skip to content

Commit 2604db5

Browse files
committed
First demo with docker
1 parent 767fd23 commit 2604db5

File tree

5 files changed

+27
-11
lines changed

5 files changed

+27
-11
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@ workdir/*
33
outputs/*
44
logs/*
55

6+
docker/izolation*
7+
68
# vim, mac os
79
*.sw*
810
.DS_Store
911
.*.un~
12+
.idea
1013

1114
# python setup.py build/install artifacts
1215
build

.travis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ git:
1010
install:
1111
- sudo apt-get update -qq
1212
- sudo apt-get install -qq gdal-bin libgdal-dev libgdal1h libgdal1-dev libgeos-dev python-dev python3-dev
13-
- pip install GDAL==1.10.0 --global-option=build_ext --global-option="-I/usr/include/gdal"
14-
- pip install -r requirements.txt
13+
- izolation install GDAL==1.10.0 --global-option=build_ext --global-option="-I/usr/include/gdal"
14+
- izolation install -r requirements.txt
1515

1616
before_script:
1717
"python demo.py -d"

demo.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def wps():
7979
return service
8080

8181

82-
@app.route('/outputs/'+'<filename>')
82+
@app.route('/outputs/'+'<path:filename>')
8383
def outputfile(filename):
8484
targetfile = os.path.join('outputs', filename)
8585
if os.path.isfile(targetfile):
@@ -94,7 +94,7 @@ def outputfile(filename):
9494
flask.abort(404)
9595

9696

97-
@app.route('/static/'+'<filename>')
97+
@app.route('/static/'+'<path:filename>')
9898
def staticfile(filename):
9999
targetfile = os.path.join('static', filename)
100100
if os.path.isfile(targetfile):

processes/ultimate_question.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11

2-
from pywps import Process, LiteralOutput
2+
from pywps.app import Process
3+
from pywps.inout.outputs import LiteralOutput
34
from pywps.app.Common import Metadata
45

6+
57
class UltimateQuestion(Process):
68
def __init__(self):
79
inputs = []
@@ -20,8 +22,8 @@ def __init__(self):
2022
metadata=[Metadata('Ultimate Question'), Metadata('What is the meaning of life')],
2123
inputs=inputs,
2224
outputs=outputs,
23-
store_supported=False,
24-
status_supported=False
25+
store_supported=True,
26+
status_supported=True
2527
)
2628

2729
def _handler(self, request, response):

pywps.cfg

+15-4
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,28 @@ contact_role=pointOfContact
2525
[server]
2626
maxsingleinputsize=1mb
2727
maxrequestsize=3mb
28-
url=http://localhost:5000/wps
29-
outputurl=http://localhost:5000/outputs/
28+
url=http://localhost:5555/wps
29+
outputurl=http://localhost:5555/outputs/
3030
outputpath=outputs
31-
workdir=/tmp
31+
workdir=workdir
32+
wd_inp_subdir=inputs
33+
wd_out_subdir=outputs
3234
maxprocesses=10
33-
parallelprocesses=2
35+
parallelprocesses=6
36+
37+
[processing]
38+
mode=docker
39+
port_min=5050
40+
port_max=5070
41+
docker_img=gdal_full_manual2
42+
dckr_inp_dir=/pywps-flask/data
43+
dckr_out_dir=/pywps-flask/outputs
3444
3545
[logging]
3646
level=INFO
3747
file=logs/pywps.log
3848
database=sqlite:///logs/pywps-logs.sqlite3
49+
format=%(asctime)s] [%(levelname)s] file=%(pathname)s line=%(lineno)s module=%(module)s function=%(funcName)s %(message)s
3950
4051
4152
[grass]

0 commit comments

Comments
 (0)