Skip to content
Scala Python JavaScript HTML Other
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
benchmarks
grafana
js/src/main
jvm/src
project
scripts
shared/src
.gitignore
.scalafmt.conf
.style.yapf
README.md
build.sbt
index.html

README.md

FrankenPaxos

Getting Started

You can build and run all of frankenpaxos's 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.
$ java -cp jvm/target/scala-2.12/frankenpaxos-assembly-0.1.0-SNAPSHOT.jar <main>

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 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 SimpleHTTPServer). 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.

Running Benchmarks

See the benchmarks/ directory for information on running benchmarks.

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
You can’t perform that action at this time.