[ Home | Schedule | Labs | Policy ]

Labs

Distributed systems labs for C++ lovers.

Lab assignments

  • Lab 1 - Replicated State Machine (Due Oct 2)
  • Lab 2 - Fault-tolerant Key-value Store (Due Oct 23)
  • Lab 3 - Sharded Key-value Store (Due Nov 13)
  • Lab 4 - Distributed Transactions (Due Dec 4)

Collaboration Policy

See here.

Lab Environment

A modern linux environment (e.g., Ubuntu 22.04) is recommended for the labs. If you do not have access to this, consider using a virtual machine, or a lxd container. All submissions will be graded in Ubuntu 22.04.

(Technically the labs can be run on a Mac, including M1/M2, with homebrew installed dependencies. But this is not thoroughly tested.)

Lab Repository Setup

Our labs are distributed and submitted through Github. Sign up an account if you don’t yet have one. Then join the labs assignment system via this link. Choose your student ID in the next page. If you don’t see your ID there, stop (don’t click skip) and contact the lecturer. Then follow the hints on the next page for initial setup of your private labs repo. (Github sometimes fails this step. Retry after a few minutes if it happens.)

You will submit labs by pushing to your private repo (as many times as you want) and we will collect labs for grading after the lab deadline directly from Github. Below are the steps for setting up the lab environment on your laptop. If you are not familiar with the git version control system, follow the resources here to get started.

Clone your repo by typing the following in a terminal:

$ git clone git@github.com:shuai-teaching/dslabs-cpp-<YourGithubUsername>.git  
$ cd dslabs-cpp-<YourGithubUsername>

You will see that a directory named dslabs-cpp-<YourGithubUsername> 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 repo you created is currently empty. Add the upstream and sync with it.

$ git remote add upstream https://github.com/stonysystems/dslabs-cpp 
$ git fetch upstream 

Next you will checkout the branch for the lab you are going to solve. For example, for lab 1:

$ git checkout -b lab-raft-solution upstream/lab-raft-22 
$ git submodule update --init
$ git push -u origin lab-raft-solution

Before compile, you need to install needed software dependencies.

sudo apt-get update
sudo apt-get install -y \
    git \
    pkg-config \
    build-essential \
    clang \
    libapr1-dev libaprutil1-dev \
    libboost-all-dev \
    libyaml-cpp-dev \
    libjemalloc-dev \
    python3-dev \
    python3-pip \
    python3-wheel \
    python3-setuptools \
    libgoogle-perftools-dev
sudo pip3 install -r requirements.txt

Refer to each lab assignment for compiling commands.

Acknowledgements

These labs are inspired by the C++/Go labs of MIT 6.824.