From 5dc7d4e0a910918a564968e69797309ccc6f73d0 Mon Sep 17 00:00:00 2001 From: Lauren Datz <105828115+ladatz@users.noreply.github.com> Date: Mon, 8 Jan 2024 15:17:55 -0500 Subject: [PATCH 01/11] Add intent_brokering folder --- Cargo.lock | 2 - Cargo.toml | 77 ++++-------------- intent_brokering/Cargo.toml | 47 +++++++++++ .../common}/Cargo.toml | 0 .../common}/src/config.rs | 0 .../common}/src/error.rs | 0 .../common}/src/ext.rs | 0 .../common}/src/lib.rs | 0 .../common}/src/query.rs | 0 .../common}/src/shutdown.rs | 0 .../common}/src/streaming_ess.rs | 0 .../common}/src/tokio_runtime_fork.rs | 0 {ess => intent_brokering/ess}/Cargo.toml | 0 {ess => intent_brokering/ess}/README.md | 0 .../ess}/benches/load_bench.rs | 0 {ess => intent_brokering/ess}/src/ess.rs | 0 {ess => intent_brokering/ess}/src/lib.rs | 0 .../examples}/applications/Dockerfile.base | 0 .../Dockerfile.cloud-object-detection | 0 .../examples}/applications/Dockerfile.generic | 0 .../applications/Dockerfile.kv-app.ci | 0 .../Dockerfile.lt-provider-app.ci | 0 .../applications/Dockerfile.mock-vas | 0 .../applications/Dockerfile.simulated-camera | 0 .../examples}/applications/README.md | 0 .../cloud-object-detection/Cargo.toml | 0 .../cloud-object-detection/README.md | 0 .../src/chariott_provider.rs | 0 .../cloud-object-detection/src/detection.rs | 0 .../cloud-object-detection/src/main.rs | 0 .../applications/dog-mode-logic/Cargo.toml | 0 .../dog-mode-logic/src/dog_mode_status.rs | 0 .../applications/dog-mode-logic/src/main.rs | 0 .../applications/dog-mode-ui/.editorconfig | 0 .../applications/dog-mode-ui/.gitignore | 0 .../dog-mode-ui/DogModeDashboard.sln | 0 .../applications/dog-mode-ui/README.md | 0 .../applications/dog-mode-ui/global.json | 0 .../mock_provider_dog_mode_demo.sh | 0 .../dog-mode-ui/src/DogModeDashboard.csproj | 0 .../applications/dog-mode-ui/src/Program.cs | 0 .../src/Properties/launchSettings.json | 0 .../src/appsettings.Development.json | 0 .../dog-mode-ui/src/appsettings.json | 0 .../dog-mode-ui/src/wwwroot/fa/LICENSE.txt | 0 .../src/wwwroot/fa/js/fontawesome.min.js | 0 .../src/wwwroot/fa/js/solid.min.js | 0 .../dog-mode-ui/src/wwwroot/index.css | 0 .../dog-mode-ui/src/wwwroot/index.html | 0 .../dog-mode-ui/src/wwwroot/streaming.html | 0 .../applications/invoke-command/Cargo.toml | 0 .../applications/invoke-command/README.md | 0 .../invoke-command/src/chariott_provider.rs | 0 .../applications/invoke-command/src/main.rs | 0 .../applications/invoke_object_detection.sh | 0 .../examples}/applications/kv-app/Cargo.toml | 0 .../examples}/applications/kv-app/README.md | 0 .../kv-app/src/chariott_provider.rs | 0 .../examples}/applications/kv-app/src/main.rs | 0 .../local-object-detection/Cargo.toml | 0 .../local-object-detection/README.md | 0 .../models/categories.json | 0 .../local-object-detection/models/readme.txt | 0 .../models/ssd_mobilenet_v2_coco.pb | 0 .../src/chariott_provider.rs | 0 .../local-object-detection/src/detection.rs | 0 .../local-object-detection/src/main.rs | 0 .../applications/lt-consumer/Cargo.toml | 0 .../applications/lt-consumer/src/main.rs | 0 .../applications/lt-provider/Cargo.toml | 0 .../applications/lt-provider/src/main.rs | 0 .../applications/mock-vas/Cargo.toml | 0 .../examples}/applications/mock-vas/README.md | 0 .../mock-vas/src/chariott_provider.rs | 0 .../mock-vas/src/communication.rs | 0 .../applications/mock-vas/src/main.rs | 0 .../applications/mock-vas/src/simulation.rs | 0 .../examples}/applications/proto/buf.yaml | 0 .../examples/detection/v1/detection.proto | 0 .../examples}/applications/run_demo.sh | 10 +-- .../applications/simple-provider/Cargo.toml | 0 .../applications/simple-provider/README.md | 0 .../simple-provider/src/chariott_provider.rs | 0 .../applications/simple-provider/src/main.rs | 0 .../applications/simulated-camera/Cargo.toml | 0 .../simulated-camera/LICENSE_IMAGES | 0 .../applications/simulated-camera/README.md | 0 .../simulated-camera/images/dog_1.jpg | Bin .../simulated-camera/images/dog_2.jpg | Bin .../simulated-camera/images/dog_3.jpg | Bin .../simulated-camera/images/dog_4.jpg | Bin .../simulated-camera/images/no_dog.jpg | Bin .../simulated-camera/src/camera.rs | 0 .../simulated-camera/src/chariott_provider.rs | 0 .../simulated-camera/src/communication.rs | 0 .../applications/simulated-camera/src/main.rs | 0 .../examples}/common/Cargo.toml | 0 .../examples}/common/build.rs | 0 .../examples}/common/src/chariott/api.rs | 0 .../common/src/chariott/inspection.rs | 0 .../examples}/common/src/chariott/mod.rs | 0 .../examples}/common/src/chariott/provider.rs | 0 .../common/src/chariott/registration.rs | 0 .../common/src/chariott/streaming.rs | 0 .../examples}/common/src/chariott/value.rs | 0 .../common/src/examples/detection.rs | 0 .../examples}/common/src/examples/mod.rs | 0 .../examples}/common/src/examples/proto.rs | 0 .../examples}/common/src/lib.rs | 0 .../examples}/common/src/url.rs | 0 .../keyvalue}/Cargo.toml | 0 .../keyvalue}/README.md | 0 .../keyvalue}/src/key_value_store.rs | 0 .../keyvalue}/src/lib.rs | 0 .../proto.rs}/Cargo.toml | 0 .../proto.rs}/build.rs | 0 .../proto.rs}/src/lib.rs | 0 {proto => intent_brokering/proto}/buf.yaml | 0 .../proto}/chariott/common/v1/common.proto | 0 .../chariott/provider/v1/provider.proto | 0 .../proto}/chariott/runtime/v1/runtime.proto | 0 .../chariott/streaming/v1/streaming.proto | 0 .../src}/chariott_grpc.rs | 0 .../src}/connection_provider.rs | 0 {src => intent_brokering/src}/execution.rs | 0 .../src}/intent_broker.rs | 0 {src => intent_brokering/src}/lib.rs | 0 {src => intent_brokering/src}/main.rs | 0 {src => intent_brokering/src}/registry.rs | 0 {src => intent_brokering/src}/streaming.rs | 0 {tests => intent_brokering/tests}/README.md | 0 .../tests}/chariott_integration.rs | 0 {tests => intent_brokering/tests}/common.rs | 0 .../tests}/container-e2e-tests-wsl2.sh | 0 {tests => intent_brokering/tests}/cover.sh | 0 {tests => intent_brokering/tests}/provider.rs | 0 .../tests}/registry-e2e.rs | 0 .../tests}/store-e2e.rs | 0 {tools => intent_brokering/tools}/charc | 0 {tools => intent_brokering/tools}/charc.md | 0 .../tools}/notice_generation.sh | 0 .../simple-discovery/consumer/Cargo.toml | 1 - .../simple-discovery/provider/Cargo.toml | 1 - .../simple-discovery/provider/src/main.rs | 7 +- 144 files changed, 72 insertions(+), 73 deletions(-) create mode 100644 intent_brokering/Cargo.toml rename {common => intent_brokering/common}/Cargo.toml (100%) rename {common => intent_brokering/common}/src/config.rs (100%) rename {common => intent_brokering/common}/src/error.rs (100%) rename {common => intent_brokering/common}/src/ext.rs (100%) rename {common => intent_brokering/common}/src/lib.rs (100%) rename {common => intent_brokering/common}/src/query.rs (100%) rename {common => intent_brokering/common}/src/shutdown.rs (100%) rename {common => intent_brokering/common}/src/streaming_ess.rs (100%) rename {common => intent_brokering/common}/src/tokio_runtime_fork.rs (100%) rename {ess => intent_brokering/ess}/Cargo.toml (100%) rename {ess => intent_brokering/ess}/README.md (100%) rename {ess => intent_brokering/ess}/benches/load_bench.rs (100%) rename {ess => intent_brokering/ess}/src/ess.rs (100%) rename {ess => intent_brokering/ess}/src/lib.rs (100%) rename {examples => intent_brokering/examples}/applications/Dockerfile.base (100%) rename {examples => intent_brokering/examples}/applications/Dockerfile.cloud-object-detection (100%) rename {examples => intent_brokering/examples}/applications/Dockerfile.generic (100%) rename {examples => intent_brokering/examples}/applications/Dockerfile.kv-app.ci (100%) rename {examples => intent_brokering/examples}/applications/Dockerfile.lt-provider-app.ci (100%) rename {examples => intent_brokering/examples}/applications/Dockerfile.mock-vas (100%) rename {examples => intent_brokering/examples}/applications/Dockerfile.simulated-camera (100%) rename {examples => intent_brokering/examples}/applications/README.md (100%) rename {examples => intent_brokering/examples}/applications/cloud-object-detection/Cargo.toml (100%) rename {examples => intent_brokering/examples}/applications/cloud-object-detection/README.md (100%) rename {examples => intent_brokering/examples}/applications/cloud-object-detection/src/chariott_provider.rs (100%) rename {examples => intent_brokering/examples}/applications/cloud-object-detection/src/detection.rs (100%) rename {examples => intent_brokering/examples}/applications/cloud-object-detection/src/main.rs (100%) rename {examples => intent_brokering/examples}/applications/dog-mode-logic/Cargo.toml (100%) rename {examples => intent_brokering/examples}/applications/dog-mode-logic/src/dog_mode_status.rs (100%) rename {examples => intent_brokering/examples}/applications/dog-mode-logic/src/main.rs (100%) rename {examples => intent_brokering/examples}/applications/dog-mode-ui/.editorconfig (100%) rename {examples => intent_brokering/examples}/applications/dog-mode-ui/.gitignore (100%) rename {examples => intent_brokering/examples}/applications/dog-mode-ui/DogModeDashboard.sln (100%) rename {examples => intent_brokering/examples}/applications/dog-mode-ui/README.md (100%) rename {examples => intent_brokering/examples}/applications/dog-mode-ui/global.json (100%) rename {examples => intent_brokering/examples}/applications/dog-mode-ui/mock_provider_dog_mode_demo.sh (100%) rename {examples => intent_brokering/examples}/applications/dog-mode-ui/src/DogModeDashboard.csproj (100%) rename {examples => intent_brokering/examples}/applications/dog-mode-ui/src/Program.cs (100%) rename {examples => intent_brokering/examples}/applications/dog-mode-ui/src/Properties/launchSettings.json (100%) rename {examples => intent_brokering/examples}/applications/dog-mode-ui/src/appsettings.Development.json (100%) rename {examples => intent_brokering/examples}/applications/dog-mode-ui/src/appsettings.json (100%) rename {examples => intent_brokering/examples}/applications/dog-mode-ui/src/wwwroot/fa/LICENSE.txt (100%) rename {examples => intent_brokering/examples}/applications/dog-mode-ui/src/wwwroot/fa/js/fontawesome.min.js (100%) rename {examples => intent_brokering/examples}/applications/dog-mode-ui/src/wwwroot/fa/js/solid.min.js (100%) rename {examples => intent_brokering/examples}/applications/dog-mode-ui/src/wwwroot/index.css (100%) rename {examples => intent_brokering/examples}/applications/dog-mode-ui/src/wwwroot/index.html (100%) rename {examples => intent_brokering/examples}/applications/dog-mode-ui/src/wwwroot/streaming.html (100%) rename {examples => intent_brokering/examples}/applications/invoke-command/Cargo.toml (100%) rename {examples => intent_brokering/examples}/applications/invoke-command/README.md (100%) rename {examples => intent_brokering/examples}/applications/invoke-command/src/chariott_provider.rs (100%) rename {examples => intent_brokering/examples}/applications/invoke-command/src/main.rs (100%) rename {examples => intent_brokering/examples}/applications/invoke_object_detection.sh (100%) rename {examples => intent_brokering/examples}/applications/kv-app/Cargo.toml (100%) rename {examples => intent_brokering/examples}/applications/kv-app/README.md (100%) rename {examples => intent_brokering/examples}/applications/kv-app/src/chariott_provider.rs (100%) rename {examples => intent_brokering/examples}/applications/kv-app/src/main.rs (100%) rename {examples => intent_brokering/examples}/applications/local-object-detection/Cargo.toml (100%) rename {examples => intent_brokering/examples}/applications/local-object-detection/README.md (100%) rename {examples => intent_brokering/examples}/applications/local-object-detection/models/categories.json (100%) rename {examples => intent_brokering/examples}/applications/local-object-detection/models/readme.txt (100%) rename {examples => intent_brokering/examples}/applications/local-object-detection/models/ssd_mobilenet_v2_coco.pb (100%) rename {examples => intent_brokering/examples}/applications/local-object-detection/src/chariott_provider.rs (100%) rename {examples => intent_brokering/examples}/applications/local-object-detection/src/detection.rs (100%) rename {examples => intent_brokering/examples}/applications/local-object-detection/src/main.rs (100%) rename {examples => intent_brokering/examples}/applications/lt-consumer/Cargo.toml (100%) rename {examples => intent_brokering/examples}/applications/lt-consumer/src/main.rs (100%) rename {examples => intent_brokering/examples}/applications/lt-provider/Cargo.toml (100%) rename {examples => intent_brokering/examples}/applications/lt-provider/src/main.rs (100%) rename {examples => intent_brokering/examples}/applications/mock-vas/Cargo.toml (100%) rename {examples => intent_brokering/examples}/applications/mock-vas/README.md (100%) rename {examples => intent_brokering/examples}/applications/mock-vas/src/chariott_provider.rs (100%) rename {examples => intent_brokering/examples}/applications/mock-vas/src/communication.rs (100%) rename {examples => intent_brokering/examples}/applications/mock-vas/src/main.rs (100%) rename {examples => intent_brokering/examples}/applications/mock-vas/src/simulation.rs (100%) rename {examples => intent_brokering/examples}/applications/proto/buf.yaml (100%) rename {examples => intent_brokering/examples}/applications/proto/examples/detection/v1/detection.proto (100%) rename {examples => intent_brokering/examples}/applications/run_demo.sh (71%) rename {examples => intent_brokering/examples}/applications/simple-provider/Cargo.toml (100%) rename {examples => intent_brokering/examples}/applications/simple-provider/README.md (100%) rename {examples => intent_brokering/examples}/applications/simple-provider/src/chariott_provider.rs (100%) rename {examples => intent_brokering/examples}/applications/simple-provider/src/main.rs (100%) rename {examples => intent_brokering/examples}/applications/simulated-camera/Cargo.toml (100%) rename {examples => intent_brokering/examples}/applications/simulated-camera/LICENSE_IMAGES (100%) rename {examples => intent_brokering/examples}/applications/simulated-camera/README.md (100%) rename {examples => intent_brokering/examples}/applications/simulated-camera/images/dog_1.jpg (100%) rename {examples => intent_brokering/examples}/applications/simulated-camera/images/dog_2.jpg (100%) rename {examples => intent_brokering/examples}/applications/simulated-camera/images/dog_3.jpg (100%) rename {examples => intent_brokering/examples}/applications/simulated-camera/images/dog_4.jpg (100%) rename {examples => intent_brokering/examples}/applications/simulated-camera/images/no_dog.jpg (100%) rename {examples => intent_brokering/examples}/applications/simulated-camera/src/camera.rs (100%) rename {examples => intent_brokering/examples}/applications/simulated-camera/src/chariott_provider.rs (100%) rename {examples => intent_brokering/examples}/applications/simulated-camera/src/communication.rs (100%) rename {examples => intent_brokering/examples}/applications/simulated-camera/src/main.rs (100%) rename {examples => intent_brokering/examples}/common/Cargo.toml (100%) rename {examples => intent_brokering/examples}/common/build.rs (100%) rename {examples => intent_brokering/examples}/common/src/chariott/api.rs (100%) rename {examples => intent_brokering/examples}/common/src/chariott/inspection.rs (100%) rename {examples => intent_brokering/examples}/common/src/chariott/mod.rs (100%) rename {examples => intent_brokering/examples}/common/src/chariott/provider.rs (100%) rename {examples => intent_brokering/examples}/common/src/chariott/registration.rs (100%) rename {examples => intent_brokering/examples}/common/src/chariott/streaming.rs (100%) rename {examples => intent_brokering/examples}/common/src/chariott/value.rs (100%) rename {examples => intent_brokering/examples}/common/src/examples/detection.rs (100%) rename {examples => intent_brokering/examples}/common/src/examples/mod.rs (100%) rename {examples => intent_brokering/examples}/common/src/examples/proto.rs (100%) rename {examples => intent_brokering/examples}/common/src/lib.rs (100%) rename {examples => intent_brokering/examples}/common/src/url.rs (100%) rename {keyvalue => intent_brokering/keyvalue}/Cargo.toml (100%) rename {keyvalue => intent_brokering/keyvalue}/README.md (100%) rename {keyvalue => intent_brokering/keyvalue}/src/key_value_store.rs (100%) rename {keyvalue => intent_brokering/keyvalue}/src/lib.rs (100%) rename {proto.rs => intent_brokering/proto.rs}/Cargo.toml (100%) rename {proto.rs => intent_brokering/proto.rs}/build.rs (100%) rename {proto.rs => intent_brokering/proto.rs}/src/lib.rs (100%) rename {proto => intent_brokering/proto}/buf.yaml (100%) rename {proto => intent_brokering/proto}/chariott/common/v1/common.proto (100%) rename {proto => intent_brokering/proto}/chariott/provider/v1/provider.proto (100%) rename {proto => intent_brokering/proto}/chariott/runtime/v1/runtime.proto (100%) rename {proto => intent_brokering/proto}/chariott/streaming/v1/streaming.proto (100%) rename {src => intent_brokering/src}/chariott_grpc.rs (100%) rename {src => intent_brokering/src}/connection_provider.rs (100%) rename {src => intent_brokering/src}/execution.rs (100%) rename {src => intent_brokering/src}/intent_broker.rs (100%) rename {src => intent_brokering/src}/lib.rs (100%) rename {src => intent_brokering/src}/main.rs (100%) rename {src => intent_brokering/src}/registry.rs (100%) rename {src => intent_brokering/src}/streaming.rs (100%) rename {tests => intent_brokering/tests}/README.md (100%) rename {tests => intent_brokering/tests}/chariott_integration.rs (100%) rename {tests => intent_brokering/tests}/common.rs (100%) rename {tests => intent_brokering/tests}/container-e2e-tests-wsl2.sh (100%) rename {tests => intent_brokering/tests}/cover.sh (100%) rename {tests => intent_brokering/tests}/provider.rs (100%) rename {tests => intent_brokering/tests}/registry-e2e.rs (100%) rename {tests => intent_brokering/tests}/store-e2e.rs (100%) rename {tools => intent_brokering/tools}/charc (100%) rename {tools => intent_brokering/tools}/charc.md (100%) rename {tools => intent_brokering/tools}/notice_generation.sh (100%) diff --git a/Cargo.lock b/Cargo.lock index cd606eff..d1950998 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -681,7 +681,6 @@ checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" name = "consumer" version = "0.1.0" dependencies = [ - "chariott-common", "samples_proto", "service_discovery_proto", "tokio", @@ -2452,7 +2451,6 @@ checksum = "cf7e6d18738ecd0902d30d1ad232c9125985a3422929b16c65517b38adc14f96" name = "provider" version = "0.1.0" dependencies = [ - "chariott-common", "samples_proto", "service_discovery_proto", "tokio", diff --git a/Cargo.toml b/Cargo.toml index 862a3160..df49f716 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,60 +4,32 @@ [workspace] members = [ - "common", - "ess", - "examples/applications/cloud-object-detection", - "examples/applications/dog-mode-logic", - "examples/applications/kv-app", - "examples/applications/invoke-command", - "examples/applications/local-object-detection", - "examples/applications/lt-consumer", - "examples/applications/lt-provider", - "examples/applications/mock-vas", - "examples/applications/simple-provider", - "examples/applications/simulated-camera", - "examples/common", - "keyvalue", - "proto.rs", + "intent_brokering", + "intent_brokering/common", + "intent_brokering/ess", + "intent_brokering/examples/applications/cloud-object-detection", + "intent_brokering/examples/applications/dog-mode-logic", + "intent_brokering/examples/applications/kv-app", + "intent_brokering/examples/applications/invoke-command", + "intent_brokering/examples/applications/local-object-detection", + "intent_brokering/examples/applications/lt-consumer", + "intent_brokering/examples/applications/lt-provider", + "intent_brokering/examples/applications/mock-vas", + "intent_brokering/examples/applications/simple-provider", + "intent_brokering/examples/applications/simulated-camera", + "intent_brokering/examples/common", + "intent_brokering/keyvalue", + "intent_brokering/proto.rs", "service_discovery/core", "service_discovery/samples/simple-discovery/consumer", "service_discovery/samples/simple-discovery/provider" ] -[package] -name = "chariott" -version = "0.1.0" -edition = "2021" -license = "MIT" - -[[test]] -name = "store-e2e" -test = false - -[[test]] -name = "registry-e2e" -test = false - -[dependencies] -async-recursion = "1.0" -async-trait = { workspace = true } -chariott-common = { workspace = true } -chariott-proto = { workspace = true } -prost = { workspace = true } -prost-types = { workspace = true } -tokio = { workspace = true, features = ["rt-multi-thread", "time"] } -tokio-util = { workspace = true } -tonic = { workspace = true } -tonic-reflection = "0.10" -tracing = { workspace = true } -tracing-subscriber = { workspace = true } -url = { workspace = true } - [workspace.dependencies] anyhow = "1.0" async-trait = "0.1" -chariott-common = { path = "./common/" } -chariott-proto = { path = "./proto.rs/" } +chariott-common = { path = "./intent_brokering/common/" } +chariott-proto = { path = "./intent_brokering/proto.rs/" } futures = { version = "0.3" } lazy_static = "1.4.0" parking_lot = "0.12.1" @@ -77,19 +49,6 @@ uuid = { version = "1.6.1", features = ["v4"] } url = "2.5" test-case = "2.2.2" -[build-dependencies] -tonic-build = { workspace = true } - -[dev-dependencies] -anyhow = { workspace = true } -async-trait = { workspace = true } -examples-common = { path = "./examples/common" } -futures = { workspace = true } -tokio-util = { workspace = true } -uuid = { workspace = true } -tokio-stream = { workspace = true } -test-case = { workspace = true } - [profile.release] strip = true opt-level = "z" diff --git a/intent_brokering/Cargo.toml b/intent_brokering/Cargo.toml new file mode 100644 index 00000000..77d21eb1 --- /dev/null +++ b/intent_brokering/Cargo.toml @@ -0,0 +1,47 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT license. +# SPDX-License-Identifier: MIT + +[package] +name = "chariott" +version = "0.1.0" +edition = "2021" +license = "MIT" + +[dependencies] +async-recursion = "1.0" +async-trait = { workspace = true } +chariott-common = { workspace = true } +chariott-proto = { workspace = true } +prost = { workspace = true } +prost-types = { workspace = true } +tokio = { workspace = true, features = ["rt-multi-thread", "time"] } +tokio-util = { workspace = true } +tonic = { workspace = true } +tonic-reflection = "0.10" +tracing = { workspace = true } +tracing-subscriber = { workspace = true } +url = { workspace = true } + +[dev-dependencies] +anyhow = { workspace = true } +async-trait = { workspace = true } +examples-common = { path = "./examples/common" } +futures = { workspace = true } +tokio-util = { workspace = true } +uuid = { workspace = true } +tokio-stream = { workspace = true } +test-case = { workspace = true } + + +[build-dependencies] +tonic-build = { workspace = true } + + +[[test]] +name = "store-e2e" +test = false + +[[test]] +name = "registry-e2e" +test = false \ No newline at end of file diff --git a/common/Cargo.toml b/intent_brokering/common/Cargo.toml similarity index 100% rename from common/Cargo.toml rename to intent_brokering/common/Cargo.toml diff --git a/common/src/config.rs b/intent_brokering/common/src/config.rs similarity index 100% rename from common/src/config.rs rename to intent_brokering/common/src/config.rs diff --git a/common/src/error.rs b/intent_brokering/common/src/error.rs similarity index 100% rename from common/src/error.rs rename to intent_brokering/common/src/error.rs diff --git a/common/src/ext.rs b/intent_brokering/common/src/ext.rs similarity index 100% rename from common/src/ext.rs rename to intent_brokering/common/src/ext.rs diff --git a/common/src/lib.rs b/intent_brokering/common/src/lib.rs similarity index 100% rename from common/src/lib.rs rename to intent_brokering/common/src/lib.rs diff --git a/common/src/query.rs b/intent_brokering/common/src/query.rs similarity index 100% rename from common/src/query.rs rename to intent_brokering/common/src/query.rs diff --git a/common/src/shutdown.rs b/intent_brokering/common/src/shutdown.rs similarity index 100% rename from common/src/shutdown.rs rename to intent_brokering/common/src/shutdown.rs diff --git a/common/src/streaming_ess.rs b/intent_brokering/common/src/streaming_ess.rs similarity index 100% rename from common/src/streaming_ess.rs rename to intent_brokering/common/src/streaming_ess.rs diff --git a/common/src/tokio_runtime_fork.rs b/intent_brokering/common/src/tokio_runtime_fork.rs similarity index 100% rename from common/src/tokio_runtime_fork.rs rename to intent_brokering/common/src/tokio_runtime_fork.rs diff --git a/ess/Cargo.toml b/intent_brokering/ess/Cargo.toml similarity index 100% rename from ess/Cargo.toml rename to intent_brokering/ess/Cargo.toml diff --git a/ess/README.md b/intent_brokering/ess/README.md similarity index 100% rename from ess/README.md rename to intent_brokering/ess/README.md diff --git a/ess/benches/load_bench.rs b/intent_brokering/ess/benches/load_bench.rs similarity index 100% rename from ess/benches/load_bench.rs rename to intent_brokering/ess/benches/load_bench.rs diff --git a/ess/src/ess.rs b/intent_brokering/ess/src/ess.rs similarity index 100% rename from ess/src/ess.rs rename to intent_brokering/ess/src/ess.rs diff --git a/ess/src/lib.rs b/intent_brokering/ess/src/lib.rs similarity index 100% rename from ess/src/lib.rs rename to intent_brokering/ess/src/lib.rs diff --git a/examples/applications/Dockerfile.base b/intent_brokering/examples/applications/Dockerfile.base similarity index 100% rename from examples/applications/Dockerfile.base rename to intent_brokering/examples/applications/Dockerfile.base diff --git a/examples/applications/Dockerfile.cloud-object-detection b/intent_brokering/examples/applications/Dockerfile.cloud-object-detection similarity index 100% rename from examples/applications/Dockerfile.cloud-object-detection rename to intent_brokering/examples/applications/Dockerfile.cloud-object-detection diff --git a/examples/applications/Dockerfile.generic b/intent_brokering/examples/applications/Dockerfile.generic similarity index 100% rename from examples/applications/Dockerfile.generic rename to intent_brokering/examples/applications/Dockerfile.generic diff --git a/examples/applications/Dockerfile.kv-app.ci b/intent_brokering/examples/applications/Dockerfile.kv-app.ci similarity index 100% rename from examples/applications/Dockerfile.kv-app.ci rename to intent_brokering/examples/applications/Dockerfile.kv-app.ci diff --git a/examples/applications/Dockerfile.lt-provider-app.ci b/intent_brokering/examples/applications/Dockerfile.lt-provider-app.ci similarity index 100% rename from examples/applications/Dockerfile.lt-provider-app.ci rename to intent_brokering/examples/applications/Dockerfile.lt-provider-app.ci diff --git a/examples/applications/Dockerfile.mock-vas b/intent_brokering/examples/applications/Dockerfile.mock-vas similarity index 100% rename from examples/applications/Dockerfile.mock-vas rename to intent_brokering/examples/applications/Dockerfile.mock-vas diff --git a/examples/applications/Dockerfile.simulated-camera b/intent_brokering/examples/applications/Dockerfile.simulated-camera similarity index 100% rename from examples/applications/Dockerfile.simulated-camera rename to intent_brokering/examples/applications/Dockerfile.simulated-camera diff --git a/examples/applications/README.md b/intent_brokering/examples/applications/README.md similarity index 100% rename from examples/applications/README.md rename to intent_brokering/examples/applications/README.md diff --git a/examples/applications/cloud-object-detection/Cargo.toml b/intent_brokering/examples/applications/cloud-object-detection/Cargo.toml similarity index 100% rename from examples/applications/cloud-object-detection/Cargo.toml rename to intent_brokering/examples/applications/cloud-object-detection/Cargo.toml diff --git a/examples/applications/cloud-object-detection/README.md b/intent_brokering/examples/applications/cloud-object-detection/README.md similarity index 100% rename from examples/applications/cloud-object-detection/README.md rename to intent_brokering/examples/applications/cloud-object-detection/README.md diff --git a/examples/applications/cloud-object-detection/src/chariott_provider.rs b/intent_brokering/examples/applications/cloud-object-detection/src/chariott_provider.rs similarity index 100% rename from examples/applications/cloud-object-detection/src/chariott_provider.rs rename to intent_brokering/examples/applications/cloud-object-detection/src/chariott_provider.rs diff --git a/examples/applications/cloud-object-detection/src/detection.rs b/intent_brokering/examples/applications/cloud-object-detection/src/detection.rs similarity index 100% rename from examples/applications/cloud-object-detection/src/detection.rs rename to intent_brokering/examples/applications/cloud-object-detection/src/detection.rs diff --git a/examples/applications/cloud-object-detection/src/main.rs b/intent_brokering/examples/applications/cloud-object-detection/src/main.rs similarity index 100% rename from examples/applications/cloud-object-detection/src/main.rs rename to intent_brokering/examples/applications/cloud-object-detection/src/main.rs diff --git a/examples/applications/dog-mode-logic/Cargo.toml b/intent_brokering/examples/applications/dog-mode-logic/Cargo.toml similarity index 100% rename from examples/applications/dog-mode-logic/Cargo.toml rename to intent_brokering/examples/applications/dog-mode-logic/Cargo.toml diff --git a/examples/applications/dog-mode-logic/src/dog_mode_status.rs b/intent_brokering/examples/applications/dog-mode-logic/src/dog_mode_status.rs similarity index 100% rename from examples/applications/dog-mode-logic/src/dog_mode_status.rs rename to intent_brokering/examples/applications/dog-mode-logic/src/dog_mode_status.rs diff --git a/examples/applications/dog-mode-logic/src/main.rs b/intent_brokering/examples/applications/dog-mode-logic/src/main.rs similarity index 100% rename from examples/applications/dog-mode-logic/src/main.rs rename to intent_brokering/examples/applications/dog-mode-logic/src/main.rs diff --git a/examples/applications/dog-mode-ui/.editorconfig b/intent_brokering/examples/applications/dog-mode-ui/.editorconfig similarity index 100% rename from examples/applications/dog-mode-ui/.editorconfig rename to intent_brokering/examples/applications/dog-mode-ui/.editorconfig diff --git a/examples/applications/dog-mode-ui/.gitignore b/intent_brokering/examples/applications/dog-mode-ui/.gitignore similarity index 100% rename from examples/applications/dog-mode-ui/.gitignore rename to intent_brokering/examples/applications/dog-mode-ui/.gitignore diff --git a/examples/applications/dog-mode-ui/DogModeDashboard.sln b/intent_brokering/examples/applications/dog-mode-ui/DogModeDashboard.sln similarity index 100% rename from examples/applications/dog-mode-ui/DogModeDashboard.sln rename to intent_brokering/examples/applications/dog-mode-ui/DogModeDashboard.sln diff --git a/examples/applications/dog-mode-ui/README.md b/intent_brokering/examples/applications/dog-mode-ui/README.md similarity index 100% rename from examples/applications/dog-mode-ui/README.md rename to intent_brokering/examples/applications/dog-mode-ui/README.md diff --git a/examples/applications/dog-mode-ui/global.json b/intent_brokering/examples/applications/dog-mode-ui/global.json similarity index 100% rename from examples/applications/dog-mode-ui/global.json rename to intent_brokering/examples/applications/dog-mode-ui/global.json diff --git a/examples/applications/dog-mode-ui/mock_provider_dog_mode_demo.sh b/intent_brokering/examples/applications/dog-mode-ui/mock_provider_dog_mode_demo.sh similarity index 100% rename from examples/applications/dog-mode-ui/mock_provider_dog_mode_demo.sh rename to intent_brokering/examples/applications/dog-mode-ui/mock_provider_dog_mode_demo.sh diff --git a/examples/applications/dog-mode-ui/src/DogModeDashboard.csproj b/intent_brokering/examples/applications/dog-mode-ui/src/DogModeDashboard.csproj similarity index 100% rename from examples/applications/dog-mode-ui/src/DogModeDashboard.csproj rename to intent_brokering/examples/applications/dog-mode-ui/src/DogModeDashboard.csproj diff --git a/examples/applications/dog-mode-ui/src/Program.cs b/intent_brokering/examples/applications/dog-mode-ui/src/Program.cs similarity index 100% rename from examples/applications/dog-mode-ui/src/Program.cs rename to intent_brokering/examples/applications/dog-mode-ui/src/Program.cs diff --git a/examples/applications/dog-mode-ui/src/Properties/launchSettings.json b/intent_brokering/examples/applications/dog-mode-ui/src/Properties/launchSettings.json similarity index 100% rename from examples/applications/dog-mode-ui/src/Properties/launchSettings.json rename to intent_brokering/examples/applications/dog-mode-ui/src/Properties/launchSettings.json diff --git a/examples/applications/dog-mode-ui/src/appsettings.Development.json b/intent_brokering/examples/applications/dog-mode-ui/src/appsettings.Development.json similarity index 100% rename from examples/applications/dog-mode-ui/src/appsettings.Development.json rename to intent_brokering/examples/applications/dog-mode-ui/src/appsettings.Development.json diff --git a/examples/applications/dog-mode-ui/src/appsettings.json b/intent_brokering/examples/applications/dog-mode-ui/src/appsettings.json similarity index 100% rename from examples/applications/dog-mode-ui/src/appsettings.json rename to intent_brokering/examples/applications/dog-mode-ui/src/appsettings.json diff --git a/examples/applications/dog-mode-ui/src/wwwroot/fa/LICENSE.txt b/intent_brokering/examples/applications/dog-mode-ui/src/wwwroot/fa/LICENSE.txt similarity index 100% rename from examples/applications/dog-mode-ui/src/wwwroot/fa/LICENSE.txt rename to intent_brokering/examples/applications/dog-mode-ui/src/wwwroot/fa/LICENSE.txt diff --git a/examples/applications/dog-mode-ui/src/wwwroot/fa/js/fontawesome.min.js b/intent_brokering/examples/applications/dog-mode-ui/src/wwwroot/fa/js/fontawesome.min.js similarity index 100% rename from examples/applications/dog-mode-ui/src/wwwroot/fa/js/fontawesome.min.js rename to intent_brokering/examples/applications/dog-mode-ui/src/wwwroot/fa/js/fontawesome.min.js diff --git a/examples/applications/dog-mode-ui/src/wwwroot/fa/js/solid.min.js b/intent_brokering/examples/applications/dog-mode-ui/src/wwwroot/fa/js/solid.min.js similarity index 100% rename from examples/applications/dog-mode-ui/src/wwwroot/fa/js/solid.min.js rename to intent_brokering/examples/applications/dog-mode-ui/src/wwwroot/fa/js/solid.min.js diff --git a/examples/applications/dog-mode-ui/src/wwwroot/index.css b/intent_brokering/examples/applications/dog-mode-ui/src/wwwroot/index.css similarity index 100% rename from examples/applications/dog-mode-ui/src/wwwroot/index.css rename to intent_brokering/examples/applications/dog-mode-ui/src/wwwroot/index.css diff --git a/examples/applications/dog-mode-ui/src/wwwroot/index.html b/intent_brokering/examples/applications/dog-mode-ui/src/wwwroot/index.html similarity index 100% rename from examples/applications/dog-mode-ui/src/wwwroot/index.html rename to intent_brokering/examples/applications/dog-mode-ui/src/wwwroot/index.html diff --git a/examples/applications/dog-mode-ui/src/wwwroot/streaming.html b/intent_brokering/examples/applications/dog-mode-ui/src/wwwroot/streaming.html similarity index 100% rename from examples/applications/dog-mode-ui/src/wwwroot/streaming.html rename to intent_brokering/examples/applications/dog-mode-ui/src/wwwroot/streaming.html diff --git a/examples/applications/invoke-command/Cargo.toml b/intent_brokering/examples/applications/invoke-command/Cargo.toml similarity index 100% rename from examples/applications/invoke-command/Cargo.toml rename to intent_brokering/examples/applications/invoke-command/Cargo.toml diff --git a/examples/applications/invoke-command/README.md b/intent_brokering/examples/applications/invoke-command/README.md similarity index 100% rename from examples/applications/invoke-command/README.md rename to intent_brokering/examples/applications/invoke-command/README.md diff --git a/examples/applications/invoke-command/src/chariott_provider.rs b/intent_brokering/examples/applications/invoke-command/src/chariott_provider.rs similarity index 100% rename from examples/applications/invoke-command/src/chariott_provider.rs rename to intent_brokering/examples/applications/invoke-command/src/chariott_provider.rs diff --git a/examples/applications/invoke-command/src/main.rs b/intent_brokering/examples/applications/invoke-command/src/main.rs similarity index 100% rename from examples/applications/invoke-command/src/main.rs rename to intent_brokering/examples/applications/invoke-command/src/main.rs diff --git a/examples/applications/invoke_object_detection.sh b/intent_brokering/examples/applications/invoke_object_detection.sh similarity index 100% rename from examples/applications/invoke_object_detection.sh rename to intent_brokering/examples/applications/invoke_object_detection.sh diff --git a/examples/applications/kv-app/Cargo.toml b/intent_brokering/examples/applications/kv-app/Cargo.toml similarity index 100% rename from examples/applications/kv-app/Cargo.toml rename to intent_brokering/examples/applications/kv-app/Cargo.toml diff --git a/examples/applications/kv-app/README.md b/intent_brokering/examples/applications/kv-app/README.md similarity index 100% rename from examples/applications/kv-app/README.md rename to intent_brokering/examples/applications/kv-app/README.md diff --git a/examples/applications/kv-app/src/chariott_provider.rs b/intent_brokering/examples/applications/kv-app/src/chariott_provider.rs similarity index 100% rename from examples/applications/kv-app/src/chariott_provider.rs rename to intent_brokering/examples/applications/kv-app/src/chariott_provider.rs diff --git a/examples/applications/kv-app/src/main.rs b/intent_brokering/examples/applications/kv-app/src/main.rs similarity index 100% rename from examples/applications/kv-app/src/main.rs rename to intent_brokering/examples/applications/kv-app/src/main.rs diff --git a/examples/applications/local-object-detection/Cargo.toml b/intent_brokering/examples/applications/local-object-detection/Cargo.toml similarity index 100% rename from examples/applications/local-object-detection/Cargo.toml rename to intent_brokering/examples/applications/local-object-detection/Cargo.toml diff --git a/examples/applications/local-object-detection/README.md b/intent_brokering/examples/applications/local-object-detection/README.md similarity index 100% rename from examples/applications/local-object-detection/README.md rename to intent_brokering/examples/applications/local-object-detection/README.md diff --git a/examples/applications/local-object-detection/models/categories.json b/intent_brokering/examples/applications/local-object-detection/models/categories.json similarity index 100% rename from examples/applications/local-object-detection/models/categories.json rename to intent_brokering/examples/applications/local-object-detection/models/categories.json diff --git a/examples/applications/local-object-detection/models/readme.txt b/intent_brokering/examples/applications/local-object-detection/models/readme.txt similarity index 100% rename from examples/applications/local-object-detection/models/readme.txt rename to intent_brokering/examples/applications/local-object-detection/models/readme.txt diff --git a/examples/applications/local-object-detection/models/ssd_mobilenet_v2_coco.pb b/intent_brokering/examples/applications/local-object-detection/models/ssd_mobilenet_v2_coco.pb similarity index 100% rename from examples/applications/local-object-detection/models/ssd_mobilenet_v2_coco.pb rename to intent_brokering/examples/applications/local-object-detection/models/ssd_mobilenet_v2_coco.pb diff --git a/examples/applications/local-object-detection/src/chariott_provider.rs b/intent_brokering/examples/applications/local-object-detection/src/chariott_provider.rs similarity index 100% rename from examples/applications/local-object-detection/src/chariott_provider.rs rename to intent_brokering/examples/applications/local-object-detection/src/chariott_provider.rs diff --git a/examples/applications/local-object-detection/src/detection.rs b/intent_brokering/examples/applications/local-object-detection/src/detection.rs similarity index 100% rename from examples/applications/local-object-detection/src/detection.rs rename to intent_brokering/examples/applications/local-object-detection/src/detection.rs diff --git a/examples/applications/local-object-detection/src/main.rs b/intent_brokering/examples/applications/local-object-detection/src/main.rs similarity index 100% rename from examples/applications/local-object-detection/src/main.rs rename to intent_brokering/examples/applications/local-object-detection/src/main.rs diff --git a/examples/applications/lt-consumer/Cargo.toml b/intent_brokering/examples/applications/lt-consumer/Cargo.toml similarity index 100% rename from examples/applications/lt-consumer/Cargo.toml rename to intent_brokering/examples/applications/lt-consumer/Cargo.toml diff --git a/examples/applications/lt-consumer/src/main.rs b/intent_brokering/examples/applications/lt-consumer/src/main.rs similarity index 100% rename from examples/applications/lt-consumer/src/main.rs rename to intent_brokering/examples/applications/lt-consumer/src/main.rs diff --git a/examples/applications/lt-provider/Cargo.toml b/intent_brokering/examples/applications/lt-provider/Cargo.toml similarity index 100% rename from examples/applications/lt-provider/Cargo.toml rename to intent_brokering/examples/applications/lt-provider/Cargo.toml diff --git a/examples/applications/lt-provider/src/main.rs b/intent_brokering/examples/applications/lt-provider/src/main.rs similarity index 100% rename from examples/applications/lt-provider/src/main.rs rename to intent_brokering/examples/applications/lt-provider/src/main.rs diff --git a/examples/applications/mock-vas/Cargo.toml b/intent_brokering/examples/applications/mock-vas/Cargo.toml similarity index 100% rename from examples/applications/mock-vas/Cargo.toml rename to intent_brokering/examples/applications/mock-vas/Cargo.toml diff --git a/examples/applications/mock-vas/README.md b/intent_brokering/examples/applications/mock-vas/README.md similarity index 100% rename from examples/applications/mock-vas/README.md rename to intent_brokering/examples/applications/mock-vas/README.md diff --git a/examples/applications/mock-vas/src/chariott_provider.rs b/intent_brokering/examples/applications/mock-vas/src/chariott_provider.rs similarity index 100% rename from examples/applications/mock-vas/src/chariott_provider.rs rename to intent_brokering/examples/applications/mock-vas/src/chariott_provider.rs diff --git a/examples/applications/mock-vas/src/communication.rs b/intent_brokering/examples/applications/mock-vas/src/communication.rs similarity index 100% rename from examples/applications/mock-vas/src/communication.rs rename to intent_brokering/examples/applications/mock-vas/src/communication.rs diff --git a/examples/applications/mock-vas/src/main.rs b/intent_brokering/examples/applications/mock-vas/src/main.rs similarity index 100% rename from examples/applications/mock-vas/src/main.rs rename to intent_brokering/examples/applications/mock-vas/src/main.rs diff --git a/examples/applications/mock-vas/src/simulation.rs b/intent_brokering/examples/applications/mock-vas/src/simulation.rs similarity index 100% rename from examples/applications/mock-vas/src/simulation.rs rename to intent_brokering/examples/applications/mock-vas/src/simulation.rs diff --git a/examples/applications/proto/buf.yaml b/intent_brokering/examples/applications/proto/buf.yaml similarity index 100% rename from examples/applications/proto/buf.yaml rename to intent_brokering/examples/applications/proto/buf.yaml diff --git a/examples/applications/proto/examples/detection/v1/detection.proto b/intent_brokering/examples/applications/proto/examples/detection/v1/detection.proto similarity index 100% rename from examples/applications/proto/examples/detection/v1/detection.proto rename to intent_brokering/examples/applications/proto/examples/detection/v1/detection.proto diff --git a/examples/applications/run_demo.sh b/intent_brokering/examples/applications/run_demo.sh similarity index 71% rename from examples/applications/run_demo.sh rename to intent_brokering/examples/applications/run_demo.sh index e2287922..db8908e5 100755 --- a/examples/applications/run_demo.sh +++ b/intent_brokering/examples/applications/run_demo.sh @@ -4,7 +4,7 @@ # SPDX-License-Identifier: MIT set -e -cd "$(dirname "$0")/../.." +cd "$(dirname "$0")/../../.." if [[ "$1" == "-h" || "$1" == "--help" ]]; then echo 'Run Chariott demo. @@ -60,13 +60,13 @@ cargo build --workspace sleep 2 -./examples/applications/dog-mode-ui/mock_provider_dog_mode_demo.sh | ANNOUNCE_URL=http://localhost:50051 ./target/debug/mock-vas > target/logs/mock_vas.txt 2>&1 & # DevSkim: ignore DS162092 +./intent_brokering/examples/applications/dog-mode-ui/mock_provider_dog_mode_demo.sh | ANNOUNCE_URL=http://localhost:50051 ./target/debug/mock-vas > target/logs/mock_vas.txt 2>&1 & # DevSkim: ignore DS162092 MOCK_VAS_PID=$! ANNOUNCE_URL=http://localhost:50064 ./target/debug/kv-app > target/logs/kv_app.txt 2>&1 & # DevSkim: ignore DS162092 -SIMULATED_CAMERA_APP_IMAGES_DIRECTORY=./examples/applications/simulated-camera/images ANNOUNCE_URL=http://localhost:50066 ./target/debug/simulated-camera-app > target/logs/simulated_camera_app.txt 2>&1 & # DevSkim: ignore DS162092 +SIMULATED_CAMERA_APP_IMAGES_DIRECTORY=./intent_brokering/examples/applications/simulated-camera/images ANNOUNCE_URL=http://localhost:50066 ./target/debug/simulated-camera-app > target/logs/simulated_camera_app.txt 2>&1 & # DevSkim: ignore DS162092 CAMERA_PID=$! TENSORFLOW_LIB_PATH="$(dirname $(find target -name libtensorflow.so -printf '%T@\t%p\n' | sort -nr | cut -f 2- | head -1))" -LIBRARY_PATH=$TENSORFLOW_LIB_PATH LD_LIBRARY_PATH=$TENSORFLOW_LIB_PATH CATEGORIES_FILE_PATH=./examples/applications/local-object-detection/models/categories.json ANNOUNCE_URL=http://localhost:50061 ./target/debug/local-object-detection-app > target/logs/local_object_detection_app.txt 2>&1 & # DevSkim: ignore DS162092 +LIBRARY_PATH=$TENSORFLOW_LIB_PATH LD_LIBRARY_PATH=$TENSORFLOW_LIB_PATH CATEGORIES_FILE_PATH=./intent_brokering/examples/applications/local-object-detection/models/categories.json ANNOUNCE_URL=http://localhost:50061 ./target/debug/local-object-detection-app > target/logs/local_object_detection_app.txt 2>&1 & # DevSkim: ignore DS162092 LOCAL_DETECTION_PID=$! if [[ ! -z "$cognitive_endpoint" || ! -z "$cognitive_key" ]]; then COGNITIVE_ENDPOINT=$cognitive_endpoint COGNITIVE_KEY=$cognitive_key ANNOUNCE_URL=http://localhost:50063 ./target/debug/cloud-object-detection-app > target/logs/cloud_object_detection_app.txt 2>&1 & # DevSkim: ignore DS162092 @@ -81,6 +81,6 @@ sleep 5 sleep 2 -dotnet run --project examples/applications/dog-mode-ui/src > ./target/logs/ui.txt 2>&1 & +dotnet run --project intent_brokering/examples/applications/dog-mode-ui/src > ./target/logs/ui.txt 2>&1 & wait diff --git a/examples/applications/simple-provider/Cargo.toml b/intent_brokering/examples/applications/simple-provider/Cargo.toml similarity index 100% rename from examples/applications/simple-provider/Cargo.toml rename to intent_brokering/examples/applications/simple-provider/Cargo.toml diff --git a/examples/applications/simple-provider/README.md b/intent_brokering/examples/applications/simple-provider/README.md similarity index 100% rename from examples/applications/simple-provider/README.md rename to intent_brokering/examples/applications/simple-provider/README.md diff --git a/examples/applications/simple-provider/src/chariott_provider.rs b/intent_brokering/examples/applications/simple-provider/src/chariott_provider.rs similarity index 100% rename from examples/applications/simple-provider/src/chariott_provider.rs rename to intent_brokering/examples/applications/simple-provider/src/chariott_provider.rs diff --git a/examples/applications/simple-provider/src/main.rs b/intent_brokering/examples/applications/simple-provider/src/main.rs similarity index 100% rename from examples/applications/simple-provider/src/main.rs rename to intent_brokering/examples/applications/simple-provider/src/main.rs diff --git a/examples/applications/simulated-camera/Cargo.toml b/intent_brokering/examples/applications/simulated-camera/Cargo.toml similarity index 100% rename from examples/applications/simulated-camera/Cargo.toml rename to intent_brokering/examples/applications/simulated-camera/Cargo.toml diff --git a/examples/applications/simulated-camera/LICENSE_IMAGES b/intent_brokering/examples/applications/simulated-camera/LICENSE_IMAGES similarity index 100% rename from examples/applications/simulated-camera/LICENSE_IMAGES rename to intent_brokering/examples/applications/simulated-camera/LICENSE_IMAGES diff --git a/examples/applications/simulated-camera/README.md b/intent_brokering/examples/applications/simulated-camera/README.md similarity index 100% rename from examples/applications/simulated-camera/README.md rename to intent_brokering/examples/applications/simulated-camera/README.md diff --git a/examples/applications/simulated-camera/images/dog_1.jpg b/intent_brokering/examples/applications/simulated-camera/images/dog_1.jpg similarity index 100% rename from examples/applications/simulated-camera/images/dog_1.jpg rename to intent_brokering/examples/applications/simulated-camera/images/dog_1.jpg diff --git a/examples/applications/simulated-camera/images/dog_2.jpg b/intent_brokering/examples/applications/simulated-camera/images/dog_2.jpg similarity index 100% rename from examples/applications/simulated-camera/images/dog_2.jpg rename to intent_brokering/examples/applications/simulated-camera/images/dog_2.jpg diff --git a/examples/applications/simulated-camera/images/dog_3.jpg b/intent_brokering/examples/applications/simulated-camera/images/dog_3.jpg similarity index 100% rename from examples/applications/simulated-camera/images/dog_3.jpg rename to intent_brokering/examples/applications/simulated-camera/images/dog_3.jpg diff --git a/examples/applications/simulated-camera/images/dog_4.jpg b/intent_brokering/examples/applications/simulated-camera/images/dog_4.jpg similarity index 100% rename from examples/applications/simulated-camera/images/dog_4.jpg rename to intent_brokering/examples/applications/simulated-camera/images/dog_4.jpg diff --git a/examples/applications/simulated-camera/images/no_dog.jpg b/intent_brokering/examples/applications/simulated-camera/images/no_dog.jpg similarity index 100% rename from examples/applications/simulated-camera/images/no_dog.jpg rename to intent_brokering/examples/applications/simulated-camera/images/no_dog.jpg diff --git a/examples/applications/simulated-camera/src/camera.rs b/intent_brokering/examples/applications/simulated-camera/src/camera.rs similarity index 100% rename from examples/applications/simulated-camera/src/camera.rs rename to intent_brokering/examples/applications/simulated-camera/src/camera.rs diff --git a/examples/applications/simulated-camera/src/chariott_provider.rs b/intent_brokering/examples/applications/simulated-camera/src/chariott_provider.rs similarity index 100% rename from examples/applications/simulated-camera/src/chariott_provider.rs rename to intent_brokering/examples/applications/simulated-camera/src/chariott_provider.rs diff --git a/examples/applications/simulated-camera/src/communication.rs b/intent_brokering/examples/applications/simulated-camera/src/communication.rs similarity index 100% rename from examples/applications/simulated-camera/src/communication.rs rename to intent_brokering/examples/applications/simulated-camera/src/communication.rs diff --git a/examples/applications/simulated-camera/src/main.rs b/intent_brokering/examples/applications/simulated-camera/src/main.rs similarity index 100% rename from examples/applications/simulated-camera/src/main.rs rename to intent_brokering/examples/applications/simulated-camera/src/main.rs diff --git a/examples/common/Cargo.toml b/intent_brokering/examples/common/Cargo.toml similarity index 100% rename from examples/common/Cargo.toml rename to intent_brokering/examples/common/Cargo.toml diff --git a/examples/common/build.rs b/intent_brokering/examples/common/build.rs similarity index 100% rename from examples/common/build.rs rename to intent_brokering/examples/common/build.rs diff --git a/examples/common/src/chariott/api.rs b/intent_brokering/examples/common/src/chariott/api.rs similarity index 100% rename from examples/common/src/chariott/api.rs rename to intent_brokering/examples/common/src/chariott/api.rs diff --git a/examples/common/src/chariott/inspection.rs b/intent_brokering/examples/common/src/chariott/inspection.rs similarity index 100% rename from examples/common/src/chariott/inspection.rs rename to intent_brokering/examples/common/src/chariott/inspection.rs diff --git a/examples/common/src/chariott/mod.rs b/intent_brokering/examples/common/src/chariott/mod.rs similarity index 100% rename from examples/common/src/chariott/mod.rs rename to intent_brokering/examples/common/src/chariott/mod.rs diff --git a/examples/common/src/chariott/provider.rs b/intent_brokering/examples/common/src/chariott/provider.rs similarity index 100% rename from examples/common/src/chariott/provider.rs rename to intent_brokering/examples/common/src/chariott/provider.rs diff --git a/examples/common/src/chariott/registration.rs b/intent_brokering/examples/common/src/chariott/registration.rs similarity index 100% rename from examples/common/src/chariott/registration.rs rename to intent_brokering/examples/common/src/chariott/registration.rs diff --git a/examples/common/src/chariott/streaming.rs b/intent_brokering/examples/common/src/chariott/streaming.rs similarity index 100% rename from examples/common/src/chariott/streaming.rs rename to intent_brokering/examples/common/src/chariott/streaming.rs diff --git a/examples/common/src/chariott/value.rs b/intent_brokering/examples/common/src/chariott/value.rs similarity index 100% rename from examples/common/src/chariott/value.rs rename to intent_brokering/examples/common/src/chariott/value.rs diff --git a/examples/common/src/examples/detection.rs b/intent_brokering/examples/common/src/examples/detection.rs similarity index 100% rename from examples/common/src/examples/detection.rs rename to intent_brokering/examples/common/src/examples/detection.rs diff --git a/examples/common/src/examples/mod.rs b/intent_brokering/examples/common/src/examples/mod.rs similarity index 100% rename from examples/common/src/examples/mod.rs rename to intent_brokering/examples/common/src/examples/mod.rs diff --git a/examples/common/src/examples/proto.rs b/intent_brokering/examples/common/src/examples/proto.rs similarity index 100% rename from examples/common/src/examples/proto.rs rename to intent_brokering/examples/common/src/examples/proto.rs diff --git a/examples/common/src/lib.rs b/intent_brokering/examples/common/src/lib.rs similarity index 100% rename from examples/common/src/lib.rs rename to intent_brokering/examples/common/src/lib.rs diff --git a/examples/common/src/url.rs b/intent_brokering/examples/common/src/url.rs similarity index 100% rename from examples/common/src/url.rs rename to intent_brokering/examples/common/src/url.rs diff --git a/keyvalue/Cargo.toml b/intent_brokering/keyvalue/Cargo.toml similarity index 100% rename from keyvalue/Cargo.toml rename to intent_brokering/keyvalue/Cargo.toml diff --git a/keyvalue/README.md b/intent_brokering/keyvalue/README.md similarity index 100% rename from keyvalue/README.md rename to intent_brokering/keyvalue/README.md diff --git a/keyvalue/src/key_value_store.rs b/intent_brokering/keyvalue/src/key_value_store.rs similarity index 100% rename from keyvalue/src/key_value_store.rs rename to intent_brokering/keyvalue/src/key_value_store.rs diff --git a/keyvalue/src/lib.rs b/intent_brokering/keyvalue/src/lib.rs similarity index 100% rename from keyvalue/src/lib.rs rename to intent_brokering/keyvalue/src/lib.rs diff --git a/proto.rs/Cargo.toml b/intent_brokering/proto.rs/Cargo.toml similarity index 100% rename from proto.rs/Cargo.toml rename to intent_brokering/proto.rs/Cargo.toml diff --git a/proto.rs/build.rs b/intent_brokering/proto.rs/build.rs similarity index 100% rename from proto.rs/build.rs rename to intent_brokering/proto.rs/build.rs diff --git a/proto.rs/src/lib.rs b/intent_brokering/proto.rs/src/lib.rs similarity index 100% rename from proto.rs/src/lib.rs rename to intent_brokering/proto.rs/src/lib.rs diff --git a/proto/buf.yaml b/intent_brokering/proto/buf.yaml similarity index 100% rename from proto/buf.yaml rename to intent_brokering/proto/buf.yaml diff --git a/proto/chariott/common/v1/common.proto b/intent_brokering/proto/chariott/common/v1/common.proto similarity index 100% rename from proto/chariott/common/v1/common.proto rename to intent_brokering/proto/chariott/common/v1/common.proto diff --git a/proto/chariott/provider/v1/provider.proto b/intent_brokering/proto/chariott/provider/v1/provider.proto similarity index 100% rename from proto/chariott/provider/v1/provider.proto rename to intent_brokering/proto/chariott/provider/v1/provider.proto diff --git a/proto/chariott/runtime/v1/runtime.proto b/intent_brokering/proto/chariott/runtime/v1/runtime.proto similarity index 100% rename from proto/chariott/runtime/v1/runtime.proto rename to intent_brokering/proto/chariott/runtime/v1/runtime.proto diff --git a/proto/chariott/streaming/v1/streaming.proto b/intent_brokering/proto/chariott/streaming/v1/streaming.proto similarity index 100% rename from proto/chariott/streaming/v1/streaming.proto rename to intent_brokering/proto/chariott/streaming/v1/streaming.proto diff --git a/src/chariott_grpc.rs b/intent_brokering/src/chariott_grpc.rs similarity index 100% rename from src/chariott_grpc.rs rename to intent_brokering/src/chariott_grpc.rs diff --git a/src/connection_provider.rs b/intent_brokering/src/connection_provider.rs similarity index 100% rename from src/connection_provider.rs rename to intent_brokering/src/connection_provider.rs diff --git a/src/execution.rs b/intent_brokering/src/execution.rs similarity index 100% rename from src/execution.rs rename to intent_brokering/src/execution.rs diff --git a/src/intent_broker.rs b/intent_brokering/src/intent_broker.rs similarity index 100% rename from src/intent_broker.rs rename to intent_brokering/src/intent_broker.rs diff --git a/src/lib.rs b/intent_brokering/src/lib.rs similarity index 100% rename from src/lib.rs rename to intent_brokering/src/lib.rs diff --git a/src/main.rs b/intent_brokering/src/main.rs similarity index 100% rename from src/main.rs rename to intent_brokering/src/main.rs diff --git a/src/registry.rs b/intent_brokering/src/registry.rs similarity index 100% rename from src/registry.rs rename to intent_brokering/src/registry.rs diff --git a/src/streaming.rs b/intent_brokering/src/streaming.rs similarity index 100% rename from src/streaming.rs rename to intent_brokering/src/streaming.rs diff --git a/tests/README.md b/intent_brokering/tests/README.md similarity index 100% rename from tests/README.md rename to intent_brokering/tests/README.md diff --git a/tests/chariott_integration.rs b/intent_brokering/tests/chariott_integration.rs similarity index 100% rename from tests/chariott_integration.rs rename to intent_brokering/tests/chariott_integration.rs diff --git a/tests/common.rs b/intent_brokering/tests/common.rs similarity index 100% rename from tests/common.rs rename to intent_brokering/tests/common.rs diff --git a/tests/container-e2e-tests-wsl2.sh b/intent_brokering/tests/container-e2e-tests-wsl2.sh similarity index 100% rename from tests/container-e2e-tests-wsl2.sh rename to intent_brokering/tests/container-e2e-tests-wsl2.sh diff --git a/tests/cover.sh b/intent_brokering/tests/cover.sh similarity index 100% rename from tests/cover.sh rename to intent_brokering/tests/cover.sh diff --git a/tests/provider.rs b/intent_brokering/tests/provider.rs similarity index 100% rename from tests/provider.rs rename to intent_brokering/tests/provider.rs diff --git a/tests/registry-e2e.rs b/intent_brokering/tests/registry-e2e.rs similarity index 100% rename from tests/registry-e2e.rs rename to intent_brokering/tests/registry-e2e.rs diff --git a/tests/store-e2e.rs b/intent_brokering/tests/store-e2e.rs similarity index 100% rename from tests/store-e2e.rs rename to intent_brokering/tests/store-e2e.rs diff --git a/tools/charc b/intent_brokering/tools/charc similarity index 100% rename from tools/charc rename to intent_brokering/tools/charc diff --git a/tools/charc.md b/intent_brokering/tools/charc.md similarity index 100% rename from tools/charc.md rename to intent_brokering/tools/charc.md diff --git a/tools/notice_generation.sh b/intent_brokering/tools/notice_generation.sh similarity index 100% rename from tools/notice_generation.sh rename to intent_brokering/tools/notice_generation.sh diff --git a/service_discovery/samples/simple-discovery/consumer/Cargo.toml b/service_discovery/samples/simple-discovery/consumer/Cargo.toml index f9bd6669..57680b5f 100644 --- a/service_discovery/samples/simple-discovery/consumer/Cargo.toml +++ b/service_discovery/samples/simple-discovery/consumer/Cargo.toml @@ -9,7 +9,6 @@ edition = "2021" license = "MIT" [dependencies] -chariott-common = { path = "../../../../common/" } samples_proto = { path = "../../proto_build/" } service_discovery_proto = { path = "../../../proto_build/"} tokio = { workspace = true, features = ["rt-multi-thread", "time"] } diff --git a/service_discovery/samples/simple-discovery/provider/Cargo.toml b/service_discovery/samples/simple-discovery/provider/Cargo.toml index 704ff27c..daf99455 100644 --- a/service_discovery/samples/simple-discovery/provider/Cargo.toml +++ b/service_discovery/samples/simple-discovery/provider/Cargo.toml @@ -9,7 +9,6 @@ edition = "2021" license = "MIT" [dependencies] -chariott-common = { path = "../../../../common/" } samples_proto = { path = "../../proto_build/" } service_discovery_proto = { path = "../../../proto_build" } tokio = { workspace = true, features = ["macros", "rt-multi-thread"] } diff --git a/service_discovery/samples/simple-discovery/provider/src/main.rs b/service_discovery/samples/simple-discovery/provider/src/main.rs index 33a28f74..2d8caa0e 100644 --- a/service_discovery/samples/simple-discovery/provider/src/main.rs +++ b/service_discovery/samples/simple-discovery/provider/src/main.rs @@ -11,7 +11,6 @@ // Tells cargo to warn if a doc comment is missing and should be provided. #![warn(missing_docs)] -use chariott_common::error::Error; use hello_world_impl::HelloWorldImpl; use samples_proto::hello_world::v1::hello_world_server::HelloWorldServer; use std::net::SocketAddr; @@ -52,10 +51,8 @@ async fn main() -> Result<(), Box> { // Intitialize addresses for provider communication. let provider_url_str = format!("http://{HELLO_WORLD_ENDPOINT}"); // DevSkim: ignore DS137138 let socket_address: SocketAddr = HELLO_WORLD_ENDPOINT - .parse() - .map_err(|e| Error::from_error("error getting SocketAddr", Box::new(e)))?; - let _provider_url: Url = Url::parse(&provider_url_str) - .map_err(|e| Error::from_error("error getting Url", Box::new(e)))?; + .parse()?; + let _provider_url: Url = Url::parse(&provider_url_str)?; let service_metadata: ServiceMetadata = ServiceMetadata { namespace: "sdv.samples".to_string(), From b73dfb2a0ef019543df2319cf00c5934343fc189 Mon Sep 17 00:00:00 2001 From: Lauren Datz <105828115+ladatz@users.noreply.github.com> Date: Mon, 8 Jan 2024 16:55:56 -0500 Subject: [PATCH 02/11] Rename dockerfiles --- Dockerfile | 54 ---------------------------------- Dockerfile.arm64 | 57 ------------------------------------ Dockerfile.valgrind | 70 --------------------------------------------- 3 files changed, 181 deletions(-) delete mode 100644 Dockerfile delete mode 100644 Dockerfile.arm64 delete mode 100644 Dockerfile.valgrind diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 7b6de5dc..00000000 --- a/Dockerfile +++ /dev/null @@ -1,54 +0,0 @@ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT license. -# SPDX-License-Identifier: MIT - -ARG RUST_VERSION=1.70 -FROM docker.io/library/rust:${RUST_VERSION} AS builder - -# Dockerfile for building Eclipse Chariott runtime container -# -# This Dockerfile utilizes a two step build process. It builds Chariott with -# statically linked dependencies (using musl) for a x86_64 architecture. - -# Chariott user id -ARG CHARIOTT_UID=10001 - -RUN apt update && apt upgrade -y -RUN apt install -y cmake protobuf-compiler - -# unprivileged identity to run Chariott as -RUN adduser \ - --disabled-password \ - --gecos "" \ - --home "/nonexistent" \ - --shell "/sbin/nologin" \ - --no-create-home \ - --uid "${CHARIOTT_UID}" \ - chariott - -WORKDIR /sdv - -COPY ./ . - -RUN rustup target add x86_64-unknown-linux-musl - -RUN cargo build --release --target=x86_64-unknown-linux-musl - -#################################################################################################### -## Final image -#################################################################################################### -FROM alpine:latest - -# Import Chariott user and group from builder. -COPY --from=builder /etc/passwd /etc/passwd -COPY --from=builder /etc/group /etc/group - -WORKDIR /sdv - -# Copy our build -COPY --from=builder /sdv/target/x86_64-unknown-linux-musl/release/chariott /sdv/chariott - -# Use the unprivileged chariott user during execution. -USER chariott:chariott - -CMD ["./chariott"] diff --git a/Dockerfile.arm64 b/Dockerfile.arm64 deleted file mode 100644 index f81b2ebc..00000000 --- a/Dockerfile.arm64 +++ /dev/null @@ -1,57 +0,0 @@ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT license. -# SPDX-License-Identifier: MIT - -ARG RUST_VERSION=1.70 -FROM docker.io/library/rust:${RUST_VERSION} AS builder - -# Dockerfile for building Eclipse Chariott container for ARM64 with -# cross-compilation. -# -# This Dockerfile utilizes a two step build process. It builds the with -# statically linked dependencies (using musl vs. glibc to accomplish this) for a -# specific architecture such that we can utilize a scratch container without -# further dependencies for our final container, minimizing container size. - -# Chariott user id -ARG CHARIOTT_UID=10001 - -RUN apt update && apt upgrade -y -RUN apt install -y cmake protobuf-compiler gcc-aarch64-linux-gnu - -# unprivileged identity to run Chariott as -RUN adduser \ - --disabled-password \ - --gecos "" \ - --home "/nonexistent" \ - --shell "/sbin/nologin" \ - --no-create-home \ - --uid "${CHARIOTT_UID}" \ - chariott - -WORKDIR /sdv - -COPY ./ . - -RUN rustup target add aarch64-unknown-linux-musl - -RUN cargo build --release --target=aarch64-unknown-linux-musl - -#############################################################x####################################### -## Final image -#################################################################################################### -FROM arm64v8/alpine:latest - -# Import Chariott user and group from builder. -COPY --from=builder /etc/passwd /etc/passwd -COPY --from=builder /etc/group /etc/group - -WORKDIR /sdv - -# Copy our build -COPY --from=builder /sdv/target/aarch64-unknown-linux-musl/release/chariott /sdv/chariott - -# Use the unprivileged Chariott user during execution. -USER chariott::chariott - -CMD ["./chariott"] diff --git a/Dockerfile.valgrind b/Dockerfile.valgrind deleted file mode 100644 index 8fbd7ab8..00000000 --- a/Dockerfile.valgrind +++ /dev/null @@ -1,70 +0,0 @@ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT license. -# SPDX-License-Identifier: MIT - -ARG RUST_VERSION=1.70 -FROM docker.io/library/rust:${RUST_VERSION} AS builder - -# Dockerfile for building Eclipse Chariott container -# -# This Dockerfile utilizes a two step build process. It builds Chariott with -# statically linked dependencies (using musl vs. glibc to accomplish this) for a -# specific architecture such that we can utilize a scratch container without -# further dependencies for our final container, minimizing container size. - -# Chariott user id -ARG CHARIOTT_UID=10001 - -RUN apt update && apt upgrade -y -RUN apt install -y cmake protobuf-compiler wget - -# unprivileged identity to run Chariott as -RUN adduser \ - --disabled-password \ - --gecos "" \ - --home "/nonexistent" \ - --shell "/sbin/nologin" \ - --no-create-home \ - --uid "${CHARIOTT_UID}" \ - chariott - -WORKDIR /sdv - -COPY ./ . - -RUN cargo build --release - -#############################################################x####################################### -## Final image -#################################################################################################### - -# **NOTE** -# This image is based on debian and is not using musl. This is because -# valgrind seems to have problems running with musl on Alpine. See this stackoverflow -# post for more details: -# https://stackoverflow.com/questions/61774643/valgrind-on-alpine-linux - -FROM debian:bullseye-slim - -# Install valgrind -RUN apt update && apt install -y valgrind - -# Create output dir to mount -RUN mkdir /output && chmod 777 /output - -# Import Chariott user and group from builder. -COPY --from=builder /etc/passwd /etc/passwd -COPY --from=builder /etc/group /etc/group - -WORKDIR /sdv - -# Copy our build -COPY --from=builder /sdv/target/release/chariott /sdv/chariott - -# Give chariott user ownership of the /sdv directory -RUN chown -R chariott:chariott /sdv - -# Use the unprivileged chariott user during execution. -USER chariott::chariott - -CMD ["valgrind", "--tool=memcheck", "--xml=yes", "--xml-file=/output/out.xml", "./chariott"] From dcf2165266d0c6b21233b7d365b83837a20488ce Mon Sep 17 00:00:00 2001 From: Lauren Datz <105828115+ladatz@users.noreply.github.com> Date: Tue, 16 Jan 2024 12:33:22 -0500 Subject: [PATCH 03/11] Renamed docker files, updated workflow files --- .github/workflows/dotnet-ci.yml | 6 +- .github/workflows/e2e-ci.yml | 16 ++--- .github/workflows/ess-bench.yml | 8 +-- .github/workflows/lt-ci.yml | 16 ++--- .github/workflows/notice-generation.yaml | 2 +- .github/workflows/rust-ci.yml | 18 ++--- Dockerfile.intent_brokering | 54 ++++++++++++++ Dockerfile.intent_brokering.arm64 | 57 +++++++++++++++ Dockerfile.intent_brokering.valgrind | 70 +++++++++++++++++++ ...tice_generation.sh => notice_generation.sh | 0 10 files changed, 214 insertions(+), 33 deletions(-) create mode 100644 Dockerfile.intent_brokering create mode 100644 Dockerfile.intent_brokering.arm64 create mode 100644 Dockerfile.intent_brokering.valgrind rename intent_brokering/tools/notice_generation.sh => notice_generation.sh (100%) diff --git a/.github/workflows/dotnet-ci.yml b/.github/workflows/dotnet-ci.yml index 2d835e20..55ab4dd3 100644 --- a/.github/workflows/dotnet-ci.yml +++ b/.github/workflows/dotnet-ci.yml @@ -8,7 +8,7 @@ on: branches: - main paths: - - 'examples/applications/dog-mode-ui/**' + - 'intent_brokering/examples/applications/dog-mode-ui/**' - '.github/workflows/dotnet-ci.yml' concurrency: @@ -24,8 +24,8 @@ jobs: - uses: actions/setup-dotnet@v2 with: dotnet-version: 6.0.403 - global-json-file: examples/applications/dog-mode-ui/global.json + global-json-file: intent_brokering/examples/applications/dog-mode-ui/global.json - run: dotnet --info - - run: dotnet build examples/applications/dog-mode-ui + - run: dotnet build intent_brokering/examples/applications/dog-mode-ui diff --git a/.github/workflows/e2e-ci.yml b/.github/workflows/e2e-ci.yml index 3a0a6cc2..e54407c9 100644 --- a/.github/workflows/e2e-ci.yml +++ b/.github/workflows/e2e-ci.yml @@ -5,14 +5,14 @@ on: branches: - main paths: - - "common/**" - - "ess/**" - - "examples/**" - - "keyvalue/**" - - "proto/**" - - 'proto.rs/**' - - "src/**" - - "tests/**" + - "intent_brokering/common/**" + - "intent_brokering/ess/**" + - "intent_brokering/examples/**" + - "intent_brokering/keyvalue/**" + - "intent_brokering/proto/**" + - 'intent_brokering/proto.rs/**' + - "intent_brokering/src/**" + - "intent_brokering/tests/**" - ".github/workflows/e2e.yaml" - 'Cargo.lock' - 'Cargo.toml' diff --git a/.github/workflows/ess-bench.yml b/.github/workflows/ess-bench.yml index d9688968..97cb113a 100644 --- a/.github/workflows/ess-bench.yml +++ b/.github/workflows/ess-bench.yml @@ -8,8 +8,8 @@ on: branches: - main paths: - - 'common/**' - - 'ess/**' + - 'intent_brokering/common/**' + - 'intent_brokering/ess/**' - '.github/workflows/ess-bench.yml' concurrency: @@ -25,7 +25,7 @@ env: AUTO_PUSH: ${{ github.event_name == 'push' }} # Comment the performance numbers of the load tests only on PRs and if the PR # comes from within the Eclipse organization. - COMMENT_ALWAYS: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'eclipse/chariott' }} + COMMENT_ALWAYS: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'eclipse-chariott/chariott' }} jobs: benchmark: @@ -41,7 +41,7 @@ jobs: run: sudo apt-get install -y protobuf-compiler - name: Run benchmark - run: cargo bench --manifest-path ess/Cargo.toml --bench load_bench -- --output-format bencher | tee output.txt + run: cargo bench --manifest-path intent_brokering/ess/Cargo.toml --bench load_bench -- --output-format bencher | tee output.txt - name: Store benchmark result env: diff --git a/.github/workflows/lt-ci.yml b/.github/workflows/lt-ci.yml index 1123bc6a..9d303938 100644 --- a/.github/workflows/lt-ci.yml +++ b/.github/workflows/lt-ci.yml @@ -8,12 +8,12 @@ on: branches: - main paths: - - 'common/**' - - 'src/**' - - 'tests/**' - - 'proto/**' - - 'proto.rs/**' - - 'examples/**' + - 'intent_brokering/common/**' + - 'intent_brokering/src/**' + - 'intent_brokering/tests/**' + - 'intent_brokering/proto/**' + - 'intent_brokering/proto.rs/**' + - 'intent_brokering/examples/**' - '.github/workflows/lt-ci.yml' - 'Cargo.lock' - 'Cargo.toml' @@ -32,7 +32,7 @@ env: AUTO_PUSH: ${{ github.event_name == 'push' }} # Comment the performance numbers of the load tests only on PRs and if the PR # comes from within the Eclipse organization. - COMMENT_ALWAYS: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'eclipse/chariott' }} + COMMENT_ALWAYS: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'eclipse-chariott/chariott' }} jobs: benchmark: @@ -72,7 +72,7 @@ jobs: uses: docker/build-push-action@v3 with: context: . - file: ./examples/applications/Dockerfile.lt-provider-app.ci + file: ./intent_brokering/examples/applications/Dockerfile.lt-provider-app.ci build-args: APP_NAME=lt-provider-app load: true tags: lt-provider-app:1 diff --git a/.github/workflows/notice-generation.yaml b/.github/workflows/notice-generation.yaml index 385ae9d7..295cc68b 100644 --- a/.github/workflows/notice-generation.yaml +++ b/.github/workflows/notice-generation.yaml @@ -20,7 +20,7 @@ jobs: - run: | git config --global user.email "chariott-bot@eclipse.org" git config --global user.name "Automated Notice Generation Pipeline" - ./tools/notice_generation.sh + ./notice_generation.sh shell: bash env: GITHUB_PAT_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/rust-ci.yml b/.github/workflows/rust-ci.yml index 690740d5..442f4a5b 100644 --- a/.github/workflows/rust-ci.yml +++ b/.github/workflows/rust-ci.yml @@ -8,14 +8,14 @@ on: branches: - main paths: - - 'common/**' - - 'src/**' - - 'tests/**' - - 'proto/**' - - 'proto.rs/**' - - 'ess/**' - - 'keyvalue/**' - - 'examples/**' + - 'intent_brokering/common/**' + - 'intent_brokering/src/**' + - 'intent_brokering/tests/**' + - 'intent_brokering/proto/**' + - 'intent_brokering/proto.rs/**' + - 'intent_brokering/ess/**' + - 'intent_brokering/keyvalue/**' + - 'intent_brokering/examples/**' - '.github/workflows/rust-ci.yml' - 'Cargo.lock' - 'Cargo.toml' @@ -80,7 +80,7 @@ jobs: name: code-coverage-report path: cobertura.xml - uses: 5monkeys/cobertura-action@master - if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'eclipse/chariott' && github.actor != 'dependabot[bot]' }} + if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'eclipse-chariott/chariott' && github.actor != 'dependabot[bot]' }} with: path: cobertura.xml repo_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/Dockerfile.intent_brokering b/Dockerfile.intent_brokering new file mode 100644 index 00000000..7b6de5dc --- /dev/null +++ b/Dockerfile.intent_brokering @@ -0,0 +1,54 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT license. +# SPDX-License-Identifier: MIT + +ARG RUST_VERSION=1.70 +FROM docker.io/library/rust:${RUST_VERSION} AS builder + +# Dockerfile for building Eclipse Chariott runtime container +# +# This Dockerfile utilizes a two step build process. It builds Chariott with +# statically linked dependencies (using musl) for a x86_64 architecture. + +# Chariott user id +ARG CHARIOTT_UID=10001 + +RUN apt update && apt upgrade -y +RUN apt install -y cmake protobuf-compiler + +# unprivileged identity to run Chariott as +RUN adduser \ + --disabled-password \ + --gecos "" \ + --home "/nonexistent" \ + --shell "/sbin/nologin" \ + --no-create-home \ + --uid "${CHARIOTT_UID}" \ + chariott + +WORKDIR /sdv + +COPY ./ . + +RUN rustup target add x86_64-unknown-linux-musl + +RUN cargo build --release --target=x86_64-unknown-linux-musl + +#################################################################################################### +## Final image +#################################################################################################### +FROM alpine:latest + +# Import Chariott user and group from builder. +COPY --from=builder /etc/passwd /etc/passwd +COPY --from=builder /etc/group /etc/group + +WORKDIR /sdv + +# Copy our build +COPY --from=builder /sdv/target/x86_64-unknown-linux-musl/release/chariott /sdv/chariott + +# Use the unprivileged chariott user during execution. +USER chariott:chariott + +CMD ["./chariott"] diff --git a/Dockerfile.intent_brokering.arm64 b/Dockerfile.intent_brokering.arm64 new file mode 100644 index 00000000..f81b2ebc --- /dev/null +++ b/Dockerfile.intent_brokering.arm64 @@ -0,0 +1,57 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT license. +# SPDX-License-Identifier: MIT + +ARG RUST_VERSION=1.70 +FROM docker.io/library/rust:${RUST_VERSION} AS builder + +# Dockerfile for building Eclipse Chariott container for ARM64 with +# cross-compilation. +# +# This Dockerfile utilizes a two step build process. It builds the with +# statically linked dependencies (using musl vs. glibc to accomplish this) for a +# specific architecture such that we can utilize a scratch container without +# further dependencies for our final container, minimizing container size. + +# Chariott user id +ARG CHARIOTT_UID=10001 + +RUN apt update && apt upgrade -y +RUN apt install -y cmake protobuf-compiler gcc-aarch64-linux-gnu + +# unprivileged identity to run Chariott as +RUN adduser \ + --disabled-password \ + --gecos "" \ + --home "/nonexistent" \ + --shell "/sbin/nologin" \ + --no-create-home \ + --uid "${CHARIOTT_UID}" \ + chariott + +WORKDIR /sdv + +COPY ./ . + +RUN rustup target add aarch64-unknown-linux-musl + +RUN cargo build --release --target=aarch64-unknown-linux-musl + +#############################################################x####################################### +## Final image +#################################################################################################### +FROM arm64v8/alpine:latest + +# Import Chariott user and group from builder. +COPY --from=builder /etc/passwd /etc/passwd +COPY --from=builder /etc/group /etc/group + +WORKDIR /sdv + +# Copy our build +COPY --from=builder /sdv/target/aarch64-unknown-linux-musl/release/chariott /sdv/chariott + +# Use the unprivileged Chariott user during execution. +USER chariott::chariott + +CMD ["./chariott"] diff --git a/Dockerfile.intent_brokering.valgrind b/Dockerfile.intent_brokering.valgrind new file mode 100644 index 00000000..8fbd7ab8 --- /dev/null +++ b/Dockerfile.intent_brokering.valgrind @@ -0,0 +1,70 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT license. +# SPDX-License-Identifier: MIT + +ARG RUST_VERSION=1.70 +FROM docker.io/library/rust:${RUST_VERSION} AS builder + +# Dockerfile for building Eclipse Chariott container +# +# This Dockerfile utilizes a two step build process. It builds Chariott with +# statically linked dependencies (using musl vs. glibc to accomplish this) for a +# specific architecture such that we can utilize a scratch container without +# further dependencies for our final container, minimizing container size. + +# Chariott user id +ARG CHARIOTT_UID=10001 + +RUN apt update && apt upgrade -y +RUN apt install -y cmake protobuf-compiler wget + +# unprivileged identity to run Chariott as +RUN adduser \ + --disabled-password \ + --gecos "" \ + --home "/nonexistent" \ + --shell "/sbin/nologin" \ + --no-create-home \ + --uid "${CHARIOTT_UID}" \ + chariott + +WORKDIR /sdv + +COPY ./ . + +RUN cargo build --release + +#############################################################x####################################### +## Final image +#################################################################################################### + +# **NOTE** +# This image is based on debian and is not using musl. This is because +# valgrind seems to have problems running with musl on Alpine. See this stackoverflow +# post for more details: +# https://stackoverflow.com/questions/61774643/valgrind-on-alpine-linux + +FROM debian:bullseye-slim + +# Install valgrind +RUN apt update && apt install -y valgrind + +# Create output dir to mount +RUN mkdir /output && chmod 777 /output + +# Import Chariott user and group from builder. +COPY --from=builder /etc/passwd /etc/passwd +COPY --from=builder /etc/group /etc/group + +WORKDIR /sdv + +# Copy our build +COPY --from=builder /sdv/target/release/chariott /sdv/chariott + +# Give chariott user ownership of the /sdv directory +RUN chown -R chariott:chariott /sdv + +# Use the unprivileged chariott user during execution. +USER chariott::chariott + +CMD ["valgrind", "--tool=memcheck", "--xml=yes", "--xml-file=/output/out.xml", "./chariott"] diff --git a/intent_brokering/tools/notice_generation.sh b/notice_generation.sh similarity index 100% rename from intent_brokering/tools/notice_generation.sh rename to notice_generation.sh From 4d394b92c13f119b41d3e6a243de9199b132aeeb Mon Sep 17 00:00:00 2001 From: Lauren Datz <105828115+ladatz@users.noreply.github.com> Date: Tue, 16 Jan 2024 12:54:11 -0500 Subject: [PATCH 04/11] Updates --- .github/workflows/containerize.yaml | 6 +++--- .github/workflows/e2e-ci.yml | 2 +- .github/workflows/lt-ci.yml | 2 +- README.md | 6 +++--- buf.work.yaml | 6 ++++-- build-all-containers.sh | 18 +++++++++--------- docs/adr/0020-integration-and-e2e-testing.md | 4 ++-- docs/design/README.md | 2 +- intent_brokering/Cargo.toml | 2 +- .../examples/applications/Dockerfile.mock-vas | 2 +- .../applications/Dockerfile.simulated-camera | 2 +- .../examples/applications/README.md | 4 ++-- .../cloud-object-detection/README.md | 6 +++--- .../applications/dog-mode-ui/README.md | 2 +- .../applications/invoke_object_detection.sh | 2 +- .../examples/applications/kv-app/README.md | 2 +- .../local-object-detection/README.md | 6 +++--- .../applications/simulated-camera/README.md | 6 +++--- .../simple-discovery/provider/src/main.rs | 3 +-- 19 files changed, 42 insertions(+), 41 deletions(-) diff --git a/.github/workflows/containerize.yaml b/.github/workflows/containerize.yaml index 65ec619f..1a3bbb35 100644 --- a/.github/workflows/containerize.yaml +++ b/.github/workflows/containerize.yaml @@ -15,9 +15,9 @@ on: branches: - main paths: - - "src/**" - - "proto/**" - - "Dockerfile" + - "intent_brokering/src/**" + - "intent_brokering/proto/**" + - "Dockerfile.intent_brokering" - ".github/workflows/containerize.yaml" - "rust-toolchain.toml" diff --git a/.github/workflows/e2e-ci.yml b/.github/workflows/e2e-ci.yml index e54407c9..4119607c 100644 --- a/.github/workflows/e2e-ci.yml +++ b/.github/workflows/e2e-ci.yml @@ -57,7 +57,7 @@ jobs: uses: docker/build-push-action@v3 with: context: . - file: ./examples/applications/Dockerfile.kv-app.ci + file: ./intent_brokering/examples/applications/Dockerfile.kv-app.ci build-args: APP_NAME=kv-app load: true tags: kv-app:1 diff --git a/.github/workflows/lt-ci.yml b/.github/workflows/lt-ci.yml index 9d303938..8e064fac 100644 --- a/.github/workflows/lt-ci.yml +++ b/.github/workflows/lt-ci.yml @@ -64,7 +64,7 @@ jobs: uses: docker/build-push-action@v3 with: context: . - file: ./Dockerfile.valgrind + file: ./Dockerfile.intent_brokering.valgrind load: true tags: val-chariott:1 diff --git a/README.md b/README.md index 9ced751d..b634ca74 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ More information can be found in the protobuf definitions in `./proto`. There is a separate document that describes the example applications and scenarios that are supported by Chariott. It can be found -[here](./examples/applications/README.md). +[here](./intent_brokering/examples/applications/README.md). ## Requirements @@ -236,11 +236,11 @@ use the [grpcurl](https://github.com/fullstorydev/grpcurl) command line tool wit and read state. The state is stored in memory and is not persisted. It also demonstrates the use of the `ess` and `keyvalue` crates. -This walkthrough is described in the [examples kv-app README](examples/applications/kv-app/README.md). +This walkthrough is described in the [examples kv-app README](intent_brokering/examples/applications/kv-app/README.md). ## How to run the dog mode demo -To run the dog mode demo, please refer to the [dog mode demo](./examples/applications/README.md). +To run the dog mode demo, please refer to the [dog mode demo](./intent_brokering/examples/applications/README.md). ## Trademarks diff --git a/buf.work.yaml b/buf.work.yaml index 81201f18..27e80c44 100644 --- a/buf.work.yaml +++ b/buf.work.yaml @@ -1,4 +1,6 @@ version: v1 directories: - - proto - - examples/applications/proto + - intent_brokering/proto + - intent_brokering/examples/applications/proto + - service_discovery/proto + - service_discovery/samples/proto diff --git a/build-all-containers.sh b/build-all-containers.sh index 0efaa56e..cf1350cd 100755 --- a/build-all-containers.sh +++ b/build-all-containers.sh @@ -18,17 +18,17 @@ if [ -z "$IMAGE_TAG" ]; then fi # Build base image for all example applications -docker build --tag "chariott:base" --file ./examples/applications/Dockerfile.base . +docker build --tag "chariott:base" --file ./intent_brokering/examples/applications/Dockerfile.base . # Build Chariott -docker build --tag "$(concat_image_registry chariott:"$IMAGE_TAG")" --file ./examples/applications/Dockerfile.generic --build-arg APP_NAME=chariott . +docker build --tag "$(concat_image_registry chariott:"$IMAGE_TAG")" --file ./intent_brokering/examples/applications/Dockerfile.generic --build-arg APP_NAME=chariott . # Build Examples -docker build --tag "$(concat_image_registry cloud-object-detection-app:"$IMAGE_TAG")" --file ./examples/applications/Dockerfile.cloud-object-detection --build-arg APP_NAME=cloud-object-detection-app . -docker build --tag "$(concat_image_registry dog-mode-logic-app:"$IMAGE_TAG")" --file ./examples/applications/Dockerfile.generic --build-arg APP_NAME=dog-mode-logic-app . -docker build --tag "$(concat_image_registry kv-app:"$IMAGE_TAG")" --file ./examples/applications/Dockerfile.generic --build-arg APP_NAME=kv-app . +docker build --tag "$(concat_image_registry cloud-object-detection-app:"$IMAGE_TAG")" --file ./intent_brokering/examples/applications/Dockerfile.cloud-object-detection --build-arg APP_NAME=cloud-object-detection-app . +docker build --tag "$(concat_image_registry dog-mode-logic-app:"$IMAGE_TAG")" --file ./intent_brokering/examples/applications/Dockerfile.generic --build-arg APP_NAME=dog-mode-logic-app . +docker build --tag "$(concat_image_registry kv-app:"$IMAGE_TAG")" --file ./intent_brokering/examples/applications/Dockerfile.generic --build-arg APP_NAME=kv-app . # Local object detection build is not executed as it is currently not working due to missing tensorflow libraries in the image -# docker build --tag "$(concat_image_registry local-object-detection-app:"$IMAGE_TAG")" --file ./examples/applications/Dockerfile --build-arg APP_NAME=local-object-detection-app . -docker build --tag "$(concat_image_registry mock-vas:"$IMAGE_TAG")" --file ./examples/applications/Dockerfile.mock-vas --build-arg APP_NAME=mock-vas . -docker build --tag "$(concat_image_registry simulated-camera-app:"$IMAGE_TAG")" --file ./examples/applications/Dockerfile.simulated-camera --build-arg APP_NAME=simulated-camera-app . -docker build --tag "$(concat_image_registry lt-provider-app:"$IMAGE_TAG")" --file ./examples/applications/Dockerfile.generic --build-arg APP_NAME=lt-provider-app . +# docker build --tag "$(concat_image_registry local-object-detection-app:"$IMAGE_TAG")" --file ./intent_brokering/examples/applications/Dockerfile --build-arg APP_NAME=local-object-detection-app . +docker build --tag "$(concat_image_registry mock-vas:"$IMAGE_TAG")" --file ./intent_brokering/examples/applications/Dockerfile.mock-vas --build-arg APP_NAME=mock-vas . +docker build --tag "$(concat_image_registry simulated-camera-app:"$IMAGE_TAG")" --file ./intent_brokering/examples/applications/Dockerfile.simulated-camera --build-arg APP_NAME=simulated-camera-app . +docker build --tag "$(concat_image_registry lt-provider-app:"$IMAGE_TAG")" --file ./intent_brokering/examples/applications/Dockerfile.generic --build-arg APP_NAME=lt-provider-app . diff --git a/docs/adr/0020-integration-and-e2e-testing.md b/docs/adr/0020-integration-and-e2e-testing.md index f6f1d2fd..cde5a70d 100644 --- a/docs/adr/0020-integration-and-e2e-testing.md +++ b/docs/adr/0020-integration-and-e2e-testing.md @@ -28,7 +28,7 @@ well as from the CI. Integration tests will be invoking the Chariott runtime server code directly, without using the [upstream gRPC -layer](../../proto/chariott/runtime/v1/runtime.proto). We will not mock out any parts +layer](../../intent_brokering/proto/chariott/runtime/v1/runtime.proto). We will not mock out any parts from the Chariott runtime when integration testing, hence we will need to set up a provider that is exposing a gRPC endpoint in order to handle intent fulfillments. @@ -88,4 +88,4 @@ This approach is equivalent to the setup in [ADR `cargo test`, and come with the advantages a test framework has without taking a dependency on test framework which we do not already use. -[charc]: ../../tools/charc.md +[charc]: ../../intent_brokering/tools/charc.md diff --git a/docs/design/README.md b/docs/design/README.md index 5ce67bcb..001cc5ed 100644 --- a/docs/design/README.md +++ b/docs/design/README.md @@ -6,7 +6,7 @@ ## Introduction -Project Eclipse Chariott delivers a metadata-driven application programming model. Today, Chariott serves two main purposes. First, it offers service discovery of "provider" applications advertising their functionality. These providers register their capabilities with Chariott. Second, Chariott provides the brokering of intent requests from any application towards the offering providers. Chariott was founded on [Capability Oriented Architecture](https://www.linkedin.com/pulse/brief-introduction-capability-oriented-architecture-coa-haishi-bai/) (COA). Since Chariott provides a common [gRPC](https://grpc.io/) interface for interacting with applications, it can be used with any language supporting gRPC. For more details on the gRPC interfaces, please see the [proto folder](../../proto/chariott/). +Project Eclipse Chariott delivers a metadata-driven application programming model. Today, Chariott serves two main purposes. First, it offers service discovery of "provider" applications advertising their functionality. These providers register their capabilities with Chariott. Second, Chariott provides the brokering of intent requests from any application towards the offering providers. Chariott was founded on [Capability Oriented Architecture](https://www.linkedin.com/pulse/brief-introduction-capability-oriented-architecture-coa-haishi-bai/) (COA). Since Chariott provides a common [gRPC](https://grpc.io/) interface for interacting with applications, it can be used with any language supporting gRPC. For more details on the gRPC interfaces, please see the [proto folder](../../intent_brokering/proto/chariott/). ## Architecture diff --git a/intent_brokering/Cargo.toml b/intent_brokering/Cargo.toml index 77d21eb1..a429b883 100644 --- a/intent_brokering/Cargo.toml +++ b/intent_brokering/Cargo.toml @@ -44,4 +44,4 @@ test = false [[test]] name = "registry-e2e" -test = false \ No newline at end of file +test = false diff --git a/intent_brokering/examples/applications/Dockerfile.mock-vas b/intent_brokering/examples/applications/Dockerfile.mock-vas index 941e90c5..2020ad21 100644 --- a/intent_brokering/examples/applications/Dockerfile.mock-vas +++ b/intent_brokering/examples/applications/Dockerfile.mock-vas @@ -15,7 +15,7 @@ RUN apk add bash # Copy our build COPY --from=base /sdv/target/x86_64-unknown-linux-musl/release/${APP_NAME} /sdv/${APP_NAME} -COPY ./examples/applications/dog-mode-ui/mock_provider_dog_mode_demo.sh /sdv/ +COPY ./intent_brokering/examples/applications/dog-mode-ui/mock_provider_dog_mode_demo.sh /sdv/ # Use the unprivileged chariott user during execution. USER ${USER_NAME}:${USER_NAME} diff --git a/intent_brokering/examples/applications/Dockerfile.simulated-camera b/intent_brokering/examples/applications/Dockerfile.simulated-camera index f4306ea8..bdf11f1f 100644 --- a/intent_brokering/examples/applications/Dockerfile.simulated-camera +++ b/intent_brokering/examples/applications/Dockerfile.simulated-camera @@ -15,7 +15,7 @@ RUN mkdir -p /sdv/images # Copy our build COPY --from=base /sdv/target/x86_64-unknown-linux-musl/release/${APP_NAME} /sdv/${APP_NAME} -COPY ./examples/applications/simulated-camera/images /sdv/images/ +COPY ./intent_brokering/examples/applications/simulated-camera/images /sdv/images/ # Use the unprivileged chariott user during execution. USER ${USER_NAME}:${USER_NAME} diff --git a/intent_brokering/examples/applications/README.md b/intent_brokering/examples/applications/README.md index 182fcaab..6909ece6 100644 --- a/intent_brokering/examples/applications/README.md +++ b/intent_brokering/examples/applications/README.md @@ -11,7 +11,7 @@ The dog mode allows a car owner to keep their dog safe while they are away from the car. If the ambient temperature is high, different applications will interact with each other to ensure that the temperature inside the car is at a safe level for the dog. This works as follows: first, the dog mode logic -application (`examples/applications/dog-mode-logic`) detects whether a dog is +application (`intent_brokering/examples/applications/dog-mode-logic`) detects whether a dog is present, either by automatically connecting a [camera][simulated camera] with [object detection][local object detection], or through user interaction in the [UI application][ui]. If a dog is detected, it will monitor various vehicle @@ -53,7 +53,7 @@ SDK and ASP.NET Core runtime. You can follow a simulation of this scenario by executing ```bash -./examples/applications/run_demo.sh --cognitive_endpoint "" --cognitive_key "" +./intent_brokering/examples/applications/run_demo.sh --cognitive_endpoint "" --cognitive_key "" ``` from the repository root directory. diff --git a/intent_brokering/examples/applications/cloud-object-detection/README.md b/intent_brokering/examples/applications/cloud-object-detection/README.md index 0f058936..1d18b9fc 100644 --- a/intent_brokering/examples/applications/cloud-object-detection/README.md +++ b/intent_brokering/examples/applications/cloud-object-detection/README.md @@ -7,7 +7,7 @@ To run the application: 1. Start chariott runtime by executing `cargo run` from the root directory 2. Start it by executing `cargo run` from the - `examples/applications/cloud-object-detection` directory while specifying + `intent_brokering/examples/applications/cloud-object-detection` directory while specifying `COGNITIVE_ENDPOINT` (i.e. `myendpoint.cognitiveservices.azure.com`) and `COGNITIVE_KEY` environment variables. 3. In the root directory create a `detect_image.json` file with the following @@ -36,7 +36,7 @@ To run the application: ``` 4. Execute detection with `grpcurl -v -plaintext -import-path proto/ \ - -import-path examples/applications/proto -use-reflection -proto \ - examples/applications/proto/examples/detection/v1/detection.proto -d @ \ + -import-path intent_brokering/examples/applications/proto -use-reflection -proto \ + intent_brokering/examples/applications/proto/examples/detection/v1/detection.proto -d @ \ localhost:4243 chariott.runtime.v1.ChariottService/Fulfill < \ detect_image.json` diff --git a/intent_brokering/examples/applications/dog-mode-ui/README.md b/intent_brokering/examples/applications/dog-mode-ui/README.md index 86665468..c2fd2982 100644 --- a/intent_brokering/examples/applications/dog-mode-ui/README.md +++ b/intent_brokering/examples/applications/dog-mode-ui/README.md @@ -50,4 +50,4 @@ Use the `mock_provider_dog_mode_demo.sh` script to pipe its output into the mock VAS to generate mocked sensor data (assuming the current working directory is the root of the repo): - ./examples/applications/dog-mode-ui/mock_provider_dog_mode_demo.sh | cargo run ... + ./intent_brokering/examples/applications/dog-mode-ui/mock_provider_dog_mode_demo.sh | cargo run ... diff --git a/intent_brokering/examples/applications/invoke_object_detection.sh b/intent_brokering/examples/applications/invoke_object_detection.sh index deb8b4e8..c939f1fb 100755 --- a/intent_brokering/examples/applications/invoke_object_detection.sh +++ b/intent_brokering/examples/applications/invoke_object_detection.sh @@ -21,7 +21,7 @@ fi DETECTION_NAMESPACE="sdv.detection" -if [ "$(../../tools/charc inspect system.registry $DETECTION_NAMESPACE | jq '. | length')" -eq 0 ] +if [ "$(../../intent_brokering/tools/charc inspect system.registry $DETECTION_NAMESPACE | jq '. | length')" -eq 0 ] then echo>&2 "No providers registered for $DETECTION_NAMESPACE." exit 1 diff --git a/intent_brokering/examples/applications/kv-app/README.md b/intent_brokering/examples/applications/kv-app/README.md index d52eaf4f..7ca4f3cd 100644 --- a/intent_brokering/examples/applications/kv-app/README.md +++ b/intent_brokering/examples/applications/kv-app/README.md @@ -66,7 +66,7 @@ Open a channel for receiving events: ```bash grpcurl -v -plaintext -import-path proto -proto \ - proto/chariott/streaming/v1/streaming.proto 0.0.0.0:50064 \ + intent_brokering/proto/chariott/streaming/v1/streaming.proto 0.0.0.0:50064 \ chariott.streaming.v1.ChannelService/Open | tee events.log & ``` diff --git a/intent_brokering/examples/applications/local-object-detection/README.md b/intent_brokering/examples/applications/local-object-detection/README.md index 3d0aa787..396fc328 100644 --- a/intent_brokering/examples/applications/local-object-detection/README.md +++ b/intent_brokering/examples/applications/local-object-detection/README.md @@ -7,7 +7,7 @@ To run the application: 1. Start chariott runtime by executing `cargo run` from the root directory 2. Start detection application by executing `cargo run` from the - `examples/applications/local-object-detection` directory. + `intent_brokering/examples/applications/local-object-detection` directory. 3. In the root directory create a `detect_image.json` file with the following message structure: @@ -34,7 +34,7 @@ To run the application: ``` 4. Execute detection with `grpcurl -v -plaintext -import-path proto/ \ - -import-path examples/applications/proto -use-reflection -proto \ - examples/applications/proto/examples/detection/v1/detection.proto -d @ \ + -import-path intent_brokering/examples/applications/proto -use-reflection -proto \ + intent_brokering/examples/applications/proto/examples/detection/v1/detection.proto -d @ \ localhost:4243 chariott.runtime.v1.ChariottService/Fulfill < \ detect_image.json` diff --git a/intent_brokering/examples/applications/simulated-camera/README.md b/intent_brokering/examples/applications/simulated-camera/README.md index 2c13cd40..a56fd672 100644 --- a/intent_brokering/examples/applications/simulated-camera/README.md +++ b/intent_brokering/examples/applications/simulated-camera/README.md @@ -8,14 +8,14 @@ manual mode where you specify the frame rate event yourself. ## To run the application 1. Start chariott runtime by executing `cargo run` from the root directory -2. Navigate to `examples/applications/simulated-camera` directory +2. Navigate to `intent_brokering/examples/applications/simulated-camera` directory 3. Create a `images` directory and place there all the `.jpg` files you want the camera application to stream 4. Start camera application by executing `cargo run` from the - `examples/applications/simulated-camera` directory. + `intent_brokering/examples/applications/simulated-camera` directory. 5. In another terminal, open a channel to the simulated-camera with `grpcurl -v \ -plaintext -import-path proto -proto \ - proto/chariott/streaming/v1/streaming.proto localhost:50066 \ + intent_brokering/proto/chariott/streaming/v1/streaming.proto localhost:50066 \ chariott.streaming.v1.ChannelService/Open` and take a note of the returned channel id in the metadata _x-chariott-channel-id_. 6. In yet another terminal, call the following, using the channel id from the diff --git a/service_discovery/samples/simple-discovery/provider/src/main.rs b/service_discovery/samples/simple-discovery/provider/src/main.rs index 2d8caa0e..f3ba279f 100644 --- a/service_discovery/samples/simple-discovery/provider/src/main.rs +++ b/service_discovery/samples/simple-discovery/provider/src/main.rs @@ -50,8 +50,7 @@ async fn main() -> Result<(), Box> { // Intitialize addresses for provider communication. let provider_url_str = format!("http://{HELLO_WORLD_ENDPOINT}"); // DevSkim: ignore DS137138 - let socket_address: SocketAddr = HELLO_WORLD_ENDPOINT - .parse()?; + let socket_address: SocketAddr = HELLO_WORLD_ENDPOINT.parse()?; let _provider_url: Url = Url::parse(&provider_url_str)?; let service_metadata: ServiceMetadata = ServiceMetadata { From 13d3335ec6bd13edaba0749c615835053e808ee8 Mon Sep 17 00:00:00 2001 From: Lauren Datz <105828115+ladatz@users.noreply.github.com> Date: Tue, 16 Jan 2024 13:26:25 -0500 Subject: [PATCH 05/11] UPdated --- .github/workflows/e2e-ci.yml | 1 + .github/workflows/lt-ci.yml | 1 + buf.work.yaml | 2 -- intent_brokering/ess/README.md | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/e2e-ci.yml b/.github/workflows/e2e-ci.yml index 4119607c..92144811 100644 --- a/.github/workflows/e2e-ci.yml +++ b/.github/workflows/e2e-ci.yml @@ -50,6 +50,7 @@ jobs: uses: docker/build-push-action@v3 with: context: . + file: ./Dockerfile.intent_brokering load: true tags: chariott:1 diff --git a/.github/workflows/lt-ci.yml b/.github/workflows/lt-ci.yml index 8e064fac..80b92560 100644 --- a/.github/workflows/lt-ci.yml +++ b/.github/workflows/lt-ci.yml @@ -57,6 +57,7 @@ jobs: uses: docker/build-push-action@v3 with: context: . + file: Dockerfile.intent_brokering load: true tags: chariott:1 diff --git a/buf.work.yaml b/buf.work.yaml index 27e80c44..c36f8ad7 100644 --- a/buf.work.yaml +++ b/buf.work.yaml @@ -2,5 +2,3 @@ version: v1 directories: - intent_brokering/proto - intent_brokering/examples/applications/proto - - service_discovery/proto - - service_discovery/samples/proto diff --git a/intent_brokering/ess/README.md b/intent_brokering/ess/README.md index 29ee0faf..c06e70fc 100644 --- a/intent_brokering/ess/README.md +++ b/intent_brokering/ess/README.md @@ -1,7 +1,7 @@ # Event sub-system (ESS) This crate contains the implementation of the event sub-system (ESS) based on -[ADR-0008](../docs/adr/0008-event-sub-system.md). On a high level, the ESS +[ADR-0008](../../docs/adr/0008-event-sub-system.md). On a high level, the ESS connects components that subscribe to a set of events with components publishing events. From 75bd1b24999ad3eb2a6b85eec38548e11c236d53 Mon Sep 17 00:00:00 2001 From: Lauren Datz <105828115+ladatz@users.noreply.github.com> Date: Tue, 16 Jan 2024 16:17:35 -0500 Subject: [PATCH 06/11] Only build chariott package from intent-brokering dockerfiles --- Dockerfile.intent_brokering | 2 +- Dockerfile.intent_brokering.arm64 | 2 +- Dockerfile.intent_brokering.valgrind | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile.intent_brokering b/Dockerfile.intent_brokering index 7b6de5dc..f46e0bd3 100644 --- a/Dockerfile.intent_brokering +++ b/Dockerfile.intent_brokering @@ -32,7 +32,7 @@ COPY ./ . RUN rustup target add x86_64-unknown-linux-musl -RUN cargo build --release --target=x86_64-unknown-linux-musl +RUN cargo build --release --target=x86_64-unknown-linux-musl -p chariott #################################################################################################### ## Final image diff --git a/Dockerfile.intent_brokering.arm64 b/Dockerfile.intent_brokering.arm64 index f81b2ebc..a5158f48 100644 --- a/Dockerfile.intent_brokering.arm64 +++ b/Dockerfile.intent_brokering.arm64 @@ -35,7 +35,7 @@ COPY ./ . RUN rustup target add aarch64-unknown-linux-musl -RUN cargo build --release --target=aarch64-unknown-linux-musl +RUN cargo build --release --target=aarch64-unknown-linux-musl -p chariott #############################################################x####################################### ## Final image diff --git a/Dockerfile.intent_brokering.valgrind b/Dockerfile.intent_brokering.valgrind index 8fbd7ab8..f19dbe72 100644 --- a/Dockerfile.intent_brokering.valgrind +++ b/Dockerfile.intent_brokering.valgrind @@ -32,7 +32,7 @@ WORKDIR /sdv COPY ./ . -RUN cargo build --release +RUN cargo build --release -p chariott #############################################################x####################################### ## Final image From 524f36b55713ef5ac037374a80143886a3e856aa Mon Sep 17 00:00:00 2001 From: Lauren Datz <105828115+ladatz@users.noreply.github.com> Date: Tue, 16 Jan 2024 16:36:56 -0500 Subject: [PATCH 07/11] Revert cobertura change for now since it is not the goal of this change, address in a later PR --- .github/workflows/rust-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust-ci.yml b/.github/workflows/rust-ci.yml index 442f4a5b..7c38c5f6 100644 --- a/.github/workflows/rust-ci.yml +++ b/.github/workflows/rust-ci.yml @@ -80,7 +80,7 @@ jobs: name: code-coverage-report path: cobertura.xml - uses: 5monkeys/cobertura-action@master - if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'eclipse-chariott/chariott' && github.actor != 'dependabot[bot]' }} + if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'eclipse/chariott' && github.actor != 'dependabot[bot]' }} with: path: cobertura.xml repo_token: ${{ secrets.GITHUB_TOKEN }} From 2ccea3166f973a7df321e2f777eb9d9980dd48d4 Mon Sep 17 00:00:00 2001 From: Lauren Datz <105828115+ladatz@users.noreply.github.com> Date: Wed, 17 Jan 2024 12:47:07 -0500 Subject: [PATCH 08/11] Update docs and add back tools folder --- .github/workflows/notice-generation.yaml | 2 +- README.md | 231 +----------------- .../{README.md => intent_brokering_design.md} | 0 intent_brokering/Cargo.toml | 2 - intent_brokering/README.md | 222 +++++++++++++++++ .../notice_generation.sh | 0 6 files changed, 236 insertions(+), 221 deletions(-) rename docs/design/{README.md => intent_brokering_design.md} (100%) create mode 100644 intent_brokering/README.md rename notice_generation.sh => tools/notice_generation.sh (100%) diff --git a/.github/workflows/notice-generation.yaml b/.github/workflows/notice-generation.yaml index 295cc68b..385ae9d7 100644 --- a/.github/workflows/notice-generation.yaml +++ b/.github/workflows/notice-generation.yaml @@ -20,7 +20,7 @@ jobs: - run: | git config --global user.email "chariott-bot@eclipse.org" git config --global user.name "Automated Notice Generation Pipeline" - ./notice_generation.sh + ./tools/notice_generation.sh shell: bash env: GITHUB_PAT_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index b634ca74..94dba485 100644 --- a/README.md +++ b/README.md @@ -12,26 +12,23 @@ - [What is Chariott?](#what-is-chariott) - [How to develop with Chariott](#how-to-develop-with-chariott) - - [Terminology](#terminology) - - [Concept of Intents](#concept-of-intents) -- [Requirements](#requirements) -- [Getting started](#getting-started) - - [Using Dev Container](#dev-container) - - [Build all binaries and run tests](#build-all-binaries-and-run-tests) - - [Build on MacOS with Docker VirtuoFS](#build-on-macos-with-docker-virtuofs) - - [Using Podman instead of Docker](#using-podman-instead-of-docker) - - [Without Dev Container](#without-dev-container) - - [Install Dependencies](#install-dependencies) - - [Build all binaries and run tests natively](#build-all-binaries-and-run-tests-natively) - - [Build and run Chariott only](#build-and-run-chariott-only) -- [Use Chariott Service Discovery only](#use-chariott-service-discovery-only) -- [How to run the examples and interact with Chariott](#how-to-run-the-examples-and-interact-with-chariott) -- [How to run the dog mode demo](#how-to-run-the-dog-mode-demo) - [Trademarks](#trademarks) ## What is Chariott? -Chariott is a [gRPC](https://grpc.io) service that provides a common interface for interacting with applications. It facilitates Service Discovery for applications to advertise their capabilities by registering themselves with Chariott's service registry. Other applications that need to consume resources and capabilities can Discover services through Chariott's service registry. In the current version of Chariott, applications can also communicate with each other through Chariott. This is done by having applications register an _intent_ which Chariott will then _fulfill_ by brokering the communication with the appropriate application to fulfill that intent. Applications which fulfill these intents are known as _providers_. More information on Chariott's current design with diagrams can be found [here](./docs/design/README.md). +Chariott is a [gRPC](https://grpc.io) service that provides a common interface for interacting with +applications. It facilitates Service Discovery of applications which advertise their capabilities +by registering themselves with Chariott's service registry. Other applications that need to consume +resources and capabilities can Discover services through Chariott's service registry. There are two +components in this project: [Intent Brokering](./intent_brokering/README.md) and +[Service Discovery](./service_discovery/README.md). Today, they are two separate components which +do not interact. Each has its own gRPC service. + +With Intent Brokering, applications can also communicate with each other through Chariott. This is +done by having applications register an _intent_ which Chariott will then _fulfill_ by brokering +the communication with the appropriate application to fulfill that intent. Applications which +fulfill these intents are known as _providers_. More information on Intent Brokering's current +design with diagrams can be found [here](./docs/design/intent_brokering_design.md). ## How to develop with Chariott @@ -40,208 +37,6 @@ client application can be written in any language that supports gRPC. The examples in this repository are written in Rust, but the same concepts apply to any language. -### Terminology - -| Term | Description | -| --- | --- | -| Application | An application is defined as any software component. | -| Provider | A provider is also an application that in addition registers its capabilities with Chariott's service registry for other applications to consume. | -| Consuming Application | A consuming application is a client application that interacts with Chariott to look up capability providers and interact with them through Chariott or directly. | ->Note: "provider" or "consuming application" are just roles for an application. Specifically, an application can be both a Chariott "provider" and "consuming application". - -### Concept of Intents - -Intents are the main way to interact with Chariott. Once a provider registers -an intent with Chariott, other applications can use that intent to interact with -the provider. The intent is a gRPC method that is defined in the provider's -protobuf definition. That definition is only used by Chariott itself. - -Chariott also provides a gRPC interface for applications to interact with -providers and delegates the calls based on the intent to the provider transparently. -Therefore, clients don't need to know the location and details of the provider as long as -their intent is fulfilled. - -Here is a list of the current supported intents: - -| Intent | Description | -| --- | --- | -| Discover | Retrieve native interfaces of providers. This comes in handy if you need specific interaction with a provider that you know is available in the system and you don't want to use Chariott to interact with it. This is also used for retrieving the streaming endpoints of a provider. | -| Inspect | Support inspection of functionality, properties and events using a simple query syntax. | -| Invoke | Invoke a method on a provider. | -| Subscribe | Subscribe to events of a provider. Note that this does not open the streaming channel, this is done through the native streaming endpoint of the provider. | -| Read | Read a property of a provider. | -| Write | Write a property to a provider. | - -More information can be found in the protobuf definitions in `./proto`. - -There is a separate document that describes the example applications and -scenarios that are supported by Chariott. It can be found -[here](./intent_brokering/examples/applications/README.md). - -## Requirements - -The current source is developed and tested under WSL2/Linux running Ubuntu 20.04 -on AMD64 architecture. It is not tested against any other configurations. You -might experience missing support for other platforms, but please feel free to -contribute to close the gaps. - -## Getting started - -### Dev Container - -For development and running the examples, we recommend using the -[Devcontainer](https://code.visualstudio.com/docs/remote/containers) template -provided at `.devcontainer/devcontainer.json`. -[These](https://code.visualstudio.com/docs/devcontainers/containers#_system-requirements) -are the system requirements (including the default requirement of docker) for using devcontainers. -If you decide not to use the Devcontainer, refer to the `devcontainer.json` and the Dockerfile -`.devcontainer/Dockerfile` for a list of the plugins and tools we use. - -> Note: If you use Devcontainers and you are running on Windows, make sure to check out the -> repository on the WSL2 file system in the target distribution you're using. - -#### Build all binaries and run tests - -```bash -cargo build --workspace -cargo test --workspace -``` - -#### Build on MacOS with Docker VirtuoFS - -As reported in [this issue](https://github.com/eclipse-chariott/chariott/issues/111), some extra -steps are needed to build if you are using MacOS with Docker VirtuoFS. - -Docker Desktop provides a fast VirtuoFS implementation on a Mac but the rust build process breaks -in devcontainers if VirtuoFS is enabled. The solution is not disabling the VirtuoFS, because this -significantly slows down the I/O operations in the containers. - -The workaround is to create a target folder outside the chariott workspace and set the environment -variable to the new target folder. The following sequence works in the devcontainer: - -```shell -vscode ➜ /workspaces/chariott (main) $ sudo mkdir ../target -vscode ➜ /workspaces/chariott (main) $ sudo chown vscode:vscode ../target -vscode ➜ /workspaces/chariott (main) $ CARGO_TARGET_DIR=../target cargo build -p chariott -vscode ➜ /workspaces/chariott (main) $ CARGO_TARGET_DIR=../target cargo run -p chariott -``` - -#### Using Podman instead of Docker - -If you want to use Podman you have to [enable Podman in Visual Studio -Code][vscode-podman] and update the `.devcontainer/devcontainer.json` file -with the following additions: - - [vscode-podman]: https://code.visualstudio.com/remote/advancedcontainers/docker-options#_podman - -```jsonc -{ - // ... - "runArgs": [ - "--cap-add=SYS_PTRACE", - "--security-opt", - "seccomp=unconfined", - "--userns=keep-id" - ], - // ... - "workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,Z", - "workspaceFolder": "/workspace", - "containerUser": "vscode", - // ... -} -``` - -> **NOTE**: Feel free to use another workspace folder name. - -### Without dev container - -#### Install Dependencies - -As stated above, the `devcontainer.json` and the Dockerfile -`.devcontainer/Dockerfile` contain a list of the plugins/tools we use for Chariott. -Below we have listed the steps to get started, but refer to those files if there are any discrepancies. - -This guide uses `apt` as the package manager in the examples. You may need to substitute your own -package manager in place of `apt` when going through these steps. - -1. Install gcc: - - ```shell - sudo apt install gcc - ``` - - > **NOTE**: Rust needs gcc's linker. - -1. Install git and git-lfs - - ```shell - sudo apt install -y git git-lfs - git lfs install - ``` - -1. Install [rust](https://rustup.rs/#), using the default installation, for example: - - ```shell - sudo apt install curl - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh - ``` - - You will need to restart your shell to refresh the environment variables. - > **NOTE**: The rust toolchain version is managed by the rust-toolchain.toml file, so once you - install rustup there is no need to manually install a toolchain or set a default. - -1. Install Protobuf Compiler: - - ```shell - sudo apt install -y protobuf-compiler - ``` - - > **NOTE**: The protobuf compiler is needed for building the project. - -1. Ensure you have openssl and pkg-config installed. These are needed for some of the tests and -examples. - - ```shell - sudo apt install pkg-config - sudo apt install libssl-dev - ``` - -#### Build all binaries and run tests natively - -```bash -cargo build --workspace -cargo test --workspace -``` - -#### Build and run Chariott only - -```bash -cargo run -p chariott -``` - -## Use Chariott Service Discovery Only - -There is a new Service Discovery mechanism that is decoupled from intent brokering. It is currently -under development. Please refer to [this document](./service_discovery/README.md) for more -information. - -## How to run the examples and interact with Chariott - -Refer to individual example applications' documentation for additional setup or dependencies that may be required. - -As Chariott's out of the box communication protocol is gRPC, the interaction with the -examples is done through gRPC. To illustrate how to invoke the gRPC methods we -use the [grpcurl](https://github.com/fullstorydev/grpcurl) command line tool with the example application -**kv-app**. The **kv-app** is a key-value store that can be used to store -and read state. The state is stored in memory and is not persisted. It also demonstrates -the use of the `ess` and `keyvalue` crates. - -This walkthrough is described in the [examples kv-app README](intent_brokering/examples/applications/kv-app/README.md). - -## How to run the dog mode demo - -To run the dog mode demo, please refer to the [dog mode demo](./intent_brokering/examples/applications/README.md). - ## Trademarks This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft diff --git a/docs/design/README.md b/docs/design/intent_brokering_design.md similarity index 100% rename from docs/design/README.md rename to docs/design/intent_brokering_design.md diff --git a/intent_brokering/Cargo.toml b/intent_brokering/Cargo.toml index a429b883..73a27fff 100644 --- a/intent_brokering/Cargo.toml +++ b/intent_brokering/Cargo.toml @@ -33,11 +33,9 @@ uuid = { workspace = true } tokio-stream = { workspace = true } test-case = { workspace = true } - [build-dependencies] tonic-build = { workspace = true } - [[test]] name = "store-e2e" test = false diff --git a/intent_brokering/README.md b/intent_brokering/README.md new file mode 100644 index 00000000..462764f7 --- /dev/null +++ b/intent_brokering/README.md @@ -0,0 +1,222 @@ +# Service Discovery + +- [Terminology](#terminology) +- [Concept of Intents](#concept-of-intents) +- [Requirements](#requirements) +- [Getting started](#getting-started) + - [Using Dev Container](#dev-container) + - [Build all binaries and run tests](#build-all-binaries-and-run-tests) + - [Build on MacOS with Docker VirtuoFS](#build-on-macos-with-docker-virtuofs) + - [Using Podman instead of Docker](#using-podman-instead-of-docker) + - [Without Dev Container](#without-dev-container) + - [Install Dependencies](#install-dependencies) + - [Build all binaries and run tests natively](#build-all-binaries-and-run-tests-natively) + - [Build and run Chariott only](#build-and-run-chariott-only) +- [Use Chariott Service Discovery only](#use-chariott-service-discovery-only) +- [How to run the examples and interact with Chariott](#how-to-run-the-examples-and-interact-with-chariott) +- [How to run the dog mode demo](#how-to-run-the-dog-mode-demo) +- [Trademarks](#trademarks) + +## Terminology + +| Term | Description | +| --- | --- | +| Application | An application is defined as any software component. | +| Provider | A provider is also an application that in addition registers its capabilities with Chariott's service registry for other applications to consume. | +| Consuming Application | A consuming application is a client application that interacts with Chariott to look up capability providers and interact with them through Chariott or directly. | +>Note: "provider" or "consuming application" are just roles for an application. Specifically, an application can be both a Chariott "provider" and "consuming application". + +## Concept of Intents + +Intents are the main way to interact with Chariott. Once a provider registers +an intent with Chariott, other applications can use that intent to interact with +the provider. The intent is a gRPC method that is defined in the provider's +protobuf definition. That definition is only used by Chariott itself. + +Chariott also provides a gRPC interface for applications to interact with +providers and delegates the calls based on the intent to the provider transparently. +Therefore, clients don't need to know the location and details of the provider as long as +their intent is fulfilled. + +Here is a list of the current supported intents: + +| Intent | Description | +| --- | --- | +| Discover | Retrieve native interfaces of providers. This comes in handy if you need specific interaction with a provider that you know is available in the system and you don't want to use Chariott to interact with it. This is also used for retrieving the streaming endpoints of a provider. | +| Inspect | Support inspection of functionality, properties and events using a simple query syntax. | +| Invoke | Invoke a method on a provider. | +| Subscribe | Subscribe to events of a provider. Note that this does not open the streaming channel, this is done through the native streaming endpoint of the provider. | +| Read | Read a property of a provider. | +| Write | Write a property to a provider. | + +More information can be found in the protobuf definitions in `./proto`. + +There is a separate document that describes the example applications and +scenarios that are supported by Chariott. It can be found +[here](./examples/applications/README.md). + +## Requirements + +The current source is developed and tested under WSL2/Linux running Ubuntu 20.04 +on AMD64 architecture. It is not tested against any other configurations. You +might experience missing support for other platforms, but please feel free to +contribute to close the gaps. + +## Getting started + +### Dev Container + +For development and running the examples, we recommend using the +[Devcontainer](https://code.visualstudio.com/docs/remote/containers) template +provided at `.devcontainer/devcontainer.json`. +[These](https://code.visualstudio.com/docs/devcontainers/containers#_system-requirements) +are the system requirements (including the default requirement of docker) for using devcontainers. +If you decide not to use the Devcontainer, refer to the `devcontainer.json` and the Dockerfile +`.devcontainer/Dockerfile` for a list of the plugins and tools we use. + +> Note: If you use Devcontainers and you are running on Windows, make sure to check out the +> repository on the WSL2 file system in the target distribution you're using. + +#### Build all binaries and run tests + +```bash +cargo build --workspace +cargo test --workspace +``` + +#### Build on MacOS with Docker VirtuoFS + +As reported in [this issue](https://github.com/eclipse-chariott/chariott/issues/111), some extra +steps are needed to build if you are using MacOS with Docker VirtuoFS. + +Docker Desktop provides a fast VirtuoFS implementation on a Mac but the rust build process breaks +in devcontainers if VirtuoFS is enabled. The solution is not disabling the VirtuoFS, because this +significantly slows down the I/O operations in the containers. + +The workaround is to create a target folder outside the chariott workspace and set the environment +variable to the new target folder. The following sequence works in the devcontainer: + +```shell +vscode ➜ /workspaces/chariott (main) $ sudo mkdir ../target +vscode ➜ /workspaces/chariott (main) $ sudo chown vscode:vscode ../target +vscode ➜ /workspaces/chariott (main) $ CARGO_TARGET_DIR=../target cargo build -p chariott +vscode ➜ /workspaces/chariott (main) $ CARGO_TARGET_DIR=../target cargo run -p chariott +``` + +#### Using Podman instead of Docker + +If you want to use Podman you have to [enable Podman in Visual Studio +Code][vscode-podman] and update the `.devcontainer/devcontainer.json` file +with the following additions: + + [vscode-podman]: https://code.visualstudio.com/remote/advancedcontainers/docker-options#_podman + +```jsonc +{ + // ... + "runArgs": [ + "--cap-add=SYS_PTRACE", + "--security-opt", + "seccomp=unconfined", + "--userns=keep-id" + ], + // ... + "workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,Z", + "workspaceFolder": "/workspace", + "containerUser": "vscode", + // ... +} +``` + +> **NOTE**: Feel free to use another workspace folder name. + +### Without dev container + +#### Install Dependencies + +As stated above, the `devcontainer.json` and the Dockerfile +`.devcontainer/Dockerfile` contain a list of the plugins/tools we use for Chariott. +Below we have listed the steps to get started, but refer to those files if there are any discrepancies. + +This guide uses `apt` as the package manager in the examples. You may need to substitute your own +package manager in place of `apt` when going through these steps. + +1. Install gcc: + + ```shell + sudo apt install gcc + ``` + + > **NOTE**: Rust needs gcc's linker. + +1. Install git and git-lfs + + ```shell + sudo apt install -y git git-lfs + git lfs install + ``` + +1. Install [rust](https://rustup.rs/#), using the default installation, for example: + + ```shell + sudo apt install curl + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh + ``` + + You will need to restart your shell to refresh the environment variables. + > **NOTE**: The rust toolchain version is managed by the rust-toolchain.toml file, so once you + install rustup there is no need to manually install a toolchain or set a default. + +1. Install Protobuf Compiler: + + ```shell + sudo apt install -y protobuf-compiler + ``` + + > **NOTE**: The protobuf compiler is needed for building the project. + +1. Ensure you have openssl and pkg-config installed. These are needed for some of the tests and +examples. + + ```shell + sudo apt install pkg-config + sudo apt install libssl-dev + ``` + +#### Build all binaries and run tests natively + +```bash +cargo build --workspace +cargo test --workspace +``` + +#### Build and run Chariott only + +```bash +cargo run -p chariott +``` + +## How to run the examples and interact with Chariott + +Refer to individual example applications' documentation for additional setup or dependencies that may be required. + +As Chariott's out of the box communication protocol is gRPC, the interaction with the +examples is done through gRPC. To illustrate how to invoke the gRPC methods we +use the [grpcurl](https://github.com/fullstorydev/grpcurl) command line tool with the example application +**kv-app**. The **kv-app** is a key-value store that can be used to store +and read state. The state is stored in memory and is not persisted. It also demonstrates +the use of the `ess` and `keyvalue` crates. + +This walkthrough is described in the [examples kv-app README](./examples/applications/kv-app/README.md). + +## How to run the dog mode demo + +To run the dog mode demo, please refer to the [dog mode demo](./examples/applications/README.md). + +## Trademarks + +This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft +trademarks or logos is subject to and must follow +[Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/legal/intellectualproperty/trademarks/usage/general). +Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. +Any use of third-party trademarks or logos are subject to those third-party's policies. diff --git a/notice_generation.sh b/tools/notice_generation.sh similarity index 100% rename from notice_generation.sh rename to tools/notice_generation.sh From ddfc33b25f3a2bf8c04abaeda1645394734a5424 Mon Sep 17 00:00:00 2001 From: Lauren Datz <105828115+ladatz@users.noreply.github.com> Date: Wed, 17 Jan 2024 14:46:38 -0500 Subject: [PATCH 09/11] Fix spacing --- README.md | 2 +- intent_brokering/README.md | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 94dba485..e339706b 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Chariott is a [gRPC](https://grpc.io) service that provides a common interface f applications. It facilitates Service Discovery of applications which advertise their capabilities by registering themselves with Chariott's service registry. Other applications that need to consume resources and capabilities can Discover services through Chariott's service registry. There are two -components in this project: [Intent Brokering](./intent_brokering/README.md) and +components in this project: [Intent Brokering](./intent_brokering/README.md) and [Service Discovery](./service_discovery/README.md). Today, they are two separate components which do not interact. Each has its own gRPC service. diff --git a/intent_brokering/README.md b/intent_brokering/README.md index 462764f7..104ca4a0 100644 --- a/intent_brokering/README.md +++ b/intent_brokering/README.md @@ -12,7 +12,6 @@ - [Install Dependencies](#install-dependencies) - [Build all binaries and run tests natively](#build-all-binaries-and-run-tests-natively) - [Build and run Chariott only](#build-and-run-chariott-only) -- [Use Chariott Service Discovery only](#use-chariott-service-discovery-only) - [How to run the examples and interact with Chariott](#how-to-run-the-examples-and-interact-with-chariott) - [How to run the dog mode demo](#how-to-run-the-dog-mode-demo) - [Trademarks](#trademarks) From d65dce50095d4a469bb3639ed1c3b7db286db5c4 Mon Sep 17 00:00:00 2001 From: ladatz <105828115+ladatz@users.noreply.github.com> Date: Wed, 17 Jan 2024 14:49:41 -0500 Subject: [PATCH 10/11] Update intent_brokering/examples/applications/simulated-camera/README.md Co-authored-by: devkelley <105753233+devkelley@users.noreply.github.com> --- .../examples/applications/simulated-camera/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/intent_brokering/examples/applications/simulated-camera/README.md b/intent_brokering/examples/applications/simulated-camera/README.md index a56fd672..fd5df7cb 100644 --- a/intent_brokering/examples/applications/simulated-camera/README.md +++ b/intent_brokering/examples/applications/simulated-camera/README.md @@ -7,7 +7,7 @@ manual mode where you specify the frame rate event yourself. ## To run the application -1. Start chariott runtime by executing `cargo run` from the root directory +1. Start chariott runtime by executing `cargo run -p chariott` from the root directory 2. Navigate to `intent_brokering/examples/applications/simulated-camera` directory 3. Create a `images` directory and place there all the `.jpg` files you want the camera application to stream From 40f5cd508f397c249a64e322899ccef7692235ba Mon Sep 17 00:00:00 2001 From: Lauren Datz <105828115+ladatz@users.noreply.github.com> Date: Thu, 18 Jan 2024 14:51:29 -0500 Subject: [PATCH 11/11] Fix title of intent brokering readme --- intent_brokering/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/intent_brokering/README.md b/intent_brokering/README.md index 104ca4a0..f64061ba 100644 --- a/intent_brokering/README.md +++ b/intent_brokering/README.md @@ -1,4 +1,4 @@ -# Service Discovery +# Intent Brokering - [Terminology](#terminology) - [Concept of Intents](#concept-of-intents)