Coder Social home page Coder Social logo

distributed-group-membership's Introduction

Distributed Group Membership

UIUC CS425, Distributed Systems: Fall 2023 Machine Programming 2

Description

See MP Document

Installation

Prerequisites

  • Go 1.20

Build

make build

Usage

Serve

serve command start the command server and wait for commands from clients.

./bin/msl serve [flags]

Flags:
  -c, --config string   path to config file (default ".msl/config.yml")
  -h, --help            help for serve
  -l, --log string      path to log file (default "logs/msl.log")
  -p, --port string     port to listen on (default "7132")

Join

join command tells the machine to join the group.

./bin/msl join [flags]

Flags:
  -h, --help   help for join
  -c, --config string          path to config file (default ".msl/config.yml")
  -m, --machine-regex string   regex for machines to join (e.g. "0[1-9]") (default ".*")

Leave

leave command tells the machine to leave the group.

./bin/msl leave [flags]

Flags:
  -h, --help   help for leave
  -c, --config string          path to config file (default ".msl/config.yml")
  -m, --machine-regex string   regex for machines to join (e.g. "0[1-9]") (default ".*")

Fail

fail command tells the machine's process to fail.

./bin/msl fail [flags]

Flags:
  -h, --help   help for fail
  -c, --config string          path to config file (default ".msl/config.yml")
  -m, --machine-regex string   regex for machines to join (e.g. "0[1-9]") (default ".*")

List the Membership List

list_mem command lists the membership list.

./bin/msl list_mem [flags]

Flags:
  -h, --help   help for list_mem
  -c, --config string          path to config file (default ".msl/config.yml")
  -m, --machine-regex string   regex for machines to join (e.g. "0[1-9]") (default ".*")

List Self's ID

list_self command lists self's ID.

./bin/msl list_self [flags]

Flags:
  -h, --help   help for list_self
  -c, --config string          path to config file (default ".msl/config.yml")
  -m, --machine-regex string   regex for machines to join (e.g. "0[1-9]") (default ".*")

Enable/Disable Suspicion

enable suspicion command enables suspicion. disable suspicion command disables suspicion.

./bin/msl enable suspicion [flags]
./bin/msl disable suspicion [flags]

Flags:
  -h, --help     help for suspicion
  -c, --config string          path to config file (default ".msl/config.yml")
  -m, --machine-regex string   regex for machines to join (e.g. "0[1-9]") (default ".*")

Config

Set DropRate

config set-droprate command sets the drop rate.

./bin/msl config set-droprate [flags]

Flags:
  -d, --droprate float32   droprate
  -h, --help               help for droprate

Global Flags:
  -c, --config string          path to config file (default ".msl/config.yml")
  -m, --machine-regex string   regex for machines to join (e.g. "0[1-9]") (default ".*")

Set Verbose

config set-verbose command sets the verbose level.

./bin/msl config set-verbose [flags]

Flags:
  -h, --help      help for set-verbose
  -v, --verbose   enable or disable verbose

Global Flags:
  -c, --config string          path to config file (default ".msl/config.yml")
  -m, --machine-regex string   regex for machines to join (e.g. "0[1-9]") (default ".*")

Development

Prerequisites

  • Docker
  • docker compose

Set Environment

# on one session
docker compose -f docker-compose.dev.yml up [-d] [--build]

# on another session
docker exec -it dev /bin/ash
docker exec -it dev-m[1-10] /bin/ash

$ go run main.go [command] [flags]

Running on VMs

Prerequisites

  • msl binary in each VM home directory
  • tmux installed

Run Serve

Use tmux to run msl serve in background on each VM.

# run all msl process
./vm_run_all.sh

Run Commands

# ssh to one machine
./msl [command] [flags]

Kill

# kill all msl process
./vm_kill_all.sh

Contributor

distributed-group-membership's People

Contributors

kenchu123 avatar williamlin0825 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.