IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 2, 2007, 6:03:37 PM (19 years ago)
Author:
jhoblitt
Message:

get a list of DataStores from pztool and poll them with pzgetexp

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTasks/summit.copy.pro

    r15170 r15173  
    11## PanTasks scripts for Summit Copy
    22
    3 #$uri        = http://otis/ds/skyprobe/
    4 #$uri        = http://otis4.ifa.hawaii.edu/ds/allskycam/
    5 #$camera     = allskycam
    6 #$telescope  = zl
    7 #$workdir    = /data/ipp004.0/allskycam
    8 #$workdir    = /data/ipp006.0/gpc1
     3# pztool -adddatastore -inst isp -telescope ps1 -uri http://otis1.ifa.hawaii.edu/ds/skyprobe/index.txt
     4# pztool -adddatastore -inst gpc1 -telescope ps1 -uri http://conductor/ds/gpc1/index.txt
     5# pztool -adddatastore -inst allskycam -telescope ps1 -uri  http://otis1.ifa.hawaii.edu/ds/allskycam/index.txt
     6
    97$workdir    = /export/ipp010.0/
    108
     
    1816end
    1917
    20 # book for summit exps that need to be queried
     18# list of DataStores to pull data from
     19book init pzDataStore
     20# list of summit exps that need to be queried
    2121book init pzPendingExp
    22 # book for summit imfiles that need to be downloaded
     22# list of summit imfiles that need to be downloaded
    2323book init pzPendingImfile
    2424
     25# build a book of datastores to poll for data
     26task pztool.datastore
     27    command      pztool -datastore
     28    host         local
     29
     30    # timeout shorter than exec so jobs do not build up
     31    periods      -exec     15
     32    periods      -poll     1
     33    periods      -timeout  15
     34
     35    # success
     36    task.exit 0
     37        # flush pzDataStore book
     38        book init pzDataStore
     39        # convert 'stdout' to book format
     40        ipptool2book stdout pzDataStore -key camera:telescope -uniq
     41    end
     42
     43    task.exit default
     44        showcommand failure
     45    end
     46    task.exit timeout
     47        showcommand timeout
     48    end
     49end
     50
     51$datastore_index = 0
     52
    2553# run pzgetexp periodically to populate pzPendingExp in the database (no I/O)
    26 task pzgetexp.gpc1
     54task pzgetexp
    2755  # timeout shorter than exec so jobs do not build up
    28   periods      -exec     15
     56  periods      -exec     10
    2957  periods      -poll     1
    30   periods      -timeout  15
     58  periods      -timeout  5
    3159  host         local
    3260
    3361  task.exec
    34       $uri        = http://conductor/ds/gpc1/index.txt
    35       $camera     = gpc1
    36       $telescope  = ps1
    37 
    38         $run = pzgetexp -uri $uri -inst $camera -telescope $telescope
    39 #        echo command $run
     62        # find an exp that needs imfiles fetched
     63        book getpage pzDataStore $datastore_index -var pageName
     64        if ("$pageName" == "NULL") break
     65
     66        # increment our pzDataStore index and loop back to 0 and the end of the
     67        # book
     68        $datastore_index ++
     69        book npages pzDataStore -var npages
     70        if ($datastore_index == $npages )
     71            $datastore_index = 0
     72        end
     73
     74        book getword pzDataStore $pageName camera -var CAMERA
     75        book getword pzDataStore $pageName telescope -var TELESCOPE
     76        book getword pzDataStore $pageName uri -var URI
     77
     78        # store the current page
     79        options $pageName
     80
     81        $run = pzgetexp -uri $URI -inst $CAMERA -telescope $TELESCOPE
     82
     83        # create the command line
     84        if ($VERBOSE > 1)
     85          echo command $run
     86        end
     87
    4088        command $run
    4189  end
    42 
    43   task.exit     0
    44   end
    45 
    46   task.exit     default
    47     showcommand failure
    48   end
    49   task.exit     timeout
    50     showcommand timeout
    51   end
    52 end
    53 
    54 task pzgetexp.allskycam
    55   # timeout shorter than exec so jobs do not build up
    56   periods      -exec     15
    57   periods      -poll     1
    58   periods      -timeout  15
    59   host         local
    60 
    61   task.exec
    62       $uri        = http://otis1.ifa.hawaii.edu/ds/allskycam/index.txt
    63       $camera     = allskycam
    64       $telescope  = ps1
    65         $run = pzgetexp -uri $uri -inst $camera -telescope $telescope
    66 #        echo command $run
    67         command $run
    68   end
    69 
    70 
    71   task.exit     0
    72   end
    73 
    74   task.exit     default
    75     showcommand failure
    76   end
    77   task.exit     timeout
    78     showcommand timeout
    79   end
    80 end
    81 
    82 task pzgetexp.isp
    83   # timeout shorter than exec so jobs do not build up
    84   periods      -exec     15
    85   periods      -poll     1
    86   periods      -timeout  15
    87   host         local
    88 
    89   task.exec
    90       $uri        = http://otis1.ifa.hawaii.edu/ds/skyprobe/index.txt
    91       $camera     = isp
    92       $telescope  = ps1
    93         $run = pzgetexp -uri $uri -inst $camera -telescope $telescope
    94 #        echo command $run
    95         command $run
    96   end
    97 
    9890
    9991  task.exit     0
Note: See TracChangeset for help on using the changeset viewer.