Skip to content

Commit

Permalink
Merge pull request #145 from tofu-rocketry/release-3.1.1
Browse files Browse the repository at this point in the history
Release 3.1.1 to master
  • Loading branch information
tofu-rocketry authored Dec 16, 2020
2 parents 1b44c22 + aa18a87 commit b0cc13b
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 34 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
Changelog for ssm
=================
* Wed Dec 16 2020 Adrian Coveney <adrian.coveney@stfc.ac.uk> - 3.1.1-1
- Changed logging to reduce how verbose the logging of a 3rd-party module is.

* Tue Dec 01 2020 Adrian Coveney <adrian.coveney@stfc.ac.uk> - 3.1.0-1
- Enabled retries for all AMS communication methods to avoid timeouts from
crashing SSM.
Expand Down
5 changes: 4 additions & 1 deletion apel-ssm.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -100,6 +100,9 @@ rm -rf $RPM_BUILD_ROOT
%doc %_defaultdocdir/%{name}

%changelog
* Wed Dec 16 2020 Adrian Coveney <adrian.coveney@stfc.ac.uk> - 3.1.1-1
- Changed logging to reduce how verbose the logging of a 3rd-party module is.

* Tue Dec 01 2020 Adrian Coveney <adrian.coveney@stfc.ac.uk> - 3.1.0-1
- Enabled retries for all AMS communication methods to avoid timeouts from
crashing SSM.
Expand Down
38 changes: 20 additions & 18 deletions migrating_to_ams.md
Original file line number Diff line number Diff line change
@@ -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:

Expand All @@ -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
```
2 changes: 1 addition & 1 deletion scripts/ssm-build-deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

set -eu

TAG=3.1.0-1
TAG=3.1.1-1

SOURCE_DIR=~/debbuild/source
BUILD_DIR=~/debbuild/build
Expand Down
2 changes: 1 addition & 1 deletion scripts/ssm-build-rpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ssm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import logging
import sys

__version__ = (3, 1, 0)
__version__ = (3, 1, 1)

LOG_BREAK = '========================================'

Expand Down
30 changes: 18 additions & 12 deletions ssm/ssm2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -42,7 +42,7 @@
AmsMessage = None

# Set up logging
log = logging.getLogger(__name__)
log = getLogger(__name__)


class Ssm2Exception(Exception):
Expand Down Expand Up @@ -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."""
Expand Down

0 comments on commit b0cc13b

Please sign in to comment.