Coder Social home page Coder Social logo

lazyyy77 / cloud-on-cloud Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 19.78 MB

The project of NUS SOC 2024, SWS3004-Cloud Computing with Big Data. This project is for weather informing and forecasting, to create a community and achieve collaborating, preparation-making, resources-sharing and life-saving. The members of our group - group2 - Waffle Rush are: Liang Wenjie, Xu Ruikang, Jiang Guanyu, Shen Yipeng.

License: Apache License 2.0

Java 5.10% Python 27.41% JavaScript 0.49% HTML 0.09% Vue 5.22% CSS 0.70% Dockerfile 0.68% Smarty 60.32%

cloud-on-cloud's Introduction

Cloud-on-Cloud

Team Member:

1. Project Overview

The project of NUS SOC 2024, SWS3004-Cloud Computing with Big Data. The members of our group - group2 - Waffle Rush are: Liang Wenjie, Xu Ruikang, Jiang Guanyu, Shen Yipeng.

1.1 Project Description

This project is for weather informing and forecasting, to create a community and achieve collaborating, preparation-making, resources-sharing and life-saving.

It showcasing the current weather conditions, providing the outdoor tips, predicting the future weather, as well as supporting an on-line weather-chatting-room for information sharing.

1.2 System Architecture

structure

1.3 Key Components

  • Component 1: Frontend-Part: using vue to design the router/pages, using nginx as web-server and handling the reverse proxy.
  • Component 2: Backend-Part with Django: response to the data request from the front-end's weather page by selecting and handling information from database.
  • Component 3: Backend-Part with Java: response to the data request from the front-end's chatbox by selecting\inserting\updating information from database.
  • Component 4: Backend-Part with Python&ML: calling the api to get the latest weather information while inserting them into the database. Using LSTM/spark to predict the future weather with timestamp.
  • Component 5: Backend-Part with Kafka: still developing. Creating and dealing with the stream data by compress a long period of time to few seconds.

2. Environment Setup

2.1 Prerequisites

2.2 Installation

The following steps can help you to run the different parts of the project in developing mode.

2.2.1 Step 1: Build the Backend-Weather

Notice: You need to change the database configuration belows to your own. To know more, check the readme in /src/Backend-Weather/readme.md.

  • weatherApp_backend/weatherApp_backend/settings.py

  • kube-yaml/mysql-deployment.yaml

  • kube-yaml/weatherapp-backend-deployment.yaml

python manage.py makemigrations
python manage.py migrate
python manage.py runserver ${your ip address}:${your port}

2.2.2 Step 2: Build the Backend-Information

There will be a more detailed guide in /src/Backend-Information/readme.md

python get_weather.py
python get_warning.py
python get_predict.py

2.2.3 Step 3: Build the Backend-Chatroom

There will be a more detailed guide in /src/Backend-Chatroom/readme.md

mvn clean compile
mvn exec:Java
mvn clean package

2.2.4 Step 4 (Optional): Build the Backend-Kafka

There will be a more detailed guide in /src/Backend-Kafka/readme.md

cd kafka-29.3.8/kafka
helm install -n kafka kafka .

2.2.5 Step 5: Build the Frontend-Release

There will be a more detailed guide in /src/Frontend-Release/readme.md

npm install
npm run dev
npm run build

3. Application Deployment

The following steps can help you to deploy the different parts of the project on k8s with production mode. It directly uses the images create by the dockerfile of each parts.

Please run the commands under the deployment folder:

3.0 AWS

  • connect to your aws account with AWS CLI.
  • create an EKS cluster with 2 node groups, whose labels nodegroup 's value equal to FrontendGroup / BackendGroup.

3.1 Service

  • fsvc.yaml -- LoadBalancer -- expose front-end kubectl apply -f ./1svc/fsvc.yaml
  • bwsvc.yaml -- NodePort -- expose back-end-weather kubectl apply -f ./1svc/bwsvc.yaml
  • bcsvc.yaml -- ClusterIP -- expose back-end-chatbox kubectl apply -f ./1svc/bcsvc.yaml
  • msvc.yaml -- ClusterIP -- expose mysql kubectl apply -f ./1svc/msvc.yaml

3.2 Database

  • mpv.yaml -- persistent volume kubectl apply -f ./2db/mpv.yaml
  • mpvc.yaml -- persistent volume claim kubectl apply -f ./2db/mpvc.yaml
  • mconfig.yaml -- ConfigMap kubectl apply -f ./2db/mconfig.yaml
  • msecret.yaml -- Secret -- password kubectl apply -f ./2db/msecret.yaml
  • mysql.yaml -- database kubectl apply -f ./2db/mysql.yaml
  • exec m-dep pod
    • kubectl exec -it ${your sql pod name} -- sh
    • execute mysql -u root -p
    • pwd = 12345678
    • execute create database weather;

3.3 Backend & Database Initialize

  • bwdep.yaml -- deployment -- backend-weather
    • kubectl apply -f ./3be/bwdep.yaml
    • kubectl autoscale deployment bw-dep --cpu-percent=50 --min=2 --max=5
    • exec bw-dep pods
      • kubectl exec -it ${your sql pod name} -- sh
      • execute python manage.py makemigrations
      • execute python manage.py migrate
  • bcdep.yaml -- deployment -- backend-chatbox
    • kubectl apply -f ./3be/bcdep.yaml
    • kubectl autoscale deployment bc-dep --cpu-percent=50 --min=1 --max=5

3.4 Jobs

  • warning_cj.yaml -- job -- provide warning
    • kubectl apply -f ./4cj/warning_cj.yaml
  • weather_cj.yaml -- job -- provide weather
    • kubectl apply -f ./4cj/weather_cj.yaml
  • predict_cj.yaml -- job -- provide predict
    • kubectl apply -f ./4cj/predict_cj.yaml

3.5 Frontend

  • fdep.yaml -- deployment -- front-end
    • kubectl apply -f ./5fe/fdep.yaml
    • kubectl autoscale deployment f-dep --cpu-percent=50 --min=2 --max=10

cloud-on-cloud's People

Contributors

lazyyy77 avatar

Watchers

Lucian avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.