Skip to content

brianweng31/CommDesign

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Environment

- Linux thinkpad-t480 5.4.0-81-generic #91~18.04.1-Ubuntu SMP Fri Jul 23 13:36:29 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
- Docker version 20.10.8, build 3967b7d
- Python 3.7.1

How to run

  • Install project dependencies
$ pip3 install -r requirements.txt
# Install protobuf compiler
$ sudo apt-get install protobuf-compiler

# Install buildtools
$ sudo apt-get install build-essential make
  • Migrate database tables
$ cd rest/
$ make
$ python3 manage.py migrate
  • Run the backend server
$ cd rest/
$ python3 manage.py runserver 127.0.0.1:8080
  • Run the eclipse mosquitto docker container (add sudo at the front if needed)
$ cd MQTT/
$ docker run -d -it -p 1883:1883 -v $(pwd)/mosquitto.conf:/mosquitto/config/mosquitto.conf eclipse-mosquitto
  • Compile protobuf schema to python wrapper
$ cd gRPC/
$ make
  • Start the fib service
$ cd gRPC/
$ python3 fib_server.py
  • Start the log service
$ cd gRPC/
$ python3 log_server.py

Send request

  • Ask for the result of fibonacci at N order
$ curl -X POST http://localhost:8080/rest/fibonacci  -d '{"order":N}'
  • Get a list of history fibonacci requests sent before
$ curl http://localhost:8080/rest/logs

CommDesign

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published