Changeset 984


Ignore:
Timestamp:
Mar 3, 2021, 3:41:55 PM (4 years ago)
Author:
djay
Message:

Take into account building ZOO-Project on ubuntu focal (cf. https://trac.osgeo.org/osgeolive/ticket/2282). Add the OTB and SAGA support to the Dockerfile to make the corresponding demos using docker WPS server. Add OGC API - Processes demo to the demos list.

Location:
trunk
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/Dockerfile

    r982 r984  
    1414    libmapserver-dev \
    1515    libmozjs185-dev \
     16    \
     17    saga \
     18    libsaga-api-7.3.0 \
     19    libotb \
     20    otb-bin \
     21    \
    1622    libpq5 \
    1723    libpython3.6 \
     
    4955    gettext-base \
    5056    \
     57    # Comment lines bellow if nor OTB nor SAGA \
     58    libotb-dev \
     59    otb-qgis \
     60    otb-bin-qt \
     61    qttools5-dev \
     62    qttools5-dev-tools \
     63    qtbase5-dev \
     64    libqt5opengl5-dev \
     65    libtinyxml-dev \
     66    libfftw3-dev \
     67    cmake \
     68    libsaga-dev \
     69    # Comment lines before this one if nor OTB nor SAGA \
     70    \
    5171    libfcgi-dev \
    5272    libgdal-dev \
     73    libwxgtk3.0-dev \
    5374    libjson-c-dev \
    5475    libssh2-1-dev \
     
    7091    && cd ./zoo-project/zoo-kernel \
    7192    && autoconf \
    72     && ./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 \
     93    && ./configure --with-python=/usr --with-pyvers=3.6 --with-js=/usr --with-mapserver=/usr --with-ms-version=7 --with-json=/usr --with-r=/usr --with-db-backend --prefix=/usr --with-otb=/usr/ --with-itk=/usr --with-otb-version=6.6 --with-itk-version=4.12 --with-saga=/usr --with-saga-version=7.2 --with-wx-config=/usr/bin/wx-config \
    7394    && make \
    7495    && make install \
     
    82103    && cp ../zoo-services/hello-py/cgi-env/* /usr/lib/cgi-bin/ \
    83104    && cp ../zoo-services/hello-js/cgi-env/* /usr/lib/cgi-bin/ \
     105    && cp ../zoo-services/hello-r/cgi-env/* /usr/lib/cgi-bin/ \
    84106    && cp ../zoo-api/js/* /usr/lib/cgi-bin/ \
     107    && cp ../zoo-api/r/minimal.r /usr/lib/cgi-bin/ \
    85108    \
    86109    && cp oas.cfg /usr/lib/cgi-bin/ \
     
    88111    # TODO: main.cfg is not processed \
    89112    && prefix=/usr envsubst < main.cfg > /usr/lib/cgi-bin/main.cfg \
     113    \
     114    #Comment lines below from here if no OTB \
     115    && mkdir otb_build \
     116    && cd otb_build \
     117    && cmake ../../../thirds/otb2zcfg \
     118    && make \
     119    && mkdir OTB \
     120    && cd OTB \
     121    && ITK_AUTOLOAD_PATH=/usr/lib/x86_64-linux-gnu/otb/applications/ ../otb2zcfg \
     122    && mkdir /usr/lib/cgi-bin/OTB \
     123    && cp *zcfg /usr/lib/cgi-bin/OTB \
     124    #&& for i in *zcfg; do cp $i /usr/lib/cgi-bin/$i ; j="$(echo $i | sed "s:.zcfg::g")" ; sed "s:$j:OTB_$j:g" -i  /usr/lib/cgi-bin/OTB_$i ; done \
     125    #Comment lines before this one if no OTB \
     126    \
     127    #Comment lines below from here if no SAGA \
     128    && cd .. \
     129    && make -C ../../../thirds/saga2zcfg \
     130    && mkdir zcfgs \
     131    && cd zcfgs \
     132    && dpkg -L saga \
     133    && export MODULE_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/saga/ \
     134    && export SAGA_MLB=/usr/lib/x86_64-linux-gnu/saga/ \
     135    && ln -s /usr/lib/x86_64-linux-gnu/saga/ /usr/lib/saga \
     136    && ../../../../thirds/saga2zcfg/saga2zcfg \
     137    && mkdir /usr/lib/cgi-bin/SAGA \
     138    && ls \
     139    && cp -r * /usr/lib/cgi-bin/SAGA \
     140    #Remove OTB if not built or SAGA if no SAGA \
     141    && for j in OTB SAGA ; do for i in $(find /usr/lib/cgi-bin/$j/ -name "*zcfg"); do sed "s:image/png:image/png\n     useMapserver = true\n     msClassify = true:g;s:text/xml:text/xml\n     useMapserver = true:g;s:mimeType = application/x-ogc-aaigrid:mimeType = application/x-ogc-aaigrid\n   </Supported>\n   <Supported>\n     mimeType = image/png\n     useMapserver=true:g" -i $i; done; done \
     142    \
     143    && cd ../.. \
     144    #Comment lines before this one if nor OTB nor SAGA \
    90145    \
    91146    && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $BUILD_DEPS \
     
    158213ARG BUILD_DEPS=" \
    159214    git \
     215    \
    160216"
    161217WORKDIR /zoo-project
     
    164220    && apt-get update && apt-get install -y --no-install-recommends $BUILD_DEPS \
    165221    \
    166     && git clone https://github.com/ZOO-Project/examples.git
     222    && git clone https://github.com/ZOO-Project/examples.git \
     223    && git clone https://github.com/swagger-api/swagger-ui.git
    167224
    168225#
     
    174231    apache2 \
    175232    curl \
     233    cgi-mapserver \
     234    mapserver-bin \
     235    #Uncomment the line below to add vi editor \
     236    #vim \
     237    #Uncomment the lines below to add debuging \
     238    #valgrind \
     239    #gdb \
    176240"
    177241
     
    190254COPY --from=demos /zoo-project/examples/data/ /usr/com/zoo-project/
    191255COPY --from=demos /zoo-project/examples/ /var/www/html/
     256COPY --from=demos /zoo-project/swagger-ui /var/www/html/swagger-ui
    192257
    193258
     
    195260    && apt-get update && apt-get install -y --no-install-recommends $RUN_DEPS \
    196261    \
     262    && sed "s=https://petstore.swagger.io/v2/swagger.json=http://localhost/ogc-api/api=g" -i /var/www/html/swagger-ui/dist/index.html \
     263    && mv  /var/www/html/swagger-ui/dist  /var/www/html/swagger-ui/oapip \
     264    && ln -s /tmp/ /var/www/html/temp \
     265    && ln -s /usr/lib/x86_64-linux-gnu/saga/ /usr/lib/saga \
    197266    && rm -rf /var/lib/apt/lists/* \
    198267    && pip3 install Cheetah3 redis\
    199268    && sed "s:AllowOverride None:AllowOverride All:g" -i /etc/apache2/apache2.conf \
    200269    && mkdir -p /tmp/statusInfos \
    201     && chown www-data:www-data -R /tmp/statusInfos \
     270    && chown www-data:www-data -R /tmp/statusInfos /usr/com/zoo-project \
    202271    && a2enmod cgi rewrite
    203272
  • trunk/docker/main.cfg

    r968 r984  
    22encoding = utf-8
    33version = 1.0.0
    4 serverAddress = http://www.zoo-project.org/zoo/
     4serverAddress = http://localhost/cgi-bin/zoo_loader.cgi
    55language = en-US
    66lang = fr-FR,en-CA,en-US
    77tmpPath=/tmp/
    8 tmpUrl = ../tmpPathRelativeToServerAdress/
     8tmpUrl = ../temp/
    99dataPath = /usr/com/zoo-project
    1010cacheDir = /tmp/
    1111templatesPath = /var/www/
     12mapserverAddress = http://localhost/cgi-bin/mapserv
     13msOgcVersion=1.0.0
     14cors=true
    1215
    1316[identification]
     
    4245schema=public
    4346
     47[env]
     48R_HOME=/usr/lib/R
     49ITK_AUTOLOAD_PATH=/usr/lib/x86_64-linux-gnu/otb/applications/
     50MODULE_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/saga/
  • trunk/docker/oas.cfg

    r968 r984  
    1212wsUrl=ws://localhost:8888/
    1313publisherUrl=http://localhost/cgi-bin/publish.py?jobid=
    14 io_as_array=true
    1514
    1615[/]
     
    4140
    4241[api.html]
    43 href=https://demo.mapmint.com/swagger-ui/ogc-api-processes/
     42href=http://localhost/swagger-ui/oapip/
    4443
    4544[api]
  • trunk/thirds/otb2zcfg/otb2zcfg.cxx

    r917 r984  
    222222          if(type == ParameterType_StringList || type == ParameterType_String || type == ParameterType_Float
    223223             || type == ParameterType_Int || type == ParameterType_Choice || type == ParameterType_ListView
    224              || type == ParameterType_RAM || type == ParameterType_Empty || type == ParameterType_Directory){
     224             || type == ParameterType_RAM || type == ParameterType_Directory){
    225225            std::cout << "   <LiteralData>" << std::endl;
    226226            std::string lt;
     
    233233               || type == ParameterType_ListView)
    234234              lt="string";
    235             if(type == ParameterType_Empty)
    236               lt="boolean";
    237235            std::cout << "    dataType = " << lt << std::endl;
    238236            if(type == ParameterType_Choice || type == ParameterType_ListView){
     
    281279            }
    282280            else{
    283               if(type == ParameterType_ComplexOutputImage){
    284                 printOutputComplexImage(m_Application->GetParameterComplexOutputImagePixelType(paramKey));
    285               }else{
     281              {
    286282                std::cout << "   <ComplexData>" << std::endl;
    287                 if(type == ParameterType_InputImage || type == ParameterType_InputImageList || type == ParameterType_ComplexInputImage){
     283                if(type == ParameterType_InputImage || type == ParameterType_InputImageList){
    288284                  printImages();
    289285                }
     
    338334        if(paramKey!="inxml" && paramKey!="outxml" &&
    339335           ((type == ParameterType_OutputVectorData || type == ParameterType_OutputImage
    340              || type == ParameterType_OutputImage || type == ParameterType_ComplexOutputImage
     336             || type == ParameterType_OutputImage
    341337             || type == ParameterType_OutputFilename) || role==1) && type != ParameterType_Group){
    342338          hasOutput=1;
     
    356352          }
    357353
    358           if(type == ParameterType_OutputImage || type == ParameterType_ComplexOutputImage){
     354          if(type == ParameterType_OutputImage){
    359355            std::cout << "   <ComplexData>" << std::endl;
    360356            printImages();
  • trunk/zoo-project/HISTORY.txt

    r982 r984  
    11Version 1.8.1
     2  * Make all demos running within docker
    23  * Deploy demo HTML UI from github from the Dockerfile
    34  * Add demo ZOO-Services build in the Dockerfile
  • trunk/zoo-project/zoo-kernel/configure.ac

    r982 r984  
    415415CPPFLAGS_SAVE="$CPPFLAGS"
    416416CPPFLAGS="$PROJ_CPPFLAGS"
    417 AC_CHECK_HEADERS([proj_api.h],
    418                  [], [AC_MSG_ERROR([could not find headers include related to PROJ4])])
    419417
    420418AC_SUBST([PROJ_CPPFLAGS])
     
    607605        echo $PYTHONCONFIG
    608606        # Extract the linker and include flags
    609         PYTHON_LDFLAGS=`$PYTHONCONFIG --ldflags`
     607        #PYTHON_LDFLAGS=`$PYTHONCONFIG --ldflags`
     608        PYTHON_LDFLAGS=$($PYTHONCONFIG --ldflags | sed "s:python${PYTHON_VERS}/config-${PYTHON_VERS}-::g")
    610609        PYTHON_CPPFLAGS=`$PYTHONCONFIG --includes`
    611610
     
    618617        # Ensure we can link against libphp
    619618        LIBS_SAVE="$LIBS"
    620         LIBS="$PYTHON_LDFLAGS"
    621         PY_LIB=`$PYTHONCONFIG --libs | sed \
    622                               -e 's/.*\(python[[0-9]]\.[[0-9]]\).*/\1/'`
    623         AC_CHECK_LIB([$PY_LIB], [PyObject_CallObject], [], [AC_MSG_ERROR([could not find libpython])], [])
     619        #LIBS="$PYTHON_LDFLAGS"
     620        #PY_LIB=`$PYTHONCONFIG --libs | sed \
     621        #                     -e 's/.*\(python[[0-9]]\.[[0-9]]\).*/\1/'`
     622        #AC_CHECK_LIB([$PY_LIB], [PyObject_CallObject], [], [AC_MSG_ERROR([could not find libpython])], [])
     623        LIBS="m $PYTHON_LDFLAGS -lpython${PYTHON_VERS}"
     624        PYTHON_LDFLAGS="-l$LIBS"
     625        LDFLAGS=$PYTHON_LDFLAGS
     626        AC_CHECK_LIB([], [PyObject_CallObject], [], [AC_MSG_ERROR([could not find libpython])], [])
    624627        LIBS="$LIBS_SAVE"
    625628fi
  • trunk/zoo-project/zoo-kernel/main_conf_read.y

    r961 r984  
    154154  my_maps=my_map;
    155155  my_maps->name=NULL;
     156  my_maps->content=NULL;
     157  my_maps->child=NULL;
     158  my_maps->next=NULL;
    156159  current_maps=my_maps;
    157160 
  • trunk/zoo-project/zoo-kernel/service.c

    r967 r984  
    838838        else
    839839          pmsCursor->next->child=NULL;
     840        return;
    840841      }
    841842      else{
  • trunk/zoo-project/zoo-kernel/service_internal_ms.c

    r955 r984  
    12721272  m->numlayers++;
    12731273  GDALClose( hDataset );
     1274#ifndef RELY_ON_DB
    12741275  GDALDestroyDriverManager();
     1276#endif
    12751277  CPLCleanupTLS();
    12761278  storeMd5(pszFilename);
  • trunk/zoo-project/zoo-kernel/service_internal_otb.c

    r962 r984  
    211211                }else{
    212212                  if(type == ParameterType_OutputVectorData){
    213                       char* ext="json";
     213                      const char* ext="json";
    214214                      if(tmpVal!=NULL){
    215215                        if(strncasecmp(tmpVal->value,"text/xml",8)==0)
     
    232232                  else
    233233                    if(type == ParameterType_OutputFilename){
    234                       char* ext="txt";
     234                      const char* ext="txt";
    235235                      if(tmpVal!=NULL){
    236236                        if(strncasecmp(tmpVal->value,"text/xml",8)==0)
     
    308308                    char tmp[1024];
    309309                    map* tmpVal=getMapFromMaps(inputs,paramKey.c_str(),"mimeType");
    310                     char* ext="json";
     310                    const char* ext="json";
    311311                    if(tmpVal!=NULL){
    312312                      if(strncasecmp(tmpVal->value,"application/zip",14)==0){
     
    362362                  else
    363363                    if(type == ParameterType_InputImage
    364                        || type == ParameterType_ComplexInputImage || type == ParameterType_InputVectorData
     364                       || type == ParameterType_InputVectorData
    365365                       || type == ParameterType_InputFilename){
    366366                      m_Application->SetParameterString(paramKey, test->value);
     
    403403                        long count;
    404404                       
    405                         char *exts[4];
     405                        const char *exts[4];
    406406                        exts[0]=".shp";
    407407                        exts[1]=".shx";
  • trunk/zoo-project/zoo-kernel/service_internal_otb.h

    r640 r984  
    3636#include "service_internal.h"
    3737#include "service.h"
    38 #include "cgic.h"
    3938#ifdef WIN32
    4039#include <windows.h>
    4140#include <direct.h>
    4241#endif
    43 #include <vector>
    44 #include <string>
    4542
    4643/**
  • trunk/zoo-project/zoo-kernel/ulinet.h

    r945 r984  
    3434#include "jsapi.h"
    3535#endif
    36 #include "fcgi_stdio.h"
    3736#include <stdlib.h>
    3837#include <fcntl.h>
  • trunk/zoo-project/zoo-kernel/zoo_service_loader.c

    r982 r984  
    18861886  FILE *f0, *f1;
    18871887  HINTERNET hInternet;
    1888   service *s1;
     1888  service *s1=NULL;
    18891889  maps *request_output_real_format = NULL;
    18901890  maps *request_input_real_format = NULL;
     
    25522552      printf("\n");
    25532553      fflush(stdout);
     2554      json_object_put(res);
    25542555    }
    25552556    //return 1;
     
    34533454#else
    34543455      recordResponse(m,fbkp1);
     3456#ifdef USE_CALLBACK
    34553457      if (eres == SERVICE_SUCCEEDED)
    3456 #ifdef USE_CALLBACK
    34573458        invokeCallback(m,NULL,request_output_real_format,6,0);
    34583459#endif
     
    34933494#endif
    34943495  }
    3495  
    3496   freeService (&s1);
    3497   free (s1);
     3496
     3497  if(s1!=NULL){
     3498    freeService (&s1);
     3499    free (s1);
     3500  }
    34983501  freeMaps (&m);
    34993502  free (m);
  • trunk/zoo-project/zoo-services/ogr/base-vect-ops/service.c

    r917 r984  
    3838#include "service_internal.h"
    3939
    40 extern "C" {
    4140#include <libxml/tree.h>
    4241#include <libxml/parser.h>
     
    4443#include <libxml/xpathInternals.h>
    4544
    46 /*#include <openssl/sha.h>
    47 #include <openssl/hmac.h>
    48 #include <openssl/evp.h>
    49 #include <openssl/bio.h>
    50 #include <openssl/buffer.h>
    51 */
     45extern "C" {
    5246
    5347  void printExceptionReportResponse(maps*,map*);
  • trunk/zoo-project/zoo-services/utils/open-api/templates/index.html

    r967 r984  
    1818#import json
    1919#if "cache_file" in $inputs["tmpl"]
    20 #set values=json.load(open($inputs["tmpl"]["cache_file"]))
     20#set values=json.load(open($inputs["tmpl"]["cache_file"], encoding='utf-8'))
    2121#else
    22 #set values=$inputs["tmpl"]["value"]
     22#set values=json.loads($inputs["tmpl"]["value"])
    2323#end if
    2424#except Exception as e
    2525$e
     26#set values={}
    2627#end try
    2728<html lang="en">
     
    202203 #end if
    203204#end if
    204 #if $obj["maxOccurs"]>1
     205#if $obj["maxOccurs"]=="unbounded" or $obj["maxOccurs"]>1
    205206        <div class="btn-group" role="group" aria-label="Basic example">
    206207          <button type="button" class="btn btn-secondary" onclick="addElementToList(\$(this));">Add</button>
     
    525526      <hr>
    526527      <address>$openapi["openapi"]["rootUrl"]$(currentUrl).html</address>
    527       <!-- hhmts start -->Last modified: Wed Dec 16 16:06:56 CET 2020 <!-- hhmts end -->
     528      <!-- hhmts start -->Last modified: Mon Mar  1 17:01:50 CET 2021 <!-- hhmts end -->
    528529    </main>
    529530#if $currentKey=="root"
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