From 93146324fc6b4c30e2a9517e312920a2113817a4 Mon Sep 17 00:00:00 2001 From: Adrian Coveney Date: Mon, 14 Dec 2020 16:56:24 +0000 Subject: [PATCH 1/8] Fix indentation for GitHub's Markdown --- migrating_to_ams.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/migrating_to_ams.md b/migrating_to_ams.md index 3110a487..d29364f0 100644 --- a/migrating_to_ams.md +++ b/migrating_to_ams.md @@ -9,20 +9,20 @@ The sender configuration is usually found under `/etc/apel/sender.cfg`. Follow t 1. Comment out `bdii` and `network`. 1. Uncomment `host` and set it to `msg-devel.argo.grnet.gr`. 1. Add the following as a new section at the top of your configuration: -``` -[sender] -# Either 'STOMP' for STOMP message brokers or 'AMS' for Argo Messaging Service -protocol: AMS -``` + ``` + [sender] + # Either 'STOMP' for STOMP message brokers or 'AMS' for Argo Messaging Service + protocol: AMS + ``` 1. Add the following to the `[messaging]` section of your configuration: -``` -# If using AMS this is the project that SSM will connect to. Ignored for STOMP. -ams_project: accounting -``` + ``` + # If using AMS this is the project that SSM will connect to. Ignored for STOMP. + ams_project: accounting + ``` 1. To send to the central APEL Accounting server, change `destination` to one of the following depending on your type of accounting: - * `gLite-APEL` for Grid Accounting - * `eu.egi.cloud.accounting` for Cloud Accounting - * `eu.egi.storage.accounting` for Storage Accounting + * `gLite-APEL` for Grid Accounting + * `eu.egi.cloud.accounting` for Cloud Accounting + * `eu.egi.storage.accounting` for Storage Accounting The next time `ssmsend` runs it should be using the AMS. You can check this by looking in the logs for a successful run, which should look like this: @@ -45,6 +45,6 @@ The next time `ssmsend` runs it should be using the AMS. You can check this by l 1. Follow the steps 1 to 4 as per the [Sender documentation](#Sender) but editing your receiver configuration instead, usually found under `/etc/apel/receiver.cfg`, naming the sction `[receiver]` rather than `[sender]`. 1. Change `destination` to be the subscription you are using to pull messages down. 1. Add your token to the `[messaging]` section of your configuration: -``` -token: your_token_here -``` + ``` + token: your_token_here + ``` From a769f3186b1a92b581ae8e704ecd4b5a63d0c4a0 Mon Sep 17 00:00:00 2001 From: Adrian Coveney Date: Mon, 14 Dec 2020 16:58:53 +0000 Subject: [PATCH 2/8] Update AMS host and correct spelling --- migrating_to_ams.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/migrating_to_ams.md b/migrating_to_ams.md index d29364f0..50e6819f 100644 --- a/migrating_to_ams.md +++ b/migrating_to_ams.md @@ -7,7 +7,7 @@ Migration requires upgrading SSM to at least version 2.4.0 and adding new values The sender configuration is usually found under `/etc/apel/sender.cfg`. Follow the steps below to migrate. 1. Comment out `bdii` and `network`. -1. Uncomment `host` and set it to `msg-devel.argo.grnet.gr`. +1. Uncomment `host` and set it to `msg.argo.grnet.gr`. 1. Add the following as a new section at the top of your configuration: ``` [sender] @@ -42,7 +42,7 @@ The next time `ssmsend` runs it should be using the AMS. You can check this by l ## Receiver -1. Follow the steps 1 to 4 as per the [Sender documentation](#Sender) but editing your receiver configuration instead, usually found under `/etc/apel/receiver.cfg`, naming the sction `[receiver]` rather than `[sender]`. +1. Follow the steps 1 to 4 as per the [Sender documentation](#Sender) but editing your receiver configuration instead, usually found under `/etc/apel/receiver.cfg`, naming the section `[receiver]` rather than `[sender]`. 1. Change `destination` to be the subscription you are using to pull messages down. 1. Add your token to the `[messaging]` section of your configuration: ``` From cbbcc337590dbf65787d27e117cf222bc2311c33 Mon Sep 17 00:00:00 2001 From: Adrian Coveney Date: Mon, 14 Dec 2020 17:48:51 +0000 Subject: [PATCH 3/8] Add note on ARGO AMS Library --- migrating_to_ams.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/migrating_to_ams.md b/migrating_to_ams.md index 50e6819f..96c7b825 100644 --- a/migrating_to_ams.md +++ b/migrating_to_ams.md @@ -1,6 +1,8 @@ # Migrating from using EGI ActiveMQ Message Brokers to using EGI ARGO Messaging Service -Migration requires upgrading SSM to at least version 2.4.0 and adding new values to your configuration. +Migration requires upgrading APEL SSM to at least version 2.4.0, installing the ARGO AMS Library, and adding new values to your configuration. + +The ARGO AMS Library is available in UMD as `python-argo-ams-library`. Versions above 0.5.0 are recommended. ## Sender From 3ae270e004413957cbe95f798c9c300dbb053f4b Mon Sep 17 00:00:00 2001 From: Adrian Coveney Date: Mon, 14 Dec 2020 17:13:05 +0000 Subject: [PATCH 4/8] Add another urllib logging tweak --- ssm/ssm2.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ssm/ssm2.py b/ssm/ssm2.py index 354aa318..f5e4c03f 100644 --- a/ssm/ssm2.py +++ b/ssm/ssm2.py @@ -174,12 +174,16 @@ def __init__(self, hosts_and_ports, qpath, cert, key, dest=None, listen=None, logging.getLogger("stomp.py").setLevel(logging.WARNING) logging.getLogger("requests.packages.urllib3.connectionpool" ).setLevel(logging.WARNING) + logging.getLogger("urllib3.connectionpool" + ).setLevel(logging.WARNING) # If the overall SSM log level is debug, we want to only # see entries from stomp.py and connectionpool at INFO above. elif logging.getLogger("ssm.ssm2").getEffectiveLevel() == logging.DEBUG: logging.getLogger("stomp.py").setLevel(logging.INFO) logging.getLogger("requests.packages.urllib3.connectionpool" ).setLevel(logging.INFO) + logging.getLogger("urllib3.connectionpool" + ).setLevel(logging.INFO) def set_dns(self, dn_list): """Set the list of DNs which are allowed to sign incoming messages.""" From 406c1f32d7926233d8de24ecf7b3fe25410ac11a Mon Sep 17 00:00:00 2001 From: Adrian Coveney Date: Tue, 15 Dec 2020 10:10:26 +0000 Subject: [PATCH 5/8] Use a 'from logging' import to simplify dense code --- ssm/ssm2.py | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/ssm/ssm2.py b/ssm/ssm2.py index f5e4c03f..5b47a709 100644 --- a/ssm/ssm2.py +++ b/ssm/ssm2.py @@ -32,7 +32,7 @@ import os import socket import time -import logging +from logging import getLogger, INFO, WARNING, DEBUG try: from argo_ams_library import ArgoMessagingService, AmsMessage @@ -42,7 +42,7 @@ AmsMessage = None # Set up logging -log = logging.getLogger(__name__) +log = getLogger(__name__) class Ssm2Exception(Exception): @@ -170,20 +170,18 @@ def __init__(self, hosts_and_ports, qpath, cert, key, dest=None, listen=None, # If the overall SSM log level is info, we want to only # see entries from stomp.py and connectionpool at WARNING and above. - if logging.getLogger("ssm.ssm2").getEffectiveLevel() == logging.INFO: - logging.getLogger("stomp.py").setLevel(logging.WARNING) - logging.getLogger("requests.packages.urllib3.connectionpool" - ).setLevel(logging.WARNING) - logging.getLogger("urllib3.connectionpool" - ).setLevel(logging.WARNING) + if getLogger("ssm.ssm2").getEffectiveLevel() == INFO: + getLogger("stomp.py").setLevel(WARNING) + getLogger("requests.packages.urllib3.connectionpool" + ).setLevel(WARNING) + getLogger("urllib3.connectionpool").setLevel(WARNING) # If the overall SSM log level is debug, we want to only # see entries from stomp.py and connectionpool at INFO above. - elif logging.getLogger("ssm.ssm2").getEffectiveLevel() == logging.DEBUG: - logging.getLogger("stomp.py").setLevel(logging.INFO) - logging.getLogger("requests.packages.urllib3.connectionpool" - ).setLevel(logging.INFO) - logging.getLogger("urllib3.connectionpool" - ).setLevel(logging.INFO) + elif getLogger("ssm.ssm2").getEffectiveLevel() == DEBUG: + getLogger("stomp.py").setLevel(INFO) + getLogger("requests.packages.urllib3.connectionpool" + ).setLevel(INFO) + getLogger("urllib3.connectionpool").setLevel(INFO) def set_dns(self, dn_list): """Set the list of DNs which are allowed to sign incoming messages.""" From a64bacc50fdd7829fc352e2f5d37217aec04a22a Mon Sep 17 00:00:00 2001 From: Adrian Coveney Date: Tue, 15 Dec 2020 10:44:41 +0000 Subject: [PATCH 6/8] Factor out logging tweaks to own method --- ssm/ssm2.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ssm/ssm2.py b/ssm/ssm2.py index 5b47a709..735056b7 100644 --- a/ssm/ssm2.py +++ b/ssm/ssm2.py @@ -168,14 +168,18 @@ def __init__(self, hosts_and_ports, qpath, cert, key, dest=None, listen=None, raise Ssm2Exception('Failed to verify server certificate %s against CA path %s.' % (self._enc_cert, self._capath)) - # If the overall SSM log level is info, we want to only + self._set_external_logging_levels() + + def _set_external_logging_levels(self): + """Tweak the logging of dependencies to better match SSM verbosity.""" + # If the overall SSM log level is INFO, we want to only # see entries from stomp.py and connectionpool at WARNING and above. if getLogger("ssm.ssm2").getEffectiveLevel() == INFO: getLogger("stomp.py").setLevel(WARNING) getLogger("requests.packages.urllib3.connectionpool" ).setLevel(WARNING) getLogger("urllib3.connectionpool").setLevel(WARNING) - # If the overall SSM log level is debug, we want to only + # If the overall SSM log level is DEBUG, we want to only # see entries from stomp.py and connectionpool at INFO above. elif getLogger("ssm.ssm2").getEffectiveLevel() == DEBUG: getLogger("stomp.py").setLevel(INFO) From 4841e46a22551028c27df55b02266c360014544c Mon Sep 17 00:00:00 2001 From: Adrian Coveney Date: Wed, 16 Dec 2020 11:10:19 +0000 Subject: [PATCH 7/8] Update version numbers for 3.1.1 --- apel-ssm.spec | 2 +- scripts/ssm-build-deb.sh | 2 +- scripts/ssm-build-rpm.sh | 2 +- ssm/__init__.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apel-ssm.spec b/apel-ssm.spec index 4259aa34..f02ce064 100644 --- a/apel-ssm.spec +++ b/apel-ssm.spec @@ -4,7 +4,7 @@ %endif Name: apel-ssm -Version: 3.1.0 +Version: 3.1.1 %define releasenumber 1 Release: %{releasenumber}%{?dist} Summary: Secure stomp messenger diff --git a/scripts/ssm-build-deb.sh b/scripts/ssm-build-deb.sh index 34e5ef9d..f145b53b 100755 --- a/scripts/ssm-build-deb.sh +++ b/scripts/ssm-build-deb.sh @@ -16,7 +16,7 @@ set -eu -TAG=3.1.0-1 +TAG=3.1.1-1 SOURCE_DIR=~/debbuild/source BUILD_DIR=~/debbuild/build diff --git a/scripts/ssm-build-rpm.sh b/scripts/ssm-build-rpm.sh index d04d69dd..9b6cf6ab 100644 --- a/scripts/ssm-build-rpm.sh +++ b/scripts/ssm-build-rpm.sh @@ -10,7 +10,7 @@ rpmdev-setuptree RPMDIR=/home/rpmb/rpmbuild -VERSION=3.1.0-1 +VERSION=3.1.1-1 SSMDIR=apel-ssm-$VERSION # Remove old sources and RPMS diff --git a/ssm/__init__.py b/ssm/__init__.py index 488dda89..d282b9e3 100644 --- a/ssm/__init__.py +++ b/ssm/__init__.py @@ -19,7 +19,7 @@ import logging import sys -__version__ = (3, 1, 0) +__version__ = (3, 1, 1) LOG_BREAK = '========================================' From aa18a878f877ccb4c263204fd15571cb759ec77a Mon Sep 17 00:00:00 2001 From: Adrian Coveney Date: Wed, 16 Dec 2020 11:14:14 +0000 Subject: [PATCH 8/8] Update changelogs for 3.1.1 --- CHANGELOG | 3 +++ apel-ssm.spec | 3 +++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index af122deb..1b0a6082 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,8 @@ Changelog for ssm ================= +* Wed Dec 16 2020 Adrian Coveney - 3.1.1-1 + - Changed logging to reduce how verbose the logging of a 3rd-party module is. + * Tue Dec 01 2020 Adrian Coveney - 3.1.0-1 - Enabled retries for all AMS communication methods to avoid timeouts from crashing SSM. diff --git a/apel-ssm.spec b/apel-ssm.spec index f02ce064..d9ebd767 100644 --- a/apel-ssm.spec +++ b/apel-ssm.spec @@ -100,6 +100,9 @@ rm -rf $RPM_BUILD_ROOT %doc %_defaultdocdir/%{name} %changelog +* Wed Dec 16 2020 Adrian Coveney - 3.1.1-1 + - Changed logging to reduce how verbose the logging of a 3rd-party module is. + * Tue Dec 01 2020 Adrian Coveney - 3.1.0-1 - Enabled retries for all AMS communication methods to avoid timeouts from crashing SSM.