Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
856899b3
Commit
856899b3
authored
Oct 10, 2016
by
jayunit100
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update scheduler perf to spin up similar client to other tests
parent
a0d4878e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
12 deletions
+14
-12
test-performance.sh
test/integration/scheduler_perf/test-performance.sh
+7
-4
util.go
test/integration/scheduler_perf/util.go
+7
-8
No files found.
test/integration/scheduler_perf/test-performance.sh
View file @
856899b3
...
@@ -18,7 +18,7 @@ set -o errexit
...
@@ -18,7 +18,7 @@ set -o errexit
set
-o
nounset
set
-o
nounset
set
-o
pipefail
set
-o
pipefail
KUBE_ROOT
=
$(
dirname
"
${
BASH_SOURCE
}
"
)
/../../../
..
KUBE_ROOT
=
$(
dirname
"
${
BASH_SOURCE
}
"
)
/../../../
source
"
${
KUBE_ROOT
}
/hack/lib/init.sh"
source
"
${
KUBE_ROOT
}
/hack/lib/init.sh"
kube::golang::setup_env
kube::golang::setup_env
...
@@ -35,15 +35,18 @@ cleanup() {
...
@@ -35,15 +35,18 @@ cleanup() {
trap
cleanup EXIT
trap
cleanup EXIT
kube::etcd::start
kube::etcd::start
kube::log::status
"performance test start"
# We are using the benchmark suite to do profiling. Because it only runs a few pods and
# We are using the benchmark suite to do profiling. Because it only runs a few pods and
# theoretically it has less variance.
# theoretically it has less variance.
if
${
RUN_BENCHMARK
:-
false
}
;
then
if
${
RUN_BENCHMARK
:-
false
}
;
then
kube::log::status
"performance test (benchmark) compiling"
go
test
-c
-o
"perf.test"
go
test
-c
-o
"perf.test"
kube::log::status
"performance test (benchmark) start"
"./perf.test"
-test
.bench
=
.
-test
.run
=
xxxx
-test
.cpuprofile
=
prof.out
-test
.short
=
false
"./perf.test"
-test
.bench
=
.
-test
.run
=
xxxx
-test
.cpuprofile
=
prof.out
-test
.short
=
false
kube::log::status
"benchmark tests finished"
kube::log::status
"
...
benchmark tests finished"
fi
fi
# Running density tests. It might take a long time.
# Running density tests. It might take a long time.
kube::log::status
"performance test (density) start"
go
test
-test
.run
=
.
-test
.timeout
=
60m
-test
.short
=
false
go
test
-test
.run
=
.
-test
.timeout
=
60m
-test
.short
=
false
kube::log::status
"density tests finished"
kube::log::status
"
...
density tests finished"
test/integration/scheduler_perf/util.go
View file @
856899b3
...
@@ -27,7 +27,6 @@ import (
...
@@ -27,7 +27,6 @@ import (
"k8s.io/kubernetes/pkg/client/record"
"k8s.io/kubernetes/pkg/client/record"
"k8s.io/kubernetes/pkg/client/restclient"
"k8s.io/kubernetes/pkg/client/restclient"
client
"k8s.io/kubernetes/pkg/client/unversioned"
client
"k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/master"
"k8s.io/kubernetes/pkg/util/workqueue"
"k8s.io/kubernetes/pkg/util/workqueue"
"k8s.io/kubernetes/plugin/pkg/scheduler"
"k8s.io/kubernetes/plugin/pkg/scheduler"
_
"k8s.io/kubernetes/plugin/pkg/scheduler/algorithmprovider"
_
"k8s.io/kubernetes/plugin/pkg/scheduler/algorithmprovider"
...
@@ -44,16 +43,15 @@ import (
...
@@ -44,16 +43,15 @@ import (
// Notes on rate limiter:
// Notes on rate limiter:
// - client rate limit is set to 5000.
// - client rate limit is set to 5000.
func
mustSetupScheduler
()
(
schedulerConfigFactory
*
factory
.
ConfigFactory
,
destroyFunc
func
())
{
func
mustSetupScheduler
()
(
schedulerConfigFactory
*
factory
.
ConfigFactory
,
destroyFunc
func
())
{
var
m
*
master
.
Master
masterConfig
:=
framework
.
NewIntegrationTestMasterConfig
()
h
:=
&
framework
.
MasterHolder
{
Initialized
:
make
(
chan
struct
{})}
m
,
err
:=
masterConfig
.
Complete
()
.
New
()
if
err
!=
nil
{
panic
(
"error in brining up the master: "
+
err
.
Error
())
}
s
:=
httptest
.
NewServer
(
http
.
HandlerFunc
(
func
(
w
http
.
ResponseWriter
,
req
*
http
.
Request
)
{
s
:=
httptest
.
NewServer
(
http
.
HandlerFunc
(
func
(
w
http
.
ResponseWriter
,
req
*
http
.
Request
)
{
m
.
GenericAPIServer
.
Handler
.
ServeHTTP
(
w
,
req
)
<-
h
.
Initialized
h
.
M
.
GenericAPIServer
.
Handler
.
ServeHTTP
(
w
,
req
)
}))
}))
framework
.
RunAMasterUsingServer
(
framework
.
NewIntegrationTestMasterConfig
(),
s
,
h
)
c
:=
client
.
NewOrDie
(
&
restclient
.
Config
{
c
:=
client
.
NewOrDie
(
&
restclient
.
Config
{
Host
:
s
.
URL
,
Host
:
s
.
URL
,
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
&
registered
.
GroupOrDie
(
api
.
GroupName
)
.
GroupVersion
},
ContentConfig
:
restclient
.
ContentConfig
{
GroupVersion
:
&
registered
.
GroupOrDie
(
api
.
GroupName
)
.
GroupVersion
},
...
@@ -62,6 +60,7 @@ func mustSetupScheduler() (schedulerConfigFactory *factory.ConfigFactory, destro
...
@@ -62,6 +60,7 @@ func mustSetupScheduler() (schedulerConfigFactory *factory.ConfigFactory, destro
})
})
schedulerConfigFactory
=
factory
.
NewConfigFactory
(
c
,
api
.
DefaultSchedulerName
,
api
.
DefaultHardPodAffinitySymmetricWeight
,
api
.
DefaultFailureDomains
)
schedulerConfigFactory
=
factory
.
NewConfigFactory
(
c
,
api
.
DefaultSchedulerName
,
api
.
DefaultHardPodAffinitySymmetricWeight
,
api
.
DefaultFailureDomains
)
schedulerConfig
,
err
:=
schedulerConfigFactory
.
Create
()
schedulerConfig
,
err
:=
schedulerConfigFactory
.
Create
()
if
err
!=
nil
{
if
err
!=
nil
{
panic
(
"Couldn't create scheduler config"
)
panic
(
"Couldn't create scheduler config"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment