Automatically apply decoupling and partitioning to Hydro programs for higher throughput.
Install development tools. These instructions are for Amazon Linux.
sudo dnf groupinstall -y "Development Tools"
# Optional, if you want to keep sessions running beyond SSH disconnects
sudo dnf install -y tmuxInstall Rust.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source ~/.bashrc
rustup target add x86_64-unknown-linux-musl
# Optional, if you plan on editing the code in an IDE
rustup component add rust-analyzerThe Linux machine on which you are running hydro-optimize will need permissions to launch VMs. If this is your local machine, you can simply sign into your AWS account locally; otherwise you will need to grant the remote machine the appropriate permissions.
The machine on which you are running hydro-optimize will need permissions to launch VMs.
- Go to AWS IAM Roles > Create role.
- Select "EC2" as the Use case.
- Add "AmazonEC2FullAccess" as the Permission policy.
- Give it a name (I named it "EC2FullRole").
- Go to the Instance you are running hydro-optimize from, Actions > Security > Modify IAM role.
- Give it the EC2FullRole.
You will need to increase your EC2 quota for experiments like benchmark_paxos. Request an increase to your "Running On-Demand Standard (A, C, D, H, I, M, R, T, Z) instances" quota for us-east-1 to 500.
Terraform is used to spin up machines. These are instructions for Amazon Linux machines; refer to the official site for your architecture.
sudo dnf install -y dnf-plugins-core
sudo dnf config-manager --add-repo https://rpm.releases.hashicorp.com/AmazonLinux/hashicorp.repo
sudo dnf install -y terraformWe rely on the Gurobi ILP solver to find the optimal set of rewrites. Gurobi is not free; you will need to either create a Gurobi account (and use a free educational license) or use your organization's license, if available.
./setup_gurobi.sh
source ~/.zshrcCreate a Gurobi license following your organization's instructions.
For free educational licenses, you may request a WSL license from Gurobi, then download it (which should create a gurobi.lic file) and put it on your remote machine under ~/.
Run all commands below within tmux so they continue running even if your SSH connection breaks.
To run Microbus or Krupa without applying any optimizations, run:
cargo run --example benchmark_paxos -- --aws > paxos.txt
cargo run --example cas -- --aws > cas.txtThe current progress of each execution can be found in the piped .txt files.
Note that killing the process (or putting the running machine to sleep) will leave the machines hanging, so if you must kill the process, be sure to follow instructions in "Tearing Down" to tear it down.
Optimization relies on an accurate model of networking costs, which must first be calibrated with NetworkCalibrator. This may take multiple hours, as it cycles through multiple network sizes, and gradually increases the number of clients for each size until throughput saturates.
cargo run --example network_calibrator -- --aws > network.txtOnce network calibration is complete, we can optimize either protocol by adding --optimize. For example:
cargo run --example benchmark_paxos -- --aws --optimize > paxos_optimize.txtRun the command above continuously in a loop until it returns with no outputs. Use the following script to automate that process:
./run_protocol.sh benchmark_paxos
./run_protocol.sh casAll results are stored in benchmark_results.
If the experiment ever goes wrong, you can terminate it with Ctrl+C.
Then delete any cloud resources with:
./terraform_cleanup.shAfterwards, you may optionally delete the terraform files to speed up future terraform cleanups:
rm -rf .hydro