• This repository has been archived on 18/Dec/2019
  • Stars
    star
    100
  • Rank 340,703 (Top 7 %)
  • Language
    Go
  • License
    MIT License
  • Created about 9 years ago
  • Updated almost 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

a tool to initiate meetings by randomly pairing individuals

Mixer

Intro

Mixer is a tool to initiate meetings by randomly pairing individuals. Read more about it here.

Development Setup

  1. Setup your golang environment

  2. Grab the repo and put it in the right place:

     go get github.com/etsy/mixer
     cd $GOPATH/src/github.com/etsy/mixer
    
  3. Create the 'mixer' database:

     mysql -u root
     create database mixer;
     \u mixer
     source db/mixer.sql
     source db/mixer_data.sql
     grant all privileges on mixer.* to 'mixeruser'@'127.0.0.1' identified by '<somepassword>';
    
  4. Configure the mixer app:

  • cp config.cfg.sample config.cfg and edit the values to match your environment
  • cp config-secrets.cfg.sample config-secrets.cfg and put the password you created for mixeruser above in config-secrets.cfg
  1. Assuming you're running apache, create a virtual host config for mixer in /etc/httpd/conf.d/mixer.conf:

     <Virtualhost *:80>
       ServerName mixer.<hostname>
       ProxyPass / http://localhost:3001/ retry=0
       ProxyPassReverse / http://localhost:3001/
    
       RequestHeader set X-Username <username>
     </VirtualHost>
    

Note: This is a development setup. In production, your authentication system needs to pass the username as an http header after the user has logged in. The header name can be defined in the config. This app was not written to assume any implementation of your authentication system.

  1. Fire it up:

     go run mixer.go
    
  2. Open it in your browser at http://mixer.<hostname>

Architecture

The server is written in Go, while the client-side javascript is backbone + jquery. There is a local staff table, which is intended to be an updated copy of data from your company-wide staff database. It is assumed in the example import script that your company provides an api to the staff database in JSON format which is defined below. If this is not the case you are welcome to write your own import implementation to populate the staff table.

Additionally, as mentioned in the setup, this assumes that the application is fronted by an authentication system that passes headers into the app that define the username of the logged-in user. This allows the application to see if the user has an account, or if they have to be presented with a registration form.

It is easy to add new mixers by inserting into the groups table. There is currently no user interface for this admin functionality.

Running the Mixer

Each mixer must be run via separate cronjobs. This gives some flexibility to the frequency each mixer is run. An example of what this cron entry would like like is below:

# run as 12:00 on Mondays
0 12 * * 1 cd /usr/local/mixer && /usr/local/mixer/bin/match --group=Engineering >> /var/log/mixer/engineeringcron.log 2>&1

Importing the Staff Data

The local staff table is assumed to be populated and updated. There are some helper scripts written that make some assumptions. They assume that you are providing a URL returning JSON data of a specific format defined below. This is taken and inserted into the local staff table.

An example cron of running the import of staff data:

 # run script to sync staff data
 0 */4 * * * cd /usr/local/mixer && /usr/local/mixer/bin/staff >> /var/log/mixer/staffcron.log 2>&1

JSON Format of Staff Datafeed

{
  id: 5000,
  auth_username: "flastname",
  first_name: "Test",
  last_name: "User",
  title: "Engineer",
  avatar: "https://someurl/img.jpg",
  enabled: 1,
  is_manager: false,
}

Cleaning up Alumni

Since it doesn't make sense to pair people with others that have left the company, some cleanup work is involved with the groups people have joined. There is a script to help here. The assumption is that you populate your staff table with both enabled and non-enabled users. The cleanup script will then remove any users that have the enabled flag set to 0 from the people_groups table so that they are no longer matched but still retain their account and history.

An example cron to run the cleanup script is:

    # run script to cleanup alumni users
    0 12 * * 1 cd /usr/local/mixer && /usr/local/mixer/bin/cleanup >> /var/log/mixer/cleanupcron.log 2>&1

Notes

the is_manager field

There is one specific mixer group called Managers that is limited to managers by some fairly specific code that should be abstracted at some point. This value is set by the is_manager field from your staff database.

running alternating mixers

It is possible with some bash-fu to short circuit it to run every other week. Here is an example:

# run engineering mixer every other monday starting from Jan 5 2015
0 14 * * 1 bash -c '((($(date +\%s) + 259200) / 86400 \% 14))' && cd /usr/local/mixer && /usr/local/mixer/bin/match --group=Engineering >> /var/log/mixer/engineeringcron.log 2>&1
# run manager mixer every other monday starting from Jan 12 2015
0 14 * * 1 bash -c '((($(date +\%s) + 864000) / 86400 \% 14))' && cd /usr/local/mixer && /usr/local/mixer/bin/match --group=Managers >> /var/log/mixer/managerscron.log 2>&1

TODO

See Issues for bugs and ideas. We'd love to see your pull requests!

Help

Stop by the #codeascraft IRC channel on Freenode if you need any help.

More Repositories

1

AndroidStaggeredGrid

An Android staggered grid view which supports multiple columns with rows of varying sizes.
Java
4,756
star
2

skyline

It'll detect your anomalies! Part of the Kale stack.
Python
2,135
star
3

logster

Parse log files, generate metrics for Graphite and Ganglia
Python
1,968
star
4

deployinator

Deployinate!
Ruby
1,878
star
5

morgue

