From 11cfbe2ebe9eaa3b8e4f9f19952507bf66057801 Mon Sep 17 00:00:00 2001
From: Sophie Hourihane <sophie.hourihane@ligo.org>
Date: Fri, 24 May 2024 15:39:54 -0700
Subject: [PATCH] removing HAS_LIGO_FRAMES requirement for osg-deploy jobs and
 add use_oauth_services to bayeswave_clean_frames jobs

---
 .../bayeswave_pipe/bayeswave_pipe_utils.py     | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/BayesWaveUtils/bayeswave_pipe/bayeswave_pipe_utils.py b/BayesWaveUtils/bayeswave_pipe/bayeswave_pipe_utils.py
index 0bdbe20..3446bcb 100644
--- a/BayesWaveUtils/bayeswave_pipe/bayeswave_pipe_utils.py
+++ b/BayesWaveUtils/bayeswave_pipe/bayeswave_pipe_utils.py
@@ -1068,12 +1068,12 @@ def condor_job_config(job_type, condor_job, config_parser):
     #
     if config_parser.getboolean('condor', 'osg-deploy'):
         # --- Force downstream jobs to run locally
-        if job_type in ['bayeswave_post', 'bayeswave_fpeak', 'bayeswave_clean_frame',
+        if job_type in ['bayeswave_post', 'bayeswave_fpeak',
                          'megaplot.py']:
-            #requires.append("(GLIDEIN_SITE=?=undefined)")
             condor_job.add_condor_cmd('+flock_local', 'True')
             condor_job.add_condor_cmd('+DESIRED_Sites', '\"nogrid\"')
 
+        # bayeswave and bayeswave_clean_frame jobs should run non-locally since they need access to frames
         else:
             try:
                 condor_job.add_condor_cmd('+DESIRED_Sites',
@@ -1086,21 +1086,19 @@ def condor_job_config(job_type, condor_job, config_parser):
             except configparser.NoOptionError:
                 pass
 
-            # Ensure LIGO data is present 
-            if not config_parser.getboolean('datafind','sim-data'):
-                requires.append("(HAS_LIGO_FRAMES=?=TRUE)")
+            # only should have LIGO frames if we are not deploying on IGWN-pool
+            # # Ensure LIGO data is present
+            # if not config_parser.getboolean('datafind','sim-data'):
+            #     requires.append("(HAS_LIGO_FRAMES=?=TRUE)")
+
             #
             # Accounting configurations
             #
-            workdir = os.getcwd()
             if not config_parser.getboolean('condor','scitoken-auth'):
                 x509 = x509_manipulation(os.getcwd())
                 condor_job.add_condor_cmd('x509userproxy', x509)
-            else: # add stuff forusing scitokens
+            else: # add stuff for using scitokens
                 condor_job.add_condor_cmd('use_oauth_services','igwn') # TODO -- would this ever need to be anything else?
-                condor_job.add_condor_cmd('igwn_oauth_permissions','read:/ligo')
-                
-
 
     try:
         condor_job.add_condor_cmd('accounting_group',
-- 
GitLab