Skip to content

How to debug on AWS?

Samarth Kulshreshtha edited this page Nov 27, 2018 · 1 revision
  1. Check if you can reproduce the problem by running across multiple processes.
  2. If Step 1. doesn't work, try to reproduce the problem on AWS with as less VMs as possible.
  3. Once you have found a small n, use the run-on-ec2 script to start n VMs and kill the command using CTRL+\ after it starts to execute the MPC commands. Now, ssh into the AWS VMs (all of them, best to use terminator or a multiple paned terminal) using the command ssh <path-to-pem> ubuntu@<ip-of-the-VM> (the username is the same username that you specify in the AWS config)
  4. Check if there are any running containers on the VMs using - sudo docker ps. If there are any running containers it is best to kill them using - sudo docker kill $(sudo docker ps -q)
  5. Run the following command to start a shell inside the container on all the VMs: sudo docker run -it -p <same-port-in-config>:<same-port-in-config> -v /home/ubuntu/config:/usr/src/HoneyBadgerMPC/config/ -v /home/ubuntu/sharedata:/usr/src/HoneyBadgerMPC/sharedata/ -v /home/ubuntu/benchmark:/usr/src/HoneyBadgerMPC/benchmark/ -e HBMPC_NODE_ID=<hbmpc_node_id> -e HBMPC_CONFIG=config/config.ini -e HBMPC_RUN_ID=<run-id> <AwsConfig.DOCKER_IMAGE_PATH> bash
  • The port must match the port specified in the config while bringing up the VMs
  • The node id is different for each VM. You should pass the node ids in the same order starting from 0 to n-1 as the instance-id ordering in current.vms file. (This file should exist in the top directory after you use the run-on-ec2 script).
  • Run id can be any string (same for all VMs) unless you are running an MPC command whose inputs are generated with the run-id prefix in which case use the run-id generated when you created the VMs.
  • Docker image path is the path where you have uploaded the docker image. Eg: sudo docker run -it -p 7000:7000 -v /home/ubuntu/config:/usr/src/HoneyBadgerMPC/config/ -v /home/ubuntu/sharedata:/usr/src/HoneyBadgerMPC/sharedata/ -v /home/ubuntu/benchmark:/usr/src/HoneyBadgerMPC/benchmark/ -e HBMPC_NODE_ID=0 -e HBMPC_CONFIG=config/config.ini -e HBMPC_RUN_ID=test_run smkuls/honeybadgermpc:latest bash
Clone this wiki locally