• Stars
    star
    113
  • Rank 298,802 (Top 7 %)
  • Language
    Scala
  • Created almost 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A collection of state machine replication protocols

FrankenPaxos

This directory contains Scala implementations of various state machine replication protocols including Compartmentalized MultiPaxos, Matchmaker Paxos, Bipartisan Paxos, MultiPaxos, CASPaxos, CRAQ, EPaxos, Fast Paxos, and Mencius.

Getting Started

Make sure you have Java, Scala, and sbt installed. We tested everything with Java version 1.8.0_131 and with sbt version 1.1.6 on Ubuntu 18.04. You can install these however you like (e.g., we use this script and this script).

You can build and run all of frankenpaxos' code using sbt. All the code in this repository can be compiled to bytecode that you can run on the JVM and can also be compiled to Javascript that you can run in the browser. As a result, the project is split into two subprojects: frankenpaxosJVM for the code that compiles to bytecode and frankenpaxosJS for the code that compiles to Javascript. frankenpaxos is a parent project of the two.

$ sbt
sbt:frankenpaxos> frankenpaxosJVM/compile  # Build the JVM code.
sbt:frankenpaxos> frankenpaxosJS/compile   # Build the Javascript code.
sbt:frankenpaxos> frankenpaxos/compile     # Build all the code.
sbt:frankenpaxos> frankenpaxosJVM/test     # Run the tests.
sbt:frankenpaxos> frankenpaxosJS/fastOptJS # Compile to Javascript.
sbt:frankenpaxos> frankenpaxosJVM/assembly # Assemble a JAR.

$ # Run the JAR. Replace <main> with one of the executable classes. You can use
$ # tab completion to see the full list of possibilities.
$ java -cp jvm/target/scala-2.12/frankenpaxos-assembly-0.1.0-SNAPSHOT.jar <main>
$
$ # For example, we can run the echo server.
$ java -cp jvm/target/scala-2.12/frankenpaxos-assembly-0.1.0-SNAPSHOT.jar \
>     frankenpaxos.echo.ServerMain --help

Core code is in the shared directory, JVM-specific code is in the jvm/ directory, and Javascript-specific code is in the js/ directory.

Running Benchmarks

See the benchmarks/ directory for information on running benchmarks.

Running in the Browser

The code in this repository is compiled to Javascript using Scala.js. With a bit of HTML and Javascript, we can visualize the execution of a distributed system in the browser. For example, visit https://mwhittaker.github.io/frankenpaxos/js/src/main/js/echo/echo.html for a visualization of a simple echo protocol.

To run the visualization locally, run sbt frankenpaxosJS/fastOptJs and then run an HTTP server on port 8000 in the root frankenpaxos directory (e.g., by running python -m http.server 8000). Open http://localhost:8000/js/src/main/js/echo/echo.html. The source code for this example can be found in the following files:

Using Eclim

Eclim is a vim plugin that lets you use all the features and functionality of Eclipse from within vim. To use eclim with this project, first install eclim and all necessary dependencies. Then, do the following:

  1. Run eclipse from within sbt. This will create a .project file and a .classpath file in the jvm/ directory.

  2. Copy jvm/.project and jvm/.classpath into the root directory.

  3. Remove the linkedResources section in .project. It is not needed.

  4. Remove the kind="src" class path entries from the top of .classpath. Replace them with the following:

    <classpathentry kind="src" path="shared/src/main/scala"/>
    <classpathentry kind="src" path="shared/src/test/scala"/>
    <classpathentry kind="src" path="js/src/main/scala"/>
    <classpathentry kind="src" path="jvm/src/main/scala"/>
    <classpathentry kind="src" path="jvm/target/scala-2.12/src_managed/main"/>
    
  5. Open up vim and run :ProjectCreate . -n scala or :ProjectRefresh if the project already exists.

Updating Github Pages

git checkout master
git branch -f gh-pages master
git checkout gh-pages
git add -f js/target/scala-2.12/frankenpaxos-fastopt.js*
git commit
git push -f origin gh-pages

More Repositories

1

quoracle

A Swiss Army knife for read-write quorum systems
Python
82
star
2

aries

A Javascript ARIES Simulator
JavaScript
59
star
3

papers

📄 Paper Summaries
HTML
52
star
4

consistency_in_distributed_systems

Distributed Systems Consistency Reading Group
JavaScript
39
star
5

clocks

Time, Clocks, and the Ordering of Events
Python
36
star
6

distributed-systems-ocaml

Distributed Systems in OCaml
OCaml
20
star
7

dotfiles

.*
Vim Script
9
star
8

occ

Optimistic Concurrency Control
Python
8
star
9

linearizability

Linearizability Visualizer
Python
8
star
10

cppconcurrency

C++ Concurrency In Action, Thoughts and Notes
TeX
8
star
11

bipartisan_paxos

Bipartisan Paxos
TeX
7
star
12

enforced_invariant_confluence

Enforced Invariant Confluence
Python
5
star
13

crdts

CRDT Visualization
OCaml
4
star
14

weight

Weight Loss Grapher
Python
4
star
15

mwhittaker.github.io

Github Page
HTML
4
star
16

tla_talk

TLA+ talk
TLA
3
star
17

rust-list

OCaml's List Module in Rust
Rust
2
star
18

senior_perspective

ACSU Senior Perspective Talk
TeX
2
star
19

cs186-fa17-section

CS 186 Fall 2017 Section Material
TeX
2
star
20

five_minute_rule

The Five-Minute Rule
TeX
2
star
21

serial

Serialization Swiss Army Knife
Python
2
star
22

duckduckgo-ocaml

DuckDuckGo OCaml API
OCaml
2
star
23

hashcons

Type-Safe Modular Hash-Consing
OCaml
2
star
24

mongo-rust-driver

MongoBD Rust Driver
Rust
2
star
25

aptfinder

Apartment Finder
Python
2
star
26

vim_acsu

ACSU Vim Workshop
Python
2
star
27

wat

Wat-Provenance
TeX
2
star
28

pinyin_guesser

Tool to learn pinyin
JavaScript
1
star
29

texmf

LaTeX Templates
TeX
1
star
30

cstructs

Command-Structure Sets
Python
1
star
31

prelim_notes

Prelim Notes
HTML
1
star
32

vms

💻 Virtual Machines
Shell
1
star
33

vim_hackshop

Big Red Hacks Vim Hackshop
Python
1
star
34

tex_examples

LaTeX Examples
TeX
1
star
35

deeprl_project

Deep RL Final Project
Python
1
star
36

evelyn_paxos

Evelyn Paxos
TeX
1
star
37

tapir_benchmarks

TAPIR Benchmarks
Python
1
star
38

frankenpaxos_ai_sys_poster

FrankenPaxos AI-Sys Spring 2019 Poster
TeX
1
star
39

meals

A Meal Planning Site
JavaScript
1
star
40

matchmakers

Matchmaker Paxos and Matchmaker MultiPaxos
Scala
1
star
41

raft

Raft Consensus Algorithm
Vim Script
1
star
42

ocaml-rpc

Jane Street's RPC Library Examples
OCaml
1
star
43

dedalus

Dedalus
Python
1
star
44

beejsockets

Beej Sockets, Thoughts and Notes
TeX
1
star
45

zeromq_examples

C++ ZeroMQ Examples
C++
1
star
46

rasrotor

Rasrotor.
CSS
1
star
47

craq_bug

A minor bug in CRAQ's garbage collection
TeX
1
star
48

phantom-matrix

Very Strongly Typed Matrix Addition
OCaml
1
star