From 2d3ef71658d648c5070570ce51b6d4d540c7eb11 Mon Sep 17 00:00:00 2001 From: Dacheng Xu Date: Fri, 21 Feb 2025 14:03:12 -0500 Subject: [PATCH] Assign `GLIDEIN_Site` if `site_only` (#268) --- outsource/config.py | 3 ++- outsource/submitter.py | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/outsource/config.py b/outsource/config.py index 6e846e7..ff30d06 100644 --- a/outsource/config.py +++ b/outsource/config.py @@ -121,10 +121,11 @@ def __init__(self, context, run_id, ignore_processed=False): self.rse_constraints[rse]["expr"] = US_ONLY_REQUIREMENTS for rse in EU_RSES: self.rse_constraints.setdefault(rse, {}) - if EU_ONLY: + if EU_ONLY and not SITE_ONLY: self.rse_constraints[rse]["expr"] = EU_ONLY_REQUIREMENTS self.rse_constraints[rse]["rank"] = EU_RANK if SITE_ONLY and rse in RSE_SITE_MAP: + self.rse_constraints[rse]["expr"] = f'GLIDEIN_Site == "{RSE_SITE_MAP[rse]}"' self.rse_constraints[rse]["site"] = RSE_SITE_MAP[rse] self.context = context diff --git a/outsource/submitter.py b/outsource/submitter.py index d2766c9..1a05a00 100644 --- a/outsource/submitter.py +++ b/outsource/submitter.py @@ -659,6 +659,16 @@ def add_lower_processing_job( disk=level["disk"][job_i], ) if desired_sites: + # Give a hint to glideinWMS for the sites we want + # (mostly useful for XENON VO in Europe). + # Glideinwms is the provisioning system. + # It starts pilot jobs (glideins) at sites when you have idle jobs in the queue. + # Most of the jobs you run to the OSPool (Open Science Pool), + # but you do have a few sites where you have allocations at, + # and those are labeled XENON VO (Virtual Organization). + # The "+" has to be used by non-standard HTCondor attributes. + # The attribute has to have double quotes, + # otherwise HTCondor will try to evaluate it as an expression. job.add_profiles(Namespace.CONDOR, "+XENON_DESIRED_Sites", f'"{desired_sites}"') job.add_profiles(Namespace.CONDOR, "requirements", requirements) job.add_profiles(Namespace.CONDOR, "priority", dbcfg.priority)