1 of 31

Our job is too hard:

Tricks we can use

M18 LightKone

Maastricht

Vitor Enes

June 13, 2018

2 of 31

2

3 of 31

Outline

  • Experiments in Distributed Systems
  • Experiments as Code (EaC)
  • Ring Application
  • Sanity check

3

4 of 31

what we talk about

when we talk about

experiments...

5 of 31

  • How to get results
    • Log aggregation
    • Plotting from these logs
  • How to automate
  • How to reproduce
  • How to not spend (much) money
  • How to run
  • How to discover others running
  • How to wait for others

5

We’ll get these for free!!!

6 of 31

“A survey of general-purpose experiment

management tools for distributed systems” (2014)

7 of 31

let’s try to do that...

8 of 31

Infrastructure as Code (IaC)

write code to:

  • automate the provisioning of infrastructure

the infrastructure can be quickly created/recreated based on a

“configuration” that is version controlled,

along with the application itself

8

9 of 31

it’s time for

Experiments as Code

(EaC)

10 of 31

Experiments as Code (EaC)

write code to:

  • provide an unambiguous description of the experiment

NOT write code to:

  • deploy/install/configure
  • run
  • collect results

10

Typically we write these!

(over and over)

11 of 31

with this mindset...

12 of 31

Goal: Ring App

  • Run N servers
  • Connect servers in a Ring
  • Run N clients once servers are connected

12

13 of 31

Goal: Ring App

  • Run N servers [run]
  • Connect servers in a Ring [discover]
  • Run N clients once servers are connected [wait + run]
  • How to run
  • How to discover others running
  • How to wait for others

12

14 of 31

Tricks we can use...

15 of 31

Tricks (tool)

  • scheduler on top of Kubernetes scheduler
  • runs applications in Docker containers
  • defines a Driver API that helps writing applications

15

16 of 31

16

Tricks

Driver API

17 of 31

Driver API

  • ANY programming language: JSON is used to communicate with Tricks
  • How to run
  • How to discover others running
  • How to wait for others

17

// connect to Tricks

Tricks tricks = Tricks.init();

// non-blocking discovery

tricks.discovery(tag);

// blocking discovery

tricks.discovery(tag, count);

// register event

tricks.registerEvent(name);

// wait for event

tricks.waitEvent(name, count);

18 of 31

Ring App

  • Run N = 6 servers

Configuration of pods is achieved through environment variables:

  • TAG
  • REPLICAS
  • POD_ID {0 ... REPLICAS - 1}
  • TRICKS_IP
  • TRICKS_PORT

18

apiVersion: v1

experiment:

- tag: server

image: vitorenesduarte/ring-server

replicas: 6

Tricks

19 of 31

Ring App

  • Connect servers in a Ring

19

// server code

// blocking discovery: id -> pod information

Map<Integer, Pod> pods = tricks.discover(“server”, 6);

// form a ring

Integer id = tricks.getConfig().getPodId();

Pod left = ...

Pod right = ...

20 of 31

Ring App

  • Run N = 6 clients once servers are connected

20

// server code

Pod left = ...

Pod right = ...

- tag: client

image: vitorenesduarte/ring-client

replicas: 6

workflow:� start:� name: server-connected

value: 6

apiVersion: v1

experiment:

- tag: server

image: vitorenesduarte/ring-server

replicas: 6

// network stuff

connect(left);

connect(right);

tricks.registerEvent(“server-connected”);

21 of 31

Ring App

  • Run N = 6 clients once servers are connected (the other alternative)

21

// client code

// block until

tricks.waitEvent(“server-connected”, 6);

apiVersion: v1

experiment:

- tag: server

image: vitorenesduarte/ring-server

replicas: 6

- tag: client

image: vitorenesduarte/ring-client

replicas: 6

22 of 31

does this make any sense?

23 of 31

RiseML: Automate DL Experiments

23

24 of 31

Metaparticle: Language-Agnostic Library

24

25 of 31

Reproduce your own experiments

(the script was developed in a Linux machine;

running it in MacOS resulted in a BUG!)

25

26 of 31

YCSB++: Synchronization Barrier using ZK

26

27 of 31

Side note: ”SPLAY: Distributed Systems Evaluation Made Simple”

(NSDI’ 09)

Kubernetes prediction

  • kube-scheduler
  • kubelet
  • containers

27

28 of 31

what’s next?

29 of 31

Next

Features

Save money!

30 of 31

Tricks

30

31 of 31

M18 LightKone - Maastricht

Questions?�Why don’t you want to use Tricks?

Vitor Enes

vitorenesduarte@gmail.com

@vitorenesduarte