Skip to content

Commit

Permalink
query service deployment information
Browse files Browse the repository at this point in the history
  • Loading branch information
tekrajchhetri committed Jul 17, 2024
1 parent 43b314d commit dcfad78
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 7 deletions.
41 changes: 34 additions & 7 deletions docs/deployment_braikbservices.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The following are the core dependencies: software and service components that ne
The JWT User & Scope Manager helps to simplify the management of permissions and users for API endpoint access. It needs to be setup as a first step in order to use JWT based authentication.

**Installation:**
- Navigate to APItokenmanager directory.
- Navigate to `APItokenmanager` directory.
- Install PostgreSQL databse by running the Docker Compose file present inside _docker-postgresql_ folder.
- **Important:** You need to create an `.env` file to hold the following information.

Expand Down Expand Up @@ -49,7 +49,7 @@ JWT User & Scope Manager - Updating user information.
RabbitMQ is an open-source messaging broker software that is used in the ingestion process. Other microservices, i.e., workers, then consume the data that RabbitMQ holds in the messaging queue.

**Installation:**
- Navigate to rabbit-mq directory.
- Navigate to `rabbit-mq` directory.
- Run the `docker-compose.yml`, issuing `docker compose up` command.
- **Important:** You need to create an `.env` file and provide the following information.
- RABBITMQ_DEFAULT_USER: Username for the RabbitMQ that will be use to login.
Expand All @@ -63,23 +63,50 @@ RabbitMQ after successful deployment.
We use GraphDB to store our KGs.

**Installation:**
- Navigate to graphdb directory.
- Navigate to `graphdb` directory.
- Run the `docker-compose.yml`, issuing `docker compose up` command. After successful deployment, you should be able to see the following screen (see {numref}`graphdbwelcome`).

```{figure} graphdb.png
:name: graphdbwelcome
GraphDB Screen.
```
- Access to the GraphDB is available to all users by default. To enable password based access, navigate to setup users and access and enable security (see {numref}`setaccesscontrol`).
- Access to the GraphDB is available to all users by default. To enable password based access, navigate to setup `` users and access and enable security (see {numref}`setaccesscontrol`).

```{figure} setaccesscontrol.png
:name: setaccesscontrol
Enabling Access Control.
```



### Query Service
The query service provides the endpoints and the functionalities necessary for querying (and updating) the knowledge graphs from the graph database.

- Navigate to `query_service` directory.
- Run either `docker-compose-dev.yml` or `docker-compose-prod.yml` depending on your environment, issuing `docker compose up` command.
- **Important:** You need to create an environment file `.env.development` to hold the following information.
- ENV_STATE: The state, either, environment and production. Use `prod` for production.
- DATABASE_URL: Use `sqlite:///data.db`.
- LOGTAIL_API_KEY: [Log Tail](https://betterstack.com) API key. {numref}`logtaildemo` shows the logging of the information.
- JWT_POSTGRES_DATABASE_HOST_URL: PostgreSQL database (`the same database from JWT User & Scope Manager`) URL.
- JWT_POSTGRES_DATABASE_NAME: Database name.
- JWT_POSTGRES_DATABASE_PORT: Port number of the PostgreSQL database.
- JWT_POSTGRES_DATABASE_USER: Username for the PostgreSQL database.
- JWT_POSTGRES_DATABASE_PASSWORD: Password for PostgreSQL database user.
- JWT_POSTGRES_TABLE_USER: Name of the table to store the user information. The default is `Web_jwtuser`.
- JWT_POSTGRES_TABLE_SCOPE: Name of the table to store the scope (or permission) information. The default is `Web_scope`.
- JWT_POSTGRES_TABLE_USER_SCOPE_REL: Name of the table to store the relationship information between scope (or permissions) and user. The default is `Web_jwtuser_scopes`.
- JWT_ALGORITHM: Algorithm to be used in JWT. The default is `HS256`.
- JWT_SECRET_KEY: Secret key to be used in JWT.
- GRAPHDATABASE_USERNAME: Username for the graph database, i.e., `GraphDB` in our case.
- GRAPHDATABASE_PASSWORD: GraphDB password.
- GRAPHDATABASE_HOSTNAME: Hostname for the graph database. Default is `http://localhost`.
- GRAPHDATABASE_PORT: Graph database port number. Default is `7200`.
- GRAPHDATABASE_TYPE: Graph database type. Default is `GRAPHDB`, representing `GraphDB`.
- GRAPHDATABASE_REPOSITORY: The name of the repository (same as table in relational database). This may not be use in all graphdatabase but for GraphDB, which we use, it is a must.

```{figure} logtaildemo.png
:name: logtaildemo
[Snapshots of the BrainKB logs from Log Tail](https://betterstack.com).
```

<b style="color:red;">Note:</b>


Binary file added docs/logtaildemo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit dcfad78

Please sign in to comment.