Changeset 968
- Timestamp:
- Dec 18, 2020, 7:11:27 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Dockerfile
r959 r968 2 2 # Base: Ubuntu 18.04 with updates and external packages 3 3 # 4 FROM ubuntu:bionic-2020 0713AS base4 FROM ubuntu:bionic-20201119 AS base 5 5 ARG DEBIAN_FRONTEND=noninteractive 6 6 ARG BUILD_DEPS=" \ … … 15 15 libmozjs185-dev \ 16 16 libpq5 \ 17 libpython 2.7\17 libpython3.6 \ 18 18 libxslt1.1 \ 19 19 gdal-bin \ 20 python \20 python3 \ 21 21 r-base \ 22 python3-pip\ 22 23 " 23 24 RUN set -ex \ … … 54 55 libxml2-dev \ 55 56 libxslt1-dev \ 56 python -dev \57 python3-dev \ 57 58 uuid-dev \ 58 59 r-base-dev \ … … 68 69 && cd ./zoo-project/zoo-kernel \ 69 70 && 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 \ 71 72 && make \ 72 73 && make install \ … … 77 78 && cp ../zoo-services/hello-js/cgi-env/* /usr/lib/cgi-bin/ \ 78 79 && cp ../zoo-api/js/* /usr/lib/cgi-bin/ \ 80 && cp ../zoo-services/utils/open-api/cgi-env/* /usr/lib/cgi-bin/ \ 79 81 && cp ../zoo-services/hello-py/cgi-env/* /usr/lib/cgi-bin/ \ 80 82 && cp ../zoo-services/hello-js/cgi-env/* /usr/lib/cgi-bin/ \ … … 112 114 # From zoo-kernel 113 115 COPY --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.5116 COPY --from=builder1 /usr/lib/libzoo_service.so.1.8 /usr/lib/libzoo_service.so.1.8 115 117 COPY --from=builder1 /usr/lib/libzoo_service.so /usr/lib/libzoo_service.so 116 118 COPY --from=builder1 /usr/com/zoo-project/ /usr/com/zoo-project/ … … 146 148 # From zoo-kernel 147 149 COPY --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.5150 COPY --from=builder1 /usr/lib/libzoo_service.so.1.8 /usr/lib/libzoo_service.so.1.8 149 151 COPY --from=builder1 /usr/lib/libzoo_service.so /usr/lib/libzoo_service.so 150 152 COPY --from=builder1 /usr/com/zoo-project/ /usr/com/zoo-project/ … … 159 161 \ 160 162 && 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 162 166 163 167 EXPOSE 80 -
trunk/docker-compose.yml
r959 r968 9 9 - ./docker/oas.cfg:/usr/lib/cgi-bin/oas.cfg 10 10 - ./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 11 16 depends_on: 12 17 - 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"] 13 29 pg: 14 30 image: postgres:9.6.18-alpine … … 33 49 depends_on: 34 50 - pg 35 51 redis: 52 image: redis:6.0.9 -
trunk/docker/main.cfg
r959 r968 9 9 dataPath = /usr/com/zoo-project 10 10 cacheDir = /tmp/ 11 templatesPath = /var/www/ 11 12 12 13 [identification] -
trunk/docker/oas.cfg
r959 r968 1 1 [openapi] 2 rootUrl=http://localhost/cgi-bin/zoo_loader.cgi 2 use_content=false 3 rootUrl=http://localhost/ogc-api 3 4 links=/,/api,/conformance,/processes 4 paths=/root,/api,/conformance,/processes,/processes/{id},/processes/{id}/jobs,/processes/{id}/jobs/{jobID},/processes/{id}/jobs/{jobID}/result 5 paths=/root,/api,/conformance,/processes,/processes/{id},/processes/{id}/jobs,/processes/{id}/jobs/{jobID},/processes/{id}/jobs/{jobID}/results 5 6 parameters=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 7 version=3.0.2 8 license_name=OGC license 9 license_url=https://raw.githubusercontent.com/opengeospatial/wps-rest-binding/master/LICENSE 10 full_html_support=false 11 partial_html_support=true 12 wsUrl=ws://localhost:8888/ 13 publisherUrl=http://localhost/cgi-bin/publish.py?jobid= 14 io_as_array=true 22 15 23 16 [/] … … 32 25 tags=Home 33 26 tags_description= 34 schema=https://raw.githubusercontent.com/opengeospatial/wps-rest-binding/master/core/openapi/schemas/root.yaml 27 schema=https://raw.githubusercontent.com/gfenoy/wps-rest-binding/change-request/95/core/openapi/responses/LandingPage.yaml 28 29 [/index.html] 30 rel=alternate 31 type=text/html 35 32 36 33 [/api] 37 rel=service 34 rel=service-desc 38 35 type=application/openapi+json;version=3.0 39 36 title=the API definition 37 38 [/api.html] 39 rel=service-doc 40 type=text/hml 41 42 [api.html] 43 href=https://demo.mapmint.com/swagger-ui/ogc-api-processes/ 40 44 41 45 [api] … … 50 54 rel=conformance 51 55 type=application/json 52 title= WPS 2.0 REST/JSON Binding Extensionconformance classes implemented by this server56 title=OGC API - Processes conformance classes implemented by this server 53 57 54 58 [conformance] 55 59 method=get 56 60 title=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 to61 abstract=list all requirements classes specified in a standard (e.g., WPS REST/JSON Binding Core) that the server conforms to 58 62 tags=Conformance 59 63 tags_description= 60 schema=https://raw.githubusercontent.com/opengeospatial/wps-rest-binding/master/core/openapi/schemas/req-classes.yaml 64 schema=https://raw.githubusercontent.com/gfenoy/wps-rest-binding/change-request/95/core/openapi/responses/ConformanceDeclaration.yaml 65 66 [/conformance.html] 67 rel=alternate 68 type=text/hml 61 69 62 70 [/processes] … … 71 79 tags=GetCapabilities 72 80 tags_description= 73 schema=https://raw.githubusercontent.com/opengeospatial/wps-rest-binding/master/core/openapi/schemas/processCollection.yaml 81 schema=https://raw.githubusercontent.com/gfenoy/wps-rest-binding/change-request/95/core/openapi/responses/ProcessList.yaml 82 83 [/processes.html] 84 rel=alternate 85 type=text/hml 74 86 75 87 [processes/{id}] … … 79 91 tags=ProcessDescription 80 92 tags_description= 81 schema=https://raw.githubusercontent.com/opengeospatial/wps-rest-binding/master/core/openapi/schemas/process.yaml 93 schema=https://raw.githubusercontent.com/gfenoy/wps-rest-binding/change-request/95/core/openapi/responses/ProcessDescription.yaml 94 ecode=404 82 95 parameters=/components/parameters/id 83 96 … … 95 108 tags=JobList 96 109 tags_description= 97 schema=https://raw.githubusercontent.com/ opengeospatial/wps-rest-binding/master/core/openapi/schemas/jobCollection.yaml110 schema=https://raw.githubusercontent.com/gfenoy/wps-rest-binding/change-request/95/core/openapi/responses/JobList.yaml 98 111 parameters=/components/parameters/id 112 ecode=404,500 99 113 method_1=post 100 114 title_1=execute a job … … 102 116 tags_1=Execute Endpoint 103 117 tags_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 118 schema_1=https://raw.githubusercontent.com/gfenoy/wps-rest-binding/change-request/95/core/openapi/responses/ExecuteSync.yaml 119 parameters_1=/components/parameters/id 120 ecode_1=400,404,500 121 eschema_1=https://raw.githubusercontent.com/gfenoy/wps-rest-binding/change-request/95/core/openapi/responses/ExecuteAsync.yaml 122 ep=,/components/parameters/oas-header1 106 123 107 124 [requestBody] 108 125 abstract=Mandatory execute request in JSON format 109 126 type=application/json 110 schema=https://raw.githubusercontent.com/ opengeospatial/wps-rest-binding/master/core/openapi/schemas/execute.yaml127 schema=https://raw.githubusercontent.com/gfenoy/wps-rest-binding/change-request/95/core/openapi/schemas/execute.yaml 111 128 112 129 [/processes/{id}/jobs/{jobID}] … … 116 133 117 134 [processes/{id}/jobs/{jobID}] 135 length=2 118 136 method=get 119 137 title=The status of a job. … … 121 139 tags=GetStatus 122 140 tags_description= 123 schema=https://raw.githubusercontent.com/ opengeospatial/wps-rest-binding/master/core/openapi/schemas/statusInfo.yaml141 schema=https://raw.githubusercontent.com/gfenoy/wps-rest-binding/change-request/95/core/openapi/responses/Status.yaml 124 142 parameters=/components/parameters/id,/components/parameters/jobID 125 126 [/processes/{id}/jobs/{jobID}/result] 143 method_1=delete 144 title_1=Cancel a job 145 abstract_1=Cancel the job execution. 146 tags_1=Dismiss 147 tags_description_1=Cencel a job execution 148 schema_1=https://raw.githubusercontent.com/gfenoy/wps-rest-binding/change-request/95/core/openapi/responses/Status.yaml 149 parameters_1=/components/parameters/id,/components/parameters/jobID 150 ecode_1=404,500 151 152 153 [/processes/{id}/jobs/{jobID}/results] 127 154 rel=canonical 128 155 type=application/json 129 156 title=Get Result 130 157 131 [processes/{id}/jobs/{jobID}/result ]158 [processes/{id}/jobs/{jobID}/results] 132 159 method=get 133 160 title=The result of a job execution. … … 135 162 tags=GetResult 136 163 tags_description= 137 schema=https://raw.githubusercontent.com/ opengeospatial/wps-rest-binding/master/core/openapi/schemas/result.yaml164 schema=https://raw.githubusercontent.com/gfenoy/wps-rest-binding/change-request/95/core/openapi/responses/Results.yaml 138 165 parameters=/components/parameters/id,/components/parameters/jobID 166 ecode=404,500 139 167 ep=,/components/parameters/oas-header2 140 168 … … 150 178 tags=GetResult 151 179 tags_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 180 schema=https://raw.githubusercontent.com/gfenoy/wps-rest-binding/change-request/95/core/openapi/schemas/valueType.yaml 181 parameters=/components/parameters/id,/components/parameters/jobID,/components/parameters/resultID 182 ep=,/components/parameters/oas-header2 154 183 155 184 … … 184 213 required=false 185 214 186 [conformTo] 187 rootUrl=http://www.opengis.net/spec/WPS/2.0/req/service/binding/rest-json/ 215 [conformsTo] 216 rootUrl=http://www.opengis.net/spec/ogcapi-processes/1.0/conf/ 217 rootUrl0=http://www.opengis.net/spec/WPS/2.0/req/service/binding/rest-json/ 188 218 link=core 189 219 link_1=oas30 190 220 link_2=json 191 length=3 221 link_3=job-list 222 link_4=dismiss 223 link_5=callback 224 length=6 192 225 193 226 [exception] 194 227 abstract=Exception 195 228 type=application/json 196 schema=https://raw.githubusercontent.com/opengeospatial/wps-rest-binding/master/core/openapi/schemas/exception.yaml 197 229 schema=https://raw.githubusercontent.com/gfenoy/wps-rest-binding/change-request/95/core/openapi/responses/NotFound.yaml 230 default_schema=https://raw.githubusercontent.com/gfenoy/wps-rest-binding/change-request/95/core/openapi/responses/ServerError.yaml 231 232 [responses] 233 length=5 234 code=404 235 schema=https://raw.githubusercontent.com/gfenoy/wps-rest-binding/change-request/95/core/openapi/responses/NotFound.yaml 236 type=application/json 237 title=NotFound 238 code_1=500 239 schema_1=https://raw.githubusercontent.com/gfenoy/wps-rest-binding/change-request/95/core/openapi/responses/ServerError.yaml 240 type_1=application/json 241 title_1=ServerError 242 code_2=400 243 schema_2=https://raw.githubusercontent.com/gfenoy/wps-rest-binding/change-request/95/core/openapi/responses/InvalidParameter.yaml 244 type_2=appliction/json 245 title_2=InvalidParameter 246 code_3=405 247 schema_3=https://raw.githubusercontent.com/gfenoy/wps-rest-binding/change-request/95/core/openapi/NotAllowed.yaml 248 type_3=appliction/json 249 title_3=NotAllowed 250 code_4=406 251 schema_4=https://raw.githubusercontent.com/gfenoy/wps-rest-binding/change-request/95/core/openapi/responses/NotSupported.yaml 252 type_4=appliction/json 253 title_4=NotSupported 254 255 [callbacks] 256 length=3 257 state=jobSuccess 258 uri=successUri 259 schema=https://raw.githubusercontent.com/gfenoy/wps-rest-binding/change-request/95/core/openapi/schemas/result.yaml 260 type=application/json 261 title=Results received successfully 262 state_1=jobInProgress 263 uri_1=inProgressUri 264 schema_1=https://raw.githubusercontent.com/gfenoy/wps-rest-binding/change-request/95/core/openapi/schemas/statusInfo.yaml 265 type_1=application/json 266 title_1=Results received successfully 267 state_2=jobFailed 268 uri_2=failedUrii 269 schema_2=https://raw.githubusercontent.com/gfenoy/wps-rest-binding/change-request/95/core/openapi/schemas/exception.yaml 270 type_2=application/json 271 title_2=Exception received successfully 272 273 [links_title] 274 self=View this document in JSON. 275 alternate=View the alternative version in HTML. 276 conformance=View the specifications that the link’s context conforms to. 277 service-desc=View the service description. 278 service-doc=View service documentation. 279 processes=View the list of processes the API offers. 280 results=View the results of a process. 281 status=View the current status of a job execution. 282 execute=View the execution endpoint of a process. 283 284 [provider_alt] 285 addressDeliveryPoint=streetAddress 286 addressCity=addressLocality 287 addressAdministrativeArea=addressRegion 288 addressPostalCode=postalCode 289 addressCountry=addressCountry 290 addressElectronicMailAddress=email 291 phoneVoice=telephone 292 phoneFacsimile=faxNumber 293 hoursOfService=hoursAvailable 294 contactInstructions=contactOption 295 -
trunk/zoo-project/zoo-kernel/configure.ac
r967 r968 542 542 543 543 AC_ARG_WITH([r], 544 [AS_HELP_STRING([--with-r=PATH], [To enable pythonsupport 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])], 545 545 [R_PATH="$withval"; R_ENABLED="-DUSE_R"], [R_ENABLED=""]) 546 546 … … 605 605 fi 606 606 607 echo $PYTHONCONFIG 607 608 # Extract the linker and include flags 608 609 PYTHON_LDFLAGS=`$PYTHONCONFIG --ldflags` -
trunk/zoo-project/zoo-services/utils/open-api/cgi-env/service.py
r962 r968 28 28 def display(conf,inputs,outputs): 29 29 config = configparser.ConfigParser() 30 config.read(conf["lenv"]["cwd"]+'/oas.cfg' )30 config.read(conf["lenv"]["cwd"]+'/oas.cfg',"utf-8") 31 31 nameSpace = {'conf': conf,'inputs': inputs, 'outputs': outputs,"openapi": config} 32 32 t = Template(file=conf["main"]["templatesPath"]+"/index.html",searchList=nameSpace) -
trunk/zoo-project/zoo-services/utils/open-api/server/publish.py
r962 r968 14 14 15 15 from urllib import parse 16 16 17 try: 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) 21 26 except Exception as e: 22 27 print(e) -
trunk/zoo-project/zoo-services/utils/open-api/server/subscriber.py
r962 r968 11 11 import redis 12 12 import json 13 import os 13 14 14 15 mThreads=[] 15 r = redis.Redis(host='localhost', port=6379, db=0) 16 r=None 17 18 if "ZOO_REDIS_HOST" in os.environ: 19 r = redis.Redis(host=os.environ["ZOO_REDIS_HOST"], port=6379, db=0) 20 else: 21 r = redis.Redis(host='redis', port=6379, db=0) 16 22 17 23 def send(t): … … 59 65 60 66 t0.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 108 108 for(var i=0;i < System["JSON_STR"]["outputs"].length;i++){ 109 109 var cOutput={}; 110 console.log($('input[name="oapi_ioAsArray"]').val()=="true"); 110 111 if($('input[name="oapi_ioAsArray"]').val()=="true") 111 cOutput s={"id": System["JSON_STR"]["outputs"][i]["id"]};112 cOutput={"id": System["JSON_STR"]["outputs"][i]["id"]}; 112 113 var cName=System["JSON_STR"]["outputs"][i]["id"].replace(/\./g,"_"); 113 114 if(System["JSON_STR"]["outputs"][i]["output"]["formats"]){
Note: See TracChangeset
for help on using the changeset viewer.