Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
anselm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
vaclab
anselm
Commits
deac3945
Commit
deac3945
authored
6 years ago
by
wactbprot
Browse files
Options
Downloads
Patches
Plain Diff
rm most rabbit parts
parent
cba4363d
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
anselm.py
+1
-10
1 addition, 10 deletions
anselm.py
anselm/config.json
+0
-3
0 additions, 3 deletions
anselm/config.json
anselm/ctrl.py
+0
-69
0 additions, 69 deletions
anselm/ctrl.py
with
1 addition
and
82 deletions
anselm.py
+
1
−
10
View file @
deac3945
import
sys
import
json
import
argparse
import
pika
from
anselm.system
import
System
class
Anselm
(
System
):
...
...
@@ -13,15 +12,7 @@ class Anselm(System):
"""
def
__init__
(
self
):
super
().
__init__
()
msg_dict
=
self
.
config
[
'
rabbitmq
'
]
host
=
msg_dict
[
'
host
'
]
self
.
msg_param
=
pika
.
ConnectionParameters
(
host
=
host
)
self
.
init_ctrl_msg_prod
()
self
.
init_stm_msg_prod
()
self
.
init_ltm_msg_prod
()
parser
=
argparse
.
ArgumentParser
(
description
=
'
check systems
'
,
usage
=
'''
anselm <command> [<args>]
'''
)
...
...
This diff is collapsed.
Click to expand it.
anselm/config.json
+
0
−
3
View file @
deac3945
...
...
@@ -3,9 +3,6 @@
"host"
:
"localhost"
,
"port"
:
27017
},
"rabbitmq"
:
{
"host"
:
"localhost"
},
"couchdb"
:
{
"host"
:
"localhost"
,
"port"
:
5984
,
...
...
This diff is collapsed.
Click to expand it.
anselm/ctrl.py
deleted
100644 → 0
+
0
−
69
View file @
cba4363d
import
sys
from
anselm.system
import
System
import
json
class
Ctrl
(
System
):
def
__init__
(
self
):
super
().
__init__
()
self
.
log
.
info
(
"
start long-term memory init function
"
)
self
.
init_stm_msg_prod
()
self
.
init_ltm_msg_prod
()
self
.
init_ctrl_msg_prod
()
self
.
init_msg_consume
(
queue_name
=
'
ctrl
'
,
callback
=
self
.
dispatch
)
def
dispatch
(
self
,
ch
,
method
,
props
,
body
):
res
=
json
.
loads
(
body
)
found
=
False
contains
=
""
source
=
""
msg
=
""
if
'
payload
'
in
res
:
payload
=
res
[
'
payload
'
]
if
'
contains
'
in
res
:
contains
=
res
[
'
contains
'
]
self
.
log
.
info
(
"
contains: {}
"
.
format
(
contains
))
if
'
source
'
in
res
:
source
=
res
[
'
source
'
]
self
.
log
.
info
(
"
source: {}
"
.
format
(
source
))
if
'
msg
'
in
res
:
msg
=
res
[
'
msg
'
]
self
.
log
.
info
(
"
msg: {}
"
.
format
(
msg
))
if
source
==
"
stm
"
and
contains
==
"
task
"
:
print
(
payload
)
found
=
True
if
source
==
"
ltm
"
and
contains
==
"
auxobj
"
:
self
.
stm_pub
(
body_dict
=
{
'
do
'
:
"
build_auxobj_db
"
,
'
payload
'
:
payload
})
found
=
True
if
source
==
"
ltm
"
and
contains
==
"
mpdoc
"
:
self
.
stm_pub
(
body_dict
=
{
'
do
'
:
"
build_mp_db
"
,
'
payload
'
:
payload
})
found
=
True
if
source
==
"
stm
"
and
msg
==
"
insert_mp_doc_complete
"
:
self
.
stm_pub
(
body_dict
=
{
'
do
'
:
"
build_mp_db
"
,
'
payload
'
:
payload
})
found
=
True
if
found
:
self
.
log
.
info
(
"
found branch for routing key
"
)
else
:
self
.
log
.
error
(
"
no branch found
"
)
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