Assignment 1 Setup and Installation - airavata-courses/jerrin92 GitHub Wiki
System Stats:
The project involves collecting the system statistics (currently load and interrupts) and converting the data to a graph which could be viewed on a browser. This project uses micro service architecture which is the objective of the assignment. There are 2 graphs of which one of them is Load and the other is Interrupt count. The data collection begins at the Python scripts getInterrupts.py and getLoad.py. The scripts get the data and insert it into the mysql. There are 2 node services that read from the db and converts it into json object and serves through http. The userInterface which is in angular would get/request the data for the 2 graphs from these services.
Following are the installation guidelines:
System Requirements
- Python 2.7
- Node ^8.1.2 (https://nodejs.org/en/download/)
- MySQL ^14.14 (https://dev.mysql.com/doc/refman/5.5/en/linux-installation.html)
- Angular ^2.4 (https://www.npmjs.com/package/angular)
- npm ^5.3.0 (https://docs.npmjs.com/getting-started/installing-node)
- Express ^4.15.0 (
npm install -g express && npm install express-generator -g
)
After installing the required software, install the below modules for running the Python scripts
- MySQLdb (https://stackoverflow.com/questions/25865270/how-to-install-python-mysqldb-module-using-pip)
- psutil (
pip install psutil
)
Building and Running the system
- Start the MySQL service on your system
- Ensure that there is a database named
test
in MySQL or create it, if it does not exist - Edit the getLoad.py, getInterrupts.py, nodemon/app.js & nodemon2/app.js and change the MySQL credentials and port as per your local MySQL installation
- In the userInterface directory run command
npm install
followed bynpm start
- In the nodemon & nodemon2 directories run
npm install
- Run both the python scripts:
python getLoad.py
andpython getInterrupts.py
- Run
node app.js
in both nodemon and nodemon2 directories - Open a web browser and visit
http://localhost:4200
to view system statistics