From 34ab44d914521d6d211bb86d8fd9db47070725d4 Mon Sep 17 00:00:00 2001 From: Adrien Faure Date: Tue, 19 Dec 2023 13:45:59 +0100 Subject: [PATCH] [modules/almigthy] same as master... --- oar/modules/almighty.py | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/oar/modules/almighty.py b/oar/modules/almighty.py index 6a50511a..8542ca21 100644 --- a/oar/modules/almighty.py +++ b/oar/modules/almighty.py @@ -23,9 +23,6 @@ import oar.lib.tools as tools from oar.lib.globals import get_logger, init_config -# TODO: should not be global -config = init_config() - # Everything is run by oar user (The real uid of this process.) os.environ["OARDO_UID"] = str(os.geteuid()) @@ -43,20 +40,18 @@ ) os.environ["OARDIR"] = binpath -meta_sched_command = config["META_SCHED_CMD"] -m = re.match(r"^\/", meta_sched_command) -if not m: - meta_sched_command = os.path.join(binpath, meta_sched_command) -if "LEON_COMMAND" in config: - leon_command = config["LEON_COMMAND"] -else: - leon_command = os.path.join(binpath, "oar-leon") +leon_command = os.path.join(binpath, "oar-leon") +check_for_villains_command = os.path.join(binpath, "oar-sarko") +check_for_node_changes = os.path.join(binpath, "oar-finaud") +nodeChangeState_command = os.path.join(binpath, "oar-node-change-state") -if "CHECK_FOR_VILLAINS_COMMAND" in config: - check_for_villains_command = config["CHECK_FOR_VILLAINS_COMMAND"] -else: - check_for_villains_command = os.path.join(binpath, "oar-sarko") +# Legacy OAR2 +# leon_command = binpath + 'Leon' +# check_for_villains_command = binpath + 'sarko' +# check_for_node_changes = binpath + 'finaud' +# nodeChangeState_command = binpath + 'NodeChangeState' +# nodeChangeState_command = 'true' proxy_appendice_command = os.path.join(binpath, "oar-appendice-proxy") bipbip_commander = os.path.join(binpath, "oar-bipbip-commander") @@ -197,13 +192,12 @@ def __init__(self): self.context = zmq.Context() self.appendice = self.context.socket(zmq.PULL) ip_addr_server = socket.gethostbyname(self.config["SERVER_HOSTNAME"]) - address_complete = "tcp://" + ip_addr_server + ":" + self.config["APPENDICE_SERVER_PORT"] try: self.appendice.bind( - address_complete + "tcp://" + ip_addr_server + ":" + self.config["APPENDICE_SERVER_PORT"] ) except Exception as e: - logger.error(f"Failed to activate appendice endpoint on {address_complete}: {e}") + logger.error(f"Failed to activate appendice endpoint: {e}") sys.exit(1) self.set_appendice_timeout(read_commands_timeout)