Skip to content

Commit 4b08148

Browse files
committed
Ignore old batch system probes
1 parent 8d1faeb commit 4b08148

File tree

1 file changed

+8
-85
lines changed

1 file changed

+8
-85
lines changed

osg_configure/configure_modules/gratia.py

Lines changed: 8 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,10 @@
1919
__all__ = ['GratiaConfiguration']
2020

2121
GRATIA_CONFIG_FILES = {
22-
'condor': '/etc/gratia/condor/ProbeConfig',
23-
'sge': '/etc/gratia/sge/ProbeConfig',
24-
'lsf': '/etc/gratia/pbs-lsf/urCollector.conf',
25-
'pbs': '/etc/gratia/pbs-lsf/urCollector.conf',
26-
'slurm': '/etc/gratia/slurm/ProbeConfig',
2722
'htcondor-ce': '/etc/gratia/htcondor-ce/ProbeConfig'
2823
}
2924

30-
CE_PROBE_RPMS = ['gratia-probe-condor', 'gratia-probe-pbs-lsf', 'gratia-probe-sge',
31-
'gratia-probe-slurm', 'gratia-probe-htcondor-ce']
25+
CE_PROBE_RPMS = ['gratia-probe-htcondor-ce']
3226

3327

3428
def requirements_are_installed():
@@ -71,7 +65,8 @@ def __init__(self, *args, **kwargs):
7165
self._production_defaults = {'probes':
7266
'jobmanager:gratia-osg-prod.opensciencegrid.org:80'}
7367

74-
self._job_managers = ['pbs', 'sge', 'lsf', 'condor', 'slurm', 'htcondor-ce']
68+
self._job_managers = ['htcondor-ce']
69+
self._old_job_managers = ['pbs', 'sge', 'lsf', 'condor', 'slurm']
7570
self._probe_config = {}
7671
self.grid_group = 'OSG'
7772

@@ -118,71 +113,7 @@ def parse_configuration(self, configuration):
118113
# grab configuration information for various jobmanagers
119114
probes_iter = self.get_installed_probe_config_files().keys()
120115
for probe in probes_iter:
121-
if probe == 'condor':
122-
self._probe_config['condor'] = {'condor_location':
123-
CondorConfiguration.get_condor_location(configuration),
124-
'condor_config':
125-
CondorConfiguration.get_condor_config(configuration)}
126-
elif probe == 'pbs':
127-
if BaseConfiguration.section_disabled(configuration, 'PBS'):
128-
# if the PBS jobmanager is disabled, the CE is probably using LSF
129-
# in any case, setting up the pbs gratia probe is not useful
130-
continue
131-
log_option = configfile.Option(name='log_directory',
132-
required=configfile.Option.OPTIONAL,
133-
default_value='')
134-
configfile.get_option(configuration, 'PBS', log_option)
135-
self._probe_config['pbs'] = {'log_directory': log_option.value}
136-
137-
accounting_log_option = configfile.Option(name='accounting_log_directory',
138-
required=configfile.Option.OPTIONAL,
139-
default_value='')
140-
configfile.get_option(configuration, 'PBS', accounting_log_option)
141-
self._probe_config['pbs'] = {'accounting_log_directory': accounting_log_option.value}
142-
elif probe == 'lsf':
143-
if BaseConfiguration.section_disabled(configuration, 'LSF'):
144-
# if the LSF jobmanager is disabled, the CE is probably using PBS
145-
# in any case, setting up the pbs gratia probe is not useful
146-
continue
147-
lsf_location = configfile.Option(name='lsf_location',
148-
default_value='/usr/bin')
149-
configfile.get_option(configuration, 'LSF', lsf_location)
150-
self._probe_config['lsf'] = {'lsf_location': lsf_location.value}
151-
152-
log_option = configfile.Option(name='log_directory',
153-
required=configfile.Option.OPTIONAL,
154-
default_value='')
155-
configfile.get_option(configuration, 'LSF', log_option)
156-
self._probe_config['lsf']['log_directory'] = log_option.value
157-
elif probe == 'sge':
158-
if BaseConfiguration.section_disabled(configuration, 'SGE'):
159-
# if section is disabled then the following code won't work
160-
# since the parse_configuration will short circuit, so
161-
# give a warning and then move on
162-
self.log("Skipping SGE gratia probe configuration since SGE is disabled",
163-
level=logging.WARNING)
164-
continue
165-
sge_config = SGEConfiguration(logger=self.logger)
166-
sge_config.parse_configuration(configuration)
167-
self._probe_config['sge'] = {'sge_accounting_file': sge_config.get_accounting_file()}
168-
elif probe == 'slurm':
169-
if BaseConfiguration.section_disabled(configuration, 'SLURM'):
170-
# if section is disabled then the following code won't work
171-
# since the parse_configuration will short circuit, so
172-
# give a warning and then move on
173-
self.log("Skipping Slurm gratia probe configuration since Slurm is disabled",
174-
level=logging.WARNING)
175-
continue
176-
slurm_config = SlurmConfiguration(logger=self.logger)
177-
slurm_config.parse_configuration(configuration)
178-
self._probe_config['slurm'] = {'db_host': slurm_config.get_db_host(),
179-
'db_port': slurm_config.get_db_port(),
180-
'db_user': slurm_config.get_db_user(),
181-
'db_pass': slurm_config.get_db_pass(),
182-
'db_name': slurm_config.get_db_name(),
183-
'cluster': slurm_config.get_slurm_cluster(),
184-
'location': slurm_config.get_location()}
185-
elif probe == 'htcondor-ce':
116+
if probe == 'htcondor-ce':
186117
self._probe_config['htcondor-ce'] = {}
187118

188119
self.get_options(configuration,
@@ -241,7 +172,9 @@ def configure(self, attributes):
241172
probe_config_files = self.get_installed_probe_config_files()
242173
probes_iter = probe_config_files.keys()
243174
for probe in probes_iter:
244-
if probe in self._job_managers:
175+
if probe in self._old_job_managers:
176+
continue
177+
elif probe in self._job_managers:
245178
if probe not in self._probe_config:
246179
# Probe is installed but we don't have configuration for it
247180
# might be due to pbs-lsf probe sharing or relevant job
@@ -265,17 +198,7 @@ def configure(self, attributes):
265198
local_resource=self.options['resource'].value,
266199
local_host=hostname
267200
)
268-
if probe == 'condor':
269-
self._configure_condor_probe()
270-
elif probe == 'pbs':
271-
self._configure_pbs_probe()
272-
elif probe == 'lsf':
273-
self._configure_lsf_probe()
274-
elif probe == 'sge':
275-
self._configure_sge_probe()
276-
elif probe == 'slurm':
277-
self._configure_slurm_probe()
278-
elif probe == 'htcondor-ce':
201+
if probe == 'htcondor-ce':
279202
self._configure_htcondor_ce_probe()
280203

281204
self.log("GratiaConfiguration.configure completed")

0 commit comments

Comments
 (0)