Makefile for compiling the source

Makefile
all: compile
	@echo -e '[INFO] Done!'
clean:
	@echo -e '[INFO] Cleaning Up..'
	@-rm -rf cs455/**/*.class cs455/**/**/*.class
 
compile: 
	@echo -e '[INFO] Compiling the Source..'
	@javac -d . cs455/**/*.java cs455/**/**/*.java

Note: You may need to change the makefile according to the structure of your code.

In this version, I've assumed that all my code is in cs455.overlay and cs455.overlay.* packages. In other words, I have assumed that the maximum depth of the package structure is 3. If you have more levels of sub-packages, you should add extra arguments to the “javac” command in “compile” target and “rm -rf” command in “clean” target. For example, if you have a package “cs455.overlay.wireformats.impl” (4 levels), then append

cs455/**/**/**/*.java

to the “javac” command arguments and append

cs455/**/**/**/*.class

to the “rm -rf” command arguments.


Test Script

You need to set up a SSH key in your CS department login, so that it is not required to provide your password when connecting to a machine through SSH. The required instructions are given here.

Following script will spawn 10 messaging nodes in 10 separate physical machines. You should manually start the Registry node and use its hostname and port in the script as explained below.

test-overlay.sh
test_home=/path/to/the/compiled/source
 
for i in `cat machine_list`
do
	echo 'logging into '${i}
	gnome-terminal -x bash -c "ssh -t ${i} 'cd $test_home; java cs455.overlay.node.MessagingNode registry_host registry_port;bash;'" &
done

You need to edit this script to suit your environment.

  • Create a file named machine_list and add the set of machines you are going to use. Use a new line for each machine. The list of machines you can use are listed here.

Use only the machines that are located in CS120 lab. An example of this file is shown below (with 4 machines).

machine_list
annapolis
atlanta
augusta
boston
  • update the variable test_home to point to the place where your code is. The code should be compiled using the Makefile before running this script. It assumes the directory structure
    cs455/overlay/*

    .

  • Replace registry_host and registry_port in the second command of the for loop accordingly.
 
tools/hw1.txt · Last modified: 2015/02/05 14:32 by thilinab