Changeset 968


Ignore:
Timestamp:
Dec 18, 2020, 7:11:27 PM (4 years ago)
Author:
djay
Message:

Add websocketd container to docker-compose and make the OGC API - Processes and it basic UI available.

Location:
trunk
Files:
2 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Dockerfile

    r959 r968  
    22# Base: Ubuntu 18.04 with updates and external packages
    33#
    4 FROM ubuntu:bionic-20200713 AS base
     4FROM ubuntu:bionic-20201119 AS base
    55ARG DEBIAN_FRONTEND=noninteractive
    66ARG BUILD_DEPS=" \
     
    1515    libmozjs185-dev \
    1616    libpq5 \
    17     libpython2.7 \
     17    libpython3.6 \
    1818    libxslt1.1 \
    1919    gdal-bin \
    20     python \
     20    python3 \
    2121    r-base \
     22    python3-pip\
    2223"
    2324RUN set -ex \
     
    5455    libxml2-dev \
    5556    libxslt1-dev \
    56     python-dev \
     57    python3-dev \
    5758    uuid-dev \
    5859    r-base-dev \
     
    6869    && cd ./zoo-project/zoo-kernel \
    6970    && autoconf \
    70     && ./configure --with-python --with-js=/usr --with-mapserver=/usr --with-ms-version=7 --with-json=/usr --with-db-backend --prefix=/usr \
     71    && ./configure --with-python=/usr --with-pyvers=3.6 --with-js=/usr --with-mapserver=/usr --with-ms-version=7 --with-json=/usr --with-db-backend --prefix=/usr \
    7172    && make \
    7273    && make install \
     
    7778    && cp ../zoo-services/hello-js/cgi-env/* /usr/lib/cgi-bin/ \
    7879    && cp ../zoo-api/js/* /usr/lib/cgi-bin/ \
     80    && cp ../zoo-services/utils/open-api/cgi-env/* /usr/lib/cgi-bin/ \
    7981    && cp ../zoo-services/hello-py/cgi-env/* /usr/lib/cgi-bin/ \
    8082    && cp ../zoo-services/hello-js/cgi-env/* /usr/lib/cgi-bin/ \
     
    112114# From zoo-kernel
    113115COPY --from=builder1 /usr/lib/cgi-bin/ /usr/lib/cgi-bin/
    114 COPY --from=builder1 /usr/lib/libzoo_service.so.1.5 /usr/lib/libzoo_service.so.1.5
     116COPY --from=builder1 /usr/lib/libzoo_service.so.1.8 /usr/lib/libzoo_service.so.1.8
    115117COPY --from=builder1 /usr/lib/libzoo_service.so /usr/lib/libzoo_service.so
    116118COPY --from=builder1 /usr/com/zoo-project/ /usr/com/zoo-project/
     
    146148# From zoo-kernel
    147149COPY --from=builder1 /usr/lib/cgi-bin/ /usr/lib/cgi-bin/
    148 COPY --from=builder1 /usr/lib/libzoo_service.so.1.5 /usr/lib/libzoo_service.so.1.5
     150COPY --from=builder1 /usr/lib/libzoo_service.so.1.8 /usr/lib/libzoo_service.so.1.8
    149151COPY --from=builder1 /usr/lib/libzoo_service.so /usr/lib/libzoo_service.so
    150152COPY --from=builder1 /usr/com/zoo-project/ /usr/com/zoo-project/
     
    159161    \
    160162    && rm -rf /var/lib/apt/lists/* \
    161     && a2enmod cgi
     163    && pip3 install Cheetah3 redis\
     164    && sed "s:AllowOverride None:AllowOverride All:g" -i /etc/apache2/apache2.conf \
     165    && a2enmod cgi rewrite
    162166
    163167EXPOSE 80
  • trunk/docker-compose.yml

    r959 r968  
    99      - ./docker/oas.cfg:/usr/lib/cgi-bin/oas.cfg
    1010      - ./docker/default.conf:/etc/apache2/sites-available/000-default.conf
     11      - ./zoo-project/zoo-services/utils/open-api/server/publish.py:/usr/lib/cgi-bin/publish.py
     12      - ./zoo-project/zoo-services/utils/open-api/server/subscriber.py:/usr/lib/cgi-bin/subscriber.py
     13      - ./docker/.htaccess:/var/www/html/.htaccess
     14      - ./zoo-project/zoo-services/utils/open-api/templates/index.html:/var/www/index.html
     15      - ./zoo-project/zoo-services/utils/open-api/static:/var/www/html/static
    1116    depends_on:
    1217      - pgbouncer
     18    environment:
     19      - ZOO_REDIS_HOST=redis
     20  websocketd:
     21    build: ./docker/websocketd
     22    ports:
     23      - 8888:8888
     24    environment:
     25      - ZOO_REDIS_HOST=redis
     26    volumes:
     27      - ./zoo-project/zoo-services/utils/open-api/server/subscriber.py:/shell.py
     28    command: ["--port=8888", "/shell.py"]
    1329  pg:
    1430    image: postgres:9.6.18-alpine
     
    3349    depends_on:
    3450      - pg
    35 
     51  redis:
     52    image: redis:6.0.9
  • trunk/docker/main.cfg

    r959 r968  
    99dataPath = /usr/com/zoo-project
    1010cacheDir = /tmp/
     11templatesPath = /var/www/
    1112
    1213[identification]
  • trunk/docker/oas.cfg

    r959 r968  
    11[openapi]
    2 rootUrl=http://localhost/cgi-bin/zoo_loader.cgi
     2use_content=false
     3rootUrl=http://localhost/ogc-api
    34links=/,/api,/conformance,/processes
    4 paths=/root,/api,/conformance,/processes,/processes/{id},/processes/{id}/jobs,/processes/{id}/jobs/{jobID},/processes/{id}/jobs/{jobID}/result
     5paths=/root,/api,/conformance,/processes,/processes/{id},/processes/{id}/jobs,/processes/{id}/jobs/{jobID},/processes/{id}/jobs/{jobID}/results
    56parameters=id,jobID,resultID
    6 header_parameters=oas-header1,oas-header2
    7 version=3.0.1
    8 
    9 [oas-header1]
    10 in=header
    11 name=Prefer
    12 type=string
    13 required=false
    14 enum=respond-async
    15 
    16 [oas-header2]
    17 in=header
    18 name=Prefer
    19 type=string
    20 required=false
    21 enum=return=representation,return=minimal
     7version=3.0.2
     8license_name=OGC license
     9license_url=https://raw.githubusercontent.com/opengeospatial/wps-rest-binding/master/LICENSE
     10full_html_support=false
     11partial_html_support=true
     12wsUrl=ws://localhost:8888/
     13publisherUrl=http://localhost/cgi-bin/publish.py?jobid=
     14io_as_array=true
    2215
    2316[/]
     
    3225tags=Home
    3326tags_description=
    34 schema=https://raw.githubusercontent.com/opengeospatial/wps-rest-binding/master/core/openapi/schemas/root.yaml
     27schema=https://raw.githubusercontent.com/gfenoy/wps-rest-binding/change-request/95/core/openapi/responses/LandingPage.yaml
     28
     29[/index.html]
     30rel=alternate
     31type=text/html
    3532
    3633[/api]
    37 rel=service
     34rel=service-desc
    3835type=application/openapi+json;version=3.0
    3936title=the API definition
     37
     38[/api.html]
     39rel=service-doc
     40type=text/hml
     41
     42[api.html]
     43href=https://demo.mapmint.com/swagger-ui/ogc-api-processes/
    4044
    4145[api]
     
    5054rel=conformance
    5155type=application/json
    52 title=WPS 2.0 REST/JSON Binding Extension conformance classes implemented by this server
     56title=OGC API - Processes conformance classes implemented by this server
    5357
    5458[conformance]
    5559method=get
    5660title=information about standards that this API conforms to
    57 abstract==list all requirements classes specified in a standard (e.g., WPS REST/JSON Binding Core) that the server conforms to
     61abstract=list all requirements classes specified in a standard (e.g., WPS REST/JSON Binding Core) that the server conforms to
    5862tags=Conformance
    5963tags_description=
    60 schema=https://raw.githubusercontent.com/opengeospatial/wps-rest-binding/master/core/openapi/schemas/req-classes.yaml
     64schema=https://raw.githubusercontent.com/gfenoy/wps-rest-binding/change-request/95/core/openapi/responses/ConformanceDeclaration.yaml
     65
     66[/conformance.html]
     67rel=alternate
     68type=text/hml
    6169
    6270[/processes]
     
    7179tags=GetCapabilities
    7280tags_description=
    73 schema=https://raw.githubusercontent.com/opengeospatial/wps-rest-binding/master/core/openapi/schemas/processCollection.yaml
     81schema=https://raw.githubusercontent.com/gfenoy/wps-rest-binding/change-request/95/core/openapi/responses/ProcessList.yaml
     82
     83[/processes.html]
     84rel=alternate
     85type=text/hml
    7486
    7587[processes/{id}]
     
    7991tags=ProcessDescription
    8092tags_description=
    81 schema=https://raw.githubusercontent.com/opengeospatial/wps-rest-binding/master/core/openapi/schemas/process.yaml
     93schema=https://raw.githubusercontent.com/gfenoy/wps-rest-binding/change-request/95/core/openapi/responses/ProcessDescription.yaml
     94ecode=404
    8295parameters=/components/parameters/id
    8396
     
    95108tags=JobList
    96109tags_description=
    97 schema=https://raw.githubusercontent.com/opengeospatial/wps-rest-binding/master/core/openapi/schemas/jobCollection.yaml
     110schema=https://raw.githubusercontent.com/gfenoy/wps-rest-binding/change-request/95/core/openapi/responses/JobList.yaml
    98111parameters=/components/parameters/id
     112ecode=404,500
    99113method_1=post
    100114title_1=execute a job
     
    102116tags_1=Execute Endpoint
    103117tags_description_1=
    104 schema_1=https://raw.githubusercontent.com/opengeospatial/wps-rest-binding/master/core/openapi/schemas/result.yaml
    105 parameters_1=/components/parameters/id,/components/parameters/oas-header1
     118schema_1=https://raw.githubusercontent.com/gfenoy/wps-rest-binding/change-request/95/core/openapi/responses/ExecuteSync.yaml
     119parameters_1=/components/parameters/id
     120ecode_1=400,404,500
     121eschema_1=https://raw.githubusercontent.com/gfenoy/wps-rest-binding/change-request/95/core/openapi/responses/ExecuteAsync.yaml
     122ep=,/components/parameters/oas-header1
    106123
    107124[requestBody]
    108125abstract=Mandatory execute request in JSON format
    109126type=application/json
    110 schema=https://raw.githubusercontent.com/opengeospatial/wps-rest-binding/master/core/openapi/schemas/execute.yaml
     127schema=https://raw.githubusercontent.com/gfenoy/wps-rest-binding/change-request/95/core/openapi/schemas/execute.yaml
    111128
    112129[/processes/{id}/jobs/{jobID}]
     
    116133
    117134[processes/{id}/jobs/{jobID}]
     135length=2
    118136method=get
    119137title=The status of a job.
     
    121139tags=GetStatus
    122140tags_description=
    123 schema=https://raw.githubusercontent.com/opengeospatial/wps-rest-binding/master/core/openapi/schemas/statusInfo.yaml
     141schema=https://raw.githubusercontent.com/gfenoy/wps-rest-binding/change-request/95/core/openapi/responses/Status.yaml
    124142parameters=/components/parameters/id,/components/parameters/jobID
    125 
    126 [/processes/{id}/jobs/{jobID}/result]
     143method_1=delete
     144title_1=Cancel a job
     145abstract_1=Cancel the job execution.
     146tags_1=Dismiss
     147tags_description_1=Cencel a job execution
     148schema_1=https://raw.githubusercontent.com/gfenoy/wps-rest-binding/change-request/95/core/openapi/responses/Status.yaml
     149parameters_1=/components/parameters/id,/components/parameters/jobID
     150ecode_1=404,500
     151
     152
     153[/processes/{id}/jobs/{jobID}/results]
    127154rel=canonical
    128155type=application/json
    129156title=Get Result
    130157
    131 [processes/{id}/jobs/{jobID}/result]
     158[processes/{id}/jobs/{jobID}/results]
    132159method=get
    133160title=The result of a job execution.
     
    135162tags=GetResult
    136163tags_description=
    137 schema=https://raw.githubusercontent.com/opengeospatial/wps-rest-binding/master/core/openapi/schemas/result.yaml
     164schema=https://raw.githubusercontent.com/gfenoy/wps-rest-binding/change-request/95/core/openapi/responses/Results.yaml
    138165parameters=/components/parameters/id,/components/parameters/jobID
     166ecode=404,500
    139167ep=,/components/parameters/oas-header2
    140168
     
    150178tags=GetResult
    151179tags_description=
    152 schema=https://raw.githubusercontent.com/opengeospatial/wps-rest-binding/master/core/openapi/schemas/valueType.yaml
    153 parameters=/components/parameters/id,/components/parameters/jobID,/components/parameters/resultID,/components/parameters/oas-header2
     180schema=https://raw.githubusercontent.com/gfenoy/wps-rest-binding/change-request/95/core/openapi/schemas/valueType.yaml
     181parameters=/components/parameters/id,/components/parameters/jobID,/components/parameters/resultID
     182ep=,/components/parameters/oas-header2
    154183
    155184
     
    184213required=false
    185214
    186 [conformTo]
    187 rootUrl=http://www.opengis.net/spec/WPS/2.0/req/service/binding/rest-json/
     215[conformsTo]
     216rootUrl=http://www.opengis.net/spec/ogcapi-processes/1.0/conf/
     217rootUrl0=http://www.opengis.net/spec/WPS/2.0/req/service/binding/rest-json/
    188218link=core
    189219link_1=oas30
    190220link_2=json
    191 length=3
     221link_3=job-list
     222link_4=dismiss
     223link_5=callback
     224length=6
    192225
    193226[exception]
    194227abstract=Exception
    195228type=application/json
    196 schema=https://raw.githubusercontent.com/opengeospatial/wps-rest-binding/master/core/openapi/schemas/exception.yaml
    197 
     229schema=https://raw.githubusercontent.com/gfenoy/wps-rest-binding/change-request/95/core/openapi/responses/NotFound.yaml
     230default_schema=https://raw.githubusercontent.com/gfenoy/wps-rest-binding/change-request/95/core/openapi/responses/ServerError.yaml
     231
     232[responses]
     233length=5
     234code=404
     235schema=https://raw.githubusercontent.com/gfenoy/wps-rest-binding/change-request/95/core/openapi/responses/NotFound.yaml
     236type=application/json
     237title=NotFound
     238code_1=500
     239schema_1=https://raw.githubusercontent.com/gfenoy/wps-rest-binding/change-request/95/core/openapi/responses/ServerError.yaml
     240type_1=application/json
     241title_1=ServerError
     242code_2=400
     243schema_2=https://raw.githubusercontent.com/gfenoy/wps-rest-binding/change-request/95/core/openapi/responses/InvalidParameter.yaml
     244type_2=appliction/json
     245title_2=InvalidParameter
     246code_3=405
     247schema_3=https://raw.githubusercontent.com/gfenoy/wps-rest-binding/change-request/95/core/openapi/NotAllowed.yaml
     248type_3=appliction/json
     249title_3=NotAllowed
     250code_4=406
     251schema_4=https://raw.githubusercontent.com/gfenoy/wps-rest-binding/change-request/95/core/openapi/responses/NotSupported.yaml
     252type_4=appliction/json
     253title_4=NotSupported
     254
     255[callbacks]
     256length=3
     257state=jobSuccess
     258uri=successUri
     259schema=https://raw.githubusercontent.com/gfenoy/wps-rest-binding/change-request/95/core/openapi/schemas/result.yaml
     260type=application/json
     261title=Results received successfully
     262state_1=jobInProgress
     263uri_1=inProgressUri
     264schema_1=https://raw.githubusercontent.com/gfenoy/wps-rest-binding/change-request/95/core/openapi/schemas/statusInfo.yaml
     265type_1=application/json
     266title_1=Results received successfully
     267state_2=jobFailed
     268uri_2=failedUrii
     269schema_2=https://raw.githubusercontent.com/gfenoy/wps-rest-binding/change-request/95/core/openapi/schemas/exception.yaml
     270type_2=application/json
     271title_2=Exception received successfully
     272
     273[links_title]
     274self=View this document in JSON.
     275alternate=View the alternative version in HTML.
     276conformance=View the specifications that the link’s context conforms to.
     277service-desc=View the service description.
     278service-doc=View service documentation.
     279processes=View the list of processes the API offers.
     280results=View the results of a process.
     281status=View the current status of a job execution.
     282execute=View the execution endpoint of a process.
     283
     284[provider_alt]
     285addressDeliveryPoint=streetAddress
     286addressCity=addressLocality
     287addressAdministrativeArea=addressRegion
     288addressPostalCode=postalCode
     289addressCountry=addressCountry
     290addressElectronicMailAddress=email
     291phoneVoice=telephone
     292phoneFacsimile=faxNumber
     293hoursOfService=hoursAvailable
     294contactInstructions=contactOption
     295
  • trunk/zoo-project/zoo-kernel/configure.ac

    r967 r968  
    542542
    543543AC_ARG_WITH([r],
    544         [AS_HELP_STRING([--with-r=PATH], [To enable python support or Specifies an alternative directory for R installation,  disabled by default])],
     544        [AS_HELP_STRING([--with-r=PATH], [To enable R support or Specifies an alternative directory for R installation,  disabled by default])],
    545545        [R_PATH="$withval"; R_ENABLED="-DUSE_R"], [R_ENABLED=""])
    546546
     
    605605        fi
    606606
     607        echo $PYTHONCONFIG
    607608        # Extract the linker and include flags
    608609        PYTHON_LDFLAGS=`$PYTHONCONFIG --ldflags`
  • trunk/zoo-project/zoo-services/utils/open-api/cgi-env/service.py

    r962 r968  
    2828def display(conf,inputs,outputs):
    2929    config = configparser.ConfigParser()
    30     config.read(conf["lenv"]["cwd"]+'/oas.cfg')
     30    config.read(conf["lenv"]["cwd"]+'/oas.cfg',"utf-8")
    3131    nameSpace = {'conf': conf,'inputs': inputs, 'outputs': outputs,"openapi": config}
    3232    t = Template(file=conf["main"]["templatesPath"]+"/index.html",searchList=nameSpace)
  • trunk/zoo-project/zoo-services/utils/open-api/server/publish.py

    r962 r968  
    1414
    1515from urllib import parse
     16
    1617try:
    17         params=parse.parse_qs(os.environ["QUERY_STRING"])
    18         r = redis.Redis(host='localhost', port=6379, db=0)
    19         print(params)
    20         r.publish(params["jobid"][0],data)
     18    params=parse.parse_qs(os.environ["QUERY_STRING"])
     19    r=None
     20    if "ZOO_REDIS_HOST" in os.environ:
     21        r = redis.Redis(host=os.environ["ZOO_REDIS_HOST"], port=6379, db=0)
     22    else:
     23        r = redis.Redis(host='redis', port=6379, db=0)
     24    print(params)
     25    r.publish(params["jobid"][0],data)
    2126except Exception as e:
    2227        print(e)
  • trunk/zoo-project/zoo-services/utils/open-api/server/subscriber.py

    r962 r968  
    1111import redis
    1212import json
     13import os
    1314
    1415mThreads=[]
    15 r = redis.Redis(host='localhost', port=6379, db=0)
     16r=None
     17
     18if "ZOO_REDIS_HOST" in os.environ:
     19    r = redis.Redis(host=os.environ["ZOO_REDIS_HOST"], port=6379, db=0)
     20else:
     21    r = redis.Redis(host='redis', port=6379, db=0)
    1622
    1723def send(t):
     
    5965
    6066t0.join()
    61 for i in range(len(mThreads)):
    62     mThreads[i].join()
     67#for i in range(len(mThreads)):
     68#    mThreads[i].join()
  • trunk/zoo-project/zoo-services/utils/open-api/static/openapi.js

    r967 r968  
    108108    for(var i=0;i < System["JSON_STR"]["outputs"].length;i++){
    109109        var cOutput={};
     110        console.log($('input[name="oapi_ioAsArray"]').val()=="true");
    110111        if($('input[name="oapi_ioAsArray"]').val()=="true")
    111             cOutputs={"id": System["JSON_STR"]["outputs"][i]["id"]};
     112            cOutput={"id": System["JSON_STR"]["outputs"][i]["id"]};
    112113        var cName=System["JSON_STR"]["outputs"][i]["id"].replace(/\./g,"_");
    113114        if(System["JSON_STR"]["outputs"][i]["output"]["formats"]){
Note: See TracChangeset for help on using the changeset viewer.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png