Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scheduler in tree #288

Merged
merged 1,317 commits into from
Jul 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1317 commits
Select commit Hold shift + click to select a range
b6d16d3
Merge pull request #721 from hex108/best_node
k8s-ci-robot Apr 8, 2019
d86cd41
Merge pull request #714 from asifdxtreme/master
k8s-ci-robot Apr 8, 2019
9f27d9c
Merge pull request #722 from shivramsrivastava/spellcheck_script
k8s-ci-robot Apr 8, 2019
11a83b3
Add workflow of Reclaim action
thandayuthapani Apr 5, 2019
0023547
Do not count in pipelined task when caculating ready tasks number
hex108 Apr 8, 2019
5b1c1fc
Merge pull request #650 from hex108/gang
k8s-ci-robot Apr 8, 2019
8127ea6
Docs for Preempt action
thandayuthapani Apr 8, 2019
89af0e3
Merge pull request #723 from thandayuthapani/preempt
k8s-ci-robot Apr 9, 2019
49ae13a
add options to enable the feature of PriorityClass
jiaxuanzhou Apr 9, 2019
b7462ea
Merge pull request #725 from jiaxuanzhou/options
k8s-ci-robot Apr 9, 2019
d2b5df3
Docs for Reclaim Action
thandayuthapani Apr 9, 2019
fd95416
Add basic Job definition
TommyLike Apr 10, 2019
8c295b2
Merge pull request #727 from thandayuthapani/reclaim
k8s-ci-robot Apr 10, 2019
efbd227
Add basic Job definition
TommyLike Apr 10, 2019
7f2dda3
Add generated client codes
TommyLike Apr 10, 2019
362a0c2
Merge branch 'feature/add-job-object' of https://github.com/TommyLike…
TommyLike Apr 10, 2019
6d2abb8
Remove generated file from checking
TommyLike Apr 10, 2019
fa43a00
Merge pull request #728 from TommyLike/feature/add-job-object
k8s-ci-robot Apr 10, 2019
0f0635c
Add job admission support
TommyLike Apr 10, 2019
943338c
Merge pull request #731 from TommyLike/feature/add-job-admission
k8s-ci-robot Apr 10, 2019
96c5f67
Add job controller
hzxuzhonghu Apr 10, 2019
e0ad04a
add helpers
hzxuzhonghu Apr 10, 2019
deda6fe
fix
hzxuzhonghu Apr 10, 2019
0d1c09a
run dep ensure
hzxuzhonghu Apr 10, 2019
4d0cd55
Add vkctl
hzxuzhonghu Apr 10, 2019
239e0e1
run dep ensure
hzxuzhonghu Apr 10, 2019
4b07b10
fix go fmt
hzxuzhonghu Apr 10, 2019
e068f63
Merge pull request #732 from hzxuzhonghu/job-cont
k8s-ci-robot Apr 10, 2019
9b0f956
Merge pull request #733 from hzxuzhonghu/cli
k8s-ci-robot Apr 10, 2019
543b1c5
Built binaries.
k82cn Apr 10, 2019
8dc2d65
fix go fmt in vkctl
hzxuzhonghu Apr 11, 2019
907a404
ignore golint check
hzxuzhonghu Apr 11, 2019
6b99172
fix boilerplate verify
hzxuzhonghu Apr 11, 2019
18d8e91
fix boilerplate
hzxuzhonghu Apr 11, 2019
85281be
Merge pull request #737 from hzxuzhonghu/fmt
k8s-ci-robot Apr 11, 2019
652affb
Merge pull request #734 from k82cn/add_build
k8s-ci-robot Apr 11, 2019
6e94b66
Fix Golint Errors
thandayuthapani Apr 11, 2019
fdc3a44
Merge pull request #738 from thandayuthapani/golint_error
k8s-ci-robot Apr 11, 2019
759eb26
Fix GoLint Errors
thandayuthapani Apr 11, 2019
7f8d664
golint fixed in cmd package
Apr 11, 2019
2aa35ab
Merge pull request #740 from thandayuthapani/golint_error
k8s-ci-robot Apr 11, 2019
4967cc3
Merge pull request #739 from Rajadeepan/golint
k8s-ci-robot Apr 11, 2019
8b70e60
Fix Golint Errors
thandayuthapani Apr 11, 2019
f36231c
add volcano e2e
hzxuzhonghu Apr 11, 2019
beecd9e
Merge pull request #741 from hzxuzhonghu/e2e
k8s-ci-robot Apr 11, 2019
43b9fbd
Merge pull request #742 from thandayuthapani/golint_error
k8s-ci-robot Apr 11, 2019
c64bb36
FixGolint in scheduler package
Apr 11, 2019
13a1852
Add helm support for Job Resource
TommyLike Apr 11, 2019
98f0002
Merge pull request #743 from TommyLike/feature/support-helm-chart
k8s-ci-robot Apr 11, 2019
e6731bb
Merge pull request #744 from Rajadeepan/golint
k8s-ci-robot Apr 11, 2019
d911a5d
Fix Lint errors for pkg/scheduler/api package
thandayuthapani Apr 11, 2019
957d77a
Merge pull request #745 from thandayuthapani/golint_error
k8s-ci-robot Apr 11, 2019
5acc056
Add Job Resource document
TommyLike Apr 11, 2019
8104661
Merge pull request #746 from TommyLike/opt/add_job_document
k8s-ci-robot Apr 11, 2019
a281851
Delete binary controller
hex108 Apr 11, 2019
ae9402c
Merge pull request #747 from hex108/bin
k8s-ci-robot Apr 11, 2019
c9fb5db
Add Job Resource into test workflow
TommyLike Apr 12, 2019
7a4be56
Fix panic error when running e2e tests
TommyLike Apr 12, 2019
1386e02
Merge pull request #752 from TommyLike/bug/fix_panic_error
k8s-ci-robot Apr 12, 2019
ad1e673
Merge pull request #750 from TommyLike/feature/enable-job-resource-in…
k8s-ci-robot Apr 12, 2019
5263f41
Removed unactive owners.
k82cn Apr 13, 2019
8bb9983
Merge pull request #754 from k82cn/cleanup_owners
k8s-ci-robot Apr 13, 2019
6353505
Enabled e2e-kind.
k82cn Apr 13, 2019
e76aad6
Merge pull request #703 from Rajadeepan/doc
k8s-ci-robot Apr 14, 2019
f2e5f1e
Merge pull request #706 from thandayuthapani/master
k8s-ci-robot Apr 14, 2019
2afaac8
Merge pull request #715 from thandayuthapani/reclaimdoc
k8s-ci-robot Apr 14, 2019
29944d2
Fix e2e_issue_2
TommyLike Apr 14, 2019
353685a
Merge pull request #756 from TommyLike/bug/fix_e2e_issue2
k8s-ci-robot Apr 14, 2019
e5fbccc
Merge pull request #753 from k82cn/enable_e2e_kind
k8s-ci-robot Apr 14, 2019
486d672
Renamed kube-batch to Volcano
k82cn Apr 14, 2019
32e0170
Merge pull request #757 from k82cn/rename_to_vk
k8s-ci-robot Apr 15, 2019
9269967
Updated README accordingly.
k82cn Apr 15, 2019
68373b5
Merge pull request #758 from k82cn/fixed_readme
k8s-ci-robot Apr 15, 2019
886080e
Add document for tests
TommyLike Apr 15, 2019
4244f5f
Update README.md
k82cn Apr 15, 2019
d7f0966
Merge pull request #759 from TommyLike/opt/add_tests_document
k8s-ci-robot Apr 15, 2019
3acb697
Combine volcano & kube batch tests
TommyLike Apr 15, 2019
44f7ba8
Added volcano logo.
k82cn Apr 15, 2019
6aa147e
Merge pull request #767 from k82cn/add_logo
k8s-ci-robot Apr 15, 2019
25904e4
Merge pull request #764 from TommyLike/opt/mmove_tests
k8s-ci-robot Apr 15, 2019
6382777
Add hzxuzhonghu to approver & reviewers
hzxuzhonghu Apr 15, 2019
3c6ccad
abstract a common pod delete func
hzxuzhonghu Apr 15, 2019
d27a7ef
Merge pull request #771 from hzxuzhonghu/patch-1
k8s-ci-robot Apr 15, 2019
0a227ff
Implement exit code error handling
hzxuzhonghu Apr 15, 2019
b9721a5
Add e2e test
hzxuzhonghu Apr 15, 2019
45cf069
run dep ensure
hzxuzhonghu Apr 15, 2019
e083e0f
fix admission e2e
hzxuzhonghu Apr 15, 2019
4fa8810
Merge pull request #775 from hzxuzhonghu/exit-code-action
k8s-ci-robot Apr 15, 2019
1871e58
fix delete po err msg
wangyuqing4 Apr 15, 2019
3fe3180
Merge pull request #777 from wangyuqing4/fix
k8s-ci-robot Apr 15, 2019
1d1b5be
Help message vkctl job
Apr 15, 2019
c86a20a
Fix typo
jimbobby5 Apr 15, 2019
85e23a4
Merge pull request #782 from jimbobby5/patch-1
k8s-ci-robot Apr 16, 2019
5391c32
Keep kube-batch doc compatible
TommyLike Apr 16, 2019
6672e2a
Merge pull request #783 from TommyLike/opt/keep_doc_compatible
k8s-ci-robot Apr 16, 2019
6ddcb71
Merge pull request #773 from hzxuzhonghu/clean
k8s-ci-robot Apr 16, 2019
87f9ee0
Merge pull request #779 from Rajadeepan/vkctl
k8s-ci-robot Apr 16, 2019
ca33ee0
Remove reclaim and preempt in deployment
thandayuthapani Apr 15, 2019
1666e52
Fix Typo
Apr 16, 2019
81b9a0b
Merge pull request #785 from Rajadeepan/volcoanodoc
k8s-ci-robot Apr 16, 2019
1babdec
Fix Broken image link
Apr 16, 2019
5316bc8
Add gencode tools
TommyLike Apr 16, 2019
f9929c1
Support generate code tool
TommyLike Apr 16, 2019
bb28138
Merge pull request #787 from Rajadeepan/volcoanodoc
k8s-ci-robot Apr 16, 2019
b4db21a
Merge pull request #784 from TommyLike/feature/support-generate-tool
k8s-ci-robot Apr 16, 2019
3539745
restore kube-batch
hzxuzhonghu Apr 16, 2019
124ee09
fix verify
hzxuzhonghu Apr 17, 2019
4b902aa
try to fix pull-kube-batch-verify
hzxuzhonghu Apr 17, 2019
49e1269
install golint in verify-golint
hzxuzhonghu Apr 17, 2019
6e56092
Merge pull request #791 from hzxuzhonghu/revert
k8s-ci-robot Apr 17, 2019
050fcf2
Add document for MPI example
TommyLike Apr 17, 2019
3506409
Add UT cases for Preempt Action
thandayuthapani Apr 12, 2019
f450ceb
Add Volcano Installation Tutorial Link
asifdxtreme Apr 17, 2019
89aa180
Merge pull request #751 from thandayuthapani/ut
k8s-ci-robot Apr 17, 2019
8376197
Add UT Cases for Reclaim Action
thandayuthapani Apr 17, 2019
61baf08
support extended resource for kube-batch
wackxu Apr 17, 2019
d91e31f
add UT for resource_info
wackxu Apr 17, 2019
737ca3b
Merge pull request #796 from asifdxtreme/ytlinks
k8s-ci-robot Apr 17, 2019
d6be068
Merge pull request #795 from wackxu/supextres
k8s-ci-robot Apr 17, 2019
db4a1e2
Merge pull request #792 from hzxuzhonghu/patch-1
k8s-ci-robot Apr 17, 2019
6b26c42
Merge pull request #793 from TommyLike/feature/add_document_for_mpi
k8s-ci-robot Apr 18, 2019
8a1aa31
Merge pull request #772 from thandayuthapani/master
k8s-ci-robot Apr 18, 2019
8e618b8
Add CheckNodeDiskPressure,CheckNodePIDPressure,CheckNodeMemoryPressur…
wackxu Apr 18, 2019
adc3f9a
Merge pull request #800 from wackxu/addpred
k8s-ci-robot Apr 18, 2019
00b0530
Merge pull request #801 from thandayuthapani/ut_reclaim
k8s-ci-robot Apr 19, 2019
15ac023
Update tutorial.md
hzxuzhonghu Apr 19, 2019
63b4dbc
Merge pull request #808 from hzxuzhonghu/patch-2
k8s-ci-robot Apr 19, 2019
fe71c70
Prevent memory leak
hzxuzhonghu Apr 20, 2019
55591a3
Kubemark changes
Mar 31, 2019
b79caec
Add density test case
Apr 1, 2019
5cabcbb
Update testcases
TommyLike Apr 20, 2019
227f5f0
Resolve conflict
TommyLike Apr 20, 2019
19f95af
Merge pull request #809 from hzxuzhonghu/sched
k8s-ci-robot Apr 20, 2019
509d259
Merge pull request #810 from TommyLike/support-kubemark
k8s-ci-robot Apr 21, 2019
769d0ca
Update start-kubemark script
TommyLike Apr 22, 2019
7df49db
Migrate duplicated code in nodeorder and predicate plugin
thandayuthapani Apr 22, 2019
401bfce
Merge pull request #816 from thandayuthapani/master
k8s-ci-robot Apr 22, 2019
da1f1da
Update cluster script
TommyLike Apr 22, 2019
083ec81
Update README.md
TommyLike Apr 22, 2019
0a5deb9
Add script for e2e prow job
asifdxtreme Apr 22, 2019
fac8e67
Added Queue status.
k82cn Apr 22, 2019
2cbce74
Merge pull request #812 from k82cn/add_queue_status
k8s-ci-robot Apr 22, 2019
7fa0f78
Merge pull request #819 from asifdxtreme/master
k8s-ci-robot Apr 23, 2019
9745bd2
Merge pull request #817 from TommyLike/feature/fix_kubemark_issue
k8s-ci-robot Apr 24, 2019
bb85253
Adding subcommand queue create and list to vkctl
Apr 22, 2019
5b048be
Merge pull request #820 from Rajadeepan/vkctlqueuecommand
k8s-ci-robot Apr 24, 2019
431538c
Replace gofmt with goimports
hex108 Apr 26, 2019
35ba121
Format imports with goimports
hex108 Apr 26, 2019
ed06308
Merge pull request #831 from hex108/goimports
k8s-ci-robot Apr 26, 2019
fa72597
Add Vivo to the doc
zionwu Apr 27, 2019
5363e31
Merge pull request #833 from zionwu/add_doc
k8s-ci-robot Apr 27, 2019
56d9412
Added user list in README.
k82cn Apr 27, 2019
40edc7f
Merge pull request #834 from k82cn/user_list
k8s-ci-robot Apr 27, 2019
4b74ec8
Revert all codes related to batch jobs
TommyLike Apr 19, 2019
58afcd7
Remove generated codes
TommyLike Apr 19, 2019
dac1c21
Removing script files
TommyLike Apr 19, 2019
33b7008
Move benchmark tests into upper folder
TommyLike Apr 28, 2019
e1b32e5
Remove redundant files
TommyLike Apr 28, 2019
78bc825
Fix volcano rename leftover
TommyLike Apr 28, 2019
5e9977d
Merge pull request #806 from TommyLike/revert_volcano_changes
k8s-ci-robot Apr 28, 2019
5feee2f
Support enqueue
TommyLike Apr 29, 2019
d22947d
Fix test issue
TommyLike Apr 29, 2019
bf3f225
Fix test issue
TommyLike Apr 29, 2019
175581c
Merge branch 'feature/support-enqueue' of https://github.com/TommyLik…
TommyLike Apr 29, 2019
5c473c3
Update generated code
TommyLike Apr 29, 2019
61cfe9c
Remove redundant file
TommyLike Apr 29, 2019
b880cec
Merge pull request #1 from TommyLike/feature/support-enqueue
k82cn Apr 29, 2019
2e229b9
Merge pull request #2 from volcano-sh/volcano-master
k82cn Apr 29, 2019
739da02
Added Queue Capability.
k82cn May 4, 2019
2a63a47
Merge pull request #4 from asifdxtreme/cherrypick
volcano-sh-bot May 6, 2019
a9d2871
The scheduler supports the scheduling algorithm of the map-reduce st…
dingtsh1 May 9, 2019
f775ff2
Merge pull request #8 from dingtsh1/master
volcano-sh-bot May 9, 2019
7d9526c
add custom information
dingtsh1 May 9, 2019
0f36bc1
Merge pull request #9 from dingtsh1/master
volcano-sh-bot May 9, 2019
2952c03
Implement queue Capability: donot allow podgroup enqueue when queue c…
hzxuzhonghu May 8, 2019
d3dbb11
fix comments
hzxuzhonghu May 9, 2019
40011b1
fix panic
hzxuzhonghu May 14, 2019
5246c63
fix lint
hzxuzhonghu May 15, 2019
3b939e2
Cleanup unsed codes
TommyLike May 15, 2019
8c5fc7d
Merge pull request #12 from TommyLike/opt/cleanup_codes
volcano-sh-bot May 15, 2019
ca395c6
Merge branch 'master' into master
hzxuzhonghu May 15, 2019
3696b73
Merge pull request #7 from hzxuzhonghu/master
volcano-sh-bot May 15, 2019
9cba437
Update session.go
nikita15p May 14, 2019
61ae40d
Merge pull request #13 from asifdxtreme/master
volcano-sh-bot May 15, 2019
7499b79
Added Configuration to enable/disable predicates
thandayuthapani May 17, 2019
aefccd1
Merge pull request #17 from asifdxtreme/master
volcano-sh-bot May 20, 2019
342e723
Fix wrong calculation for nodeinfo used
wackxu May 25, 2019
3ab1c80
Update README.md
k82cn May 30, 2019
bbabb00
Fix wrong calculation for queue deserved in proportion plugin
zionwu May 23, 2019
6f6798c
Merge branch 'master' into master
k82cn May 30, 2019
0b3cce9
Merge pull request #19 from asifdxtreme/master
volcano-sh-bot May 30, 2019
3df0644
Merge branch 'master' into 730
k82cn May 30, 2019
b7a3371
Merge pull request #20 from asifdxtreme/730
volcano-sh-bot May 30, 2019
8b69136
fix podInformer FilterFunc bug
wackxu Jun 3, 2019
8eab88e
Merge pull request #21 from wackxu/fixmultische
volcano-sh-bot Jun 3, 2019
7360fe3
Refer to installation
k82cn Jun 4, 2019
9d8ffc5
Merge pull request #22 from volcano-sh/installation-guidance
volcano-sh-bot Jun 4, 2019
f58c7e6
Enqueue jobs if Queue's capability is not set.
k82cn Jun 4, 2019
7003812
Merge pull request #23 from k82cn/vk_197
volcano-sh-bot Jun 4, 2019
108095f
Fixed the Pod failure event reason string for the k8s conformance tes…
shivramsrivastava May 2, 2019
6d0e875
Changing the event source to the correct schedulerName
shivramsrivastava May 6, 2019
92c4d3f
Merge pull request #24 from shivramsrivastava/eventsfix_cherrypk
volcano-sh-bot Jun 6, 2019
120b716
Merge branch 'master' into schdname_cherry
k82cn Jun 6, 2019
1b4f76c
Merge pull request #25 from shivramsrivastava/schdname_cherry
volcano-sh-bot Jun 7, 2019
d0f0d83
update node info no matter what node info changed
wackxu May 25, 2019
eedcab5
Ignore nodes if out of syc.
k82cn Jun 10, 2019
865447b
Merge pull request #27 from asifdxtreme/master
volcano-sh-bot Jun 10, 2019
16a8420
Merge branch 'master' into kb_861
k82cn Jun 10, 2019
4b391ab
Merge pull request #26 from k82cn/kb_861
volcano-sh-bot Jun 11, 2019
03457a8
Enable some e2e test cases
Jun 12, 2019
537e6aa
Add event reason check since change in event
thandayuthapani Jun 12, 2019
ec1328c
Merge pull request #29 from thandayuthapani/vk-scheduler
volcano-sh-bot Jun 12, 2019
6664a74
Merge branch 'master' into fixe2e
k82cn Jun 12, 2019
6335a47
Merge pull request #28 from Rajadeepan/fixe2e
volcano-sh-bot Jun 12, 2019
d12cc30
Adding max-pods test case under kube-batch e2e test cases
shivramsrivastava Apr 24, 2019
bd67e46
Adding e2e test case for resource limit checks under kube-batch test …
shivramsrivastava Apr 24, 2019
292b4ab
Resolve conflict and update e2e test case
Jun 17, 2019
7120748
Reducing the number of lines of log printing in the travis
Jun 18, 2019
80388d2
Merge pull request #30 from Rajadeepan/e2etest
volcano-sh-bot Jun 21, 2019
bd2b465
change SchedulerName kube-batch to volcano
wangyuqing4 Jun 20, 2019
ab057d3
Merge pull request #32 from lminzhw/scheduler_name
volcano-sh-bot Jun 24, 2019
ef9a89f
performance improvement
lminzhw May 23, 2019
70de67e
improve performance
lminzhw May 28, 2019
ede35a3
split eventClient from kubeClient
lminzhw Jun 3, 2019
65e615e
fix golint error
lminzhw Jun 28, 2019
a92572f
Merge pull request #35 from lminzhw/performance_improvement
volcano-sh-bot Jun 28, 2019
a31f695
limit the panic in resource_info
lminzhw May 30, 2019
f41ba10
allow job to Inqueue if queue capability of job was not set
sivanzcw May 31, 2019
c941e03
add performance code to master
lminzhw Jun 3, 2019
ead014d
add pod.annotations in binding
dingtsh1 Jun 14, 2019
00fb1ce
change nodeInfo Other to Others
wangyuqing4 Jun 19, 2019
4de758b
fix golint / UT
lminzhw Jun 26, 2019
6be08ee
support scheduler detailed event
lminzhw Jun 14, 2019
8651f7a
fix golint
lminzhw Jun 26, 2019
31b04ec
Merge pull request #34 from lminzhw/scheduler_detailed_event
volcano-sh-bot Jun 28, 2019
0302d83
Merge pull request #31 from lminzhw/private_scheduler
volcano-sh-bot Jun 28, 2019
edcb590
improve scheduling performance on batch jobs
william-wang Jul 1, 2019
81b1e4f
Restructed the codes and add the e2e test case
william-wang Jul 2, 2019
78a11b8
fix a typo
william-wang Jul 2, 2019
04b454f
Fix some e2e test error
william-wang Jul 2, 2019
924b8bc
Fix the format
william-wang Jul 2, 2019
b2baa8d
fix the failure in static check.
william-wang Jul 3, 2019
5749259
Merge pull request #37 from william-wang/master
volcano-sh-bot Jul 3, 2019
1276fe2
update in-tree scheduler-upstream code
kevin-wangzefeng Jul 4, 2019
4142499
remove cmd/kube-batch
kevin-wangzefeng Jul 4, 2019
471b543
update in-tree cmd/kube-batch code
kevin-wangzefeng Jul 4, 2019
aec87f6
update scheduler import paths to volcano and fix building
kevin-wangzefeng Jul 4, 2019
5de004c
tentatively skip scheduler code lint failures.
kevin-wangzefeng Jul 4, 2019
00bac39
fix gofmt
kevin-wangzefeng Jul 4, 2019
2bf4884
fix scheduler ut
kevin-wangzefeng Jul 4, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/admission/app/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"net/http"

