mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-26 17:06:22 +02:00
parent
a8e437fc7f
commit
6c7af8789d
216 changed files with 31360 additions and 1611 deletions
|
|
@ -45,13 +45,13 @@ class Configuration:
|
|||
|
||||
# FIXME: Some version vs config race conditions
|
||||
|
||||
def __init__(self, push, host, user, password, keyspace):
|
||||
def __init__(self, push, host, username, password, keyspace):
|
||||
|
||||
# External function to respond to update
|
||||
self.push = push
|
||||
|
||||
self.table_store = ConfigTableStore(
|
||||
host, user, password, keyspace
|
||||
host, username, password, keyspace
|
||||
)
|
||||
|
||||
async def inc_version(self):
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ from trustgraph.schema import FlowRequest, FlowResponse
|
|||
from trustgraph.schema import flow_request_queue, flow_response_queue
|
||||
|
||||
from trustgraph.base import AsyncProcessor, Consumer, Producer
|
||||
from trustgraph.base.cassandra_config import add_cassandra_args, resolve_cassandra_config
|
||||
|
||||
from . config import Configuration
|
||||
from . flow import FlowConfig
|
||||
|
|
@ -60,9 +61,21 @@ class Processor(AsyncProcessor):
|
|||
"flow_response_queue", default_flow_response_queue
|
||||
)
|
||||
|
||||
cassandra_host = params.get("cassandra_host", default_cassandra_host)
|
||||
cassandra_user = params.get("cassandra_user")
|
||||
cassandra_host = params.get("cassandra_host")
|
||||
cassandra_username = params.get("cassandra_username")
|
||||
cassandra_password = params.get("cassandra_password")
|
||||
|
||||
# Resolve configuration with environment variable fallback
|
||||
hosts, username, password = resolve_cassandra_config(
|
||||
host=cassandra_host,
|
||||
username=cassandra_username,
|
||||
password=cassandra_password
|
||||
)
|
||||
|
||||
# Store resolved configuration
|
||||
self.cassandra_host = hosts
|
||||
self.cassandra_username = username
|
||||
self.cassandra_password = password
|
||||
|
||||
id = params.get("id")
|
||||
|
||||
|
|
@ -76,8 +89,9 @@ class Processor(AsyncProcessor):
|
|||
"config_push_schema": ConfigPush.__name__,
|
||||
"flow_request_schema": FlowRequest.__name__,
|
||||
"flow_response_schema": FlowResponse.__name__,
|
||||
"cassandra_host": cassandra_host,
|
||||
"cassandra_user": cassandra_user,
|
||||
"cassandra_host": self.cassandra_host,
|
||||
"cassandra_username": self.cassandra_username,
|
||||
"cassandra_password": self.cassandra_password,
|
||||
}
|
||||
)
|
||||
|
||||
|
|
@ -142,9 +156,9 @@ class Processor(AsyncProcessor):
|
|||
)
|
||||
|
||||
self.config = Configuration(
|
||||
host = cassandra_host.split(","),
|
||||
user = cassandra_user,
|
||||
password = cassandra_password,
|
||||
host = self.cassandra_host,
|
||||
username = self.cassandra_username,
|
||||
password = self.cassandra_password,
|
||||
keyspace = keyspace,
|
||||
push = self.push
|
||||
)
|
||||
|
|
@ -276,23 +290,7 @@ class Processor(AsyncProcessor):
|
|||
help=f'Flow response queue {default_flow_response_queue}',
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
'--cassandra-host',
|
||||
default="cassandra",
|
||||
help=f'Graph host (default: cassandra)'
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
'--cassandra-user',
|
||||
default=None,
|
||||
help=f'Cassandra user'
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
'--cassandra-password',
|
||||
default=None,
|
||||
help=f'Cassandra password'
|
||||
)
|
||||
add_cassandra_args(parser)
|
||||
|
||||
def run():
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue