-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* migrate ibeji adapter * Generate PlantUML Diagrams * fix workflow issues * fix workflow issues --------- Co-authored-by: Automated Notice Generation Pipeline <[email protected]>
- Loading branch information
1 parent
6c3db75
commit deb162e
Showing
17 changed files
with
528 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,7 @@ cert | |
Chariott | ||
chariott | ||
Chariott's | ||
ChariottServiceDiscovery | ||
chmod | ||
ci | ||
cli | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT license. | ||
# SPDX-License-Identifier: MIT | ||
|
||
[package] | ||
name = "ibeji-adapter" | ||
version = "0.1.0" | ||
edition = "2021" | ||
license = "MIT" | ||
|
||
[dependencies] | ||
async-trait = { workspace = true } | ||
core-protobuf-data-access = { workspace = true } | ||
freyja-build-common = { workspace = true } | ||
freyja-common = { workspace = true } | ||
futures = { workspace = true } | ||
log = { workspace = true } | ||
proc-macros = { workspace = true } | ||
serde = { workspace = true } | ||
serde_json = { workspace = true } | ||
service_discovery_proto = { workspace = true } | ||
strum = { workspace = true } | ||
strum_macros = { workspace = true } | ||
tempfile = { workspace = true } | ||
tokio = { workspace = true } | ||
tokio-stream = { workspace = true, features = ["net"] } | ||
tonic = { workspace = true } | ||
tower = { workspace = true } | ||
|
||
[build-dependencies] | ||
freyja-build-common = { workspace = true } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Ibeji Adapter | ||
|
||
The Ibeji Adapter is used to integrate with the [Ibeji In-Vehicle Digital Twin Service](https://github.com/eclipse-ibeji/ibeji), and optionally [Chariott](https://github.com/eclipse-chariott/chariott) to discover Ibeji. | ||
|
||
## Configuration | ||
|
||
This adapter supports two different configuration schemas depending on how you want to discover the In-Vehicle Digital Twin Service: | ||
|
||
### Without Chariott | ||
|
||
To bypass Chariott and use a configuration value to specify the In-Vehicle Digital Twin Service URI, you must specify the following configuration: | ||
|
||
- `service_discovery_method`: Set this value to `"Config"`. | ||
- `uri`: The URI for the In-Vehicle Digital Twin Service. | ||
- `max_retries`: The maximum number of times to retry failed attempts to communicate with the In-Vehicle Digital Twin Service. | ||
- `retry_interval_ms`: The duration between retries in milliseconds. | ||
|
||
### Using Chariott | ||
|
||
To use Chariott to discover the In-Vehicle Digital Twin Service, you must specify the following configuration: | ||
|
||
- `service_discovery_method`: Set this value to `"ChariottServiceDiscovery"` to use Chariott. | ||
- `uri`: The URI for Chariott's Service Discovery system. | ||
- `max_retries`: The maximum number of times to retry failed attempts to communicate with Chariott or the In-Vehicle Digital Twin Service. | ||
- `retry_interval_ms`: The duration between retries in milliseconds. | ||
- `metadata`: Metadata for the discovery operation: | ||
- `namespace`: The namespace for the In-Vehicle Digital Twin Service. | ||
- `name`: The service name for the In-Vehicle Digital Twin Service. | ||
- `version`: The version of the In-Vehicle Digital Twin Service to query for. | ||
|
||
An example of a configuration file that uses Chariott can be found at `res/ibeji_adapter_config.chariott_sample.json`. | ||
|
||
### Configuration Overrides | ||
|
||
This adapter supports the same [config override method](../../../docs/tutorials/config-overrides.md) as the Freyja mocks. The override filename is `ibeji_adapter_config.json`, and the default config is located at `res/ibeji_adapter_config.default.json`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
// SPDX-License-Identifier: MIT | ||
|
||
use freyja_build_common::copy_config; | ||
|
||
const CONFIG_FILE_STEM: &str = "ibeji_adapter_config"; | ||
|
||
fn main() { | ||
copy_config(CONFIG_FILE_STEM); | ||
} |
11 changes: 11 additions & 0 deletions
11
adapters/digital_twin/ibeji_adapter/res/ibeji_adapter_config.chariott_sample.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"service_discovery_method": "ChariottServiceDiscovery", | ||
"uri": "http://0.0.0.0:50000", | ||
"max_retries": 5, | ||
"retry_interval_ms": 1000, | ||
"discover_request": { | ||
"namespace": "sdv.ibeji", | ||
"name": "invehicle_digital_twin", | ||
"version": "1.0" | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
adapters/digital_twin/ibeji_adapter/res/ibeji_adapter_config.default.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"service_discovery_method": "FromConfig", | ||
"uri": "http://0.0.0.0:5010", | ||
"max_retries": 5, | ||
"retry_interval_ms": 1000 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
// SPDX-License-Identifier: MIT | ||
|
||
use serde::{Deserialize, Serialize}; | ||
|
||
/// Configuration for the Ibeji Adapter. | ||
/// Supports two different schemas based on the service discovery method. | ||
#[derive(Clone, Serialize, Deserialize)] | ||
#[serde(tag = "service_discovery_method")] | ||
pub enum Config { | ||
/// Use a URI from the config for the In-Vehicle Digital Twin Service | ||
FromConfig { | ||
/// The URI for the In-Vehicle Digital Twin Service | ||
uri: String, | ||
|
||
/// The maximum number of retries for communication attempts | ||
max_retries: u32, | ||
|
||
/// The duration between retries in milliseconds | ||
retry_interval_ms: u64, | ||
}, | ||
|
||
/// Use Chariott's Service Discovery system to discover the In-Vehicle Digital Twin Service | ||
ChariottServiceDiscovery { | ||
/// The URI for the Chariott Discovery Service | ||
uri: String, | ||
|
||
/// The maximum number of retries for communication attempts | ||
max_retries: u32, | ||
|
||
/// The duration between retries in milliseconds | ||
retry_interval_ms: u64, | ||
|
||
/// The request to send to Chariott | ||
discover_request: ChariottDiscoverRequest, | ||
}, | ||
} | ||
|
||
/// A Chariott Service Discovery request | ||
#[derive(Clone, Serialize, Deserialize)] | ||
pub struct ChariottDiscoverRequest { | ||
/// The service namespace | ||
pub namespace: String, | ||
|
||
/// The service name | ||
pub name: String, | ||
|
||
/// The service version | ||
pub version: String, | ||
} |
Oops, something went wrong.