Skip to content

Instantly share code, notes, and snippets.

View yifan-gu's full-sized avatar

Yifan Gu yifan-gu

  • San Francisco
View GitHub Profile

##Our project:

####Decentralized Membership System for Health Check and Service Discovery. (For clarification, we are proposing an engineering project, not a research topic. We want to open source this project, and hope we can use this in real production environment in the future.)

Problem we want to solve: Relieve the load on central coordinator, thus improve the scalability.

Why we think this might be a problem:

@yifan-gu
yifan-gu / wci.md
Last active August 29, 2015 14:08
who computes id.

#####Problem:

  1. Agent A has an address addA. The address addA also has an aliases addA'.

  2. When A starts, it uses addA as its address, so it computes its id = ID(addA)

  3. Another agent B starts, it wants to join A, but it only knows the aliases address of A, that is addA', so it uses this address to to compute the id of A, which is ID(addA').

  4. Later, when A and B exchange information, A will see an id = ID(addA'), and treat it as a different node from itself, thus A will then send message to itself.

#####To solve the problem:

@yifan-gu
yifan-gu / pseudo.md
Last active August 29, 2015 14:11
pseudo

��

Sender: 
gossip() {
    for (i = 0; i < fanout; i++ ) {
    q = getPeer();
    send (msg, q);
}
I0211 09:39:53.466158 22648 server.go:169] Both --etcd_servers and --api_servers are set. Not using etcd source.
W0211 09:39:53.466268 22648 server.go:240] Could not load kubernetes auth path: stat /home/yifan/gopher/src/github.com/GoogleCloudPlatform/kubernetes/hack/.test-cmd-auth: no such file or directory. Continuing with defaults.
I0211 09:39:53.466304 22648 docker.go:657] Connecting to docker on unix:///var/run/docker.sock
I0211 09:39:53.466323 22648 util.go:76] Sending events to api server.
I0211 09:39:53.466381 22648 server.go:360] Watching apiserver
I0211 09:39:53.466462 22648 plugins.go:112] Loaded volume plugin "kubernetes.io/empty-dir"
I0211 09:39:53.466478 22648 plugins.go:112] Loaded volume plugin "empty"
I0211 09:39:53.466497 22648 plugins.go:112] Loaded volume plugin "kubernetes.io/gce-pd"
I0211 09:39:53.466509 22648 plugins.go:112] Loaded volume plugin "gce-pd"
I0211 09:39:53.466527 22648 plugins.go:112] Loaded volume plugin "kubernetes.io/git-repo"
@yifan-gu
yifan-gu / testsystem.go
Created February 12, 2015 01:09
testsystemd.go
package main
import (
"fmt"
"github.com/coreos/go-systemd/dbus"
)
func main() {
fmt.Println("first")
first
second
panic: close of closed channel
goroutine 5 [running]:
github.com/godbus/dbus.(*Conn).Close(0xc208000a20, 0x0, 0x0)
/home/yifan/gopher/src/github.com/godbus/dbus/conn.go:178 +0x62
github.com/godbus/dbus.(*Conn).inWorker(0xc208000a20)
/home/yifan/gopher/src/github.com/godbus/dbus/conn.go:334 +0x10be
created by github.com/godbus/dbus.(*Conn).Auth
@yifan-gu
yifan-gu / no_fallocate.txt
Created February 26, 2015 23:50
no fallocate
PASS
BenchmarkWrite100EntryWithoutBatch 50 37415004 ns/op
BenchmarkWrite100EntryBatch10 500 3276359 ns/op
BenchmarkWrite100EntryBatch100 10000 362926 ns/op
BenchmarkWrite100EntryBatch500 20000 72593 ns/op
BenchmarkWrite100EntryBatch1000 50000 38534 ns/op
BenchmarkWrite1000EntryWithoutBatch 50 42914454 ns/op
BenchmarkWrite1000EntryBatch10 500 3900643 ns/op
BenchmarkWrite1000EntryBatch100 10000 386800 ns/op
BenchmarkWrite1000EntryBatch500 20000 81089 ns/op
1. Update the syncPod in container_runtime branch.
2. Add tests for rkt runtime.
3. Think about Puller, Exec.
@yifan-gu
yifan-gu / dd.md
Last active August 29, 2015 14:19
dd
{
    "ip4": <ipv4-and-subnet-in-CIDR>,
    "ip6": <ipv6-and-subnet-in-CIDR>
}
### Install dependencies
We have two kinds of dependencies in this project: tools and angular framework code. The tools help
us manage and test the application.
* We get the tools we depend upon via `npm`, the [node package manager](https://www.npmjs.com/).
* We get the angular code via `bower`, a [client-side code package manager](http://bower.io/).
`npm` is configured to automatically run `bower install` and `gulp`. Before you run the application for the first time, simply run this command from the `www/master` directory: