IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 35402


Ignore:
Timestamp:
Apr 16, 2013, 6:27:02 AM (13 years ago)
Author:
eugene
Message:

add error handling for dvopsps skytable; add config entry for memory usage for memory db tables; add / fix version parsing; error handling for xmllint; error handline for dvograbber (unused); set max_heap_table_size before creating memory tables; add error handling for dvopsps objects; break on error from dvopsps detections; do not try to populate Chip table unless it exists; skip batch on failure, but continue to load

Location:
branches/eam_branches/ipp-20130307/ippToPsps/jython
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20130307/ippToPsps/jython/batch.py

    r35352 r35402  
    276276            p = Popen(cmd, shell=True, stdout=PIPE)
    277277            p.wait()
     278            if p.returncode != 0:
     279                self.logger.errorPair("error running xmllint for ", tmpPath)
     280                raise
    278281        except:
    279282            self.logger.errorPair("Popen failed", cmd)
     
    301304        p = Popen(cmd, shell=True, stdout=PIPE)
    302305        p.wait()
    303 
    304306        if p.returncode != 0:
    305307            self.logger.errorPair("tar command", "failed")
     
    311313        p = Popen(cmd, shell=True, stdout=PIPE)
    312314        p.wait()
    313 
    314315        if p.returncode != 0:
    315316            self.logger.errorPair("gzip command", "failed")
     
    519520        p = Popen(cmd, shell=True, stdout=PIPE)
    520521        p.wait()
     522        if p.returncode != 0:
     523            self.logger.errorPair("dvograbber command", "failed")
     524            return False
    521525
    522526        rowCount = self.scratchDb.getRowCount("dvoDetection")
  • branches/eam_branches/ipp-20130307/ippToPsps/jython/config.py

    r35352 r35402  
    6666        self.czarPlotsPath = self.settingsDoc.find("czarPlotsPath").text
    6767
    68 
    69 
    7068        # print "config.programName: ", self.programName
    7169        # print "config.configDir: ", self.configDir
     
    125123            return self.settingsDoc.find(dbType +"/password").text
    126124
     125    def getDbMemory(self, dbType):
     126        if dbType == 'localdatabase' or dbType == 'localdatabase_test':
     127            return self.scratchDbLeaf.find('memory').text
     128        else:
     129            print "memory is not a valid option for non-scratch databases..."
     130            raise
     131
    127132    def setScratchDbLeaf(self, myhost):
    128133        root = self.settingsDoc.getroot()
  • branches/eam_branches/ipp-20130307/ippToPsps/jython/datastore.py

    r35097 r35402  
    4747                    --list " + tempFile.name
    4848
     49        print "dsreg cmd: ", command
    4950        p = Popen(command, shell=True, stdout=PIPE)
    5051        p.wait()
  • branches/eam_branches/ipp-20130307/ippToPsps/jython/detectionbatch.py

    r35369 r35402  
    909909                    return False
    910910
    911         if self.populatePspsTablesChip("Chip", 0, 0, results, tables): otaCount = otaCount + 1
    912 
    913         if self.skipBatch:
    914             self.logger.error("fatal problem for exposure, skipping")
    915             return False
     911        if "Chip" in self.imageIDs:
     912            if self.populatePspsTablesChip("Chip", 0, 0, results, tables): otaCount = otaCount + 1
     913            if self.skipBatch:
     914                self.logger.error("fatal problem for exposure, skipping")
     915                return False
    916916
    917917        # print totals
     
    926926        self.logger.info("+-------+---------------+---------------+---------------+---------------+---------------+---------------+")
    927927
    928         # if we only have one table export, i.e. FrameMeta, then get out of here
     928        # if we only have one table export, i.e. FrameMeta, then get out of here (skip batch, but do not abort)
    929929        if len(self.tablesToExport) == 1:
    930            
     930            self.skipBatch = True
    931931            self.logger.error("No tables to export")
    932932            return False
  • branches/eam_branches/ipp-20130307/ippToPsps/jython/dvo.py

    r35352 r35402  
    193193            p = Popen(cmd, shell=True, stdout=PIPE)
    194194            p.wait()
     195            if p.returncode != 0:
     196                self.logger.errorPair("dvopsps failed on SkyTable.fits for ", self.skychunk.dvoLocation)
     197                raise
    195198
    196199        self.logger.infoPair("Adding index to", self.scratchDb.dvoSkyTable)
  • branches/eam_branches/ipp-20130307/ippToPsps/jython/dvoobjects.py

    r35223 r35402  
    6767
    6868        if self.skychunk.parallel:
     69            if self.scratchDb.dbHost == "localhost":
     70                self.logger.info("dvopsps objects -parallel is incompatible with localhost for scratchdb")
     71                raise
     72               
    6973            cmd += " -parallel"
    7074
     
    7276        p = Popen(cmd, shell=True, stdout=PIPE)
    7377        p.wait()
     78        if p.returncode != 0:
     79            self.logger.errorPair("dvopsps failed on ", region)
     80            raise
    7481
    7582        # update lists after attempted sync
  • branches/eam_branches/ipp-20130307/ippToPsps/jython/loader.py

    r35352 r35402  
    198198                            # insertion
    199199                            if not self.ippToPspsDb.isBoxIngested(boxId, self.scratchDb.dbHost):
    200                                 self.dvoDetections.nativeIngestDetections(boxId, boxDim)
     200                                if not self.dvoDetections.nativeIngestDetections(boxId, boxDim):
     201                                    self.logger.error("Unable to ingest detections with nativeIngest")
     202                                    return False
    201203
    202204                            useFullTables = 1
  • branches/eam_branches/ipp-20130307/ippToPsps/jython/mysql.py

    r35352 r35402  
    5555            rs.first()
    5656            fullVersion = rs.getString(1)
    57             self.version = fullVersion[0:3]
     57            majVersion = fullVersion[0:3]
     58            self.version = float(majVersion)
    5859           
    5960        except:
     
    6162            raise
    6263
    63         # print "version number: ", self.version
    6464        self.connected = True
    6565
  • branches/eam_branches/ipp-20130307/ippToPsps/jython/scratchdb.py

    r35369 r35402  
    3838        self.dvoSkyTable = "dvoSkyTable"
    3939        self.dvoPhotcodesTable = "dvoPhotcodes"
     40        self.memoryTableSize = config.getDbMemory(dbType)
    4041
    4142    '''
     
    509510       self.dropTable(self.dvoDetectionTable)
    510511
     512       # we need a big enough memory table for the incoming detections
     513       print "requested memory in gigs: ", self.memoryTableSize
     514       tableSize = int(self.memoryTableSize) * 1024 * 1024 * 1024
     515       sql = "set @@max_heap_table_size = " + str(tableSize)
     516       print "setting max heap size: ", sql
     517       try: self.execute(sql)
     518       except:
     519           self.logger.errorPair("Unable to set max MEMORY table size for ", self.dvoDetectionTable)
     520           return False
     521
    511522       # create detections table
    512523       self.logger.infoPair("Creating table", self.dvoDetectionTable)
Note: See TracChangeset for help on using the changeset viewer.