New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 836091 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Jul 17
Cc:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Feature

Blocking:
issue 782499


Participants' hotlists:
ML-Service


Sign in to add a comment

ML Service Mojo builds, synchronized between Chromium and Chromium OS

Project Member Reported by amoylan@chromium.org, Apr 24 2018

Issue description

The basic mojo interface for ML service was added in crrev.com/c/967901. This interface is needed on both Chromium OS side (for ML daemon) and Chromium side (for clients).

First step could be to add a BUILD rule building against the Chromium OS mojoms appearing in Chromium under third_party/cros_system_api/.

Second version could be to explicitly submit (identical) mojoms to Chrome OS repo.

 
Summary: ML Service Mojo builds, synchronized between Chromium and Chromium OS (was: Sync ML service Mojo interfaces between Chromium and Chromium OS)
Project Member

Comment 2 by bugdroid1@chromium.org, May 4 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/system_api/+/a4736b507e60aca560f3d79c6efdd495e06558fe

commit a4736b507e60aca560f3d79c6efdd495e06558fe
Author: Andrew Moylan <amoylan@chromium.org>
Date: Fri May 04 10:02:46 2018

Add a library build rule for ml_service mojo files

This library build rule is needed in order for platform2/ml to
conveniently depend on & use these interfaces.

Converted the 'action' to a 'rule' in order to build our multiple
mojoms.

Also fixed some typos in the existing mojoms that didn't have a build
rule yet.

TEST=Used from an in-progress platform2/ml CL on my machine.
BUG= chromium:836091 

Change-Id: Ia0b8ebffcfae3f5cd54599f89f0f24b466023335
Reviewed-on: https://chromium-review.googlesource.com/1032133
Commit-Ready: Andrew Moylan <amoylan@chromium.org>
Tested-by: Andrew Moylan <amoylan@chromium.org>
Reviewed-by: Eric Caruso <ejcaruso@chromium.org>

[modify] https://crrev.com/a4736b507e60aca560f3d79c6efdd495e06558fe/mojo/ml_service/interface.mojom
[modify] https://crrev.com/a4736b507e60aca560f3d79c6efdd495e06558fe/mojo/ml_service/model.mojom
[modify] https://crrev.com/a4736b507e60aca560f3d79c6efdd495e06558fe/system_api.gyp

Owner: amoylan@chromium.org
I'm working on this concurrently with the D-Bus bootstrap  crbug.com/836092 .

We will go with the submit-matching-mojoms-to-both-repos approach per sammc's analysis in https://docs.google.com/document/d/1rX3xtR6ZioKZaO-4qBFJFqFypSX1p6gAvQ_MuYn64G8/edit
Cc: napper@chromium.org claudiomagni@chromium.org martis@chromium.org
Project Member

Comment 6 by bugdroid1@chromium.org, Jul 16

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/5ced600fb66be67bd35dbe83022662c82daa090f

commit 5ced600fb66be67bd35dbe83022662c82daa090f
Author: Andrew Moylan <amoylan@chromium.org>
Date: Mon Jul 16 01:24:09 2018

ML service: Implement D-Bus->Mojo bootstrap & add a thin client library

This CL adds logic for Chromium to bootstrap a Mojo connection to the
Chrome OS ML service daemon via D-Bus, and a very simple client library
for client code in Chromium to use to access the ML service.

1. Bootstrap
To connect to the daemon, Chromium prepares a Unix socket pair and sends
a Mojo invitation, including a primordial pipe handle, through the
socket. The file descriptor for the other end of the socket pair is
passed to the daemon as the argument of its BootstrapMojoConnection
D-Bus method. The daemon is expected to bind the primordial pipe to an
implementation of the MachineLearningService top-level Mojo interface.

The ML service daemon side of the above interaction is added in
crrev.com/c/1123663.

2. Thin client library
This CL adds chromeos::machine_learning::ServiceConnection which client
code in Chromium can use to access the ML service. This singleton class
automatically performs D-Bus->Mojo bootstrap as necessary, and exposes
a method clients can use to bind a ModelProviderPtr mojo interface and
thereby access the ML service.

This CL also brings the .mojom files specifying the ML service Mojo
interface under public/mojom. Previously we intended to access these via
third_party/cros_system_api, but Chromium will instead maintain its own
copy of these mojoms, which will be manually eventually-consistent with
the Chrome OS copies (under src/platform2/ml). We are switching to this
recommended approach for the reasons discussed in the following doc:
https://docs.google.com/document/d/1rX3xtR6ZioKZaO-4qBFJFqFypSX1p6gAvQ_MuYn64G8
A separate CL will remove the .mojoms under platform/system_api/mojo.

Testing:

How to automatically test that Chromium + the daemon successfully
perform the D-Bus -> Mojo bootstrap is not clear and is under discussion
(comments welcome). It may have to wait until there is a client in
Chromium calling the daemon, which could then have an end-to-end
autotest.

I manually tested this against a Chrome OS ML service built with
crrev.com/c/1123663 by adding some test calls to BootstrapMojoConnection
initiated from chrome_browser_main_chromeos.

Bug:  836091 ,  836092 ,  836107 
Change-Id: I3dbcaeb7a0af0bc09a56a98e68d9420cc1626d91
Reviewed-on: https://chromium-review.googlesource.com/1123964
Reviewed-by: Ben Chan <benchan@chromium.org>
Reviewed-by: Ken Rockot <rockot@chromium.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Commit-Queue: Andrew Moylan <amoylan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#575193}
[modify] https://crrev.com/5ced600fb66be67bd35dbe83022662c82daa090f/chrome/common/chrome_features.cc
[modify] https://crrev.com/5ced600fb66be67bd35dbe83022662c82daa090f/chrome/common/chrome_features.h
[modify] https://crrev.com/5ced600fb66be67bd35dbe83022662c82daa090f/chromeos/BUILD.gn
[modify] https://crrev.com/5ced600fb66be67bd35dbe83022662c82daa090f/chromeos/dbus/dbus_clients_common.cc
[modify] https://crrev.com/5ced600fb66be67bd35dbe83022662c82daa090f/chromeos/dbus/dbus_clients_common.h
[modify] https://crrev.com/5ced600fb66be67bd35dbe83022662c82daa090f/chromeos/dbus/dbus_thread_manager.cc
[modify] https://crrev.com/5ced600fb66be67bd35dbe83022662c82daa090f/chromeos/dbus/dbus_thread_manager.h
[add] https://crrev.com/5ced600fb66be67bd35dbe83022662c82daa090f/chromeos/dbus/fake_machine_learning_client.cc
[add] https://crrev.com/5ced600fb66be67bd35dbe83022662c82daa090f/chromeos/dbus/fake_machine_learning_client.h
[add] https://crrev.com/5ced600fb66be67bd35dbe83022662c82daa090f/chromeos/dbus/machine_learning_client.cc
[add] https://crrev.com/5ced600fb66be67bd35dbe83022662c82daa090f/chromeos/dbus/machine_learning_client.h
[add] https://crrev.com/5ced600fb66be67bd35dbe83022662c82daa090f/chromeos/services/machine_learning/DEPS
[add] https://crrev.com/5ced600fb66be67bd35dbe83022662c82daa090f/chromeos/services/machine_learning/public/cpp/BUILD.gn
[add] https://crrev.com/5ced600fb66be67bd35dbe83022662c82daa090f/chromeos/services/machine_learning/public/cpp/service_connection.cc
[add] https://crrev.com/5ced600fb66be67bd35dbe83022662c82daa090f/chromeos/services/machine_learning/public/cpp/service_connection.h
[add] https://crrev.com/5ced600fb66be67bd35dbe83022662c82daa090f/chromeos/services/machine_learning/public/mojom/BUILD.gn
[add] https://crrev.com/5ced600fb66be67bd35dbe83022662c82daa090f/chromeos/services/machine_learning/public/mojom/OWNERS
[add] https://crrev.com/5ced600fb66be67bd35dbe83022662c82daa090f/chromeos/services/machine_learning/public/mojom/graph_executor.mojom
[add] https://crrev.com/5ced600fb66be67bd35dbe83022662c82daa090f/chromeos/services/machine_learning/public/mojom/machine_learning_service.mojom
[add] https://crrev.com/5ced600fb66be67bd35dbe83022662c82daa090f/chromeos/services/machine_learning/public/mojom/model.mojom
[add] https://crrev.com/5ced600fb66be67bd35dbe83022662c82daa090f/chromeos/services/machine_learning/public/mojom/tensor.mojom

Status: Fixed (was: Started)
Project Member

Comment 8 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/system_api/+/de836897c796fe15a03840e6a05f0227032df545

commit de836897c796fe15a03840e6a05f0227032df545
Author: Andrew Moylan <amoylan@chromium.org>
Date: Tue Jul 17 06:03:04 2018

Remove ML service mojoms from system_api

Instead of sharing ML service .mojoms between Chrome OS and Chromium
here in system_api, we will follow the recommendations of the doc below
to keep eventually-consistent copies of the mojoms separately in each
repo:
https://docs.google.com/document/d/1rX3xtR6ZioKZaO-4qBFJFqFypSX1p6gAvQ_MuYn64G8

This CL just removes the mojoms. They are added separately in Chrome OS
and Chromium in, respectively: crrev.com/c/1123663 and
crrev.com/c/1123964.

BUG= chromium:836091 
TEST=no

Change-Id: Ie5a696c8ade776dde7c6f30a6cab9c41dea15d91
Reviewed-on: https://chromium-review.googlesource.com/1123968
Commit-Ready: Andrew Moylan <amoylan@chromium.org>
Tested-by: Andrew Moylan <amoylan@chromium.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Claudio M <claudiomagni@chromium.org>

[delete] https://crrev.com/6e71a28cf4a6fc980b0cb3ce55a82204ed20d89a/mojo/ml_service/interface.mojom
[delete] https://crrev.com/6e71a28cf4a6fc980b0cb3ce55a82204ed20d89a/mojo/ml_service/model.mojom
[delete] https://crrev.com/6e71a28cf4a6fc980b0cb3ce55a82204ed20d89a/mojo/ml_service/learning_example.mojom
[modify] https://crrev.com/de836897c796fe15a03840e6a05f0227032df545/system_api.gyp

Sign in to add a comment