#"-zap_chans", str(400), str(410),
                           #"-zap_chans", str(435), str(455),
                           "-detect_thresh", str(opts.thresh), "-output_dir", outdir])
    #subprocess.check_call(['chown','-R','50000:50000',str(outdir)]) # old pulsar account
    # need to chown and chmod to pulsar group
    subprocess.check_call(['chown','-R','4875:6850',str(outdir)]) 
    subprocess.check_call(['chmod','-R','g=u',str(outdir)])

if __name__ == "__main__":
    from optparse import OptionParser
    parser = OptionParser()
    PP.add_pika_process_opts(parser)
    parser.add_option("-d","--lowdm",dest='lodm',default=0.0)
    parser.add_option("-D","--highdm",dest='hidm',default=2000.0)
    parser.add_option("-T","--thresh",dest='thresh',default=8.0)
    (opts,args) = parser.parse_args()
    processor = PP.pika_process_from_opts(opts)
    processor.process(lambda message: on_message(message, opts))

''' optparse!!!

rabbitMQ/pikaURL pw username host port (and default) DONE
queue names DONE
heimdall xtra args: DONE
atexit, at fail put file back to input queue
fix gpu=0 !!!
kubectl get all
kubectl describe service rabbitmq
kubectl get services
'''
예제 #2
0
def consume_from_rabbit(opts):
    # Consume message from RabbitMQ
    processor = pika_process.pika_process_from_opts(opts)
    processor.process(lambda message: receive_and_make_peasoup_args(message,opts))
                                  cwd=info["output_path"])

    #except subprocess.CalledProcessError:
    #    log.info("Partial file exists. Removing and creating a new one....")
    #    subprocess.check_call("rm %s/%s"%(info['output_path'],info['filename']),shell=True)
    #    print ("rm %s/%s"%(info['output_path'],info['filename']))
    #    subprocess.check_call(digifil_script,shell=True)
    # Publish to Rabbit
    #pika_process.publish_info(opts,info)

    except Exception as e:
        log.error("Merge and failed for %s in path %s" %
                  (prepfold_script, info['output_path']))
        log.error(e)


if __name__ == "__main__":

    # Update all input arguments
    consume_parser = optparse.OptionParser()
    pika_process.add_pika_process_opts(consume_parser)
    opts, args = consume_parser.parse_args()

    # Setup logging config
    log_type = opts.log_level
    log.setLevel(log_type.upper())

    #Consume message from RabbitMQ
    processor = pika_process.pika_process_from_opts(opts)
    processor.process(lambda message: receive_and_merge(message, opts))