Revision 14 -
(download)
(as text)
(annotate)
Mon Oct 8 09:46:28 2012 UTC
(11 years, 9 months ago)
by agomez File size: 1353 byte(s)
New license from GPL to Apache
Cleaning some files that are not used.
#!/usr/bin/python
#
# BonFIRE Virtual Clusters on Federated Clouds Demonstration Kit
#
# Copyright (c) Fundacion Centro Tecnologico de Supercomputacion de Galicia 2012
#
# License Apache Software
#
# The research leading to these results has received funding from
# the European Community's Seventh Framework Programme (FP7/2007-2013)
# under agreement number 257386
#
# This software is provided with ABSOLUTELY NO WARRANTY
#
import socket
import bonfire
import ogs
import sys
import time
import vcutil
from logger import log,configure
if len(sys.argv) >1:
configure(logfile = sys.argv[1], debug=True, console=False)
else:
configure(debug=True, console=True)
default_bonfire = "/etc/default/bonfire"
bonfire.read_defaults(default_bonfire)
log.info("Bonfire URI: %s" % bonfire.uri)
log.info("Credentials: %s:%s" % (bonfire.user,bonfire.password,))
log.info("Experiment: %s" % bonfire.experiment_id)
while True:
try:
log.info("Get hostname")
hostname = socket.gethostname()
log.info("I am %s" % hostname)
#Check if it is registered
log.info("Get hosts")
hosts = ogs.get_execution_hosts()
log.debug(hosts)
if hostname in hosts:
log.info("Starting execd")
ogs.start_execd()
break
except Exception as excpt:
log.exception(excpt)
time.sleep(20)