15440 f15 project 3
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



This repository contains the starter code for project 3 (15-440, Fall 2015). These instructions assume you have set your GOPATH to point to the repository's root p3/ directory.

Starter Code

The starter code for this project is organized roughly as follows:

bin/                               Student-compiled binaries

  paxos/                           implement Paxos

  tests/                           Source code for official tests
    paxostest/                     Tests your paxos implementation
    paxosrpc/                      Paxos RPC helpers/constants
tests/                             Shell scripts to run the tests
    paxostest.sh                   Script for checkpoint tests


Compiling your code

To and compile your code, execute one or more of the following commands (the resulting binaries will be located in the $GOPATH/bin directory):

go install github.com/cmu440/runners/prunner

To simply check that your code compiles (i.e. without creating the binaries), you can use the go build subcommand to compile an individual package as shown below:

# Build/compile the "paxos" package.
go build path/to/paxos

# A different way to build/compile the "paxos" package.
go build github.com/cmu440-F15/paxos
How to Write Go Code

If at any point you have any trouble with building, installing, or testing your code, the article titled How to Write Go Code is a great resource for understanding how Go workspaces are built and organized. You might also find the documentation for the go command to be helpful. As always, feel free to post your questions on Piazza.

The prunner program

The prunner program creates and runs an instance of your PaxosNode implementation. Some example usage is provided below:

# Start a ring of three paxos nodes, where node 0 has prot 9009, node 1 has port 9010, and so on.
./prunner -ports=9009,9010,9011 -N=3 -id=0 -retries=5
./prunner -ports=9009,9010,9011 -N=3 -id=1 -retries=5
./prunner -ports=9009,9010,9011 -N=3 -id=2 -retries=5

You can read further descriptions of these flags by running

./prunner -h

Executing the official tests

1. Checkpoint

The tests for checkpoint are provided as bash shell scripts in the p3/tests directory. The scripts may be run from anywhere on your system (assuming your GOPATH has been set and they are being executed on a 64-bit Mac OS X or Linux machine). Simply execute the following:


2. Full test

The tests for the whole project are not provided for this project. You should develop your own ways of testing your code. After the checkpoint is due, we will open up submissions for the final version and run the full suite of tests.

If you have other questions about the testing policy please don't hesitate to ask us a question on Piazza!

Submitting to Autolab

To submit your code to Autolab, create a paxosapp.tar file containing your implementation as follows:

cd $GOPATH/src/github.com/cmu440-F15/
tar -cvf paxosapp.tar paxosapp/

In order for us to test your Paxos implementation, you should maintain the same directory structure and API for RPC calls as in the handout. However, you can add additional packages as part of your application component.


Using Go on AFS

For those students who wish to write their Go code on AFS (either in a cluster or remotely), you will need to set the GOROOT environment variable as follows (this is required because Go is installed in a custom location on AFS machines):

export GOROOT=/usr/local/depot/go