From 09aee5218fbe45782da4c191bbf6108eda951ce7 Mon Sep 17 00:00:00 2001 From: William Lyles <26171886+wilyle@users.noreply.github.com> Date: Mon, 18 Mar 2024 15:31:28 -0700 Subject: [PATCH] fix paths --- .github/workflows/dotnet-ci.yml | 6 +++--- .github/workflows/security-audit.yml | 2 +- cloud_connectors/mqtt_connector/README.md | 4 ++-- .../resources/{sample-dtdl => sample_dtdl}/hvac.json | 0 .../resources/{sample-dtdl => sample_dtdl}/obd.json | 0 .../resources/{sample-dtdl => sample_dtdl}/trailer.json | 0 .../resources/{sample-dtdl => sample_dtdl}/vehicle.json | 0 cloud_connectors/resources/scripts/digital_twins_setup.sh | 6 +++--- .../resources/scripts/digital_twins_setup_smart_trailer.sh | 6 +++--- 9 files changed, 12 insertions(+), 12 deletions(-) rename cloud_connectors/resources/{sample-dtdl => sample_dtdl}/hvac.json (100%) rename cloud_connectors/resources/{sample-dtdl => sample_dtdl}/obd.json (100%) rename cloud_connectors/resources/{sample-dtdl => sample_dtdl}/trailer.json (100%) rename cloud_connectors/resources/{sample-dtdl => sample_dtdl}/vehicle.json (100%) diff --git a/.github/workflows/dotnet-ci.yml b/.github/workflows/dotnet-ci.yml index dae58fb..056eac0 100644 --- a/.github/workflows/dotnet-ci.yml +++ b/.github/workflows/dotnet-ci.yml @@ -31,7 +31,7 @@ jobs: ${{ runner.os }}-nuget - name: Build MQTT Connector's Azure Function run: | - dotnet build cloud_connectors/azure/mqtt_connector/azure_function/src/function.csproj -warnaserror - dotnet build cloud_connectors/azure/mqtt_connector/azure_function/tests/MQTTConnectorAzureFunction.Tests.csproj -warnaserror + dotnet build cloud_connectors/resources/azure_function/src/function.csproj -warnaserror + dotnet build cloud_connectors/resources/azure_function/tests/MQTTConnectorAzureFunction.Tests.csproj -warnaserror - name: MQTT Connector's Azure Function Tests - run: dotnet test cloud_connectors/azure/mqtt_connector/azure_function/tests/MQTTConnectorAzureFunction.Tests.csproj \ No newline at end of file + run: dotnet test cloud_connectors/resources/azure_function/tests/MQTTConnectorAzureFunction.Tests.csproj \ No newline at end of file diff --git a/.github/workflows/security-audit.yml b/.github/workflows/security-audit.yml index 5a0d85b..4275f68 100644 --- a/.github/workflows/security-audit.yml +++ b/.github/workflows/security-audit.yml @@ -57,6 +57,6 @@ jobs: with: languages: ${{ matrix.language }} - name: Build MQTT Connector's Azure Function - run: dotnet build cloud_connectors/azure/mqtt_connector/azure_function/src/function.csproj + run: dotnet build cloud_connectors/resources/azure_function/src/function.csproj - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v2 \ No newline at end of file diff --git a/cloud_connectors/mqtt_connector/README.md b/cloud_connectors/mqtt_connector/README.md index 9b2f6f0..f1b11e0 100644 --- a/cloud_connectors/mqtt_connector/README.md +++ b/cloud_connectors/mqtt_connector/README.md @@ -6,7 +6,7 @@ This is an example implementation of a Cloud Connector. The role of the Cloud Co The MQTT Cloud Connector forwards data emitted by Freyja to an MQTT broker. In the sample architecture presented here, this is an Azure Event Grid using the MQTT Protocol. This cloud connector accepts requests via gRPC using the [Freyja standard cloud connector contract](https://github.com/eclipse-ibeji/freyja/blob/main/interfaces/cloud_connector/v1/cloud_connector.proto), thus making it compatible with Freyja's standard cloud adapter. This cloud connector also includes an associated Azure Function which will forward the data to Azure Digital Twins, but the data from Azure Event Grid can be ingested by any desired cloud architecture using the appropriate connector. -![Component Diagram](../../../docs/diagrams/azure_mqtt_cloud_connector.svg) +![Component Diagram](../../docs/diagrams/azure_mqtt_cloud_connector.svg) Note that since this cloud connector interfaces with MQTT, it can be configured for use with any MQTT endpoint, not only the Azure-based solution shown here. The architecture diagram and the setup steps presented in this document provide a sample of a full end-to-end architecture that integrates this connector with a cloud digital twin solution. @@ -30,7 +30,7 @@ You will need to be an Owner for your Azure resource group to deploy Azure resou ### Deploy Azure Digital Twins -In your Azure Digital Twins resource, you will also need to create digital twin instances. This repository contains [DTDL samples](../sample-dtdl/) to get started. +In your Azure Digital Twins resource, you will also need to create digital twin instances. This repository contains [DTDL samples](../resources/sample_dtdl/) to get started. >NOTE: The deployment scripts are compatible with the [`mixed` sample for Ibeji](https://github.com/eclipse-ibeji/ibeji/tree/main/samples/mixed) and the smart trailer sample from this repository. These scripts will will upload these sample models and create instances of them for you. Modification of the Cloud Digital Twin or setup scripts may be required for other scenarios. diff --git a/cloud_connectors/resources/sample-dtdl/hvac.json b/cloud_connectors/resources/sample_dtdl/hvac.json similarity index 100% rename from cloud_connectors/resources/sample-dtdl/hvac.json rename to cloud_connectors/resources/sample_dtdl/hvac.json diff --git a/cloud_connectors/resources/sample-dtdl/obd.json b/cloud_connectors/resources/sample_dtdl/obd.json similarity index 100% rename from cloud_connectors/resources/sample-dtdl/obd.json rename to cloud_connectors/resources/sample_dtdl/obd.json diff --git a/cloud_connectors/resources/sample-dtdl/trailer.json b/cloud_connectors/resources/sample_dtdl/trailer.json similarity index 100% rename from cloud_connectors/resources/sample-dtdl/trailer.json rename to cloud_connectors/resources/sample_dtdl/trailer.json diff --git a/cloud_connectors/resources/sample-dtdl/vehicle.json b/cloud_connectors/resources/sample_dtdl/vehicle.json similarity index 100% rename from cloud_connectors/resources/sample-dtdl/vehicle.json rename to cloud_connectors/resources/sample_dtdl/vehicle.json diff --git a/cloud_connectors/resources/scripts/digital_twins_setup.sh b/cloud_connectors/resources/scripts/digital_twins_setup.sh index 8c45fb4..725500b 100755 --- a/cloud_connectors/resources/scripts/digital_twins_setup.sh +++ b/cloud_connectors/resources/scripts/digital_twins_setup.sh @@ -72,9 +72,9 @@ echo -e "\nAssigning the Azure Digital Twins Data Owner role" user_object_id=$(az ad signed-in-user show --query id -o tsv) az dt role-assignment create --dt-name "$digital_twin_name" --assignee "$user_object_id" --role "Azure Digital Twins Data Owner" -# Upload the sample-dtdl models -echo -e "\nUploading sample-dtdl models" -for file in $(find ../sample-dtdl -name "*.json"); do +# Upload the sample dtdl models +echo -e "\nUploading sample dtdl models" +for file in $(find ../sample_dtdl -name "*.json"); do if ! az dt model create --dt-name ${digital_twin_name} --models $file; then echo "$file" dtdl already uploaded. fi diff --git a/cloud_connectors/resources/scripts/digital_twins_setup_smart_trailer.sh b/cloud_connectors/resources/scripts/digital_twins_setup_smart_trailer.sh index 1b03eb7..95b3f4e 100755 --- a/cloud_connectors/resources/scripts/digital_twins_setup_smart_trailer.sh +++ b/cloud_connectors/resources/scripts/digital_twins_setup_smart_trailer.sh @@ -72,9 +72,9 @@ echo -e "\nAssigning the Azure Digital Twins Data Owner role" user_object_id=$(az ad signed-in-user show --query id -o tsv) az dt role-assignment create --dt-name "$digital_twin_name" --assignee "$user_object_id" --role "Azure Digital Twins Data Owner" -# Upload the sample-dtdl models -echo -e "\nUploading sample-dtdl models" -for file in $(find ../sample-dtdl -name "trailer.json"); do +# Upload the sample dtdl models +echo -e "\nUploading sample dtdl models" +for file in $(find ../sample_dtdl -name "trailer.json"); do if ! az dt model create --dt-name ${digital_twin_name} --models $file; then echo "$file" dtdl already uploaded. fi