CA4019 Project
- Rust Nightly
- Protobuf Compiler
- Docker
- Docker Compose
Build everything by running:
$ cargo build --all
The following dependancies are required to run the benchmarking script:
- python3-tk
- matplotlib
Ubuntu dependancy installation:
apt-get install python3-pip python3-tk
pip3 install numpy matplotlib
The AWS benchmarking script is located at aws/benchmarking.py
Run cargo build --release
before running the script.
The project currently only works on Linux. macOS and other platforms are planned for the future.
OpenSSL is required - See http://github.com/sfackler/rust-openssl#building for installation instructions.
pip install boto3
-
Add AWS credentials to ~/.aws/credentials
A sample file is located in aws/credentials. Simply replace ACCESS_KEY_ID and SECRET_ACCESS_KEY with their respective values.
-
Update parameters in aws.py script
You will need to create and download an EC2 key pair from AWS and update the python script to use your .pem file containing the created key.
-
Ensure that you push the latest version of the master/worker containers to DockerHub
This can be done by running
./production-deployment.sh
in the cerberus root directory. -
Configure Launch Templates
You need to create two Launch Templates for EC2.
Each template MUST have the same name as described below and must have the given tag associated with it. Any other settings can be changed as you see fit.
Template Name Tag Master Key: "type", Value: "master" Worker Key: "type", Value: "worker" -
Deploy Instances
To create 1 master and N workers and deploy our containers to them we can run the following command:
python aws.py --create N --deploy
Useful commands:
- To restart currently running instances we can run
python aws.py --terminate --deploy
- To kill all of the instances we can use
python aws.py --kill