Skip to content

Commit

Permalink
Merge pull request #90 from ankitmashu/setupdocs
Browse files Browse the repository at this point in the history
Setupdocs
  • Loading branch information
kailash authored Mar 21, 2023
2 parents e817ec7 + c790986 commit b0b5a03
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 75 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ The api docs can be found [here](https://gis.iudx.io/apis).

The Gis-interface Server connects with various external dependencies namely
- PostgreSQL
- ImmuDB
- RabbitMQ

Find the installations of the above along with the configurations to modify the database url, port and associated credentials in the appropriate sections
Expand Down
95 changes: 21 additions & 74 deletions SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,46 +12,16 @@ The Gis Interface connects with various external dependencies namely
- `PostgreSQL` : used to store and query data related to
- Token Invalidation
- Fetching data
- `ImmuDB` : used to store metering information
- `RabbitMQ` : used to receive token invalidation info



The Gis Interface also connects with various DX dependencies namely
- Authorization Server : used to download the certificate for token decoding
- Catalogue Server : used to download the list of resources, access policies and query types supported on a resource.
- Auditing Server : used to store information of metering in ImmuDB and Postgres.

----
## Setting up RabbitMQ for IUDX Gis Interface
- Refer to the docker files available [here](https://github.com/datakaveri/iudx-deployment/blob/master/Docker-Swarm-deployment/single-node/databroker) to setup RMQ.


In order to connect to the appropriate RabbitMQ instance, required information such as dataBrokerIP, dataBrokerPort etc. should be updated in the DataBrokerVerticle module available in [config-example.json](configs/config-example.json).

**DataBrokerVerticle**
```
{
id": "iudx.gis.server.databroker.DataBrokerVerticle",
"verticleInstances": <num-of-verticle-instances>,
"dataBrokerIP": "localhost",
"dataBrokerPort": <port-number>,
"dataBrokerVhost": <vHost-name>,
"dataBrokerUserName": <username-for-rmq>,
"dataBrokerPassword": <password-for-rmq>,
Adding default apiserver ports
- Default http port is 8080.
- Default port when ssl is enabled is 8443.
- Apiserver port configurable using parameter 'httpPort "dataBrokerManagementPort": <management-port-number>,
"connectionTimeout": <time-in-milliseconds>,
"requestedHeartbeat": <time-in-seconds>,
"handshakeTimeout": <time-in-milliseconds>,
"requestedChannelMax": <num-of-max-channels>,
"networkRecoveryInterval": <time-in-milliseconds>,
"automaticRecoveryEnabled": "true"
}
```
---

## Setting up PostgreSQL for IUDX Gis Interface
- Refer to the docker files available [here](https://github.com/datakaveri/iudx-deployment/blob/master/Docker-Swarm-deployment/single-node/postgres) to setup PostgreSQL
Expand All @@ -72,29 +42,15 @@ In order to connect to the appropriate Postgres database, required information s
"databasePassword": <password-for-psql>,
"poolSize": <pool-size>
}
```
**DatabaseVerticle**
```
{
"id": "iudx.gis.server.database.DatabaseVerticle",
"verticleInstances": <num-of-verticle-instance>,
"databaseIP": "localhost",
"databasePort": <port-number>,
"databaseName": <database-name>,
"databaseUserName": <username-for-psql>,
"databasePassword": <password-for-psql>,
"dbClientPoolSize": <pool-size>
}
```

```
#### Schemas for PostgreSQL tables in IUDX Gis Interface
1. **Token Invalidation Table Schema**
```
CREATE TABLE IF NOT EXISTS revoked_tokens
(
_id uuid NOT NULL,
expiry timestamp with time zone NOT NULL,
expiry timestamp without time zone NOT NULL,
created_at timestamp without time zone NOT NULL,
modified_at timestamp without time zone NOT NULL,
CONSTRAINT revoke_tokens_pk PRIMARY KEY (_id)
Expand All @@ -119,48 +75,37 @@ CREATE TABLE IF NOT EXISTS gis
```
----

## Setting up ImmuDB for IUDX Gis Interface
- Refer to the docker files available [here](https://github.com/datakaveri/iudx-deployment/blob/master/Docker-Swarm-deployment/single-node/immudb) to setup ImmuDB.
- Refer [this](https://github.com/datakaveri/iudx-deployment/blob/master/Docker-Swarm-deployment/single-node/immudb/docker/immudb-config-generator/immudb-config-generator.py) to create table/user.
- In order to connect to the appropriate ImmuDB database, required information such as meteringDatabaseIP, meteringDatabasePort etc. should be updated in the MeteringVerticle module available in [config-example.json](configs/config-example.json).
## Setting up Metering for IUDX Gis Interface
- In Metering Verticle we are pushing data in Auditing Server through RabbitMQ. [config-example.json](configs/config-example.json).

**MeteringVerticle**

```
{
"id": "iudx.gis.server.metering.MeteringVerticle",
"verticleInstances": <num-of-verticle-instances>,
"meteringDatabaseIP": "localhost",
"meteringDatabasePort": <port-number>,
"meteringDatabaseName": <database-name>,
"meteringDatabaseUserName": <username-for-immudb>,
"meteringDatabasePassword": <password-for-immudb>,
"meteringDatabaseTableName": <table-name-for-immudb>
"meteringPoolSize": <pool-size>
}
```

**Metering Table Schema**
----

## Setting up Internal Cache Store
- In order to connect with the internal cache, we need to add cache verticle configs available in [config-example.json](configs/config-example.json).

**CacheVerticle**

```
CREATE TABLE IF NOT EXISTS gisaudit (
id VARCHAR[128] NOT NULL,
api VARCHAR[128],
userid VARCHAR[128],
epochtime INTEGER,
resourceid VARCHAR[200],
isotime VARCHAR[128],
providerid VARCHAR[128],
size INTEGER,
PRIMARY KEY id
);
{
"id": "iudx.gis.server.cache.CacheVerticle",
"verticleInstances": 1
}
```

----

## Setting up RabbitMQ for IUDX Gis Interface
- Refer to the docker files available [here](https://github.com/datakaveri/iudx-deployment/blob/master/Docker-Swarm-deployment/single-node/databroker) to setup RMQ.


In order to connect to the appropriate RabbitMQ instance, required information such as dataBrokerIP, dataBrokerPort etc. should be updated in the DataBrokerVerticle module available in [config-example.json](configs/config-example.json).

**DataBrokerVerticle**
Expand All @@ -170,16 +115,18 @@ In order to connect to the appropriate RabbitMQ instance, required information s
"verticleInstances": <num-of-verticle-instances>,
"dataBrokerIP": "localhost",
"dataBrokerPort": <port-number>,
"dataBrokerVhost": <vHost-name>,
"dataBrokerUserName": <username-for-rmq>,
"dataBrokerPassword": <password-for-rmq>,
"dataBrokerManagementPort": <management-port-number>,
"connectionTimeout": <time-in-milliseconds>,
"requestedHeartbeat": <time-in-seconds>,
"handshakeTimeout": <time-in-milliseconds>,
"requestedChannelMax": <num-of-max-channels>,
"networkRecoveryInterval": <time-in-milliseconds>,
"automaticRecoveryEnabled": <true | false>
"automaticRecoveryEnabled": <true | false>,
"prodVhost": <prodVhost>,
"internalVhost": <internalVhost>,
"externalVhost": <externalVhost>
}
```

Expand Down
1 change: 1 addition & 0 deletions src/test/java/iudx/gis/server/cache/CacheServiceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ public void refreshCacheTest(Vertx vertx, VertxTestContext testContext) {
}
});
}

@Description("refresh cache without passing key and value.")
@Test
public void refreshCacheTest_1(Vertx vertx, VertxTestContext testContext) {
Expand Down

0 comments on commit b0b5a03

Please sign in to comment.