Skip to content

Commit e0167ae

Browse files
doc: update for gRPC
Signed-off-by: Bastian Krause <bst@pengutronix.de> Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
1 parent 81f5801 commit e0167ae

7 files changed

Lines changed: 20 additions & 75 deletions

File tree

doc/RELEASE.rst

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,6 @@ Test the upload by using pypi dev as a download source
6666

6767
::
6868

69-
virtualenv -p python3 labgrid-crossbar-release-<your-version-number>
70-
labgrid-crossbar-release-<your-version-number>/bin/pip install --upgrade pip
71-
labgrid-crossbar-release-<your-version-number>/bin/pip install -r crossbar-requirements.txt
72-
7369
virtualenv -p python3 labgrid-release-<your-version-number>
7470
source labgrid-release-<your-version-number>/bin/activate
7571
pip install --upgrade pip setuptools wheel
@@ -80,7 +76,7 @@ And optionally run the tests:
8076
::
8177

8278
pip install ".[dev]"
83-
pytest tests --crossbar-venv labgrid-crossbar-release-<your-version-number>
79+
pytest tests
8480

8581
7. Upload to pypi
8682
=================

doc/development.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Install required dependencies:
2323

2424
.. code-block:: bash
2525
26-
sudo apt install python3-dev libow-dev libsnappy-dev
26+
sudo apt install python3-dev libow-dev
2727
2828
Install labgrid with development dependencies into the virtualenv in editable
2929
mode:

doc/getting_started.rst

Lines changed: 5 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Test your installation by running:
6262
.. code-block:: bash
6363
6464
labgrid-venv $ labgrid-client --help
65-
usage: labgrid-client [-h] [-x URL] [-c CONFIG] [-p PLACE] [-d] COMMAND ...
65+
usage: labgrid-client [-h] [-x ADDRESS] [-c CONFIG] [-p PLACE] [-d] COMMAND ...
6666
...
6767
6868
If the help for labgrid-client does not show up, open an `Issue
@@ -170,58 +170,11 @@ exporter, and learn how to access the exporter via the client.
170170
Coordinator
171171
~~~~~~~~~~~
172172

173-
To start the coordinator, we will download the labgrid repository, create an
174-
extra virtualenv and install the dependencies:
173+
We can simply start the coordinator:
175174

176175
.. code-block:: bash
177176
178-
$ sudo apt install libsnappy-dev
179-
$ git clone https://github.com/labgrid-project/labgrid
180-
$ cd labgrid
181-
$ virtualenv -p python3 crossbar-venv
182-
$ crossbar-venv/bin/pip install --upgrade pip
183-
$ crossbar-venv/bin/pip install -r crossbar-requirements.txt
184-
$ virtualenv -p python3 labgrid-venv
185-
$ source labgrid-venv/bin/activate
186-
labgrid-venv $ pip install --upgrade pip
187-
labgrid-venv $ pip install .
188-
189-
All necessary dependencies should be installed now.
190-
191-
Copy and customize the crossbar config file ``.crossbar/config-anonymous.yaml``
192-
for your use case:
193-
194-
.. code-block:: bash
195-
196-
labgrid-venv $ cp .crossbar/config-anonymous.yaml .crossbar/my-config.yaml
197-
198-
.. note:: crossbar is a network messaging framework for building distributed
199-
applications, which labgrid plugs into.
200-
201-
The path to the Python interpreter in the labgrid-venv needs to be configured
202-
in crossbar's config, either manually or with the labgrid-venv being active
203-
via:
204-
205-
.. code-block:: bash
206-
207-
labgrid-venv $ sed -i "s#^ executable: .*\$# executable: ${VIRTUAL_ENV}/bin/python3#" .crossbar/my-config.yaml
208-
209-
.. note:: For long running deployments a different ``workdir`` and port may be
210-
used.
211-
The crossbar config should reside in a ``.crossbar`` directory in the
212-
``workdir`` in this case.
213-
For an example systemd service file, see
214-
:ref:`remote-getting-started-systemd-files`.
215-
216-
Now we can finally start the coordinator inside the repository:
217-
218-
.. code-block:: bash
219-
220-
$ crossbar-venv/bin/crossbar start --config my-config.yaml
221-
222-
.. note:: If --config is specified as a relative path, the config is expected
223-
in a .crossbar subdirectory (as is the case in the labgrid
224-
repository).
177+
labgrid-venv $ labgrid-coordinator
225178
226179
Exporter
227180
~~~~~~~~
@@ -375,25 +328,19 @@ Follow these instructions to install the systemd files on your machine(s):
375328
installation paths of your distribution.
376329
#. Adapt the ``ExecStart`` paths of the service files to the respective Python
377330
virtual environments of the coordinator and exporter.
378-
#. Create the coordinator configuration file referenced in the ``ExecStart``
379-
option of the :file:`labgrid-coordinator.service` file by using
380-
:file:`.crossbar/config-anonymous.yaml` as a starting point. You most likely
381-
want to make sure that the ``workdir`` option matches the path given via the
382-
``--cbdir`` option in the service file; see
383-
:ref:`remote-getting-started-coordinator` for further information.
384331
#. Adjust the ``SupplementaryGroups`` option in the
385332
:file:`labgrid-exporter.service` file to your distribution so that the
386333
exporter gains read and write access on TTY devices (for ``ser2net``); most
387334
often, these groups are called ``dialout``, ``plugdev`` or ``tty``.
388335
Depending on your udev configuration, you may need multiple groups.
389-
#. Set the coordinator URL the exporter should connect to by overriding the
336+
#. Set the coordinator address the exporter should connect to by overriding the
390337
exporter service file; i.e. execute ``systemctl edit
391338
labgrid-exporter.service`` and add the following snippet:
392339

393340
.. code-block::
394341
395342
[Service]
396-
Environment="LG_CROSSBAR=ws://<your-host>:<your-port>/ws"
343+
Environment="LG_COORDINATOR=<your-host>[:<your-port>]"
397344
398345
#. Create the ``labgrid`` user and group:
399346

doc/man.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ Manual Pages
55
man/client
66
man/device-config
77
man/exporter
8+
man/coordinator

doc/man/coordinator.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.. _labgrid-coordinator:
2+
.. include:: ../../man/labgrid-coordinator.rst

doc/overview.rst

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ labgrid contains components for accessing resources which are not directly
210210
accessible on the local machine.
211211
The main parts of this are:
212212

213-
labgrid-coordinator (crossbar component)
213+
labgrid-coordinator
214214
Clients and exporters connect to the coordinator to publish resources, manage
215215
place configuration and handle mutual exclusion.
216216

@@ -227,9 +227,8 @@ RemotePlace (managed resource)
227227
When used in a `Target`, the RemotePlace expands to the resources configured
228228
for the named places.
229229

230-
These components communicate over the `WAMP <http://wamp-proto.org/>`_
231-
implementation `Autobahn <http://autobahn.ws/>`_ and the `Crossbar
232-
<http://crossbar.io/>`_ WAMP router.
230+
These components communicate over `gRPC <https://grpc.io/>`_. The coordinator
231+
acts as a gRPC server to which client and exporter connect.
233232

