finn pushed to branch mablanch/00-host-bot-rename at BuildGrid / buildgrid
Commits:
5 changed files:
- buildgrid/_app/bots/temp_directory.py → buildgrid/_app/bots/host.py
- buildgrid/_app/commands/cmd_bot.py
- docs/source/reference_cli.rst
- docs/source/using_bazel.rst
- docs/source/using_internal.rst
Changes:
... | ... | @@ -24,7 +24,7 @@ from buildgrid._protos.build.bazel.remote.execution.v2 import remote_execution_p |
24 | 24 |
from buildgrid.utils import output_file_maker, output_directory_maker
|
25 | 25 |
|
26 | 26 |
|
27 |
-def work_temp_directory(context, lease):
|
|
27 |
+def work_host_tools(context, lease):
|
|
28 | 28 |
"""Executes a lease for a build action, using host tools.
|
29 | 29 |
"""
|
30 | 30 |
|
... | ... | @@ -31,7 +31,7 @@ import grpc |
31 | 31 |
from buildgrid.bot import bot, bot_interface
|
32 | 32 |
from buildgrid.bot.bot_session import BotSession, Device, Worker
|
33 | 33 |
|
34 |
-from ..bots import buildbox, dummy, temp_directory
|
|
34 |
+from ..bots import buildbox, dummy, host
|
|
35 | 35 |
from ..cli import pass_context
|
36 | 36 |
|
37 | 37 |
|
... | ... | @@ -135,8 +135,7 @@ def cli(context, parent, remote, client_key, client_cert, server_cert, |
135 | 135 |
@pass_context
|
136 | 136 |
def run_dummy(context):
|
137 | 137 |
"""
|
138 |
- Simple dummy client. Creates a session, accepts leases, does fake work and
|
|
139 |
- updates the server.
|
|
138 |
+ Creates a session, accepts leases, does fake work and updates the server.
|
|
140 | 139 |
"""
|
141 | 140 |
try:
|
142 | 141 |
b = bot.Bot(context.bot_session)
|
... | ... | @@ -146,15 +145,16 @@ def run_dummy(context): |
146 | 145 |
pass
|
147 | 146 |
|
148 | 147 |
|
149 |
-@cli.command('temp-directory', short_help="Runs commands in temp directory and uploads results.")
|
|
148 |
+@cli.command('host-tools', short_help="Runs commands using the host's tools.")
|
|
150 | 149 |
@pass_context
|
151 |
-def run_temp_directory(context):
|
|
152 |
- """ Downloads files and command from CAS and runs
|
|
153 |
- in a temp directory, uploading result back to CAS
|
|
150 |
+def run_host_tools(context):
|
|
151 |
+ """
|
|
152 |
+ Downloads inputs from CAS, runs build commands using host-tools and uploads
|
|
153 |
+ result back to CAS.
|
|
154 | 154 |
"""
|
155 | 155 |
try:
|
156 | 156 |
b = bot.Bot(context.bot_session)
|
157 |
- b.session(temp_directory.work_temp_directory,
|
|
157 |
+ b.session(host.work_host_tools,
|
|
158 | 158 |
context)
|
159 | 159 |
except KeyboardInterrupt:
|
160 | 160 |
pass
|
... | ... | @@ -168,7 +168,7 @@ def run_temp_directory(context): |
168 | 168 |
@pass_context
|
169 | 169 |
def run_buildbox(context, local_cas, fuse_dir):
|
170 | 170 |
"""
|
171 |
- Uses BuildBox to run commands.
|
|
171 |
+ Uses BuildBox to run build commands.
|
|
172 | 172 |
"""
|
173 | 173 |
context.local_cas = local_cas
|
174 | 174 |
context.fuse_dir = fuse_dir
|
... | ... | @@ -36,10 +36,10 @@ BuildGrid's Command Line Interface (CLI) reference documentation. |
36 | 36 |
|
37 | 37 |
----
|
38 | 38 |
|
39 |
-.. _invoking-bgd-bot-temp-directory:
|
|
39 |
+.. _invoking-bgd-bot-host-tools:
|
|
40 | 40 |
|
41 |
-.. click:: buildgrid._app.commands.cmd_bot:run_temp_directory
|
|
42 |
- :prog: bgd bot temp-directory
|
|
41 |
+.. click:: buildgrid._app.commands.cmd_bot:run_host_tools
|
|
42 |
+ :prog: bgd bot host-tools
|
|
43 | 43 |
|
44 | 44 |
----
|
45 | 45 |
|
... | ... | @@ -137,4 +137,4 @@ BuildGrid's Command Line Interface (CLI) reference documentation. |
137 | 137 |
.. _invoking-bgd-server-start:
|
138 | 138 |
|
139 | 139 |
.. click:: buildgrid._app.commands.cmd_server:start
|
140 |
- :prog: bgd server start
|
|
140 |
+ :prog: bgd server start
|
|
\ No newline at end of file |
... | ... | @@ -94,13 +94,13 @@ has ``gcc`` installed, run: |
94 | 94 |
|
95 | 95 |
.. code-block:: sh
|
96 | 96 |
|
97 |
- bgd bot --remote=http://localhost:50051 --parent=main temp-directory
|
|
97 |
+ bgd bot --remote=http://localhost:50051 --parent=main host-tools
|
|
98 | 98 |
|
99 | 99 |
The ``--remote`` option is used to specify the server location (running on the
|
100 | 100 |
same machine here, and listening to port 50051). The ``--parent`` option is used
|
101 | 101 |
to specify the server instance you except the bot to be attached to. Refer to
|
102 |
-the :ref:`CLI reference section <invoking-bgd-bot-temp-directory>` for command
|
|
103 |
-line interface details.
|
|
102 |
+the :ref:`CLI reference section <invoking-bgd-bot-host-tools>` for command line
|
|
103 |
+interface details.
|
|
104 | 104 |
|
105 | 105 |
The BuildGrid server is now ready to accept jobs and execute them. Bazel needs
|
106 | 106 |
some :ref:`configuration <bazel-configuration>` in order to run remote builds.
|
... | ... | @@ -128,4 +128,4 @@ generated executable. Simply invoke: |
128 | 128 |
./bazel-bin/main/hello-world
|
129 | 129 |
|
130 | 130 |
.. _bazel-examples: https://github.com/bazelbuild/examples
|
131 |
-.. _stage3 CPP example: https://github.com/bazelbuild/examples/tree/master/cpp-tutorial/stage3
|
|
131 |
+.. _stage3 CPP example: https://github.com/bazelbuild/examples/tree/master/cpp-tutorial/stage3
|
|
\ No newline at end of file |
1 |
+ |
|
1 | 2 |
.. _internal-client:
|
2 | 3 |
|
3 | 4 |
Internal client
|
... | ... | @@ -20,7 +21,7 @@ In one terminal, start a server: |
20 | 21 |
|
21 | 22 |
In another terminal, upload an action to CAS:
|
22 | 23 |
|
23 |
-.. code-block::sh
|
|
24 |
+.. code-block:: sh
|
|
24 | 25 |
|
25 | 26 |
bgd cas upload-dummy
|
26 | 27 |
|
... | ... | @@ -34,7 +35,7 @@ The stage should show as ``QUEUED`` as it awaits a bot to pick up the work: |
34 | 35 |
|
35 | 36 |
.. code-block:: sh
|
36 | 37 |
|
37 |
- bgd execute list
|
|
38 |
+ bgd operation list
|
|
38 | 39 |
|
39 | 40 |
Create a bot session:
|
40 | 41 |
|
... | ... | @@ -46,7 +47,7 @@ Show the work as completed: |
46 | 47 |
|
47 | 48 |
.. code-block:: sh
|
48 | 49 |
|
49 |
- bgd execute list
|
|
50 |
+ bgd operation list
|
|
50 | 51 |
|
51 | 52 |
|
52 | 53 |
.. _simple-build:
|
... | ... | @@ -83,7 +84,7 @@ Start the following bot session: |
83 | 84 |
|
84 | 85 |
.. code-block:: sh
|
85 | 86 |
|
86 |
- bgd bot temp-directory
|
|
87 |
+ bgd bot host-tools
|
|
87 | 88 |
|
88 | 89 |
Upload the directory containing the C file:
|
89 | 90 |
|
... | ... | @@ -101,4 +102,4 @@ to run on the bot: |
101 | 102 |
bgd execute command --output-file hello True /path/to/test-buildgrid -- gcc -Wall hello.c -o hello
|
102 | 103 |
|
103 | 104 |
The resulting executeable should have returned to a new directory called
|
104 |
-``testing``.
|
|
105 |
+``testing``.
|
|
\ No newline at end of file |