Skip to content

Commit eefc253

Browse files
authored
Merge pull request #48 from benchhub/store/meta/split-node
[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 ....
2 parents 8c1bcb8 + 44e03bc commit eefc253

30 files changed

+2419
-1153
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ language: go
33
sudo: true
44
git:
55
depth: 3
6+
env:
7+
- DUMP=true # gommon/util/testutil.Dump
68

79
go:
810
- 1.9.x

doc/survey/scheduler/k8s.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,54 @@ spec:
114114
restartPolicy: Never
115115
backoffLimit: 4
116116
````
117+
118+
## Scheduler
119+
120+
- https://github.com/benchhub/benchhub/issues/49
121+
- official
122+
- https://github.com/kubernetes/community/blob/master/contributors/devel/scheduler.md
123+
- code
124+
- blog
125+
- https://jvns.ca/blog/2017/07/27/how-does-the-kubernetes-scheduler-work/
126+
- https://deis.com/blog/2016/schedulers-pt2-kubernetes/ Mothiki (colleague in PayPal) is the author
127+
128+
````text
129+
pod = pop(queue)
130+
nodes = filter(nodes)
131+
nodes = order(nodes)
132+
node = pick_one(node)
133+
````
134+
135+
interface
136+
137+
````go
138+
// scheduler/algorithm/scheduler_interface.go
139+
type ScheduleAlgorithm interface {
140+
// Schedule tries to schedule the given pod to one of the nodes in the node list.
141+
// If it succeeds, it will return the name of the node.
142+
// If it fails, it will return a FitError error with reasons.
143+
Schedule(*v1.Pod, NodeLister) (selectedMachine string, err error)
144+
}
145+
146+
// scheduler/algorithm/types.go
147+
type PredicateFailureReason interface {
148+
GetReason() string
149+
}
150+
151+
// FitPredicate is a function that indicates if a pod fits into an existing node.
152+
// The failure information is given by the error.
153+
type FitPredicate func(pod *v1.Pod, meta PredicateMetadata, nodeInfo *schedulercache.NodeInfo) (bool, []PredicateFailureReason, error)
154+
155+
// scheduler/algorithm/predicates/error.go
156+
// PredicateFailureError describes a failure error of predicate.
157+
type PredicateFailureError struct {
158+
PredicateName string
159+
PredicateDesc string
160+
}
161+
````
162+
163+
implementation generic + mock
164+
165+
````go
166+
// scheduler/core/generic_scheduler.go
167+
````

example/pingpong/pingpong.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,16 @@ workload:
1212
databaseVersion: "0.0.1"
1313
# NOTE: extra tag is specified in proto file using (gogoproto.moretags) = "yaml:\"nodeAssignments\""
1414
nodeAssignments:
15-
- name: srv
16-
# NOTE: custom yaml unmarshaler
17-
role: database
18-
- name: cli
19-
role: loader
15+
- selectors:
16+
- role: database # NOTE: custom yaml unmarshaler
17+
properties:
18+
name: srv
19+
role: database
20+
- selectors:
21+
- role: loader
22+
properties:
23+
name: cli
24+
role: loader
2025
pipelines:
2126
- name: download
2227
stages:

0 commit comments

Comments
 (0)