post mortem tracker
PHP
1,017
star
6

411

An Alert Management Web Application
PHP
971
star
7

feature

Etsy's Feature flagging API used for operational rampups and A/B testing.
PHP
869
star
8

MIDAS

Mac Intrusion Detection Analysis System
833
star
9

opsweekly

On call alert classification and reporting
JavaScript
761
star
10

oculus

The metric correlation component of Etsy's Kale system
Java
707
star
11

mctop

a top like tool for inspecting memcache key values in realtime
Ruby
507
star
12

supergrep

realtime log streamer
JavaScript
411
star
13

Conjecture

Scalable Machine Learning in Scalding
Java
361
star
14

statsd-jvm-profiler

Simple JVM Profiler Using StatsD and Other Metrics Backends
Java
330
star
15

nagios-herald

Add context to Nagios alerts
Ruby
322
star
16

dashboard

JavaScript
308
star
17

boundary-layer

Builds Airflow DAGs from configuration files. Powers all DAGs on the Etsy Data Platform
Python
262
star
18

Testing101

Etsy's educational materials on testing and design
PHP
262
star
19

DebriefingFacilitationGuide

Leading Groups at Etsy to Learn From Accidents
247
star
20

phpunit-extensions

Etsy PHPUnit Extensions
PHP
228
star
21

nagios_tools

Tools for use with Nagios
Python
173
star
22

open-api

We are working on a new version of Etsy’s Open API and want feedback from developers like you.
166
star
23

TryLib

TryLib is a simple php library that helps you generate a diff of your working copy and send it to Jenkins to run the test suite(s) on the latest code patched with your changes.
PHP
155
star
24

BugHunt-iOS

Objective-C
148
star
25

mod_realdoc

Apache module to support atomic deploys - http://codeascraft.com/2013/07/01/atomic-deploys-at-etsy/
C
128
star
26

ab

Etsy's little framework for A/B testing, feature ramp up, and more.
128
star
27

wpt-script

Scripts to generate WebPagetest tests and download results
PHP
121
star
28

applepay-php

A PHP extension that verifies and decrypts Apple Pay payment tokens
C
118
star
29

foodcritic-rules

Etsy's foodcritic rules
Ruby
115
star
30

kevin-middleware

This is an Express middleware that makes developing javascript in a monorepo easier.
JavaScript
110
star
31

cloud-jewels

Estimate energy consumption using GCP Billing Data
TSQL
96
star
32

jenkins-master-project

Jenkins Plugin: Master Project. Jenkins project type that allows for selection of sub-jobs to execute, watch, and report worst status of all sub-projects.
Java
83
star
33

Sahale

A Cascading Workflow Visualizer
JavaScript
83
star
34

PushBot

An IRC Bot for organizing code pushes
Java
79
star
35

cdncontrol

CLI tool for working with multiple CDNs
Ruby
79
star
36

rules_grafana

Bazel rules for building Grafana dashboards
Starlark
70
star
37

chef-whitelist

Simple library to enable host based rollouts of changes
Ruby
68
star
38

rfid-checkout

Low Frequency RFID check out/in client for Raspberry Pi
Python
64
star
39

Etsy-Engineering-Career-Ladder

Etsy's Engineering Career Ladder
HTML
61
star
40

Evokit

Rust
60
star
41

ELK-utils

Utilities for working with the ELK (Elasticsearch, Logstash, Kibana) stack
Ruby
59
star
42

incpath

PHP extension to support atomic deploys
C
52
star
43

arbiter

A utility for generating Oozie workflows from a YAML definition
Java
48
star
44

VIPERBuilder

Scaffolding for building apps in a clean way with VIPER architecture
Swift
41
star
45

chef-handlers

Chef handlers we use at Etsy
Ruby
40
star
46

sbt-checkstyle-plugin

SBT Plugin for Running Checkstyle on Java Sources
Scala
32
star
47

es-restlog

Plugin for logging Elasticsearch REST requests
Java
29
star
48

yubigpgkeyer

Script to make RSA authentication key generation on Yubikeys differently painful
Python
28
star
49

Apotheosis

Python
28
star
50

jenkins-deployinator

Jenkins Plugin: Deployinator. Links key deployinator information to Jenkins builds via the CLI.
Java
25
star
51

sbt-compile-quick-plugin

SBT Plugin for Compiling a Single File
Scala
25
star
52

geonames

Scripts for using Geonames
PHP
24
star
53

jading

cascading.jruby build and execution tool
16
star
54

etsy.github.com

Etsy! on Github!
HTML
16
star
55

divertsy-client

The Android client for running DIVERTsy, a waste stream recording tool to help track diversion rates.
Java
13
star
56

cdncontrol_ui

A web UI for Etsy's cdncontrol tool
CSS
13
star
57

terraform-demux

A user-friendly launcher (à la bazelisk) for Terraform.
Go
12
star
58

logstash-plugins

Ruby
11
star
59

jenkins-triggering-user

Jenkins Plugin: Triggering User. Populates a $TRIGGERING_USER environment variable from the build cause and other sources, a best guess.
10
star
60

EtsyCompositionalLayoutBridge

iOS framework that allows for simultaneously leveraging flow layout and compositional layout in collection views
Swift
3
star
61

consulkit

Ruby API for interacting with HashiCorp's Consul.
Ruby
1
star
62

soft-circuits-workshop

Etsy Soft Circuits Workshop
Arduino
1
star