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 4259aa34..d9ebd767 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 @@ -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. diff --git a/migrating_to_ams.md b/migrating_to_ams.md index 3110a487..96c7b825 100644 --- a/migrating_to_ams.md +++ b/migrating_to_ams.md @@ -1,28 +1,30 @@ # 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 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] -# 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: @@ -42,9 +44,9 @@ 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: -``` -token: your_token_here -``` + ``` + token: your_token_here + ``` 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 = '========================================' diff --git a/ssm/ssm2.py b/ssm/ssm2.py index 354aa318..735056b7 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): @@ -168,18 +168,24 @@ 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 logging.getLogger("ssm.ssm2").getEffectiveLevel() == logging.INFO: - logging.getLogger("stomp.py").setLevel(logging.WARNING) - logging.getLogger("requests.packages.urllib3.connectionpool" - ).setLevel(logging.WARNING) - # If the overall SSM log level is debug, we want to only + 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) + 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."""