bpartridge / CS262_ComputeServer_Group8

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

# Distributed Compute Server for CS 262 (Group 8) #

Group members: Brenton Partridge, Ore B, Holly Anderson

## COMPILATION ##

To compile all files:

    ./compile.sh

Class files and stubs will be placed in the "bin/" directory.

## GENERAL RMI CONSIDERATIONS ##

Begin by running the RMI registry on the default port in the background with `rmiregistry &`. Note its hostname. If running on the same machine as any other components of the system, it should be run without arguments from the "bin/" directory to avoid classpath problems.

In order for a worker running on an uncontrolled host (with an uncontrolled codebase) to be able to access the class files that implement client tasks, the following conditions must be true:

(1) The client must make its codebase available over HTTP. We recommend running a simple HTTP server whose root is the directory in which class files are organized by package (for Group 8, this is the "bin/" directory. For instance, `(cd bin && python -m SimpleHTTPServer)` will serve the codebase on port 8000 by default.

(2) The client must broadcast the codebase address by specifying `-Djava.rmi.server.codebase="http://$CLIENT_HOST_NAME:$CLIENT_CODEBASE_PORT"` on the command line, where $CLIENT_HOST_NAME must resolve to the public IP address of whatever machine is running the HTTP server from (1), and $CLIENT_CODEBASE_PORT is the port of the HTTP server from (1).

(3) The server and worker must EACH permit dynamic code loading from client-specified codebase addresses by specifying `-Djava.rmi.server.useCodebaseOnly=false` on the command line. No specific information is needed about addresses of other machines.

Additionally, any component must pass the **public** (publicly resolvable) host name or IP address of the machine it is running on, as the command line option "-Djava.rmi.server.hostname=$MY_PUBLIC_HOST_NAME", so that the rmiregistry communicates the public IP rather than an internal IP to other components.

These requirements are implemented in the usage instructions below.

## USAGE FOR GROUP 8 COMPONENTS ##

After starting the rmiregistry and the codebase server as explained above, run the following commands for each part of the system (possibly but not necessarily on separate machines), substituting the rmiregistry host name and port for $REGISTRY_HOST_NAME and $REGISTRY_PORT respectively; $CLIENT_HOST_NAME and $CLIENT_CODEBASE_PORT as explained in (2) above; an arbitrary but consistent server name such as ComputeServer for $SERVER_NAME; and arguments as needed for tasks such as $DIGITS_OF_PI.

    (cd bin && java -Djava.security.policy=../general.policy -Djava.rmi.server.useCodebaseOnly=false -Djava.rmi.server.hostname=$MY_PUBLIC_HOST_NAME group8.QueuedServer $REGISTRY_HOST_NAME $SERVER_NAME $REGISTRY_PORT)

    (cd bin && java -Djava.security.policy=../general.policy -Djava.rmi.server.useCodebaseOnly=false -Djava.rmi.server.hostname=$MY_PUBLIC_HOST_NAME group8.Worker $REGISTRY_HOST_NAME $SERVER_NAME $REGISTRY_PORT)
    
    (cd bin && java -Djava.security.policy=../general.policy -Djava.rmi.server.codebase="http://$CLIENT_HOST_NAME:$CLIENT_CODEBASE_PORT/" -Djava.rmi.server.hostname=$MY_PUBLIC_HOST_NAME group8.ComputePi $REGISTRY_HOST_NAME $SERVER_NAME $REGISTRY_PORT $DIGITS_OF_PI)

The specific tasks are:

    group8.ComputePi (shown above, computes an approximation of the value of pi, requires 1 extra argument for # digits to compute)
    group8.ComputeE (computes an approximation of the value of e, requires 1 extra argument for number of iterations)
    group8.ComputeFact (computes an approximation of the value of x!, requires 1 extra argument for x)

About


Languages

Language:Java 99.5%Language:Shell 0.5%