Skip to content

Per48edjes/Gossip-Glomers-C

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gossip Glomers in C

This repo houses solutions Fly.io's Gossip Glomers challenges, implemented in C.

❓: What's Gossip Glomers? See here for more information!

Getting Set Up

The workflow to develop this project leverages Docker to provide the runtime for maelstrom (the testing framework for Gossip Glomers). For developer quality of life (dev QoL), we recommend developing locally and volume mounting the container. This allows you to use your local development environment (e.g., choice of editor, LSP, debugger, etc.) while still having the runtime available for testing and program execution.

Requirements

The following are what's needed to set up the development and execution environments for this project:

  • Docker Desktop (namely, the Docker daemon will need to be running to run the container)

Note that the following two dependencies are already included in the runtime (see Dockerfile), but are worth installing locally for dev QoL (e.g., LSPs may require having json-c source on hand).

  • json-c (e.g., on Mac, this can be installed using brew install json-c; see the project Github for more information)
  • pkg-config (e.g., on Mac, this can be installed using brew install pkg-config)

Building the Project

The top-level Makefile governs the build dependency graph. For convenience, the entire project can be built by simply executing:

make

in the container's /app directory (read: the same directory, in the container, mounted to the local directory containing this project).

Challenges

Challenge 1

To run the solution to Challenge 1: Echo, execute the following (in /app) in the container (after building the project):

maelstrom test -w echo --bin build/challenge-1.out --node-count 1 --time-limit 10

Challenge 2

To run the solution to Challenge 2: Unique ID Generation, execute the following (in /app) in the container (after building the project):

maelstrom test -w unique-ids --bin build/challenge-2.out --time-limit 30 --rate 1000 --node-count 3 --availability total --nemesis partition

Challenge 3a

To run the solution to Challenge 3a: Single Node Broadcast, execute the following (in /app) in the container (after building the project):

maelstrom test -w broadcast --bin build/challenge-3a.out --node-count 1 --time-limit 20 --rate 10

Challenges 3b & 3c

To run the solution to Challenge 3b: Multi Node Broadcast and Challenge 3c: Fault Tolerant Broadcast, execute the following (in /app) in the container (after building the project):

# Challenge 3b
maelstrom test -w broadcast --bin build/challenge-3bc.out --node-count 5 --time-limit 20 --rate 10

# Challenge 3c
maelstrom test -w broadcast --bin build/challenge-3bc.out --node-count 5 --time-limit 20 --rate 10 --nemesis partition

Everything looks good! ヽ(‘ー`)ノ

About

Solutions to distributed system challenges from https://fly.io/dist-sys/

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 89.7%
  • Makefile 7.4%
  • Shell 1.5%
  • Dockerfile 1.4%