From e3832516a99681bb08e87567b16890307f535f64 Mon Sep 17 00:00:00 2001 From: Brian Lin Date: Thu, 4 Nov 2021 12:54:55 -0500 Subject: [PATCH 1/3] Add OSPool specific ProbeConfig changes to the RPM (SOFTWARE-4841) --- rpm/osg-flock.spec | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/rpm/osg-flock.spec b/rpm/osg-flock.spec index 250615ec..7b105024 100644 --- a/rpm/osg-flock.spec +++ b/rpm/osg-flock.spec @@ -1,6 +1,6 @@ Name: osg-flock Version: 1.6 -Release: 2%{?dist} +Release: 3%{?dist} Summary: OSG configurations for a flocking host License: Apache 2.0 @@ -8,7 +8,7 @@ URL: https://opensciencegrid.org/docs/submit/osg-flock BuildArch: noarch -Requires: gratia-probe-condor-ap +Requires(post): gratia-probe-condor-ap Requires: condor Source0: %{name}-%{version}%{?gitrev:-%{gitrev}}.tar.gz @@ -32,6 +32,30 @@ install -m 644 rpm/80-osg-flocking.conf $RPM_BUILD_ROOT/%{_sysconfdir}/condor/co # Install gratia configuration install -d $RPM_BUILD_ROOT/%{_sysconfdir}/gratia/condor/ +%post +# Set OSPool specific Gratia probe config +probeconfig=/etc/gratia/condor-ap/ProbeConfig +overrides=( + 'SuppressGridLocalRecords="1"' + 'MapUnknownToGroup="1"' + 'MapGroupToRole="1"' + 'VOOverride="OSG"' +) + +for override in "${overrides[@]}"; do + key=${override%%=*} + if grep "$override" $probeconfig 2>&1 > /dev/null; then + # override already present + continue + elif grep "$key" $probeconfig 2>&1 > /dev/null; then + # config value already exists but is not overriden + sed -i -e "s/$key.*/$override/" $probeconfig + else + # config value doesn't exist + sed -i -e "s/\(EnableProbe.*\)/\1\n $override/" $probeconfig + fi +done + %clean rm -rf $RPM_BUILD_ROOT @@ -43,6 +67,10 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Thu Nov 4 2021 Brian Lin - 1.6-3 +- Append OSPool specific ProbeConfig changes in post-installation + (SOFTWARE-4846) + * Wed Oct 27 2021 Brian Lin 1.6-2 - Remove reference to old ProbeConfig From 494c4724ffad09a83ae486ffe6c990fc171ce927 Mon Sep 17 00:00:00 2001 From: Brian Lin Date: Thu, 4 Nov 2021 15:01:47 -0500 Subject: [PATCH 2/3] Do not override config values that are already set (SOFTWARE-4841) We want to avoid doing this as it would mean that the user would not be able to override any of the configs that we set this way --- rpm/osg-flock.spec | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/rpm/osg-flock.spec b/rpm/osg-flock.spec index 7b105024..12b8dc08 100644 --- a/rpm/osg-flock.spec +++ b/rpm/osg-flock.spec @@ -43,15 +43,11 @@ overrides=( ) for override in "${overrides[@]}"; do - key=${override%%=*} if grep "$override" $probeconfig 2>&1 > /dev/null; then # override already present continue - elif grep "$key" $probeconfig 2>&1 > /dev/null; then - # config value already exists but is not overriden - sed -i -e "s/$key.*/$override/" $probeconfig else - # config value doesn't exist + # add override if not present sed -i -e "s/\(EnableProbe.*\)/\1\n $override/" $probeconfig fi done From 01ebdf05ac7cd19a83440d702a38c02230d0f3d1 Mon Sep 17 00:00:00 2001 From: Brian Lin Date: Thu, 4 Nov 2021 15:04:32 -0500 Subject: [PATCH 3/3] Move SuppressGridLocalRecords back to the gratia-probe repo (SOFTWARE-4841) Enabling this option disables sending records for jobs that ran on slots without GLIDEIN_ResourceName or GLIDEIN_Site (i.e., not pilots), which is a reasonable default for all OSG APs --- rpm/osg-flock.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/rpm/osg-flock.spec b/rpm/osg-flock.spec index 12b8dc08..efe6f38e 100644 --- a/rpm/osg-flock.spec +++ b/rpm/osg-flock.spec @@ -36,7 +36,6 @@ install -d $RPM_BUILD_ROOT/%{_sysconfdir}/gratia/condor/ # Set OSPool specific Gratia probe config probeconfig=/etc/gratia/condor-ap/ProbeConfig overrides=( - 'SuppressGridLocalRecords="1"' 'MapUnknownToGroup="1"' 'MapGroupToRole="1"' 'VOOverride="OSG"'