234233
The following sections describe the responsibilities of each component. See
235234
:ref:`remote-usage` for usage information.
@@ -239,8 +238,8 @@ The following sections describe the responsibilities of each component. See
239238
Coordinator
240239
~~~~~~~~~~~
241240

242-
The `Coordinator` is implemented as a Crossbar component and is started by the
243-
router.
241+
The `Coordinator` is implemented as a gRPC server and is started as a separate
242+
process.
244243
It provides separate RPC methods for the exporters and clients.
245244

246245
The coordinator keeps a list of all resources for clients and
@@ -387,7 +386,7 @@ variable needs to be set to the remote host which should tunnel the connection
387386
to the coordinator. The client then forwards all network traffic -
388387
client-to-coordinator and client-to-exporter - through SSH, via their
389388
respective proxies. This means that with :code:`LG_PROXY` and
390-
:code:`LG_CROSSBAR` labgrid can be used fully remotely with only a SSH
389+
:code:`LG_COORDINATOR` labgrid can be used fully remotely with only a SSH
391390
connection as a requirement.
392391

393392
.. note::

doc/usage.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -437,10 +437,10 @@ Other labgrid-related pytest plugin options are:
437437
Specify a labgrid environment config file.
438438
This is equivalent to labgrid-client's ``-c``/``--config``.
439439

440-
``--lg-coordinator=CROSSBAR_URL``
441-
Specify labgrid coordinator websocket URL.
442-
Defaults to ``ws://127.0.0.1:20408/ws``.
443-
This is equivalent to labgrid-client's ``-x``/``--crossbar``.
440+
``--lg-coordinator=COORDINATOR_ADDRESS``
441+
Specify labgrid coordinator gRPC address as ``HOST[:PORT]``.
442+
Defaults to ``127.0.0.1:20408``.
443+
This is equivalent to labgrid-client's ``-x``/``--coordinator``.
444444

445445
``--lg-log=[path to logfiles]``
446446
Path to store console log file.

0 commit comments

Comments
 (0)