Skip to content

Commit

Permalink
In Paired WAN setup for Google Cloud instances, use separate SSD for …
Browse files Browse the repository at this point in the history
…swapfiles
  • Loading branch information
samkumar committed Apr 25, 2021
1 parent 4c60d41 commit 1c38f88
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 3 deletions.
7 changes: 7 additions & 0 deletions cloud-init-gcp-paired.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,17 @@ disk_setup:
/dev/nvme0n1:
table_type: gpt
layout: true
/dev/nvme0n2:
table_type: gpt
layout: true
overwrite: true
fs_setup:
- device: /dev/nvme0n1p1
filesystem: ext4
- device: /dev/nvme0n2p1
filesystem: ext4
mounts:
- [ /dev/nvme0n1 ]
- [ /dev/nvme0n1p1 ]
- [ /dev/nvme0n2 ]
- [ /dev/nvme0n2p1 ]
2 changes: 1 addition & 1 deletion cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def init(_, id):
gcp_instance_name = "{0}-{1}-{2}".format(name, wan_location, location_id)
if (id % num_lan_machines) == 0:
c.location_to_id[wan_location] = id
google_cloud.spawn_instance(c.machines[id], gcp_instance_name, "n2-highmem-4", 1, "paired-noswap", *region_zone)
google_cloud.spawn_instance(c.machines[id], gcp_instance_name, "n2-highmem-4", 2, "paired-noswap", *region_zone)
else:
wan_index = id - num_lan_machines
wan_location = wan_machine_locations[wan_index]
Expand Down
2 changes: 1 addition & 1 deletion experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def clear_memory_caches(cluster, worker_ids):
cluster.for_each_concurrently(lambda machine, id: remote.exec_sync(machine.public_ip_address, "sudo swapoff -a; sudo sync; echo 3 | sudo tee /proc/sys/vm/drop_caches"), worker_ids)

def clear_output_files(cluster, worker_ids, prefix):
cluster.for_each_concurrently(lambda machine, id: remote.exec_sync(machine.public_ip_address, "rm -f ~/work/mage/bin/{0}* ~/work/mage/bin/*swapfile".format(prefix)), worker_ids)
cluster.for_each_concurrently(lambda machine, id: remote.exec_sync(machine.public_ip_address, "rm -f ~/work/mage/bin/{0}* ~/work/scratch/*".format(prefix)), worker_ids)

def run_paired_wan_experiment(cluster, problem_name, problem_size, scenario, mem_limit, location, log_name, workers_per_node, nodes_per_party, ot_pipeline_depth, ot_num_daemons, generate_fresh_input = True, generate_fresh_memprog = True):
protocol = "halfgates"
Expand Down
2 changes: 1 addition & 1 deletion scripts/generate_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def generate_worker_config_dict(global_id, internal_port, external_port, cluster
worker["external_host"] = cluster["machines"][global_id]["public_ip_address" if wan else "private_ip_address"]
worker["external_port"] = external_port
if wan:
worker["storage_path"] = "worker{0}_swapfile".format(worker_id)
worker["storage_path"] = "~/work/scratch/worker{0}_swapfile".format(worker_id)
else:
worker["storage_path"] = "/dev/disk/cloud/azure_resource-part1"
return worker
Expand Down
7 changes: 7 additions & 0 deletions scripts/provision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ sudo mount ${DISK_DEVICE} ~/work
sudo chown $(whoami):$(whoami) ~/work
cp -r /opt/* ~/work

mkdir -p ~/work/scratch
if [[ $1 = "gcloud" && $2 = "paired-noswap" ]]
then
sudo mount /dev/nvme0n2p1 ~/work/scratch
sudo chown $(whoami):$(whoami) ~/work/scratch
fi

# Use the latest version of MAGE
pushd ~/work/mage
git fetch origin
Expand Down

0 comments on commit 1c38f88

Please sign in to comment.