Commit 092953a2 authored by Leo Pound Singer's avatar Leo Pound Singer

Update sleek-lvalert to 2.0.0

This switches the XMPP client from the unmaintained SleekXMPP
project to the currently maintained fork Slixmpp.
parent 43ee463c
......@@ -20,6 +20,9 @@ Changelog
coincident event. Update both time and spatial FAR within superevent
when publishable.
- Update to sleek-lvalert 2.0.0, which switches the XMPP client from the
unmaintained SleekXMPP project to the currently maintained fork Slixmpp.
0.12.1 (2020-03-12)
-------------------
......
......@@ -16,6 +16,30 @@
]
},
"default": {
"aiodns": {
"hashes": [
"sha256:815fdef4607474295d68da46978a54481dd1e7be153c7d60f9e72773cd38d77d",
"sha256:aaa5ac584f40fe778013df0aa6544bf157799bd3f608364b451840ed2c8688de"
],
"version": "==2.0.0"
},
"aiohttp": {
"hashes": [
"sha256:1e984191d1ec186881ffaed4581092ba04f7c61582a177b187d3a2f07ed9719e",
"sha256:259ab809ff0727d0e834ac5e8a283dc5e3e0ecc30c4d80b3cd17a4139ce1f326",
"sha256:2f4d1a4fdce595c947162333353d4a44952a724fba9ca3205a3df99a33d1307a",
"sha256:32e5f3b7e511aa850829fbe5aa32eb455e5534eaa4b1ce93231d00e2f76e5654",
"sha256:344c780466b73095a72c616fac5ea9c4665add7fc129f285fbdbca3cccf4612a",
"sha256:460bd4237d2dbecc3b5ed57e122992f60188afe46e7319116da5eb8a9dfedba4",
"sha256:4c6efd824d44ae697814a2a85604d8e992b875462c6655da161ff18fd4f29f17",
"sha256:50aaad128e6ac62e7bf7bd1f0c0a24bc968a0c0590a726d5a955af193544bcec",
"sha256:6206a135d072f88da3e71cc501c59d5abffa9d0bb43269a6dcd28d66bfafdbdd",
"sha256:65f31b622af739a802ca6fd1a3076fd0ae523f8485c52924a89561ba10c49b48",
"sha256:ae55bac364c405caa23a4f2d6cfecc6a0daada500274ffca4a9230e7129eac59",
"sha256:b778ce0c909a2653741cb4b1ac7015b5c130ab9c897611df43ae6a58523cb965"
],
"version": "==3.6.2"
},
"amqp": {
"hashes": [
"sha256:6e649ca13a7df3faacdc8bbb280aa9a6602d22fd9d545336077e573a1f4ff3b8",
......@@ -28,7 +52,7 @@
"sha256:5b26757dc6f79a3b7dc9fab95359328d5747fcb2409d331ea66d0272b90ab2a0",
"sha256:8b995ffe925347a2138d7ac0fe77155e4311a0ea6d6da4f5128fe4b3cbe5ed71"
],
"markers": "sys_platform == 'darwin'",
"markers": "platform_system == 'Darwin'",
"version": "==0.1.0"
},
"astroplan": {
......@@ -94,6 +118,13 @@
],
"version": "==0.5"
},
"async-timeout": {
"hashes": [
"sha256:0c3c816a028d47f659d6ff5c745cb2acf1f966da1fe5c19c77a70282b25f4c5f",
"sha256:4291ca197d287d274d0b6cb5d6f8f8f82d434ed288f962539ff18cc9012f9ea3"
],
"version": "==3.0.1"
},
"attrs": {
"hashes": [
"sha256:08a96c641c3a74e44eb59afb61a24f2cb9f4d7188748e76ba4bb5edfa3cb7d1c",
......@@ -289,13 +320,6 @@
],
"version": "==0.3.1.1"
},
"dnspython": {
"hashes": [
"sha256:36c5e8e38d4369a08b6780b7f27d790a292b2b08eea01607865bf0936c558e01",
"sha256:f69c21288a962f4da86e56c4905b49d11aba7938d3d740e80d9e366ee4f1632d"
],
"version": "==1.16.0"
},
"dqsegdb2": {
"hashes": [
"sha256:51bbe3fc6adf1ca7bb06305dfc684a9f45de96db67c6003eecff1ab26dd8dcc5",
......@@ -741,6 +765,28 @@
],
"version": "==8.2.0"
},
"multidict": {
"hashes": [
"sha256:317f96bc0950d249e96d8d29ab556d01dd38888fbe68324f46fd834b430169f1",
"sha256:42f56542166040b4474c0c608ed051732033cd821126493cf25b6c276df7dd35",
"sha256:4b7df040fb5fe826d689204f9b544af469593fb3ff3a069a6ad3409f742f5928",
"sha256:544fae9261232a97102e27a926019100a9db75bec7b37feedd74b3aa82f29969",
"sha256:620b37c3fea181dab09267cd5a84b0f23fa043beb8bc50d8474dd9694de1fa6e",
"sha256:6e6fef114741c4d7ca46da8449038ec8b1e880bbe68674c01ceeb1ac8a648e78",
"sha256:7774e9f6c9af3f12f296131453f7b81dabb7ebdb948483362f5afcaac8a826f1",
"sha256:85cb26c38c96f76b7ff38b86c9d560dea10cf3459bb5f4caf72fc1bb932c7136",
"sha256:a326f4240123a2ac66bb163eeba99578e9d63a8654a59f4688a79198f9aa10f8",
"sha256:ae402f43604e3b2bc41e8ea8b8526c7fa7139ed76b0d64fc48e28125925275b2",
"sha256:aee283c49601fa4c13adc64c09c978838a7e812f85377ae130a24d7198c0331e",
"sha256:b51249fdd2923739cd3efc95a3d6c363b67bbf779208e9f37fd5e68540d1a4d4",
"sha256:bb519becc46275c594410c6c28a8a0adc66fe24fef154a9addea54c1adb006f5",
"sha256:c2c37185fb0af79d5c117b8d2764f4321eeb12ba8c141a95d0aa8c2c1d0a11dd",
"sha256:dc561313279f9d05a3d0ffa89cd15ae477528ea37aa9795c4654588a3287a9ab",
"sha256:e439c9a10a95cb32abd708bb8be83b2134fa93790a4fb0535ca36db3dda94d20",
"sha256:fc3b4adc2ee8474cb3cd2a155305d5f8eda0a9c91320f83e55748e1fcb68f8e3"
],
"version": "==4.7.5"
},
"networkx": {
"hashes": [
"sha256:cdfbf698749a5014bf2ed9db4a07a5295df1d3a53bf80bf3cbd61edf9df05fa1",
......@@ -961,6 +1007,40 @@
],
"version": "==0.2.8"
},
"pycares": {
"hashes": [
"sha256:050f00b39ed77ea8a4e555f09417d4b1a6b5baa24bb9531a3e15d003d2319b3f",
"sha256:0a24d2e580a8eb567140d7b69f12cb7de90c836bd7b6488ec69394d308605ac3",
"sha256:0c5bd1f6f885a219d5e972788d6eef7b8043b55c3375a845e5399638436e0bba",
"sha256:11c628402cc8fc8ef461076d4e47f88afc1f8609989ebbff0dbffcd54c97239f",
"sha256:18dfd4fd300f570d6c4536c1d987b7b7673b2a9d14346592c5d6ed716df0d104",
"sha256:1917b82494907a4a342db420bc4dd5bac355a5fa3984c35ba9bf51422b020b48",
"sha256:1b90fa00a89564df059fb18e796458864cc4e00cb55e364dbf921997266b7c55",
"sha256:1d8d177c40567de78108a7835170f570ab04f09084bfd32df9919c0eaec47aa1",
"sha256:236286f81664658b32c141c8e79d20afc3d54f6e2e49dfc8b702026be7265855",
"sha256:2e4f74677542737fb5af4ea9a2e415ec5ab31aa67e7b8c3c969fdb15c069f679",
"sha256:48a7750f04e69e1f304f4332b755728067e7c4b1abe2760bba1cacd9ff7a847a",
"sha256:7d86e62b700b21401ffe7fd1bbfe91e08489416fecae99c6570ab023c6896022",
"sha256:7e2d7effd08d2e5a3cb95d98a7286ebab71ab2fbce84fa93cc2dd56caf7240dd",
"sha256:81edb016d9e43dde7473bc3999c29cdfee3a6b67308fed1ea21049f458e83ae0",
"sha256:96c90e11b4a4c7c0b8ff5aaaae969c5035493136586043ff301979aae0623941",
"sha256:9a0a1845f8cb2e62332bca0aaa9ad5494603ac43fb60d510a61d5b5b170d7216",
"sha256:a05bbfdfd41f8410a905a818f329afe7510cbd9ee65c60f8860a72b6c64ce5dc",
"sha256:a5089fd660f0b0d228b14cdaa110d0d311edfa5a63f800618dbf1321dcaef66b",
"sha256:c457a709e6f2befea7e2996c991eda6d79705dd075f6521593ba6ebc1485b811",
"sha256:c5cb72644b04e5e5abfb1e10a0e7eb75da6684ea0e60871652f348e412cf3b11",
"sha256:cce46dd4717debfd2aab79d6d7f0cbdf6b1e982dc4d9bebad81658d59ede07c2",
"sha256:cfdd1f90bcf373b00f4b2c55ea47868616fe2f779f792fc913fa82a3d64ffe43",
"sha256:d88a279cbc5af613f73e86e19b3f63850f7a2e2736e249c51995dedcc830b1bb",
"sha256:eba9a9227438da5e78fc8eee32f32eb35d9a50cf0a0bd937eb6275c7cc3015fe",
"sha256:eee7b6a5f5b5af050cb7d66ab28179287b416f06d15a8974ac831437fec51336",
"sha256:f41ac1c858687e53242828c9f59c2e7b0b95dbcd5bdd09c7e5d3c48b0f89a25a",
"sha256:f8deaefefc3a589058df1b177275f79233e8b0eeee6734cf4336d80164ecd022",
"sha256:fa78e919f3bd7d6d075db262aa41079b4c02da315c6043c6f43881e2ebcdd623",
"sha256:fadb97d2e02dabdc15a0091591a972a938850d79ddde23d385d813c1731983f0"
],
"version": "==3.1.1"
},
"pycondor": {
"hashes": [
"sha256:5d2c3f179c00e568271bcbbea88ac4d2523634a481f4b3e56b8346cda2fd6a2b",
......@@ -1234,16 +1314,16 @@
},
"sleek-lvalert": {
"hashes": [
"sha256:a2b9fbdbbd99c2c618140a235cbe5c4e5548652e4833fd14107367bb39159e81",
"sha256:b777d005d77f8ede2db68df6d00797a1ef0795f236d015c9d6c263e66e0aded2"
"sha256:74c5309a4a0fd98d677cbc559862d273cc480e6b0f3a1131ee79fb5ca36f18a6",
"sha256:c5b03f33163b603f33d7e5f751fbb341b67bdc0d4ce0b45dafedd664022f4178"
],
"version": "==1.0.0"
"version": "==2.0.0"
},
"sleekxmpp": {
"slixmpp": {
"hashes": [
"sha256:d213c1de71d92505f95ced0460ee0f84fdc4ddcacb7d7dd343739ed4028e5569"
"sha256:c3204fbe8ded148e1eca6720ba0398298c159f29ec76dfc6f7dd7ed999ae1767"
],
"version": "==1.3.3"
"version": "==1.4.2"
},
"statsmodels": {
"hashes": [
......@@ -1385,6 +1465,28 @@
],
"version": "==1.0.0"
},
"yarl": {
"hashes": [
"sha256:0c2ab325d33f1b824734b3ef51d4d54a54e0e7a23d13b86974507602334c2cce",
"sha256:0ca2f395591bbd85ddd50a82eb1fde9c1066fafe888c5c7cc1d810cf03fd3cc6",
"sha256:2098a4b4b9d75ee352807a95cdf5f10180db903bc5b7270715c6bbe2551f64ce",
"sha256:25e66e5e2007c7a39541ca13b559cd8ebc2ad8fe00ea94a2aad28a9b1e44e5ae",
"sha256:26d7c90cb04dee1665282a5d1a998defc1a9e012fdca0f33396f81508f49696d",
"sha256:308b98b0c8cd1dfef1a0311dc5e38ae8f9b58349226aa0533f15a16717ad702f",
"sha256:3ce3d4f7c6b69c4e4f0704b32eca8123b9c58ae91af740481aa57d7857b5e41b",
"sha256:58cd9c469eced558cd81aa3f484b2924e8897049e06889e8ff2510435b7ef74b",
"sha256:5b10eb0e7f044cf0b035112446b26a3a2946bca9d7d7edb5e54a2ad2f6652abb",
"sha256:6faa19d3824c21bcbfdfce5171e193c8b4ddafdf0ac3f129ccf0cdfcb083e462",
"sha256:944494be42fa630134bf907714d40207e646fd5a94423c90d5b514f7b0713fea",
"sha256:a161de7e50224e8e3de6e184707476b5a989037dcb24292b391a3d66ff158e70",
"sha256:a4844ebb2be14768f7994f2017f70aca39d658a96c786211be5ddbe1c68794c1",
"sha256:c2b509ac3d4b988ae8769901c66345425e361d518aecbe4acbfc2567e416626a",
"sha256:c9959d49a77b0e07559e579f38b2f3711c2b8716b8410b320bf9713013215a1b",
"sha256:d8cdee92bc930d8b09d8bd2043cedd544d9c8bd7436a77678dd602467a993080",
"sha256:e15199cdb423316e15f108f51249e44eb156ae5dba232cb73be555324a1d49c2"
],
"version": "==1.4.2"
},
"zipp": {
"hashes": [
"sha256:aa36550ff0c0b7ef7fa639055d797116ee891440eac1a56f378e2d3179e0320b",
......
import asyncio
from threading import Thread
from celery import bootsteps
from celery.utils.log import get_logger
......@@ -41,16 +44,24 @@ class Receiver(LVAlertBootStep):
self._client = client.LVAlertClient(
server=consumer.app.conf['lvalert_host'],
nodes=consumer.app.conf['lvalert_nodes'])
self._client.listen(_send_lvalert_received)
self._thread = Thread(target=self._run)
def _run(self):
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
self._client.disconnected = loop.create_future()
self._client.loop = loop
self._client.start()
def start(self, consumer):
super().start(consumer)
self._client.connect()
self._client.process()
self._client.listen(_send_lvalert_received)
self._thread.start()
def stop(self, consumer):
super().stop(consumer)
self._client.disconnect()
self._client.stop()
self._thread.join()
def info(self, consumer):
return {'lvalert-nodes': self._client.get_subscriptions()}
return {'lvalert-nodes': list(self._client.subscriptions)}
import asyncio
from celery.utils.log import get_logger
import sleek_lvalert
......@@ -10,8 +12,23 @@ class LVAlertClient(sleek_lvalert.LVAlertClient):
super().__init__(*args, **kwargs)
self._needed_subscriptions = set(nodes or ())
self.add_event_handler('session_start', self._resubscribe)
self.add_event_handler('session_start', self._refresh)
self.add_event_handler('pubsub_subscription', self._refresh)
self._current_subscriptions = set()
def _resubscribe(self, event):
async def _resubscribe(self, *args):
log.info('Resubscribing to PubSub nodes')
current_subscriptions = set(self.get_subscriptions())
self.subscribe(*(self._needed_subscriptions - current_subscriptions))
await self._refresh()
to_subscribe = self._needed_subscriptions - self.subscriptions
to_unsubscribe = self.subscriptions - self._needed_subscriptions
await asyncio.gather(self.subscribe(*to_subscribe),
self.unsubscribe(to_unsubscribe))
async def _refresh(self, *args):
log.info('Subscriptions detected')
self._current_subscriptions = set(await self.get_subscriptions())
log.info('Current subscriptions: %r', self._current_subscriptions)
@property
def subscriptions(self):
return self._current_subscriptions
......@@ -3,7 +3,6 @@ bilby-pipe >= 0.3.8
celery[redis] >= 4.4.0
comet
corner
dnspython # silence "DNS: dnspython not found. Can not use SRV lookup." warning from SleekXMPP
flask
flask-caching
gracedb-sdk >= 0.1.5
......@@ -30,7 +29,7 @@ safe-netrc
seaborn
sentry-sdk[flask,tornado]
service_identity # We don't actually use this package, but it silences some annoying warnings from twistd.
sleek-lvalert < 2.0.0
sleek-lvalert >= 2.0.0
voeventlib >= 1.2
werkzeug >= 0.15.0 # for werkzeug.middleware.proxy_fix.ProxyFix
zstandard # for task compression
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment