Skip to content
Snippets Groups Projects
Commit b0bb468f authored by Christoph Heidecker's avatar Christoph Heidecker
Browse files

Added functionality to connect to future buffering service for HTCondor information

parent 05e02343
Branches
Tags
1 merge request!1merge fixed unit tests into master branch
......@@ -6,6 +6,7 @@ from navix.replygenerator.create_reply import create_hpda_rank,\
add_hpda_requirement,\
add_classad_for_monitoring_to_reply
from navix.replygenerator.check_waiting_time import check_waiting_time_and_add_resources
from navix.replygenerator.htcondor_info import get_htcondor_information
#############################################################################################################
......@@ -65,6 +66,14 @@ class ComputeAndGenerateReply:
raise ValueError('Error while locating files via pyXrootD!'
+ 'ERROR: ' + str(err))
# get HTCondor information for advanced coordination of data and job
try:
htcondor_dict = get_htcondor_information(self.queue_logging, self.thread_num, self.settings)
except Exception as err:
raise ValueError('Error while getting additional information via HTCondor python bindings!'
+ 'ERROR: ' + str(err))
print(htcondor_dict)
self.queue_logging.put("DEBUG: " + str(self.thread_num) + ": Start generating response for hook")
self.queue_logging.put("DEBUG: " + str(self.thread_num) + ": Server found with weight and count of files: "
......
# from multiprocessing import Process, Queue
def get_htcondor_information(queue_logging, thread_num, settings):
"""
:param queue_logging:
:param thread_num:
:param settings:
:return:
dictionary containing additional information about the whole HTCondor system
"""
try:
queue_logging.put("DEBUG: " + str(thread_num)
+ ": Requesting information from buffering service for HTCondor")
return connect_to_htcondor_buffering_service(queue_logging, thread_num, settings)
except Exception as e:
queue_logging.put("ERROR: " + str(thread_num)
+ ": Something went wrong while requesting information from buffering service for HTCondor!"
+ "\n-> abort"
+ "\nPython-ERROR: " + str(e))
raise ValueError
def connect_to_htcondor_buffering_service(queue_logging, thread_num, settings):
"""
:param queue_logging:
:param thread_num:
:param settings:
:return:
asks NaviX buffering service for HTCondor information and writes all into a dictionary
"""
queue_logging.put("DEBUG: " + str(thread_num)
+ ": Generating request to buffering service for HTCondor")
htcondor_dict = dict()
# open connection to buffering service and
# try:
# htcondor_dict =
# except Exception as err:
# queue_logging.put("ERROR: " + str(thread_num)
# + ": Python-ERROR: " + str(err)
# + "\n -> Abort")
# raise ValueError(err)
return htcondor_dict
......@@ -5,6 +5,7 @@ from tests.Test_replygenerator_check_waiting_time import TestCheckWaitingTime
from tests.Test_replygenerator_generate_file_list import TestGenerateFileList
from tests.Test_common import TestCommon
from tests.Test_replygenerator_locate_files import TestLocateFiles
from tests.Test_replygenerator_htcondor_info import TestGetHtcondorInformation
from tests.Test_replygenerator_create_reply import TestCreateReply
from tests.Test_compile import TestCompile
from tests.Test_settings import TestSettings
......
from unittest import TestCase
from navix.logging import *
from tests.settings_for_test import SettingsForTesting as Settings
from navix.replygenerator.htcondor_info import get_htcondor_information, connect_to_htcondor_buffering_service
class TestGetHtcondorInformation(TestCase):
def setUp(self):
# log file path
log_file_s = 'NaviX_start_error.log'
# create logger
start_log = logging.getLogger(log_file_s)
start_log.setLevel(logging.DEBUG)
settings = Settings()
log = Logging()
self.thread_num = "TEST"
self.settings = settings
self.logger = log.queue_logging
self.htcondor_dict = dict()
return
def test_get_htcondor_information(self):
# TODO connect to the buffering service for HTCondor information!
return
get_htcondor_information
def test_connect_to_htcondor_buffering_service(self):
# TODO connect to the buffering service for HTCondor information!
return
connect_to_htcondor_buffering_service
......@@ -101,11 +101,11 @@ class TestLocateFiles(TestCase):
return
def test_get_location_of_files(self):
# TODO reuests pyxrootd and xrootd server!
# TODO request pyxrootd and xrootd server!
return
get_location_of_files
def test_search_for_files_pyxrootd(self):
# TODO reuests pyxrootd and xrootd server!
# TODO request pyxrootd and xrootd server!
return
search_for_files_pyxrootd
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment