Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
61c134f5
Commit
61c134f5
authored
9 years ago
by
Sree Kuchibhotla
Browse files
Options
Downloads
Patches
Plain Diff
Significantly rewrite tools/gke/run_stress_tests_on_gke.py and make
everything configurable
parent
f63c4923
No related branches found
No related tags found
No related merge requests found
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tools/gke/kubernetes_api.py
+46
-1
46 additions, 1 deletion
tools/gke/kubernetes_api.py
tools/gke/run_stress_tests_on_gke.py
+341
-200
341 additions, 200 deletions
tools/gke/run_stress_tests_on_gke.py
with
387 additions
and
201 deletions
tools/gke/kubernetes_api.py
+
46
−
1
View file @
61c134f5
...
@@ -50,7 +50,8 @@ def _make_pod_config(pod_name, image_name, container_port_list, cmd_list,
...
@@ -50,7 +50,8 @@ def _make_pod_config(pod_name, image_name, container_port_list, cmd_list,
'
name
'
:
pod_name
,
'
name
'
:
pod_name
,
'
image
'
:
image_name
,
'
image
'
:
image_name
,
'
ports
'
:
[{
'
containerPort
'
:
port
,
'
ports
'
:
[{
'
containerPort
'
:
port
,
'
protocol
'
:
'
TCP
'
}
for
port
in
container_port_list
],
'
protocol
'
:
'
TCP
'
}
for
port
in
container_port_list
],
'
imagePullPolicy
'
:
'
Always
'
'
imagePullPolicy
'
:
'
Always
'
}
}
]
]
...
@@ -222,3 +223,47 @@ def delete_pod(kube_host, kube_port, namespace, pod_name):
...
@@ -222,3 +223,47 @@ def delete_pod(kube_host, kube_port, namespace, pod_name):
del_url
=
'
http://%s:%d/api/v1/namespaces/%s/pods/%s
'
%
(
kube_host
,
kube_port
,
del_url
=
'
http://%s:%d/api/v1/namespaces/%s/pods/%s
'
%
(
kube_host
,
kube_port
,
namespace
,
pod_name
)
namespace
,
pod_name
)
return
_do_delete
(
del_url
,
'
Delete Pod
'
)
return
_do_delete
(
del_url
,
'
Delete Pod
'
)
def
create_pod_and_service
(
kube_host
,
kube_port
,
namespace
,
pod_name
,
image_name
,
container_port_list
,
cmd_list
,
arg_list
,
env_dict
,
is_headless_service
):
"""
A simple helper function that creates a pod and a service (if pod creation was successful).
"""
is_success
=
create_pod
(
kube_host
,
kube_port
,
namespace
,
pod_name
,
image_name
,
container_port_list
,
cmd_list
,
arg_list
,
env_dict
)
if
not
is_success
:
print
'
Error in creating Pod
'
return
False
is_success
=
create_service
(
kube_host
,
kube_port
,
namespace
,
pod_name
,
# Use pod_name for service
pod_name
,
container_port_list
,
# Service port list same as container port list
container_port_list
,
is_headless_service
)
if
not
is_success
:
print
'
Error in creating Service
'
return
False
print
'
Successfully created the pod/service %s
'
%
pod_name
return
True
def
delete_pod_and_service
(
kube_host
,
kube_port
,
namespace
,
pod_name
):
"""
A simple helper function that calls delete_pod and delete_service
"""
is_success
=
delete_pod
(
kube_host
,
kube_port
,
namespace
,
pod_name
)
if
not
is_success
:
print
'
Error in deleting pod %s
'
%
pod_name
return
False
# Note: service name assumed to the the same as pod name
is_success
=
delete_service
(
kube_host
,
kube_port
,
namespace
,
pod_name
)
if
not
is_success
:
print
'
Error in deleting service %s
'
%
pod_name
return
False
print
'
Successfully deleted the Pod/Service: %s
'
%
pod_name
return
True
This diff is collapsed.
Click to expand it.
tools/gke/run_stress_tests_on_gke.py
+
341
−
200
View file @
61c134f5
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment