Changeset 907


Ignore:
Timestamp:
May 4, 2019, 3:36:37 PM (3 months ago)
Author:
djay
Message:

Fix typo. Define StdErr? from FinalizeHPC1 service. make sure to call removeShmLock in case it has been created by the GetStatus? service.

Location:
branches/prototype-v0/zoo-project/zoo-services
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • branches/prototype-v0/zoo-project/zoo-services/hello-mono/cgi-env/longProcessMono.zcfg

    r794 r907  
    11[longProcessMono]
    2  Title = Create a welcome message string.
    3  Abstract = Create a welcome string.
     2 Title = Demo long process.
     3 Abstract = This service doesn't do anything except taking its time, it demonstrates how to use the updateStatus function from your ZOO Service.
    44 processVersion = 2
    55 storeSupported = true
     
    1313   Title = Input string
    1414   Abstract = The name to display in the welcome message.
    15    minOccurs = 1
     15   minOccurs = 0
    1616   maxOccurs = 1
    1717   <LiteralData>
    1818    dataType = int
    19     <Default>
    20     AllowedValues = 101,202,303,404
    21     rangeMin = -100
    22     rangeMax = 100
    23     rangeSpacing = 1
    24     rangeClosure = co
    25       value = 11
    26     </Default>
    27     <Supported>
    28         AllowedValues = 405,502,503,504
    29     </Supported>
    30     <Supported>
    31         AllowedValues = 540,502,603,604
    32     </Supported>
     19    <Default />
    3320   </LiteralData>
    3421 </DataInputs>
  • branches/prototype-v0/zoo-project/zoo-services/utils/hpc/Makefile

    r854 r907  
    33CFLAGS=-I${INST_INCLUDE} ${ZOO_CFLAGS} ${XML2CFLAGS} ${GDAL_CFLAGS} ${PYTHONCFLAGS} -DLINUX_FREE_ISSUE #-DDEBUG
    44
    5 cgi-env/wps_hpc.zo: service.c
     5cgi-env/wps_hpc.zo: service.c service2.c
    66        g++ ${CFLAGS} -shared -fpic -o cgi-env/wps_hpc.zo service.c service2.c ${GDAL_LIBS} ${XML2LDFLAGS} ${MACOS_LD_FLAGS} ${ZOO_LDFLAGS} ${MACOS_LD_NET_FLAGS} ${XSLT_LDFLAGS} ${FCGI_LDFLAGS} -L${ZRPATH}/zoo-kernel/ -lzoo_service ${ZRPATH}/zoo-kernel/sshapi.o ${HPCLDFLAGS}
    77
  • branches/prototype-v0/zoo-project/zoo-services/utils/hpc/service.c

    r878 r907  
    269269    }
    270270    free(logPath);
    271     // Run scontrol to check if the service execution ended.
     271    // Run sacct to check if the service execution ended.
    272272    // Store all the informations returned by scontrol command as a cfg file to
    273273    // be parsed back by the ZOO-Kernel waiting for the execution of the remote
     
    277277    map* tmpMap=getMapFromMaps(conf,configId->value,"remote_command_opt");
    278278    char* command=(char*)malloc((126+strlen(tmpMap->value))*sizeof(char));
    279     sprintf(command,"sacct --format=%s -p | grep \"%s\" | sed \"s:||:|None|:g;s:||:|:g\"",tmpMap->value,jobid->value);   
     279    sprintf(command,"sacct --format=%s -p | grep \"%s\" | sed \"s:||:|None|:g;s:||:|None|:g\"",tmpMap->value,jobid->value);   
    280280    if(ssh_exec(conf,command,ssh_get_cnt(conf))==0){
    281281      free(command);
    282       setMapInMaps(conf,"lenv","message",_("Failed to run scontrol remotely"));
     282      setMapInMaps(conf,"lenv","message",_("Failed to run sacct remotely"));
    283283      // TODO: check status in db and if available continue in other case return SERVICE_FAILED
    284284      return SERVICE_FAILED;
     
    315315        }
    316316      }else{
     317        free(logPath);
    317318        setMapInMaps(conf,"lenv","message",_("Unable to access the downloaded execution log file"));
    318319        return SERVICE_FAILED;
    319320      }
     321    }
     322    tmpMap=getMapFromMaps(tmpMaps,"henv","JobId");
     323    if(tmpMap!=NULL){
     324      char* tmpStr=(char*)malloc((32)*sizeof(char));
     325      sprintf(tmpStr,"slurm-%s.out",tmpMap->value);
     326      addToMap(tmpMaps->content,"StdErr",tmpStr);
     327      free(tmpStr);
    320328    }
    321329    logPath=(char*)malloc((strlen(tmpPath->value)+strlen(jobid->value)+15)*sizeof(char));
  • branches/prototype-v0/zoo-project/zoo-services/utils/hpc/service2.c

    r862 r907  
    133133    if(unlink(fullpath)==0){
    134134      // TODO store the filename_full in the deletedfiles
    135       fprintf(stderr,"#### DeleteData #### %s %d %s has been successfully deleted\n",__FILE__,__LINE__,(strlen(filename)>0?filename:fullpath));
     135      fprintf(stderr,"#### DeleteData #### %s %d %s has been successfully deleted\n",__FILE__,__LINE__,(filename!=NULL && strlen(filename)>0?filename:fullpath));
    136136    }else{
    137137      fprintf(stderr,"#### DeleteData #### unable to delete %s %s \n",fullpath,fetchErrno(errno));
     
    155155    map* ioname=getMapFromMaps(inputs,"ioname","value");
    156156    char tmp0[4];
    157     sprintf(tmp0,"%c%c%c",filename->value[strlen(filename->value)-4],filename->value[strlen(filename->value)-3],filename->value[strlen(filename->value)-2]);
     157    sprintf(tmp0,"%c%c%c",filename->value[strlen(filename->value)-3],filename->value[strlen(filename->value)-2],filename->value[strlen(filename->value)-1]);
    158158    char *cfilename=NULL;
    159159    if(strcasecmp(tmp0,"zca")==0){
     
    208208        char tmp1[8];
    209209        snprintf(tmp1,7,"%s",filename->value);
    210         if(strcasecmp(tmp1,"output")==0 || strcasecmp(tmp1,"input_")==0){
    211           trydeletedatafile(tmppath->value,filename->value);
     210        if(strcasecmp(tmp1,"output")==0 || strstr(filename->value,".zca")!=NULL || strcasecmp(tmp1,"input_")==0){
     211          tryDeleteDataFile(tmpPath->value,filename->value);
    212212          char *tmp=zStrdup(filename->value);
    213213          tmp[strlen(tmp)-strlen(strrchr(tmp,'.'))]=0;
     
    254254          setMapInMaps(outputs,"Result","value",_ss("The output data has been correclty removed"));
    255255        }else{
    256           setMapInMaps(conf,"lenv","message",_ss("The file you try to delete is nor an input, nor and output."));
     256          setMapInMaps(conf,"lenv","message",_ss("The file you try to delete is nor an input, nor an output."));
    257257          unlockFile(conf,lck);
    258258          return SERVICE_FAILED;
  • branches/prototype-v0/zoo-project/zoo-services/utils/status/service.c

    r839 r907  
    7272      return SERVICE_FAILED;
    7373    }
     74    map tmpMap1=getMapFromMaps(conf,"lenv","semaphore")
     75    if(tmpMap1!=NULL && strcasecmp(tmpMap1->value,"Created")==0)
     76      removeShmLock(conf,1);
    7477    sprintf(xslFileName,"%s/updateStatus.xsl",tmpMmap->value);
    7578    xmlSubstituteEntitiesDefault(1);
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