Distributed Computing Course Projects
Table of Contents
1 Prerequisites
- We will try to fill you in on the missing prerequisites. Please fill out the following survey ../Overview/survey.html
1.1 Languages
- It is assumed that you are fluent in Java, and C++/C.
- It is not assumed that you are familiar with either RPC or RMI, Scala or Akka.
1.2 Programs v Processes
- Conceptually you must have a pretty good understanding of Programs-v-Processes.
- Both theory and (Linux) practice.
1.3 Linux
- We use Linux – any distro. We will not be using Windows.
- This course expects that you are already comfortable in the use of networked machines based on Linux and X GUI.
- Be able to remote login via
ssh
into a machine without having to give a password each time. Set up pub/private keys for your self. - Linux process-related system calls, in particular,
alarm, fork, pipes, signals
and somebash
scripting.
1.4 Assertions
- This course uses assertions written in logic (generalized Boolean exp) heavily.
- There will be lecture(s) on assertions; see ../FormalMethods/.
- But, do become familiar on your own with
assert.h
of C/C++ https://en.wikipedia.org/wiki/Assert.h.
2 Overview
- The projects are required. Not producing demonstrable (even if faulty) projects will award you a grade no better than an F in the whole course regardless of your performance in the exams.
- The projects must be work done by you as a single individual. Do not use code from other sources, not even if it was given by the instructor in a past term.
- The projects are evaluated both by a demo and by skimming the source code and associated documentation.
3 The Idea of a Digital WhiteBoard
- Our whiteboard (WB) is a digital interactive version of a typical class room whiteboard mounted on a wall but allowing multiple people, geographically distant, to simultaneously use the board. There are many open source and commercial implementations of this idea.
- To keep our project size within 1500 lines of code, we drastically simplified the WBs to (i) draw no more than zig-zag lines, and (ii) no text display. The multiple people are just you remotely working from multiple (virtual) machines.
3.1 WhiteBoard #1
- A whiteboard, say b0, is a window of colored zig-zag lines produced by different clients who are on the board. Clients can join/leave an existing board, or create a new board.
- A server S1 handles all the clients that share a given board b0, and has in general multiple boards, b0, b1,… There can be many servers, S1, S2, …
- A whiteboard is not shared among servers. For load balancing or whatever, a server may transfer a board (and all clients on it) to another server.
3.2 WhiteBoard #2
- Conceptually, the servers and clients are on whatever network nodes you wish. Obviously, firewalls etc, should permit communication among our nodes.
- We will give a demo, during the first week, to make all this familiar.
4 Project P0: Tasks 5% weight
We will give a P0.tar.gz (A Startup WhiteBoard Src Code Bundle) by Dr Mateti. Depending on the background of the students registered, this will be in one of C++, Java/Kotlin, or Go.
The P0 will be a tiny collection of client-server programs using
- C++ and RPC
- Java RMI and/or Jini, JavaSpaces
- Distributed PLs: Erlang, Go, and/or Scala
that implement the WB client-server paradigm, depending on the PL. These, as given, have only one server, but can have multiple boards and clients.
In P0, we are not using "threads". We do use multiple processes. And, several "machines".
4.1 Getting Started with P0
- For now, we assume P0 was given in C++. See ./WB-C-RPC/ to get an overview of the directory.
- Here is a ./WB-C-RPC/html/ web-browse-able version of the P0 source generated by http://www.doxygen.com .
- Study the source code closely. P0 is 800+ lines. You should become so familiar with it as if you wrote it. Read through this entire page: ../Projects/WB-C-RPC/0README.html
4.2 First Task: Build P0
- Your first task is to
make
the C++/X/RPC version so that the server is on one machine (node), and there are at least four clients on four different nodes (different CPUs?) and two different whiteboards. - Read the ./WB-C-RPC/0README.html to get an overview. You are given a working
version bundle of source code of the P0. Untar this (
tar xvvf tarBall.tbz
), and do a make. - We expect no errors inherently present in the bundle. Any errors you run into are likely to be due to your build environment.
- You will find ./WB-C-RPC/wbadmin.c useful after you have begun working with P1.
4.3 Second Task: Run P0
- Your second task is to run the C++/X/RPC version so that the server is on one machine (node), and there are at least four clients on four different nodes (different CPUs?) and two different whiteboards.
- The P0 C++/RPC version of our WB project expects that the Linux setup is as follows. See Linux Setup for further details.
rpcbind
is running with option -i. Read the man page for details.- Xorg/X server must not disable listening to TCP – The option
-nolistentcp
should not be present. - Be able to remote login via
ssh
into a machine without having to give a password each time. Set up pub/private keys for your self.
4.4 Second Task: Assertions
- Your second task is to write entry- and exit assertions for most of the procedures and functions of P0. First, in English prose, and then in PL Boolean expressions.
5 C-RPC-WhiteBoard Project P1 10%
- Extend P0 to P1. Extend the clients and server(s) as follows. The percentages shown below are the associated weights in grading.
- WB server now responds to messages from a new ``client'' that we call
wbadmin
. A simple example ofwbadmin.c
is included in the source code. 10% - Server must respond to a query with full information (name of the board, names of the host machines where the boards are in use, etc.) regarding all its whiteboards. 15%
- Server must respond to a request to initiate a new server on a given node. The newly given node may be the same node as that of an existing server. The newly created server begins its life with no boards to serve. 25%
- A server must respond to a request to transfer a given whiteboard (and hence all clients on it) from one server to another. This transfer should be transparent to the users of the clients. 25%
- Add usable pre- post-conditions to all (old and new) functions/ procedures/ methods. 25%
- Further clarifications, as needed, will be found on our discussion board.
- Design and implement the extensions described above in C++ and RPC. We are naming this version P1.
6 Java RMI: P2 10%
- Re-do/ re-design the P1 above but using Java, and RMI.
- ../RPC+RMI/java-rmi.html Further details. Required Readings listed there.
7 Scala + Akka: P3 10%
- Ideal Goal: Re-do/ re-design the P1 above but using [Scala and] Akka Actors.
- But, we had to face Covid-19 driven campus shutdown, lockdowns, etc. So, here are the new choices. The 10% of this project is divided as shown.
- 5% Learn some amount of Scala. Install a recent version of Scala.
Show that (i) the well-known "Hello World" works in the REPL. (ii)
The code given at
https://rosettacode.org/wiki/Sort_an_integer_array#Scala works when
compiled and run. (iii) Rewrite this using your own Quick Sort.
That is, without using the
scala.util.Sorting.quickSort(array)
or any other sorting library method. Read my lecture notes on Scala. ../Languages/Scala/index.html - 5% Learn some amount of Akka via Scala. Install version 2.6.4 or later of Akka. Show that the well-known Dining Philosophers Problem works in Akka. A web search will show that there are many blogs "solving" this problem. Fix their code so that it (first the problem, and then a solution) works in current Akka. You may use FSM or some other technique. Read my lecture notes on Akka. ../Akka/index.html
8 Turnins and Demos
8.1 Demos
- When you are done you must give me a demo of your program. You will get just one chance. It is over in about 5 minutes, typically. I may ask you to rebuild the program prior to the demo, but have it ready-to-run. We expect some of our class students as audience. Read through the acceptance test linked below.
- This is not a software engineering class. Bugs are tolerated. There is no teamwork.
- But your project must be demonstrable and must satisfy the acceptance test.
- Graded on a very coarse (not fine) basis.
8.2 Turnins
- The due dates and project weights are on the course home page. For each of the above, turn in a brief PDF report, with an overview of how you did it. Include screenshots that show that the WB Acceptance Test was passed. Also, turnin the tar ball of your source code.
- Applicable at WSU {Login to
thor.cs.wright.edu
. Using the command line~ceg737000/turnin P1 fileNames
. Change P1 to P0, P2 or P3 as needed.} - Revised to suit IIIT-Delhi. Submit to the Google Classroom.
- Submit files with your changes clearly pointed out/ marked/ highlighted.
- Submit your
ReadMe.txt
, not my0README.*
. Include this in your PDF.
9 Links
- ./Linux-Setup.html Linux Setup. Help with Linux for our WhiteBoard RPC projects (P0 and P1).
- ./7370-WB-C-RPC/ of the WhiteBoard C RPC projects P0, the src code bundle expanded for use in lectures. Download ./WB-C-RPC-2020.tbz
- ./WB-Java-RMI/ Java RMI version of P0. Download ./WB-Java-RMI-2020.tbz
- ./accept-test.html Acceptance Test. Before the demo, verify that it will pass this text.