Ignore:
Timestamp:
Aug 16, 2018, 8:00:56 AM (6 years ago)
Author:
djay
Message:

Fixes for supporting properly the memory=protect which force the ZOO-Kernel to not store any downloaded files in memory. Add footer to the HPC support. Fix the autotools to build service_json and sshapi only when required so, when HPC support is activated, this also avoid adding too much dependencies at compilation time. Store md5 of the downloaded files to avoid uploading on HPC server the same file more than once, in case the md5 correspond.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/prototype-v0/zoo-project/zoo-kernel/zoo_service_loader.c

    r873 r877  
    6868#ifdef WIN32
    6969#include "caching.h"
     70extern wchar_t**_wenviron;
    7071#endif
    7172
     
    111112#include <dirent.h>
    112113#include <signal.h>
     114#ifndef WIN32
    113115#include <execinfo.h>
     116#endif
    114117#include <unistd.h>
    115118#ifndef WIN32
     
    365368              fflush (stderr);
    366369  #endif
    367               inheritance(r,&s1);
     370              if(s1!=NULL)
     371                inheritance(r,&s1);
    368372              func (r, m, doc, n, s1);
    369373              freeService (&s1);
     
    14491453            r_inputs = NULL;
    14501454            r_inputs = getMap (request_inputs, "version");
     1455#ifdef DEBUG
    14511456            fprintf(stderr," ** DEBUG %s %d \n",__FILE__,__LINE__);
    14521457            fflush(stderr);
     1458#endif
    14531459            xmlNodePtr n = printWPSHeader(doc,m,"DescribeProcess",
    14541460                                          root_nodes[vid][1],(version!=NULL?version->value:"1.0.0"),1);
     
    16281634                        hasVal = 1;
    16291635                        setMapInMaps (m, "lenv", "level", "0");
    1630                         /*
    1631                           #ifdef META_DB
    1632                           }
    1633                           #endif
    1634                         */
    16351636                      }
    16361637                    else
     
    17261727                                  addNestedOutputs(&s1);
    17271728#endif
    1728                                   json_object* jobj=serviceToJson(s1);
     1729                                  /*json_object* jobj=serviceToJson(s1);
    17291730                                  const char* jsonStr=json_object_to_json_string_ext(jobj,JSON_C_TO_STRING_PLAIN);
    1730                                   fprintf(stderr,"*** %s %d %s \n",__FILE__,__LINE__,jsonStr);
     1731                                  fprintf(stderr,"*** %s %d %s \n",__FILE__,__LINE__,jsonStr);*/
    17311732
    17321733                                  printDescribeProcessForProcess (zooRegistry,m, doc, n, s1);
     
    19421943    dup2 (fileno (stderr), fileno (stdout));
    19431944    t = readServiceFile (m, tmps1, &s1, r_inputs->value);
    1944     inheritance(zooRegistry,&s1);
     1945    fprintf(stderr,"%d %s %d",t,__FILE__,__LINE__);
     1946    fflush(stderr);
     1947    if(t>=0){
     1948      inheritance(zooRegistry,&s1);
    19451949#ifdef USE_HPC
    1946     addNestedOutputs(&s1);
    1947 #endif
     1950      addNestedOutputs(&s1);
     1951#endif
     1952    }
    19481953    if(zooRegistry!=NULL){
    19491954      freeRegistry(&zooRegistry);
     
    22542259#endif
    22552260  int ei = 1;
    2256   char **orig =
     2261 
    22572262#ifdef WIN32
    2258     GetEnvironmentStrings()
     2263  LPVOID orig = GetEnvironmentStrings();
     2264  LPTSTR s = (LPTSTR) orig;
    22592265#else
    2260     environ
    2261 #endif
    2262     ;
     2266  char **orig = environ;
    22632267  char *s=*orig;
     2268#endif
     2269
    22642270  _tmpMaps = createMaps("renv");
    22652271  for (; s; ei++) {
     
    22772283      free(tmpName);
    22782284    }
     2285#ifdef WIN32
     2286    s++;
     2287#else
    22792288    s = *(orig+ei);
     2289#endif
    22802290  }
    22812291  if(_tmpMaps->content!=NULL && getMap(_tmpMaps->content,"HTTP_COOKIE")!=NULL){
     
    22852295  freeMaps (&_tmpMaps);
    22862296  free (_tmpMaps);
     2297 
    22872298  if(postRequest!=NULL)
    22882299    setMapInMaps (m, "renv", "xrequest", postRequest->value);
     
    23352346        return -1;
    23362347      }
     2348      map* testMap=getMapFromMaps(m,"main","memory");
     2349      if(testMap!=NULL && strcasecmp(testMap->value,"load")!=0)
     2350        dumpMapsValuesToFiles(&m,&request_input_real_format);
    23372351      loadServiceAndRun (&m, s1, request_inputs, &request_input_real_format,
    23382352                         &request_output_real_format, &eres);
     
    23792393      else if (pid == 0)
    23802394        {
     2395          eres = SERVICE_ACCEPTED;
    23812396          //
    23822397          // son : have to close the stdout, stdin and stderr to let the parent
     
    24572472          recordServiceStatus(m);
    24582473#endif
     2474#ifdef USE_HPC
    24592475          invokeCallback(m,NULL,NULL,0,0);
     2476#endif
    24602477          if(vid==0){
    24612478            //
     
    24992516          free(flenv);
    25002517
     2518#ifdef USE_HPC
    25012519          invokeCallback(m,request_input_real_format,NULL,1,0);
     2520#endif
    25022521          if(validateRequest(&m,s1,request_inputs, &request_input_real_format,&request_output_real_format,&hInternet)<0){
    25032522            freeService (&s1);
     
    25142533#else
    25152534            recordResponse(m,fbkp1);
     2535#ifdef USE_HPC
    25162536            invokeCallback(m,NULL,NULL,7,0);
     2537#endif
    25172538#endif
    25182539            unlink (fbkpid);
     
    25392560          if(getMapFromMaps(m,"lenv","mapError")!=NULL){
    25402561            setMapInMaps(m,"lenv","message",_("Issue with geographic data"));
     2562#ifdef USE_HPC
    25412563            invokeCallback(m,NULL,NULL,7,0);
     2564#endif
    25422565            eres=-1;//SERVICE_FAILED;
    25432566          }else{
     2567            map* testMap=getMapFromMaps(m,"main","memory");
     2568            if(testMap!=NULL && strcasecmp(testMap->value,"load")!=0)
     2569              dumpMapsValuesToFiles(&m,&request_input_real_format);
    25442570            loadServiceAndRun (&m, s1, request_inputs,
    25452571                               &request_input_real_format,
     
    25672593  rewind(stdout);
    25682594
    2569   fprintf(stderr,"%s %d %d\n",__FILE__,__LINE__,eres);
     2595  //fprintf(stderr,"%s %d %d\n",__FILE__,__LINE__,eres);
    25702596
    25712597  if (eres != -1)
     
    25922618    {
    25932619      if (eres == SERVICE_SUCCEEDED)
     2620#ifdef USE_HPC
    25942621        invokeCallback(m,NULL,request_output_real_format,5,1);
    2595 
     2622#endif
    25962623      fflush(stderr);
    25972624      fflush(stdout);
     
    26222649      recordResponse(m,fbkp1);
    26232650      if (eres == SERVICE_SUCCEEDED)
     2651#ifdef USE_HPC
    26242652        invokeCallback(m,NULL,request_output_real_format,6,0);
     2653#endif
    26252654#endif
    26262655      freeMaps(&bmap);
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