File tree Expand file tree Collapse file tree 5 files changed +16
-192
lines changed
Expand file tree Collapse file tree 5 files changed +16
-192
lines changed Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -25,6 +25,3 @@ ${DEBUG} docker build --build-arg PYCLOWDER_PYTHON="-python3" --tag clowder/extr
2525${DEBUG} docker build --build-arg PYCLOWDER_PYTHON=" -python3" --tag clowder/extractors-wordcount:latest sample-extractors/wordcount
2626${DEBUG} docker build --build-arg PYCLOWDER_PYTHON=" -python3" --tag clowder/extractors-wordcount-simple-extractor:latest sample-extractors/wordcount-simple-extractor
2727${DEBUG} docker build --build-arg PYCLOWDER_PYTHON=" -python3" --tag clowder/extractors-wordcount-simple-r-extractor:latest sample-extractors/wordcount-simple-r-extractor
28-
29- # build contrib
30- ${DEBUG} docker build --tag clowder/extractors-monitor:latest contrib/monitor
Original file line number Diff line number Diff line change 3737import os
3838import pickle
3939import subprocess
40+ import sys
4041import time
4142import tempfile
4243import threading
@@ -808,10 +809,13 @@ def send_heartbeat(self):
808809 'queue' : self .rabbitmq_queue ,
809810 'extractor_info' : self .extractor_info
810811 }
812+ next_heartbeat = time .time ()
811813 while self .thread :
812814 try :
813- self .channel .basic_publish (exchange = 'extractors' , routing_key = '' , body = json .dumps (message ))
814- time .sleep (self .heartbeat )
815+ self .channel .connection .process_data_events ()
816+ if time .time () >= next_heartbeat :
817+ self .channel .basic_publish (exchange = 'extractors' , routing_key = '' , body = json .dumps (message ))
818+ next_heartbeat = time .time () + self .heartbeat
815819 except SystemExit :
816820 raise
817821 except KeyboardInterrupt :
@@ -820,6 +824,8 @@ def send_heartbeat(self):
820824 raise
821825 except Exception : # pylint: disable=broad-except
822826 logging .getLogger (__name__ ).exception ("Error while sending heartbeat." )
827+ sys .exit (- 1 )
828+ time .sleep (1 )
823829
824830
825831class RabbitMQHandler (Connector ):
Original file line number Diff line number Diff line change 3737fi
3838
3939# tag all images and push if needed
40- for i in pyclowder pyclowder-python3 extractors-monitor extractors- wordcount; do
40+ for i in pyclowder pyclowder-python3 extractors-wordcount; do
4141 for v in ${TAGS} ; do
4242 if [ " $v " != " latest" -o " $SERVER " != " " ]; then
4343 ${DEBUG} docker tag clowder/${i} :latest ${SERVER} clowder/${i} :${v}
4949# tag all images for onbuild and push if needed
5050for i in pyclowder extractors-binary-preview extractors-simple-extractor extractors-simple-r-extractor; do
5151 for j in " " " -python3" ; do
52- for v in ${VERSION } ; do
52+ for v in ${TAGS } ; do
5353 if [ " $v " != " latest" ]; then
54- ${DEBUG} docker tag clowder/${i} :onbuild ${SERVER} clowder/${i} :${v} -onbuild
55- ${DEBUG} docker push ${SERVER} clowder/${i} :${v} -onbuild
54+ ${DEBUG} docker tag clowder/${i}${j} :onbuild ${SERVER} clowder/${i}${j } :${v} -onbuild
55+ ${DEBUG} docker push ${SERVER} clowder/${i}${j} :${v} -onbuild
5656 elif [ " $SERVER " != " " ]; then
57- ${DEBUG} docker tag clowder/${i} :onbuild ${SERVER} clowder/${i} :onbuild
58- ${DEBUG} docker push ${SERVER} clowder/${i} :onbuild
57+ ${DEBUG} docker tag clowder/${i} {j} :onbuild ${SERVER} clowder/${i}${j } :onbuild
58+ ${DEBUG} docker push ${SERVER} clowder/${i}${j} :onbuild
5959 else
60- ${DEBUG} docker push clowder/${i} :onbuild
60+ ${DEBUG} docker tag clowder/${i}${j} :onbuild clowder/${i}${j} :onbuild
61+ ${DEBUG} docker push clowder/${i}${j} :onbuild
6162 fi
6263 done
6364 done
You can’t perform that action at this time.
0 commit comments