Lab assignments

Lab 1 - Primary-backup (Due: 9/22)
Lab 2 - Raft (Due: 10/17, 10/27, 11/6)
Lab 3 - MapReduce (Due: 11/15)
(project alternative) Lab 4 - Fault-tolerant Key-value (Due: 12/4)
(project alternative) Lab 5 - Sharded key-value (Due: 12/15)

Acknowledgements

Labs 2-5 are originally developed as part of MIT 6.824.

Collaboration Policy

See here

If you wish to use your own existing Linux-based desktop or laptop instead of the class virtual machine, the labs might just work, but note that we don't have the energy or expertise to debug any problems you might have.

Lab Virtual Machine

We will grade your labs on an Ubuntu 16.04 machine with golang version 1.9. If you would like to do your labs on an identical environment, we recommend you install the class virtual machine (based on Ubuntu 16.04). To set it up, do the following steps.

Start a terminal once you logged in (You can find "LXterminal" under the "System tools" tab, which is expanded when you click the lower left button). Install golang1.9 by following the instructions given here. Note that it's easiest to do a binary installation of Go.

You may skip using VirtualBox and directly install Go1.9 on your MacOS or whatever. However, we will not provide any technical support should you encounter any OS-related issues in doing the labs. Furthermore, should the results of your lab differ from what we have obtained by running the tests on Linux, we will use our test results in determining the grade.

Lab Repository Setup

For each student in the class, we have created him/her a corresponding private lab repository on Github.com. You will submit labs by pushing to your private repo on github.com (as many times as you want) and we will collect labs for grading after the lab deadline directly from Github.com. Below are the steps for setting up your the lab environment on your laptop. If you are not familiar with the git version control system, follow the resources here to get started.

Cloning your lab repo locally

In a VirtualBox terminal, clone your repo by typing the following:

$ git clone https://github.com/nyu-ds2017/<YourGithubUsername>-golabs.git golabs
$ cd <YourGithubUsername>-golabs-2016
You will see that a directory named <YourGithubUsername>-golabs has been created under your home directory. This is the git repo for your lab assignments throughout the semester.

Setting up the upstream repo

The lab skeleton code are kept in the repo golabs managed by the course staff. Therefore, the first thing you need to do is to set up your own lab repo to track the changes made in the golabs repo. In the git world, golabs would be your "upstream" repo from which changes should ``flow'' into your own lab repo.

Type git remote add to add the upstream repo, and git remote -v to check that golabs is indeed an upstream for your own lab repo.

$ git remote add upstream https://github.com/nyu-ds2017/golabs.git
$ git remote -v
origin	git@github.com:nyu-ds2017/YourGithubUsername-golabs.git (fetch)
origin	git@github.com:nyu-ds2017/YourGithubUsername-golabs.git (push)
upstream	https://github.com/nyu-ds2017/golabs.git (fetch)
upstream	https://github.com/nyu-ds2017/golabs.git (push)

Immediately, you should check if the upstream golabs repo has additional changes not present in your repo. You can check for and merge in those changes by typing:

$ git fetch upstream
$ git merge upstream/master
You should perform the above two steps periodically to ensure that you've got the latest lab code. We will also remind you to fetch upstream on Piazza if we make changes/bug-fixes to the labs.

Saving changes while you are working on Labs

As you modify the skeleton files to complete the labs, you should frequently save your work to protect against laptop failures and other unforeseen troubles. You save the changes by first "committing" them to your local lab repo and then "pushing" those changes to the repo stored on github.com
$ git commit -am "saving my changes"
$ git push origin
Note that whenever you add a new file, you need to manually tell git to ``track it''. Otherwise, the file will not be committed by git commit. Make git track a new file by typing:
$ git add <my-new-file>
After you've pushed your changes with git push, they are safely stored on github.com. Even if your laptop catches on fire in the future, those pushed changes can still be retrieved. However, you must remember that git commit by itself does not save your changes on github.com (it only saves your changes locally). So, don't forget to type that git push origin.

To see if your local repo is up-to-date with your origin repo on github.com and vice versa, type

$ git status

Handin Procedure

To handin your files, simply commit and push them to github.com
$ git commit -am "saving all my changes and handing in"
$ git push origin 
We will fetching your lab files from Github.com at the specified deadline and grade them.