All Projects → vitorenesduarte → tricks

vitorenesduarte / tricks

Licence: Apache-2.0 license
Run experiments effortlessly on top of Kubernetes

Programming Languages

erlang
1774 projects
shell
77523 projects

Projects that are alternatives of or similar to tricks

developers-tips-and-tricks-resources
Repository with various tips and tricks for developers 🧑‍💻💡
Stars: ✭ 57 (+137.5%)
Mutual labels:  tricks
Frontend Tutorials
📘 Frontend Tutorials and Tricks — 前端技巧和教程
Stars: ✭ 33 (+37.5%)
Mutual labels:  tricks
Pine Utils
Code Snippets + Tricks & Tips to help Pine Script developers
Stars: ✭ 149 (+520.83%)
Mutual labels:  tricks
Deep Learning Tricks
Enumerate diverse machine learning training tricks.
Stars: ✭ 387 (+1512.5%)
Mutual labels:  tricks
Elixir Tips
The Killer Elixir Tips and Tricks...from the experience...
Stars: ✭ 833 (+3370.83%)
Mutual labels:  tricks
Better Python 59 Ways
Code Sample of Book "Effective Python: 59 Specific Ways to Write Better Pyton" by Brett Slatkin
Stars: ✭ 1,207 (+4929.17%)
Mutual labels:  tricks
git-wizard
instant git magic and tricks
Stars: ✭ 21 (-12.5%)
Mutual labels:  tricks
Pharo Wiki
Wiki related to the Pharo programming language and environment.
Stars: ✭ 161 (+570.83%)
Mutual labels:  tricks
Azuretipsandtricks
Learn some of our favorite Azure tips and tricks—some long-standing, and new ones that have recently been added to become more productive with Azure. Star the repo now to shave hours off your coding tasks tomorrow.
Stars: ✭ 957 (+3887.5%)
Mutual labels:  tricks
Dailyhack
🐱‍💻 Tiny Tiny Hacks we use in our daily life.
Stars: ✭ 142 (+491.67%)
Mutual labels:  tricks
Android Tips Tricks
☑️ [Cheatsheet] Tips and tricks for Android Development
Stars: ✭ 4,496 (+18633.33%)
Mutual labels:  tricks
Pytorchinsight
a pytorch lib with state-of-the-art architectures, pretrained models and real-time updated results
Stars: ✭ 713 (+2870.83%)
Mutual labels:  tricks
Js tricks
一些常用的 JS 方法 - some JS methods always by used
Stars: ✭ 82 (+241.67%)
Mutual labels:  tricks
Leader.js.cool
不可替代的团队领袖培养计划
Stars: ✭ 257 (+970.83%)
Mutual labels:  tricks
Shell Tricks
Simple bash tricks which make your life easier.
Stars: ✭ 153 (+537.5%)
Mutual labels:  tricks
SKanimATE
Animated Flatground Skateboard Tricks
Stars: ✭ 18 (-25%)
Mutual labels:  tricks
Spellbook
Micro-framework for rapid development of reusable security tools
Stars: ✭ 53 (+120.83%)
Mutual labels:  tricks
Easter Egg Collection
🐰 A funny library for tricking your colleagues.
Stars: ✭ 249 (+937.5%)
Mutual labels:  tricks
Vim Galore
🎓 All things Vim!
Stars: ✭ 12,610 (+52441.67%)
Mutual labels:  tricks
Synology
Cheatsheet and bash scripts sripts for Synology Nas Stations cheet cheat sheet nas networkdisk
Stars: ✭ 125 (+420.83%)
Mutual labels:  tricks

Build Status Coverage Status

Tricks

Running an experiment should be as easy as describing it in an YAML file.


Tricks presentation

Here's a presentation about Tricks.

About Tricks

A Tricks entry (TE) is a set of replicas/pods. An experiment is one or more TE's.

