-
Notifications
You must be signed in to change notification settings - Fork 4
Milestone 1 : Project Setup Instructions
Download or pull the repository in to your local machine. The following steps detail the steps needed to set up and run the project.
git clone https://github.com/airavata-courses/CAPtivate.git
git checkout release/project1-0.0.1
Start Kafka and Zookeper servers by running the command root of repository
cd kafka
docker-compose up -d
This should create a kafka broker listening on localhost:9092
with the following topics
usermanagement
sessionmanagement
session-update
data-retrieval
model-execution
postprocessing-analysis
In-order to run the service do the following.
-
Download and install SBT for your machine from here
https://www.scala-sbt.org/download.html
-
cd into the service folder
cd api-gateway
-
Build the project by running
sbt compile
-
You can run the service by executing
sbt run
-
Inorder to build and run tests do
sbt test:compile sbt test
- Java 8
- Tomcat Server v9.0 - Download the Windows Service Installer (32-bit/64-bit Windows Service Installer (pgp, sha512))
- Maven - Download the binary zip archive file
- MySQL
-
Option 1 - Download MySQL server on your local machine
-
Download MySQL Server
-
Configure and set up the database as follows -
- Create a datbase by the name of 'ads' in your mysql instance by running the following command MySQL.
create database ads;
2. In the applications.properties file of the repository (in the '..\CAPtivateUserManagement\src\main\resources' folder), change the value of the following variables as per the settings of your MySQL instance.- spring.datasource.username=<your_MySQL_root_username>
- spring.datasource.password=<your_MySQL_root_password>
-
-
Option 2 - Run the MySQL Server on Docker. (RECOMMENDED)
- Open a command prompt here and navigate to your repository's '\UserManagement\db-docker' folder.
- Use the following command to run a MySQL instance in the Docker system.
docker-compose up
- Open a browser and type the following URL.
http://localhost:8081/
- In the resulting page, enter the following values in the respective text fields.
- Server: mysql-container
- Username: root
- Password: root.CAP2020
- Database: ads_docker
-
After you've downloaded and installed the above in your system, follow these steps to run the Spring Boot application
- Unzip maven to a desired location in your computer.
- Define 'MAVEN_HOME' in your system variables. It would point to the location of the folder containining the Maven files unzipped in step 1. For eg. 'C:\User\apache-maven-3.6.3'
- Set path for Maven in your environment variables. It would contain the path upto the bin directory in the Maven folder (Step 2). For eg. 'C:\User\apache-maven-3.6.3\bin'
- Set JAVA_HOME variable (if not already present), to point to the JDK folder in the '..\Program Files\Java' directory. Eg. 'C:\Program Files\Java\jdk1.8.0_241'
- Download and extract the code to your local machine. Open a command prompt and navigate to the folder UserManagement, which must contain the pom.xml.
- Build the Spring Boot UserManagement Application with Maven by using either of the commands given below.
mvn install / mvn clean install
or
maven package
- Run the application using Maven with the following command.
mvn spring-boot:run
-
Install Nodejs and npm package (can be installed from https://nodejs.org/en/ any version greater than 9. Follow the instructions to download nodejs and npm)
-
Start MongoDB container using
docker run -d -p 27023-27025:27017-27019 --name sessionmanagementDB mongo:4.0.4
- Run the command
npm install
- Now run the command
npm start
- Now you will be able to access the service through
http://localhost:3005/
-
A Running kafka broker at
localhost:9092
with topicdata-retrieval
. -
Python 3
- [https://www.python.org/downloads/] (https://www.python.org/downloads/). -
kafka-python
&pymongo
&requests
-
pip3 install kafka-python
pip3 install pymongo
pip3 install requests
-
Start Mongo container using
- DB instance for data retrieval service
docker run -d -p 27014-27016:27017-27019 --name dataretrievaldb mongo:4.0.4
- DB instance for model execution service
docker run -d -p 27017-27019:27017-27019 --name modelexecutiondb mongo:4.0.4
- DB instance for post-processing and analysis service
docker run -d -p 27020-27022:27017-27019 --name ppadb mongo:4.0.4
if you do not have mongo image already pull it from docker repo using
docker pull mongo:4.0.4
- Run the scripts as follows from root of repository
cd data-retrieval
python3 data-retrieval.py
cd model-execution
python3 model-execution.py
cd postprocessing-analysis
python3 postprocessing-analysis.py
-
Navigate to the folder 'WeatherApp'
-
Run the command
npm install
.This will install all the dependent packages for the ui to run.
3.Now run the command npm start
.
This will open the browser and your app will be running at `http://localhost:3000/`