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
5d6d005c
Commit
5d6d005c
authored
10 years ago
by
Tim Emiola
Browse files
Options
Downloads
Patches
Plain Diff
Adds a grpc_show_servers command
parent
5ebf8807
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/gce_setup/grpc_docker.sh
+42
-3
42 additions, 3 deletions
tools/gce_setup/grpc_docker.sh
with
42 additions
and
3 deletions
tools/gce_setup/grpc_docker.sh
+
42
−
3
View file @
5d6d005c
...
...
@@ -590,6 +590,45 @@ grpc_sync_images() {
done
}
_grpc_show_servers_args
()
{
[[
-n
$1
]]
&&
{
# host
host
=
$1
shift
}
||
{
echo
"
$FUNCNAME
: missing arg: host"
1>&2
return
1
}
}
# Shows servers on a docker instance.
#
# call-seq;
# grpc_show_servers <server_name>
# E.g
# grpc_show_server grpc-docker-server
#
# Shows the grpc servers on the GCE instance <server_name>
grpc_show_servers
()
{
# declare vars local so that they don't pollute the shell environment
# where they this func is used.
local
grpc_zone grpc_project dry_run
# set by _grpc_set_project_and_zone
# set by _grpc_show_servers
local
host
# set the project zone and check that all necessary args are provided
_grpc_set_project_and_zone
-f
_grpc_show_servers_args
"
$@
"
||
return
1
gce_has_instance
$grpc_project
$host
||
return
1
;
local
cmd
=
"sudo docker ps | grep grpc_"
local
ssh_cmd
=
"bash -l -c
\"
$cmd
\"
"
echo
"will run:"
echo
"
$ssh_cmd
"
echo
"on
$host
"
[[
$dry_run
==
1
]]
&&
continue
# don't run the command on a dry run
gcloud compute
$project_opt
ssh
$zone_opt
$host
--command
"
$cmd
"
}
_grpc_launch_servers_args
()
{
[[
-n
$1
]]
&&
{
# host
host
=
$1
...
...
@@ -619,11 +658,11 @@ grpc_launch_servers() {
# declare vars local so that they don't pollute the shell environment
# where they this func is used.
local
grpc_zone grpc_project dry_run
# set by _grpc_set_project_and_zone
# set by grpc_launch_servers_args
local
servers
# set by
_
grpc_launch_servers_args
local
host
servers
# set the project zone and check that all necessary args are provided
_grpc_set_project_and_zone
-f
_grpc_launch_server_args
"
$@
"
||
return
1
_grpc_set_project_and_zone
-f
_grpc_launch_server
s
_args
"
$@
"
||
return
1
gce_has_instance
$grpc_project
$host
||
return
1
;
# launch each of the servers in turn
...
...
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