Features

  • Register occurrence of events. Each event has a counter associated.
  • Implicit events (start and stop of each pod in a TE)
  • Subscribe to events
    • can be used to implement synchronization barrier (e.g. make sure all clients start at the same time)
  • Workflow (e.g. only start a given TE once event X counter is Y)
  • Sequences of experiments
  • Pod discovery
  • Log aggregation
  • Plotting from logs (e.g. latency/throughput, CDF, bar, line)
  • Detect coordination omission from logs
  • Fault injection
    • (when) could be defined in the same way workflow is
    • (what) maybe provide some sort of pod selector for process faults, and link selector for network faults
  • Federation support (run across multiple Kubernetes clusters)
  • Spot/preemptible instances support (if an instance is killed, the experiment is restarted)

Example

In this example, event client1_stop and client2_stop are implicit events, while server-ready is an event registered by replicas in the server TE.

apiVersion: v1
experiment:
- tag: server
  image: vitorenesduarte/tricks-example
  replicas: 3
  env:
  - name: TYPE
    value: loop
  workflow:
    stop:
      name: client2_stop
      value: 6
- tag: client1
  image: vitorenesduarte/tricks-example
  replicas: 3
  env:
  - name: TYPE
    value: loop
  - name: SECONDS 
    value: 5
  workflow:
    start:
      name: server-ready
      value: 3
- tag: client2
  image: vitorenesduarte/tricks-example
  replicas: 6
  env:
  - name: TYPE
    value: loop
  - name: SECONDS
    value: 10
  workflow:
    start:
      name: client1_stop
      value: 3

Other examples

Running Tricks

Assuming there's a Kubernetes cluster running:

$ tricks start
$ tricks logs

And then in another terminal, run one of the examples:

$ tricks exp examples/explicit-events.yaml

Environment variables

Configuration of pods is achieved through environment variables. Some variable names are reserved and always defined in every pod:

  • TAG: from configuration file
  • REPLICAS: from configuration file
  • EXP_ID: an experiment identifier generated by Tricks
  • POD_ID: unique (no other pod with the same TAG and EXP_ID has the same id)
  • POD_IP: pod IP from Kubernetes
  • TRICKS_IP: pod IP of Tricks
  • TRICKS_PORT: port of Tricks

Drivers API

Replicas in experiments can be written in any language, as long as there's a driver available. Drivers open a socket (TRICKS_IP and TRICKS_PORT) and talk with Tricks using the following API ([DT] is used if it's a message from a Driver to Tricks, or with [TD] otherwise).

  • Register events [DT]
{
  "expId": "123456",
  "type": "event",
  "eventName": "connected",
}
  • Subscription of events [DT]
{
  "expId": "123456",
  "type": "subscription",
  "eventName": "connected",
  "value": 10
}
  • Notification of events [TD]
{
  "expId": "123456",
  "type": "notification",
  "eventName": "connected",
  "value": 10
}
  • Pod discovery [DT]
{
  "expId": "123456",
  "type": "discovery",
  "tag": "server",
  "min": 2
}

The argument min in the previous message is optional (default value is 0). Tricks will only reply when it has at least min pods (sending all, even if more than min).

  • Pod discovery [TD]
{
  "expId": "123456",
  "type": "pods",
  "tag": "server",
  "pods": [
    {
      "id": 1,
      "ip": "10.12.13.15"
    },
    {
      "id": 2,
      "ip": "10.12.13.16"
    },
    {
      "id": 3,
      "ip": "10.12.13.17"
    }
  ]
}

Sequences of experiments

Typically we want, not to run a single experiment, but several, and in the end compare metrics collected.

In order to support sequences of experiments, configuration values in the YAML file can be replaced by variables (e.g. $var), that are defined in a list of configurations. Each configuration will be used to create an experiment.

An example with two variables ($op_number and $client_number) that are used to define number of replicas, workflow configuration and environment variables:

apiVersion: v1
config:
  - $op_number: 100
    $client_number: 3
  - $op_number: 200
    $client_number: 3
  - $op_number: 100
    $client_number: 6
  - $op_number: 200
    $client_number: 6
experiment:
  - tag: server
    image: vitorenesduarte/tricks-example
    replicas: 3
    env:
    - name: TYPE
      value: server
    workflow:
      stop:
        name: client_stop
        value: $client_number
  - tag: client
    image: vitorenesduarte/tricks-example
    replicas: $client_number
    env:
    - name: TYPE
      value: client
    - name: OP_NUMBER
      value: $op_number
    workflow:
      start:
        name: server_start
        value: 3
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].