Skip to content

Running Experiments on a Cloud Instance

Heron Yang edited this page May 2, 2018 · 4 revisions

Running a batch experiment may take few minutes to hours, so we run it on a cloud instance to avoid running such computational heavy job on our local machine for a long period.

Connect to a Cloud Instance

We skipped the details of allocating a Cloud Instance; instead, we start from a running instance and a given key to access it.

$ chmod 600 <folder_path_to_where_your_key_stores>/asset2.pem
$ ssh -i <folder_path_to_where_your_key_stores>/asset2.pem [email protected]

Create a GNU Screen Session

To avoid our session be lost after we disconnect, we always create a new session or resume the previous one before starting.

$ screen -RR
$ cd airport-simulation

Edit a Batch Simulation

At the time this document is composed, we have 4 batch experiments.

  1. batch_plans/sfo-terminal-2-uc-failed-spot.yaml: Uncertainty experiment on counting the failure rate
  2. batch_plans/sfo-terminal-2-uc-success-spot.yaml: Uncertainty experiment on generating the output metrics
  3. batch_plans/sfo-terminal-2-rt-failed.yaml: Reschedule exerpiment on counting the failure rate
  4. batch_plans/sfo-terminal-2-rt-success.yaml: Reschedule exerpiment on generating the output metrics

You can edit them using vim.

Run a Batch Simulation

Once we've edited the batch plan, we can run it now! For example:

$ ./simulator.py -f batch_plans/sfo-terminal-2-uc-failed-spot.yaml
Starting the simulation in batch mode
Running simulation with uncertainty.prob_hold = 0.000000 (nth = 0)
2018-05-02 18:49:12,849 Done
...

View the result

Batch run results are stored in the batch_output/ folder. You can able to find a subfolder that is as same as your batch plan name.

For multiple individual simulations executed by a batch run, you can find the results under output/

To download the data to a local machine, please use scp like the following command on your local machine, or a visualized tool like CyberDuck.

$ scp -i <folder_path_to_where_your_key_stores>/asset2.pem -r [email protected]:~/airport-simulation/batch_output/<batch_output_name>/ .

(Optional) Visualizing One of the Simulation Result

Step 1: Run the following command on the cloud instance:

./visualization/server.py

Step 2: Open the browser on your local machine and visit: http://35.170.55.208:5000/

Step 3: Select an experiment result from the left bottom dropdown list. It should start to load the data. Please wait for around 1~2 minutes for it to load the data. After the data is loaded, the right bottom should display "00:00" instead of "loading". Then, you can click on the arrow buttons or "auto-play" button to view the results.