Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Anatomy of a Cluster Manager

Anatomy of a Cluster Manager

An overview of the fundamental components or building blocks of a general purpose cluster manager, the future of cloud computing, and a brief rant on the state of the industry.

Avatar for Jeff Lindsay

Jeff Lindsay

October 15, 2016

Other Decks in Programming

Transcript

  1. "We’re big believers in the value of disaggregation – of

    breaking down traditional data center technologies into their core components so we can build new systems that are more flexible, more scalable, and more efficient.”
 —Somebody at Facebook
  2. Dokku • Docker powered mini-Heroku • First Docker “killer app”

    • Single host only • Originally 65 lines of Bash • Simple and extensible #!/bin/bash set -e export PLUGIN_PATH=${PLUGIN_PATH:="/var/lib/dokku/plugins"} case "$1" in receive) APP="$2"; IMAGE="app/$APP" echo "-----> Building $APP ..." cat | dokku build $IMAGE echo "-----> Build complete!" echo "-----> Deploying $APP ..." dokku deploy $APP $IMAGE echo "=====> Application deployed:" echo " $(dokku url $APP)" echo ;; build) IMAGE="$2" id=$(cat | docker run -i -a stdin progrium/buildstep /bin/bash -c "mkdir -p /app && tar -xC /app") test $(docker wait $id) -eq 0 docker commit $id $IMAGE > /dev/null id=$(docker run -d $IMAGE /build/builder) docker attach $id test $(docker wait $id) -eq 0 docker commit $id $IMAGE > /dev/null ;; deploy) APP="$2"; IMAGE="$3" pluginhook pre-deploy $APP $IMAGE if [[ ! -f "$HOME/$APP/PORT" ]]; then # First deploy id=$(docker run -d -p 5000 -e PORT=5000 $IMAGE /bin/bash -c "/start web") echo $id > "$HOME/$APP/CONTAINER" port=$(docker port $id 5000) echo $port > "$HOME/$APP/PORT" echo "$(< "$HOME/HOSTNAME"):$port" > "$HOME/$APP/ADDRESS" else # Regular deploy oldid=$(< "$HOME/$APP/CONTAINER") docker kill $oldid > /dev/null port=$(< "$HOME/$APP/PORT") id=$(docker run -d -p ":$port" -e "PORT=$port" $IMAGE /bin/bash -c "/start web") echo $id > "$HOME/$APP/CONTAINER" fi pluginhook post-deploy $APP $port ;; plugins) ls -1 -d $PLUGIN_PATH/*/ pluginhook install ;; help) cat<<EOF | pluginhook commands help | sort help Print the list of commands plugins Print active plugins EOF ;; *) pluginhook commands "$@" ;; esac
  3. You should be able to throw together a cluster manager

    But I also believe you should be able to Throw Together Anything (tm)