Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
GraceDB Server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IGWN Computing and Software
GraceDB
GraceDB Server
Commits
aa2e035a
Commit
aa2e035a
authored
9 years ago
by
Branson Craig Stephens
Browse files
Options
Downloads
Patches
Plain Diff
Settings to disable use of the overseer and related imports.
parent
96025b93
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
gracedb/alert.py
+27
-18
27 additions, 18 deletions
gracedb/alert.py
settings/branson.py
+2
-0
2 additions, 0 deletions
settings/branson.py
settings/default.py
+2
-0
2 additions, 0 deletions
settings/default.py
settings/roy.py
+2
-0
2 additions, 0 deletions
settings/roy.py
with
33 additions
and
18 deletions
gracedb/alert.py
+
27
−
18
View file @
aa2e035a
...
...
@@ -9,9 +9,12 @@ import json
import
logging
from
hashlib
import
sha1
from
ligo.overseer.client
import
send_to_overseer
from
multiprocessing
import
Process
,
Manager
# These imports can be fragile, so they should be brought in only
# if use of the LVAlert overseer is really intended.
if
settings
.
USE_LVALERT_OVERSEER
:
from
hashlib
import
sha1
from
ligo.overseer.client
import
send_to_overseer
from
multiprocessing
import
Process
,
Manager
log
=
logging
.
getLogger
(
'
gracedb.alert
'
)
...
...
@@ -150,27 +153,33 @@ def issueXMPPAlert(event, location, alert_type="new", description="", serialized
msg
=
json
.
dumps
(
lva_data
)
log
.
debug
(
"
issueXMPPAlert: writing message %s
"
%
msg
)
manager
=
Manager
()
if
settings
.
USE_LVALERT_OVERSEER
:
manager
=
Manager
()
for
server
in
settings
.
ALERT_XMPP_SERVERS
:
port
=
settings
.
LVALERT_OVERSEER_PORTS
[
server
]
for
nodename
in
nodenames
:
# Calculate unique message_id and log
message_id
=
sha1
(
nodename
+
msg
).
hexdigest
()
log
.
info
(
"
issueXMPPAlert: sending %s to node %s on %s
"
%
(
message_id
,
nodename
,
server
))
if
settings
.
USE_LVALERT_OVERSEER
:
# Calculate unique message_id and log
message_id
=
sha1
(
nodename
+
msg
).
hexdigest
()
log
.
info
(
"
issueXMPPAlert: sending %s to node %s on %s
"
%
(
message_id
,
nodename
,
server
))
rdict
=
manager
.
dict
()
msg_dict
=
{
'
node_name
'
:
nodename
,
'
message
'
:
msg
,
'
action
'
:
'
push
'
}
p
=
Process
(
target
=
send_to_overseer
,
args
=
(
msg_dict
,
rdict
,
log
,
True
,
port
))
p
.
start
()
p
.
join
()
if
rdict
.
get
(
'
success
'
,
None
):
continue
# If not success, we need to do this the old way.
log
.
info
(
"
issueXMPPAlert: failover to lvalert_send
"
)
else
:
# Not using LVAlert overseer, so just log the node and server
log
.
info
(
"
issueXMPPAlert: sending to node %s on %s
"
%
(
nodename
,
server
))
rdict
=
manager
.
dict
()
msg_dict
=
{
'
node_name
'
:
nodename
,
'
message
'
:
msg
,
'
action
'
:
'
push
'
}
p
=
Process
(
target
=
send_to_overseer
,
args
=
(
msg_dict
,
rdict
,
log
,
True
,
port
))
p
.
start
()
p
.
join
()
if
rdict
.
get
(
'
success
'
,
None
):
continue
# If not success, we need to do this the old way.
log
.
info
(
"
issueXMPPAlert: failover to lvalert_send
"
)
null
=
open
(
'
/dev/null
'
,
'
w
'
)
p
=
Popen
(
[
"
lvalert_send
"
,
...
...
This diff is collapsed.
Click to expand it.
settings/branson.py
+
2
−
0
View file @
aa2e035a
...
...
@@ -40,6 +40,8 @@ ALERT_TEST_EMAIL_TO = [
ALERT_XMPP_SERVERS
=
[
"
lvalert-test.cgca.uwm.edu
"
,]
LVALERT_SEND_EXECUTABLE
=
'
/usr/bin/lvalert_send
'
USE_LVALERT_OVERSEER
=
False
# For each lvalert server, a separate instance of the lvalert_overseer
# must be running and listening on a distinct port.
LVALERT_OVERSEER_PORTS
=
{
...
...
This diff is collapsed.
Click to expand it.
settings/default.py
+
2
−
0
View file @
aa2e035a
...
...
@@ -30,6 +30,8 @@ ALERT_TEST_EMAIL_TO = [
ALERT_XMPP_SERVERS
=
[
"
lvalert.cgca.uwm.edu
"
]
LVALERT_SEND_EXECUTABLE
=
'
/usr/bin/lvalert_send
'
USE_LVALERT_OVERSEER
=
False
# For each lvalert server, a separate instance of the lvalert_overseer
# must be running and listening on a distinct port.
LVALERT_OVERSEER_PORTS
=
{
...
...
This diff is collapsed.
Click to expand it.
settings/roy.py
+
2
−
0
View file @
aa2e035a
...
...
@@ -50,6 +50,8 @@ LVALERT_OVERSEER_PORTS = {
'
lvalert-test.cgca.uwm.edu
'
:
8001
,
}
USE_LVALERT_OVERSEER
=
False
EMBB_MAIL_ADDRESS
=
'
embb@embb-dev.ligo.caltech.edu
'
EMBB_SMTP_SERVER
=
'
acrux.ligo.caltech.edu
'
EMBB_MAIL_ADMINS
=
[
'
roy.williams@ligo.org
'
,]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment