# google/device-infra architecture

> Architecture diagram of the GitHub repository google/device-infra, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/google/device-infra
- Repository: https://github.com/google/device-infra

## Overview

Android Test Station Utilities supports a UI for Android test engineers to run standard suites such as CTS. The visible repository spans frontend workflows, device/lab APIs, session and messaging contracts, Android device/emulator support, and monitoring utilities; the README also names server and runner artifacts. The principal workflow is represented at a subsystem level because the tree and excerpts do not expose the complete request-to-execution implementation. Arrows are limited to relationships documented in the README or visible in sampled source/index references.

Main entry points: [`src/devtools/mobileharness/fe/v6/angular/app`](https://github.com/google/device-infra/tree/main/src/devtools/mobileharness/fe/v6/angular/app) (Station interface), [`src/java/com/google/devtools/mobileharness/infra/monitoring/BatchPipelineService.java`](https://github.com/google/device-infra/blob/main/src/java/com/google/devtools/mobileharness/infra/monitoring/BatchPipelineService.java) (Batch monitoring), [`src/devtools/mobileharness/fe/v6/angular/app/features/device_detail`](https://github.com/google/device-infra/tree/main/src/devtools/mobileharness/fe/v6/angular/app/features/device_detail) (Device workflows), [`src/devtools/mobileharness/fe/v6/angular/app/features/search_page`](https://github.com/google/device-infra/tree/main/src/devtools/mobileharness/fe/v6/angular/app/features/search_page) (Search workflows)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Station UI"]
  node_station_ui["Station interface"]
  node_device_detail["Device workflows"]
  node_search_ui["Search workflows"]
end

subgraph group_contracts["Harness APIs"]
  node_device_api["Device information"]
  node_deviceconfig_api["Device configuration"]
  node_query_api["Device and lab queries"]
  node_model_api["Harness models"]
  node_session_rpc["Session service contract"]
  node_search_rpc["Search service contract"]
end

subgraph group_execution["Test execution"]
  node_ats_runner["ATS runners"]
  node_session_service["Session service"]
  node_ats_job_sync["Job synchronization"]
end

subgraph group_device["Device infrastructure"]
  node_device_actions["Device actions"]
  node_android_device["Android device control"]
  node_cloud_emulator["Cloud emulator"]
  node_lab_service["Lab information"]
end

subgraph group_operations["Operations"]
  node_monitoring["Batch monitoring"]
  node_data_puller["Data puller"]
  node_data_pusher["Data pusher"]
end

node_engineers(("Test engineers"))
node_cloud_orchestrator(("Cloud orchestrator"))
node_test_suites(("Android test suites"))

node_engineers -->|"use"| node_station_ui
node_station_ui -->|"run suites"| node_test_suites
node_device_detail -.->|"uses contracts"| node_device_api
node_search_ui -.->|"queries through"| node_search_rpc
node_station_ui -.->|"uses contract"| node_session_rpc
node_session_service -.->|"starts runners"| node_ats_runner
node_ats_job_sync -.->|"schedules against"| node_android_device
node_cloud_emulator -.->|"calls API"| node_cloud_orchestrator
node_monitoring -->|"pulls data"| node_data_puller
node_monitoring -->|"pushes data"| node_data_pusher

click node_station_ui "https://github.com/google/device-infra/tree/main/src/devtools/mobileharness/fe/v6/angular/app"
click node_device_detail "https://github.com/google/device-infra/tree/main/src/devtools/mobileharness/fe/v6/angular/app/features/device_detail"
click node_search_ui "https://github.com/google/device-infra/tree/main/src/devtools/mobileharness/fe/v6/angular/app/features/search_page"
click node_device_api "https://github.com/google/device-infra/tree/main/src/devtools/deviceinfra/api/deviceinfo/proto"
click node_deviceconfig_api "https://github.com/google/device-infra/tree/main/src/devtools/mobileharness/api/deviceconfig/proto"
click node_query_api "https://github.com/google/device-infra/tree/main/src/devtools/mobileharness/api/query/proto"
click node_model_api "https://github.com/google/device-infra/tree/main/src/devtools/mobileharness/api/model/proto"
click node_session_rpc "https://github.com/google/device-infra/tree/main/src/devtools/mobileharness/fe/v6/service/proto/session"
click node_search_rpc "https://github.com/google/device-infra/tree/main/src/devtools/mobileharness/fe/v6/service/proto/search"
click node_ats_runner "https://github.com/google/device-infra/tree/main/src/java/com/google/devtools/mobileharness/infra/ats"
click node_session_service "https://github.com/google/device-infra/blob/main/src/java/com/google/devtools/mobileharness/infra/client/longrunningservice/rpc/service/SessionService.java"
click node_ats_job_sync "https://github.com/google/device-infra/blob/main/src/java/com/google/devtools/mobileharness/infra/client/api/mode/ats/JobSyncService.java"
click node_device_actions "https://github.com/google/device-infra/tree/main/src/devtools/deviceaction/schemas/proto/actions"
click node_android_device "https://github.com/google/device-infra/blob/main/src/java/com/google/wireless/qa/mobileharness/shared/api/device/AndroidRealDevice.java"
click node_cloud_emulator "https://github.com/google/device-infra/blob/main/src/java/com/google/devtools/mobileharness/platform/android/shared/emulator/CloudOrchestratorClient.java"
click node_lab_service "https://github.com/google/device-infra/blob/main/src/java/com/google/devtools/mobileharness/shared/labinfo/LabInfoService.java"
click node_monitoring "https://github.com/google/device-infra/blob/main/src/java/com/google/devtools/mobileharness/infra/monitoring/BatchPipelineService.java"
click node_data_puller "https://github.com/google/device-infra/tree/main/src/java/com/google/devtools/mobileharness/infra/monitoring"
click node_data_pusher "https://github.com/google/device-infra/tree/main/src/java/com/google/devtools/mobileharness/infra/monitoring"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_station_ui,node_device_detail,node_search_ui toneBlue
class node_device_api,node_deviceconfig_api,node_query_api,node_model_api,node_session_rpc,node_search_rpc toneAmber
class node_ats_runner,node_session_service,node_ats_job_sync toneMint
class node_device_actions,node_android_device,node_cloud_emulator,node_lab_service toneRose
class node_monitoring,node_data_puller,node_data_pusher,node_engineers,node_cloud_orchestrator,node_test_suites toneIndigo
```

## Components

### Station UI

- [Station interface](https://github.com/google/device-infra/tree/main/src/devtools/mobileharness/fe/v6/angular/app): `src/devtools/mobileharness/fe/v6/angular/app`
- [Device workflows](https://github.com/google/device-infra/tree/main/src/devtools/mobileharness/fe/v6/angular/app/features/device_detail): `src/devtools/mobileharness/fe/v6/angular/app/features/device_detail`
- [Search workflows](https://github.com/google/device-infra/tree/main/src/devtools/mobileharness/fe/v6/angular/app/features/search_page): `src/devtools/mobileharness/fe/v6/angular/app/features/search_page`

### Harness APIs

- [Device information](https://github.com/google/device-infra/tree/main/src/devtools/deviceinfra/api/deviceinfo/proto): `src/devtools/deviceinfra/api/deviceinfo/proto`
- [Device configuration](https://github.com/google/device-infra/tree/main/src/devtools/mobileharness/api/deviceconfig/proto): `src/devtools/mobileharness/api/deviceconfig/proto`
- [Device and lab queries](https://github.com/google/device-infra/tree/main/src/devtools/mobileharness/api/query/proto): `src/devtools/mobileharness/api/query/proto`
- [Harness models](https://github.com/google/device-infra/tree/main/src/devtools/mobileharness/api/model/proto): `src/devtools/mobileharness/api/model/proto`
- [Session service contract](https://github.com/google/device-infra/tree/main/src/devtools/mobileharness/fe/v6/service/proto/session): `src/devtools/mobileharness/fe/v6/service/proto/session`
- [Search service contract](https://github.com/google/device-infra/tree/main/src/devtools/mobileharness/fe/v6/service/proto/search): `src/devtools/mobileharness/fe/v6/service/proto/search`

### Test execution

- [ATS runners](https://github.com/google/device-infra/tree/main/src/java/com/google/devtools/mobileharness/infra/ats): `src/java/com/google/devtools/mobileharness/infra/ats`
- [Session service](https://github.com/google/device-infra/blob/main/src/java/com/google/devtools/mobileharness/infra/client/longrunningservice/rpc/service/SessionService.java): `src/java/com/google/devtools/mobileharness/infra/client/longrunningservice/rpc/service/SessionService.java`
- [Job synchronization](https://github.com/google/device-infra/blob/main/src/java/com/google/devtools/mobileharness/infra/client/api/mode/ats/JobSyncService.java): `src/java/com/google/devtools/mobileharness/infra/client/api/mode/ats/JobSyncService.java`

### Device infrastructure

- [Device actions](https://github.com/google/device-infra/tree/main/src/devtools/deviceaction/schemas/proto/actions): `src/devtools/deviceaction/schemas/proto/actions`
- [Android device control](https://github.com/google/device-infra/blob/main/src/java/com/google/wireless/qa/mobileharness/shared/api/device/AndroidRealDevice.java): `src/java/com/google/wireless/qa/mobileharness/shared/api/device/AndroidRealDevice.java`
- [Cloud emulator](https://github.com/google/device-infra/blob/main/src/java/com/google/devtools/mobileharness/platform/android/shared/emulator/CloudOrchestratorClient.java): `src/java/com/google/devtools/mobileharness/platform/android/shared/emulator/CloudOrchestratorClient.java`
- [Lab information](https://github.com/google/device-infra/blob/main/src/java/com/google/devtools/mobileharness/shared/labinfo/LabInfoService.java): `src/java/com/google/devtools/mobileharness/shared/labinfo/LabInfoService.java`

### Operations

- [Batch monitoring](https://github.com/google/device-infra/blob/main/src/java/com/google/devtools/mobileharness/infra/monitoring/BatchPipelineService.java): `src/java/com/google/devtools/mobileharness/infra/monitoring/BatchPipelineService.java`
- [Data puller](https://github.com/google/device-infra/tree/main/src/java/com/google/devtools/mobileharness/infra/monitoring): `src/java/com/google/devtools/mobileharness/infra/monitoring`
- [Data pusher](https://github.com/google/device-infra/tree/main/src/java/com/google/devtools/mobileharness/infra/monitoring): `src/java/com/google/devtools/mobileharness/infra/monitoring`

### Other components

- **Test engineers**
- **Cloud orchestrator**
- **Android test suites**

## Connections

- Test engineers → Station interface: use
- Station interface → Android test suites: run suites
- Device workflows → Device information: uses contracts
- Search workflows → Search service contract: queries through
- Station interface → Session service contract: uses contract
- Session service → ATS runners: starts runners
- Job synchronization → Android device control: schedules against
- Cloud emulator → Cloud orchestrator: calls API
- Batch monitoring → Data puller: pulls data (evidence: `src/java/com/google/devtools/mobileharness/infra/monitoring/BatchPipelineService.java`)
- Batch monitoring → Data pusher: pushes data (evidence: `src/java/com/google/devtools/mobileharness/infra/monitoring/BatchPipelineService.java`)