"github.com/golang/glog"
"github.com/kubernetes-sigs/kube-batch/pkg/client/clientset/versioned"
"volcano.sh/volcano/pkg/client/clientset/versioned"

"k8s.io/api/admission/v1beta1"
"k8s.io/apimachinery/pkg/runtime"
Expand Down
2 changes: 1 addition & 1 deletion cmd/controllers/app/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import (
"k8s.io/client-go/tools/leaderelection/resourcelock"
"k8s.io/client-go/tools/record"

kbver "github.com/kubernetes-sigs/kube-batch/pkg/client/clientset/versioned"
kbver "volcano.sh/volcano/pkg/client/clientset/versioned"

"volcano.sh/volcano/cmd/controllers/app/options"
vkclient "volcano.sh/volcano/pkg/client/clientset/versioned"
Expand Down
95 changes: 95 additions & 0 deletions cmd/kube-batch/app/options/options.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
/*
Copyright 2017 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package options

import (
"fmt"
"time"

"github.com/spf13/pflag"
)

const (
defaultSchedulerName = "volcano"
defaultSchedulerPeriod = time.Second
defaultQueue = "default"
defaultListenAddress = ":8080"

defaultQPS = 50.0
defaultBurst = 100
)

// ServerOption is the main context object for the controller manager.
type ServerOption struct {
Master string
Kubeconfig string
SchedulerName string
SchedulerConf string
SchedulePeriod time.Duration
EnableLeaderElection bool
LockObjectNamespace string
DefaultQueue string
PrintVersion bool
ListenAddress string
EnablePriorityClass bool
KubeAPIBurst int
KubeAPIQPS float32
}

// ServerOpts server options
var ServerOpts *ServerOption

// NewServerOption creates a new CMServer with a default config.
func NewServerOption() *ServerOption {
s := ServerOption{}
return &s
}

// AddFlags adds flags for a specific CMServer to the specified FlagSet
func (s *ServerOption) AddFlags(fs *pflag.FlagSet) {
fs.StringVar(&s.Master, "master", s.Master, "The address of the Kubernetes API server (overrides any value in kubeconfig)")
fs.StringVar(&s.Kubeconfig, "kubeconfig", s.Kubeconfig, "Path to kubeconfig file with authorization and master location information")
// kube-batch will ignore pods with scheduler names other than specified with the option
fs.StringVar(&s.SchedulerName, "scheduler-name", defaultSchedulerName, "kube-batch will handle pods whose .spec.SchedulerName is same as scheduler-name")
fs.StringVar(&s.SchedulerConf, "scheduler-conf", "", "The absolute path of scheduler configuration file")
fs.DurationVar(&s.SchedulePeriod, "schedule-period", defaultSchedulerPeriod, "The period between each scheduling cycle")
fs.StringVar(&s.DefaultQueue, "default-queue", defaultQueue, "The default queue name of the job")
fs.BoolVar(&s.EnableLeaderElection, "leader-elect", s.EnableLeaderElection,
"Start a leader election client and gain leadership before "+
"executing the main loop. Enable this when running replicated kube-batch for high availability")
fs.BoolVar(&s.PrintVersion, "version", false, "Show version and quit")
fs.StringVar(&s.LockObjectNamespace, "lock-object-namespace", s.LockObjectNamespace, "Define the namespace of the lock object that is used for leader election")
fs.StringVar(&s.ListenAddress, "listen-address", defaultListenAddress, "The address to listen on for HTTP requests.")
fs.BoolVar(&s.EnablePriorityClass, "priority-class", true,
"Enable PriorityClass to provide the capacity of preemption at pod group level; to disable it, set it false")
fs.Float32Var(&s.KubeAPIQPS, "kube-api-qps", defaultQPS, "QPS to use while talking with kubernetes apiserver")
fs.IntVar(&s.KubeAPIBurst, "kube-api-burst", defaultBurst, "Burst to use while talking with kubernetes apiserver")
}

// CheckOptionOrDie check lock-object-namespace when LeaderElection is enabled
func (s *ServerOption) CheckOptionOrDie() error {
if s.EnableLeaderElection && s.LockObjectNamespace == "" {
return fmt.Errorf("lock-object-namespace must not be nil when LeaderElection is enabled")
}

return nil
}

// RegisterOptions registers options
func (s *ServerOption) RegisterOptions() {
ServerOpts = s
}
51 changes: 51 additions & 0 deletions cmd/kube-batch/app/options/options_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
Copyright 2019 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package options

import (
"reflect"
"testing"
"time"

"github.com/spf13/pflag"
)

func TestAddFlags(t *testing.T) {
fs := pflag.NewFlagSet("addflagstest", pflag.ContinueOnError)
s := NewServerOption()
s.AddFlags(fs)

args := []string{
"--schedule-period=5m",
"--priority-class=false",
}
fs.Parse(args)

// This is a snapshot of expected options parsed by args.
expected := &ServerOption{
SchedulerName: defaultSchedulerName,
SchedulePeriod: 5 * time.Minute,
DefaultQueue: defaultQueue,
ListenAddress: defaultListenAddress,
KubeAPIBurst: defaultBurst,
KubeAPIQPS: defaultQPS,
}

if !reflect.DeepEqual(expected, s) {
t.Errorf("Got different run options than expected.\nGot: %+v\nExpected: %+v\n", s, expected)
}
}
153 changes: 153 additions & 0 deletions cmd/kube-batch/app/server.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
/*
Copyright 2017 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package app

import (
"context"
"fmt"
"net/http"
"os"
"time"

"github.com/golang/glog"
"github.com/prometheus/client_golang/prometheus/promhttp"
"volcano.sh/volcano/cmd/kube-batch/app/options"
"volcano.sh/volcano/pkg/scheduler"
"volcano.sh/volcano/pkg/version"

v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/util/uuid"
clientset "k8s.io/client-go/kubernetes"
"k8s.io/client-go/kubernetes/scheme"
corev1 "k8s.io/client-go/kubernetes/typed/core/v1"

// Register gcp auth
_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
"k8s.io/client-go/rest"
restclient "k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"
"k8s.io/client-go/tools/leaderelection"
"k8s.io/client-go/tools/leaderelection/resourcelock"
"k8s.io/client-go/tools/record"
)

const (
leaseDuration = 15 * time.Second
renewDeadline = 10 * time.Second
retryPeriod = 5 * time.Second
apiVersion = "v1alpha1"
)

func buildConfig(opt *options.ServerOption) (*rest.Config, error) {
var cfg *rest.Config
var err error

master := opt.Master
kubeconfig := opt.Kubeconfig
if master != "" || kubeconfig != "" {
cfg, err = clientcmd.BuildConfigFromFlags(master, kubeconfig)
} else {
cfg, err = rest.InClusterConfig()
}
if err != nil {
return nil, err
}
cfg.QPS = opt.KubeAPIQPS
cfg.Burst = opt.KubeAPIBurst

return cfg, nil
}

// Run the kubeBatch scheduler
func Run(opt *options.ServerOption) error {
if opt.PrintVersion {
version.PrintVersionAndExit()
}

config, err := buildConfig(opt)
if err != nil {
return err
}

// Start policy controller to allocate resources.
sched, err := scheduler.NewScheduler(config,
opt.SchedulerName,
opt.SchedulerConf,
opt.SchedulePeriod,
opt.DefaultQueue)
if err != nil {
panic(err)
}

go func() {
http.Handle("/metrics", promhttp.Handler())
glog.Fatalf("Prometheus Http Server failed %s", http.ListenAndServe(opt.ListenAddress, nil))
}()

run := func(ctx context.Context) {
sched.Run(ctx.Done())
<-ctx.Done()
}

if !opt.EnableLeaderElection {
run(context.TODO())
return fmt.Errorf("finished without leader elect")
}

leaderElectionClient, err := clientset.NewForConfig(restclient.AddUserAgent(config, "leader-election"))
if err != nil {
return err
}

// Prepare event clients.
broadcaster := record.NewBroadcaster()
broadcaster.StartRecordingToSink(&corev1.EventSinkImpl{Interface: leaderElectionClient.CoreV1().Events(opt.LockObjectNamespace)})
eventRecorder := broadcaster.NewRecorder(scheme.Scheme, v1.EventSource{Component: opt.SchedulerName})

hostname, err := os.Hostname()
if err != nil {
return fmt.Errorf("unable to get hostname: %v", err)
}
// add a uniquifier so that two processes on the same host don't accidentally both become active
id := hostname + "_" + string(uuid.NewUUID())

rl, err := resourcelock.New(resourcelock.ConfigMapsResourceLock,
opt.LockObjectNamespace,
"kube-batch",
leaderElectionClient.CoreV1(),
resourcelock.ResourceLockConfig{
Identity: id,
EventRecorder: eventRecorder,
})
if err != nil {
return fmt.Errorf("couldn't create resource lock: %v", err)
}

leaderelection.RunOrDie(context.TODO(), leaderelection.LeaderElectionConfig{
Lock: rl,
LeaseDuration: leaseDuration,
RenewDeadline: renewDeadline,
RetryPeriod: retryPeriod,
Callbacks: leaderelection.LeaderCallbacks{
OnStartedLeading: run,
OnStoppedLeading: func() {
glog.Fatalf("leaderelection lost")
},
},
})
return fmt.Errorf("lost lease")
}
20 changes: 15 additions & 5 deletions cmd/kube-batch/main.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2018 The Vulcan Authors.
Copyright 2017 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -18,24 +18,34 @@ package main
import (
"fmt"
"os"
"runtime"
"time"

// init pprof server
_ "net/http/pprof"

"github.com/golang/glog"
"github.com/spf13/pflag"

"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/apiserver/pkg/util/flag"

_ "github.com/kubernetes-sigs/kube-batch/pkg/scheduler/actions"
_ "github.com/kubernetes-sigs/kube-batch/pkg/scheduler/plugins"
"volcano.sh/volcano/cmd/kube-batch/app"
"volcano.sh/volcano/cmd/kube-batch/app/options"

// Import default actions/plugins.
_ "volcano.sh/volcano/pkg/scheduler/actions"
_ "volcano.sh/volcano/pkg/scheduler/plugins"

"github.com/kubernetes-sigs/kube-batch/cmd/kube-batch/app"
"github.com/kubernetes-sigs/kube-batch/cmd/kube-batch/app/options"
// init assert
_ "volcano.sh/volcano/pkg/scheduler/util/assert"
)

var logFlushFreq = pflag.Duration("log-flush-frequency", 5*time.Second, "Maximum number of seconds between log flushes")

func main() {
runtime.GOMAXPROCS(runtime.NumCPU())

s := options.NewServerOption()
s.AddFlags(pflag.CommandLine)
s.RegisterOptions()
Expand Down
7 changes: 7 additions & 0 deletions hack/.golint_failures
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
volcano.sh/volcano/pkg/apis/scheduling/v1alpha1
volcano.sh/volcano/pkg/apis/utils
volcano.sh/volcano/pkg/scheduler/actions/allocate
volcano.sh/volcano/pkg/scheduler/actions/backfill
volcano.sh/volcano/pkg/scheduler/actions/enqueue
volcano.sh/volcano/pkg/scheduler/actions/preempt
volcano.sh/volcano/pkg/scheduler/actions/reclaim
volcano.sh/volcano/test/e2e
2 changes: 1 addition & 1 deletion hack/update-gencode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ CODEGEN_PKG=${CODEGEN_PKG:-$(cd ${SCRIPT_ROOT}; ls -d -1 ./vendor/k8s.io/code-ge
# instead of the $GOPATH directly. For normal projects this can be dropped.
${CODEGEN_PKG}/generate-groups.sh "deepcopy,client,informer,lister" \
volcano.sh/volcano/pkg/client volcano.sh/volcano/pkg/apis \
"batch:v1alpha1 bus:v1alpha1" \
"batch:v1alpha1 bus:v1alpha1 scheduling:v1alpha1" \
--go-header-file ${SCRIPT_ROOT}/hack/boilerplate/boilerplate.go.txt

# To use your own boilerplate text use:
Expand Down
2 changes: 1 addition & 1 deletion pkg/admission/admit_job.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"strings"

"github.com/golang/glog"
"github.com/kubernetes-sigs/kube-batch/pkg/client/clientset/versioned"
"volcano.sh/volcano/pkg/client/clientset/versioned"

"k8s.io/api/admission/v1beta1"
"k8s.io/api/core/v1"
Expand Down
Loading