-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
57 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,26 @@ | ||
#!/bin/bash | ||
|
||
# roughly what needs to happen to set up a new machine | ||
sudo apt-get install git -y | ||
# sudo apt-get install vim -y | ||
|
||
# get java | ||
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u74-b02/jdk-8u74-linux-x64.tar.gz -nv | ||
|
||
tar xzf jdk-8u74-linux-x64.tar.gz | ||
rm jdk-8u74-linux-x64.tar.gz | ||
|
||
echo "export JAVA_HOME=~/jdk1.8.0_74" >> /home/vagrant/.bashrc | ||
echo "export PATH=\$JAVA_HOME/bin:\$PATH" >> /home/vagrant/.bashrc | ||
echo "export JAVA_HOME=~/jdk1.8.0_74" > ~/.bashrc | ||
echo "export PATH=\$JAVA_HOME/bin:\$PATH" >> ~/.bashrc | ||
|
||
# get lein | ||
mkdir bin | ||
cd bin | ||
wget https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein -nv | ||
chmod +x lein | ||
echo "export PATH=~/bin:\$PATH" >> /home/vagrant/.bashrc | ||
echo "export PATH=~/bin:\$PATH" >> ~/.bashrc | ||
echo "export LEIN_ROOT=1" >> ~/.bashrc | ||
|
||
# get the code | ||
cd /home/vagrant | ||
apt-get install git -y | ||
cd | ||
git clone https://github.com/dpzmick/auto_parallel.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,66 @@ | ||
#!/bin/bash | ||
|
||
# wrapper around run suite that runs the suite remotely | ||
|
||
display_usage() { | ||
echo -e "usage $0 host auto_parallel_local num_cpus local_out specs" | ||
echo -e "usage $0 num_cpus num_boxes local_out specs" | ||
echo -e "where" | ||
echo -e "\thost - remote host" | ||
echo -e "\tauto_parallel_local - directory with auto parallel code locally" | ||
echo -e "\tnum_cpus - number of cpus to use remotely" | ||
echo -e "\tnum_cpus - number of cpus in each vm" | ||
echo -e "\tnum_boxes - number of vms to create" | ||
echo -e "\tlocal_out - local directory to put output in" | ||
echo -e "\tspecs - specs to run, relative to the auto_parallel root on the remote" | ||
} | ||
|
||
# configs | ||
ssh_config_file=/tmp/vagrant-ssh-cfg | ||
auto_parallel_dir_local=. | ||
auto_parallel_dir_remote=/home/vagrant/auto_parallel | ||
|
||
if [ $# -lt 4 ] | ||
then | ||
display_usage | ||
exit 1 | ||
fi | ||
|
||
host=$1 | ||
auto_parallel_dir_local=$2 | ||
auto_parallel_dir_remote=/root/auto_parallel | ||
num_cpus=$3 | ||
local_output_dir=$4 | ||
num_cpus=$1 | ||
num_boxes=$2 | ||
local_out=$3 | ||
|
||
# idk | ||
tmp=( "$@" ) | ||
specs=( "${tmp[@]:3}" ) | ||
specs=$(echo "${specs[*]}") | ||
|
||
echo $specs | ||
# bring up all the vms | ||
# save the hosts to the config file one at a time | ||
for n in `seq 1 $num_boxes` ; do | ||
host="cores"$num_cpus"n"$n | ||
vagrant up $host | ||
vagrant ssh-config $host >> $ssh_config_file | ||
done | ||
|
||
# run the benchmarks, | ||
for n in `seq 1 $num_boxes` ; do | ||
host="cores"$num_cpus"n"$n | ||
( echo cd $auto_parallel_dir_remote ; echo git pull ; rm -rf out ; \ | ||
echo ./run_suite.sh out $specs) | \ | ||
{ ssh -F $ssh_config_file $host 2>&1 | sed "s/^/$host==>/" ; } & | ||
done | ||
wait | ||
|
||
echo "pushing directory" $auto_parallel_dir_local | ||
# copy the results into the local directory | ||
for n in `seq 1 $num_boxes` ; do | ||
host="cores"$num_cpus"n"$n | ||
mkdir -p $local_out/$host | ||
scp -F $ssh_config_file -r $host:$auto_parallel_dir_remote/out $local_out/$host | ||
done | ||
|
||
# copy a dir to run something | ||
rsync -a $auto_parallel_dir_local root@$host:$(dirname $auto_parallel_dir_remote) | ||
# shut down all the vms | ||
# for n in `seq 1 $num_boxes` ; do | ||
# host="cores"$num_cpus"n"$n | ||
# vagrant halt $host | ||
# done | ||
|
||
ssh root@$host auto_parallel_dir_remote=$auto_parallel_dir_remote num_cpus=$num_cpus specs=\"$specs\" 'bash -s' <<'ENDSSH' | ||
cd $auto_parallel_dir_remote | ||
./run_suite.sh $num_cpus out $specs | ||
ENDSSH | ||
|
||
echo "pulling directory" $auto_parallel_dir_remote/out | ||
# echo "pulling directory" $auto_parallel_dir_remote/out | ||
|
||
# copy an output dir back | ||
rsync -a root@$host:$auto_parallel_dir_remote/out . | ||
# # copy an output dir back | ||
# rsync -a root@$host:$auto_parallel_dir_remote/out . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters