Skip to content

Installation steps for all the services.

Kaustubh Bhalerao edited this page Feb 14, 2020 · 13 revisions

Welcome to the devengers wiki!

Environment setup for DataRetrieval, DataModelling and DataAnalysis service.

Location

After git pull from "develop_new" branch you will find three folders with the same name as of the services mentioned above.

Install docker

  1. Mac OS - https://docs.docker.com/docker-for-mac/install
  2. Windows - https://docs.docker.com/docker-for-windows/install/
  3. Ubuntu - https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-18-04

RabbitMQ setup in docker.

  1. pull rabbimq image: docker pull rabbitmq:3-management

  2. run the image in a container (rabbitmq-server): docker run -d -p 15672:15672 -p 5672:5672 --name rabbitmq-server rabbitmq:3-management

PostgreSQL setup in docker

  1. docker run -d -p 5432:5432 --name postgres postgres
  2. docker exec -it postgres bash
  3. psql -U postgres
  4. CREATE DATABASE dataretrieval_db
  5. CREATE DATABASE dataresult_db
  6. CREATE DATABASE datamodelling_db
  7. exit from Postgres (\q) and then from bash (exit).

python services

  1. Install python virtual environment in your system. follow this link. https://raturi.in/blog/installing-python-virtual-environment-ubuntu-mac-and-windows/

  2. Start the python virtual environment in one terminal and type the following commands to install dependencies.

    • pip install pika
    • pip install Flask
    • pip install psycopg2-binary
    • pip install nexradaws
  1. Now start open two more terminals and start the virtual environment run services in each terminal.

    python3 dataretrieval.py run python3 datamodelling.py run python3 dataanalysis.py run

  2. To test the services independently you may create a producer.py file with the below code and run it in the python virtual environment.

import pika
import json
connection = pika.BlockingConnection(pika.ConnectionParameters('localhost'))
channel = connection.channel()
channel.queue_declare(queue='retrieval-processing', durable=True)
data = {
        "userid": "abc",
        "correlationid": "11111",
        "year": "2013",
	"month": "05",
	"day": "31",
	"starttime":"17",
	"startmin":"0",
	"endtime": "18",
	"endtime":"0"
    }
message = json.dumps(data)
channel.basic_publish(exchange='',
                      routing_key='retrieval-processing',
                      body=message)
print(" [x] Sent 'Hello World!'")
connection.close()

Usermanagement Service and API Gateway

Download and Install Node

https://nodejs.org/en/

check if node is installed : node -v

npm install npm@latest -g

npm -v

In the project directory, run:

npm install -all (Only once) Installing Dependencies from package.json

npm run dev To start the node backend server

Mongo DB TO setup connection please Update URL in .env file.

UI react

Session Management Service

  1. Download the code (db-service) and import it as a maven project.
  2. Change the application.properties field
  3. spring.datasource.username= WITH YOUR OWN PASSWORD spring.datasource.password =WITH YOUR OWN PASSWORD
  4. Start your mysql server on machine.
  5. Create Database named as test.
  6. Run DbServiceApplication.java as a java application.

Available Scripts

In the project directory, run:

npm install -all

(Only once) Installing Dependencies from package.json

npm start

Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.