diff options
author | Scott Murray <scott.murray@konsulko.com> | 2022-09-10 12:15:20 -0400 |
---|---|---|
committer | Scott Murray <scott.murray@konsulko.com> | 2022-09-21 14:33:32 +0000 |
commit | 992f87151ff189dc061624f010eddee2036fd33f (patch) | |
tree | 1372b14798ee21610f66b2466061f564ef631a17 /README.md | |
parent | 920f7d6d92ffca4998f6215f4d20ab17693b59db (diff) |
Add gRPC API implementationneedlefish
Changes:
- Rename the existing daemon to applaunchd-dbus, and add a new
version that exposes a gRPC based implementation of the API based
on the protobuf definition added in a top-level protos directory.
Having both the D-Bus and gRPC APIs exposed by a single daemon was
posing difficulties around startup dependencies stemming from D-Bus
activation of the daemon. Since the end goal is dropping the D-Bus
API entirely, it is easier to just add a second daemon for gRPC that
will eventually be the only one present.
- To facilitate building the two implementations, a significant amount
of code refactoring has been done to move things from the D-Bus API
implementing app_launcher.[ch] to systemd_manager.[ch] so the code
can be reused.
- All use of the systemd D-Bus library except for the path encoding
helper function has been replaced with GDBus. The systemd interface
wrapper code was generated with gdbus-codegen from XML files captured
via introspection on a running system. The motivation for this
change was to avoid multithreading issues with sd_bus exposed when
calling into it from the gRPC threads.
- The copyright headers in the source files have been tweaked to
remove the Apache license boilerplate in favour of a SPDX license
tag.
Notes:
- The gRPC API differs slightly from the D-Bus one in that it has a
single status streaming RPC method as opposed to the separate signals
for application started or terminated that the D-Bus API has.
- The gRPC API is currently unauthenticated, the aim is to circle back
and implement authentication once a consensus can be reached on what
mechanism should be used (fixed JWT configuration, OAuth, etc.).
Bug-AGL: SPEC-4559
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Change-Id: I828f38a58b60e9959162b98054982124d4fa4380
(cherry picked from commit c52afaf8b5c96136fe20e5d5a1332121d3b09ee9)
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 24 |
1 files changed, 17 insertions, 7 deletions
@@ -1,23 +1,33 @@ AGL Application Launcher service reference implementation `applaunchd` is a simple service for launching applications from other -applications. It exposes an interface named 'org.automotivelinux.AppLaunch' on -on the D-Bus session bus and can be autostarted by using this interface name. +applications. It exposes a gRPC RPC interface as described in the file +`protos/applauncher.proto`. Additionally, there is a now deprecated +`applaunchd-dbus`, which exposes a comparable version of the interface +named 'org.automotivelinux.AppLaunch' on the D-Bus session bus and can +be autostarted by using this interface name. -This interface can be used to: +The interface can be used to: - retrieve a list of available applications - request that a specific application be started by using the 'start' method -- subcribe to the 'started' and/or 'terminated' signals in order to be - notified when an application started successfully or terminated +- subcribe to a status signal (separate 'started' and/or 'terminated' signals + for the D-Bus implementation) in order to be notified when an application + has started successfully or terminated. -For more details about the D-Bus interface, please refer to the file -`data/org.automotivelinux.AppLaunch.xml`. +For more details about the deprecated D-Bus interface, please refer to the +file `data/org.automotivelinux.AppLaunch.xml`. Applications are enumerated from systemd's list of available units based on the pattern agl-app*@*.service, and are started and controled using their systemd unit. Please note `applaunchd` allows only one instance of a given application. +Note that while the gRPC and D-Bus implementations are comparable in +functionality, they are not interoperable with respect to status notifications +for applications started by the other interface. It is advised that their +usage not be mixed in the same image to avoid confusion around application +window activation. + AGL repo for source code: https://gerrit.automotivelinux.org/gerrit/#/admin/projects/src/applaunchd |