Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
buildgrid
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Privacy statement
Keyboard shortcuts
?
What's new
6
Snippets
Groups
Projects
Show more breadcrumbs
BuildGrid
buildgrid
Commits
e59fb607
Commit
e59fb607
authored
6 years ago
by
Finn
Committed by
finn
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Allow user to change time period of bot updates through the cli.
parent
7cc13d06
No related branches found
No related tags found
1 merge request
!89
Allow user to change time period of bot updates through the cli.
Pipeline
#31893223
passed with warnings
6 years ago
Stage: test
Stage: post
Stage: deploy
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
buildgrid/_app/commands/cmd_bot.py
+7
-4
7 additions, 4 deletions
buildgrid/_app/commands/cmd_bot.py
with
7 additions
and
4 deletions
buildgrid/_app/commands/cmd_bot.py
+
7
−
4
View file @
e59fb607
...
...
@@ -52,16 +52,19 @@ from ..cli import pass_context
help
=
"
Public CAS client certificate for TLS (PEM-encoded)
"
)
@click.option
(
'
--cas-server-cert
'
,
type
=
click
.
Path
(
exists
=
True
,
dir_okay
=
False
),
default
=
None
,
help
=
"
Public CAS server certificate for TLS (PEM-encoded)
"
)
@click.option
(
'
--update-period
'
,
type
=
click
.
FLOAT
,
default
=
0.5
,
show_default
=
True
,
help
=
"
Time period for bot updates to the server in seconds.
"
)
@click.option
(
'
--parent
'
,
type
=
click
.
STRING
,
default
=
'
main
'
,
show_default
=
True
,
help
=
"
Targeted farm resource.
"
)
@pass_context
def
cli
(
context
,
parent
,
remote
,
client_key
,
client_cert
,
server_cert
,
def
cli
(
context
,
parent
,
update_period
,
remote
,
client_key
,
client_cert
,
server_cert
,
remote_cas
,
cas_client_key
,
cas_client_cert
,
cas_server_cert
):
# Setup the remote execution server channel:
url
=
urlparse
(
remote
)
context
.
remote
=
'
{}:{}
'
.
format
(
url
.
hostname
,
url
.
port
or
50051
)
context
.
remote_url
=
remote
context
.
update_period
=
update_period
context
.
parent
=
parent
if
url
.
scheme
==
'
http
'
:
...
...
@@ -138,7 +141,7 @@ def run_dummy(context):
Creates a session, accepts leases, does fake work and updates the server.
"""
try
:
b
=
bot
.
Bot
(
context
.
bot_session
)
b
=
bot
.
Bot
(
context
.
bot_session
,
context
.
update_period
)
b
.
session
(
dummy
.
work_dummy
,
context
)
except
KeyboardInterrupt
:
...
...
@@ -153,7 +156,7 @@ def run_host_tools(context):
result back to CAS.
"""
try
:
b
=
bot
.
Bot
(
context
.
bot_session
)
b
=
bot
.
Bot
(
context
.
bot_session
,
context
.
update_period
)
b
.
session
(
host
.
work_host_tools
,
context
)
except
KeyboardInterrupt
:
...
...
@@ -174,7 +177,7 @@ def run_buildbox(context, local_cas, fuse_dir):
context
.
fuse_dir
=
fuse_dir
try
:
b
=
bot
.
Bot
(
context
.
bot_session
)
b
=
bot
.
Bot
(
context
.
bot_session
,
context
.
update_period
)
b
.
session
(
buildbox
.
work_buildbox
,
context
)
except
KeyboardInterrupt
:
...
...
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