Skip to content

Commit

Permalink
Merge pull request #48 from benchhub/store/meta/split-node
Browse files Browse the repository at this point in the history
[failed][store][meta][proto] Split node into info and status

this pr is not finished but merged due to the following reasons

- I am currently unifying project and labels of all my projects at15/ghutil#2
- after reading more code from non time series databases, I feel BenchHub the proejct itself should be structured like a database instead of a normal client and server application #50, some breaking change would be introduced, and just let the tests fail ....
  • Loading branch information
at15 authored Apr 13, 2018
2 parents 8c1bcb8 + 44e03bc commit eefc253
Show file tree
Hide file tree
Showing 30 changed files with 2,419 additions and 1,153 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ language: go
sudo: true
git:
depth: 3
env:
- DUMP=true # gommon/util/testutil.Dump

go:
- 1.9.x
Expand Down
51 changes: 51 additions & 0 deletions doc/survey/scheduler/k8s.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,54 @@ spec:
restartPolicy: Never
backoffLimit: 4
````

## Scheduler

- https://github.com/benchhub/benchhub/issues/49
- official
- https://github.com/kubernetes/community/blob/master/contributors/devel/scheduler.md
- code
- blog
- https://jvns.ca/blog/2017/07/27/how-does-the-kubernetes-scheduler-work/
- https://deis.com/blog/2016/schedulers-pt2-kubernetes/ Mothiki (colleague in PayPal) is the author

````text
pod = pop(queue)
nodes = filter(nodes)
nodes = order(nodes)
node = pick_one(node)
````

interface

````go
// scheduler/algorithm/scheduler_interface.go
type ScheduleAlgorithm interface {
// Schedule tries to schedule the given pod to one of the nodes in the node list.
// If it succeeds, it will return the name of the node.
// If it fails, it will return a FitError error with reasons.
Schedule(*v1.Pod, NodeLister) (selectedMachine string, err error)
}

// scheduler/algorithm/types.go
type PredicateFailureReason interface {
GetReason() string
}

// FitPredicate is a function that indicates if a pod fits into an existing node.
// The failure information is given by the error.
type FitPredicate func(pod *v1.Pod, meta PredicateMetadata, nodeInfo *schedulercache.NodeInfo) (bool, []PredicateFailureReason, error)

// scheduler/algorithm/predicates/error.go
// PredicateFailureError describes a failure error of predicate.
type PredicateFailureError struct {
PredicateName string
PredicateDesc string
}
````

implementation generic + mock

````go
// scheduler/core/generic_scheduler.go
````
15 changes: 10 additions & 5 deletions example/pingpong/pingpong.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,16 @@ workload:
databaseVersion: "0.0.1"
# NOTE: extra tag is specified in proto file using (gogoproto.moretags) = "yaml:\"nodeAssignments\""
nodeAssignments:
- name: srv
# NOTE: custom yaml unmarshaler
role: database
- name: cli
role: loader
- selectors:
- role: database # NOTE: custom yaml unmarshaler
properties:
name: srv
role: database
- selectors:
- role: loader
properties:
name: cli
role: loader
pipelines:
- name: download
stages:
Expand Down
Loading

0 comments on commit eefc253

Please sign in to comment.