# Programming Assignments of CSE 486/586 ### Overview The goal of these assignments is to develop the skills of designing and implementing distributed protocols over multiple machines. They are more about designing and understanding the protocols/systems rather than programming itself; yet, these assignments are very challenging as they require strong programming skills. Assignment 1 is a simple application of MapReduce. It familiarizes you with the Go language and the distributed coding environment. Assignment 2 works on a more complicated protocol, distributed snapshot. It expects you to tackle more challenging designs. Assignments 3 and 4 implement Raft, a complex consensus protocol. They expect you to solve difficult problems in distributed systems. ### Suggestions * Start early. These assignments are difficult. * Understand the protocols and work out your design first before coding. * Code progressively. (Finishing an assignment in one sitting is impossible!) * Save your progress frequently. Use Git! ### System and Language Requirement * You should develop your code on MacOS or Linux (e.g., Ubuntu). Please note that TAs will grade your assignments on Ubuntu. Do not use Windows. * The assignments are written in Go. The tests are known to work with Go v1.13 and above. * Git is required for assignment submission. ### Tools and IDEs
There are some useful tools in the Go ecosystem, e.g., Go fmt, Go vet, and Golint. These tools could make your coding easier, but you do not have to use them.
For those who are used to Emacs and Vim, there are some resources for Go development, e.g., go_in_emacs (additional information available here) and go_in_vim (additional resources here).
For those who are used to Sublime, there are some useful Sublime packages for Go development: GoSublime and Sublime-Build.
JetBrains Goland is also a good option. It's a useful, full-featured Go IDE. You can get a free educational account with your UB email address.
### Coding StyleGood coding style is always important, and sometimes necessary, e.g., in large collaborative projects. Your code should have proper indentation, descriptive comments, and a comment header at the beginning of each file, which includes your name, student id, and a description of the file. A good coding style is always consistent, e.g., the same format for all comments throughout your code. We do not grade your code based on the style, you earn full credits as along as the code passes all tests, but you should prepare yourself (starting from now) for future real-world projects.
It is recommended to use the standard tools gofmt and govet. You can also use the Go Checkstyle tool for advice on how to improve your code's style. It would also be advisable to produce code that complies with Golint where possible.
### GitVersion control is necessary for developing large collaborative projects while working as a team. These assignments are individual, but you will be familiarized with the basic functions of Git. Please read this Git Tutorial.
The basic Git workflow in the shell (assuming you already have a repo set up):
All programming assignments require Git for submission.
We use Github for distributing and collecting your assignments. (You need to create a Github account if you have not done so.) You now should have your working copy of the assignments on Github, named labs-fall23-[your_github_username], by joining the Github classroom. It should be private. Never make it public or share it with anyone else; otherwise, it is a violation of academic integrity. To work on the assignments on your local machine, you need to clone the repository from Github to your machine. Normally, you only need to clone the repository once.
```bash $ git clone https://github.com/Distributed-Systems-at-Buffalo/labs-fall23-[username].git 586 $ cd 586 $ ls assignment1-1 assignment1-2 assignment1-3 assignment2 assignment3 assignment4 README.md $ ``` Now, you have everything you need for doing all assignments, i.e., instructions and starter code. Git allows you to keep track of and save the changes you make to the code. (This is why it's called version control.) For example, to checkpoint your progress, you canSome of the assignments are adapted from MIT's 6.824 course. Thanks to Frans Kaashoek, Robert Morris, and Nickolai Zeldovich for their support.