From 5ccb337db22edbf56dcb64e3a5fbcf4cef97e3dd Mon Sep 17 00:00:00 2001 From: Carlos Schmidt <18703981+carlos-schmidt@users.noreply.github.com> Date: Mon, 11 Dec 2023 13:01:03 +0100 Subject: [PATCH] Update docker example and how-to --- edc-extension4aas/build.gradle.kts | 12 +- example/Dockerfile | 6 +- example/README.md | 11 +- .../configurations/workdir/config.properties | 34 + example/configurations/workdir/demoAAS.json | 936 ++++++++++++++++++ 5 files changed, 984 insertions(+), 15 deletions(-) create mode 100644 example/configurations/workdir/config.properties create mode 100644 example/configurations/workdir/demoAAS.json diff --git a/edc-extension4aas/build.gradle.kts b/edc-extension4aas/build.gradle.kts index ea636096..08960659 100644 --- a/edc-extension4aas/build.gradle.kts +++ b/edc-extension4aas/build.gradle.kts @@ -40,14 +40,10 @@ dependencies { repositories { mavenCentral() } - -tasks.test { - useJUnitPlatform() -} - -tasks.jacocoTestReport { - dependsOn(tasks.test) // tests are required to run before generating the report -} +tasks.compileJava {options.encoding = "UTF-8"} +tasks.compileTestJava {options.encoding = "UTF-8"} +tasks.test {useJUnitPlatform()} +tasks.jacocoTestReport {dependsOn(tasks.test)} // FA³ST dependency needs the following configurations.all { diff --git a/example/Dockerfile b/example/Dockerfile index e291d163..7a74bb54 100644 --- a/example/Dockerfile +++ b/example/Dockerfile @@ -11,11 +11,11 @@ WORKDIR /app # Copy FA³ST config # COPY ./resources/demoConfig.json /app/demoConfig.json # Copy config -COPY ./configurations /configurations -COPY ./resources /resources +# COPY ./configurations /configurations +# COPY ./resources /resources # Copy jar COPY ./build/libs/dataspace-connector.jar /app ENV EDC_FS_CONFIG=$EDC_FS_CONFIG -ENTRYPOINT java -jar dataspace-connector.jar +ENTRYPOINT ["java", "-jar", "dataspace-connector.jar"] diff --git a/example/README.md b/example/README.md index b19f1333..563e3837 100644 --- a/example/README.md +++ b/example/README.md @@ -40,12 +40,15 @@ java "-Dedc.fs.config=./example/configurations/provider.properties" -jar ./examp ### Alternative: docker & docker-compose + After building the extension as seen above, a docker image can be built with -```sh -cd ./example -docker build -t edc-aas-extension:latest . -``` +0. `cd ./example` +1. `docker build -t edc-aas-extension:latest .` +2. `mkdir workdir` +2. Create configuration under `./workdir/config.properties` +3. Add additional files under `./workdir` (Fitting to your paths in config.properties) +4. Run with `docker run -i -v $PWD/workdir:/workdir/ -e EDC_FS_CONFIG=/workdir/config.properties edc-extension4aas:latest` This docker image can be run individually or **inside a docker-compose file**: diff --git a/example/configurations/workdir/config.properties b/example/configurations/workdir/config.properties new file mode 100644 index 00000000..997c162f --- /dev/null +++ b/example/configurations/workdir/config.properties @@ -0,0 +1,34 @@ +# AAS Extension specific +# Supply AAS model + (port XOR AAS service config) for an AAS service internally started by the extension +edc.aas.localAASModelPath=/workdir/demoAAS.json +edc.aas.localAASServicePort=8080 +# edc.aas.localAASServiceConfigPath = /app/demoConfig.json +# Provide a URL of an already running AAS service (such as FA³ST, BaSyx) +# edc.aas.remoteAasLocation = http://example.com/aas +# Period of synchronizing the EDC assetStore with the connected AAS services (in seconds) +edc.aas.syncPeriod=100 +# Path to a default access policy definition file +# edc.aas.defaultAccessPolicyDefinitionPath = ... +# Path to a default contract policy definition file +# edc.aas.defaultContractPolicyDefinitionPath = ... +# EDC specific, mostly default values +# Port and path for custom http services such as SelfDescription +web.http.port=8181 +web.http.path=/api +# Port and path for requesting an EDC to communicate with another EDC by IDS messages (consumer-provider) +web.http.management.port=8182 +web.http.management.path=/management +# Port and path for IDS messages (from another EDC) +web.http.protocol.port=8282 +web.http.protocol.path=/dsp +edc.dsp.callback.address=http://provider:8282/dsp +edc.transfer.functions.enabled.protocols=http +# Connector hostname, which e.g. is used in referer urls +edc.hostname=provider +# Auth key for using internal EDC api (header key: x-api-key) +edc.api.auth.key=password +# GUI configuration (enable DataDashboard to communicate with EDC) +edc.web.rest.cors.enabled=true +edc.web.rest.cors.origins=* +edc.web.rest.cors.headers=x-api-key, content-type +edc.web.rest.cors.methods=GET, POST, DELETE, PUT, OPTIONS diff --git a/example/configurations/workdir/demoAAS.json b/example/configurations/workdir/demoAAS.json new file mode 100644 index 00000000..f0f7efce --- /dev/null +++ b/example/configurations/workdir/demoAAS.json @@ -0,0 +1,936 @@ +{ + "assetAdministrationShells": [ + { + "assetInformation": { + "assetKind": "Instance", + "globalAssetId": { + "keys": [ + { + "idType": "Iri", + "type": "Asset", + "value": "https://acplt.org/Test_Asset" + } + ] + }, + "billOfMaterial": [ + { + "keys": [ + { + "idType": "Iri", + "type": "Submodel", + "value": "http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial" + } + ] + } + ] + }, + "submodels": [ + { + "keys": [ + { + "type": "Submodel", + "value": "https://example.com/ids/sm/1145_8090_6012_5097", + "idType": "Iri" + } + ] + }, + { + "keys": [ + { + "type": "Submodel", + "value": "https://example.com/ids/sm/4445_8090_6012_7409", + "idType": "Iri" + } + ] + }, + { + "keys": [ + { + "type": "Submodel", + "value": "https://example.com/ids/sm/2110_9090_6012_8448", + "idType": "Iri" + } + ] + }, + { + "keys": [ + { + "type": "Submodel", + "value": "https://example.com/ids/sm/5410_9090_6012_0950", + "idType": "Iri" + } + ] + }, + { + "keys": [ + { + "type": "Submodel", + "value": "https://example.com/ids/sm/2402_1191_1022_1090", + "idType": "Iri" + } + ] + } + ], + "identification": { + "idType": "Iri", + "id": "https://example.com/ids/aas/3235_8090_6012_8932" + }, + "idShort": "FestoDemoAAS", + "modelType": { + "name": "AssetAdministrationShell" + } + } + ], + "assets": [ + { + "identification": { + "idType": "Iri", + "id": "https://example.com/ids/asset/3435_8090_6012_2867" + }, + "idShort": "FestoDemo", + "modelType": { + "name": "Asset" + }, + "kind": "Instance" + } + ], + "submodels": [ + { + "semanticId": { + "keys": [ + { + "idType": "Iri", + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ] + }, + "identification": { + "idType": "Iri", + "id": "https://example.com/ids/sm/1145_8090_6012_5097" + }, + "idShort": "Config", + "modelType": { + "name": "Submodel" + }, + "kind": "Instance", + "submodelElements": [] + }, + { + "semanticId": { + "keys": [ + { + "idType": "Iri", + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ] + }, + "identification": { + "idType": "Iri", + "id": "https://example.com/ids/sm/4445_8090_6012_7409" + }, + "idShort": "Status", + "modelType": { + "name": "Submodel" + }, + "kind": "Instance", + "submodelElements": [ + { + "value": "", + "semanticId": { + "keys": [ + { + "idType": "Iri", + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ] + }, + "idShort": "GripperUp", + "category": "Variable", + "modelType": { + "name": "Property" + }, + "valueType": "boolean", + "kind": "Instance", + "descriptions": [ + { + "language": "en", + "text": "Shows it the gripper is currently pulled up" + } + ] + }, + { + "value": "3", + "semanticId": { + "keys": [ + { + "idType": "Iri", + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ] + }, + "idShort": "Pressure", + "category": "Variable", + "modelType": { + "name": "Property" + }, + "valueType": "int", + "kind": "Instance", + "descriptions": [ + { + "language": "en", + "text": "Shows pressure" + } + ] + }, + { + "value": "55", + "semanticId": { + "keys": [ + { + "idType": "Iri", + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ] + }, + "idShort": "ProcessCounter", + "category": "Variable", + "modelType": { + "name": "Property" + }, + "valueType": "int", + "kind": "Instance", + "descriptions": [ + { + "language": "en", + "text": "Counts the processes" + } + ] + }, + { + "value": "13.6", + "semanticId": { + "keys": [ + { + "idType": "Iri", + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ] + }, + "idShort": "ProcessDuration", + "category": "Variable", + "modelType": { + "name": "Property" + }, + "valueType": "float", + "kind": "Instance", + "descriptions": [ + { + "language": "en", + "text": "Shows the last measurement duration" + } + ] + }, + { + "value": "40", + "semanticId": { + "keys": [ + { + "idType": "Iri", + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ] + }, + "idShort": "RemainingProcesses", + "category": "Variable", + "modelType": { + "name": "Property" + }, + "valueType": "int", + "kind": "Instance", + "descriptions": [ + { + "language": "en", + "text": "Shows remaining processes until system failure" + } + ] + }, + { + "value": "", + "semanticId": { + "keys": [ + { + "idType": "Iri", + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ] + }, + "idShort": "GripperOpen", + "category": "Variable", + "modelType": { + "name": "Property" + }, + "valueType": "boolean", + "kind": "Instance", + "descriptions": [ + { + "language": "en", + "text": "Shows if the gripper claw is currently open" + } + ] + }, + { + "value": "0", + "semanticId": { + "keys": [ + { + "idType": "Iri", + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ] + }, + "idShort": "DistanceSensor", + "category": "Variable", + "modelType": { + "name": "Property" + }, + "valueType": "int", + "kind": "Instance", + "descriptions": [ + { + "language": "en", + "text": "Shows the current distance of the object (height guess)" + } + ] + }, + { + "value": "", + "semanticId": { + "keys": [ + { + "idType": "Iri", + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ] + }, + "idShort": "LightGateEntrance", + "category": "Variable", + "modelType": { + "name": "Property" + }, + "valueType": "boolean", + "kind": "Instance" + }, + { + "value": "", + "semanticId": { + "keys": [ + { + "idType": "Iri", + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ] + }, + "idShort": "LightGateMiddle", + "category": "Variable", + "modelType": { + "name": "Property" + }, + "valueType": "boolean", + "kind": "Instance" + }, + { + "value": "", + "semanticId": { + "keys": [ + { + "idType": "Iri", + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ] + }, + "idShort": "LightGateExit", + "category": "Variable", + "modelType": { + "name": "Property" + }, + "valueType": "boolean", + "kind": "Instance" + }, + { + "value": "", + "semanticId": { + "keys": [ + { + "idType": "Iri", + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ] + }, + "idShort": "ConveyorBeltForward", + "category": "Variable", + "modelType": { + "name": "Property" + }, + "valueType": "boolean", + "kind": "Instance" + }, + { + "value": "", + "semanticId": { + "keys": [ + { + "idType": "Iri", + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ] + }, + "idShort": "ConveyorBeltBackward", + "category": "Variable", + "modelType": { + "name": "Property" + }, + "valueType": "boolean", + "kind": "Instance" + }, + { + "value": "", + "semanticId": { + "keys": [ + { + "idType": "Iri", + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ] + }, + "idShort": "isRunning", + "category": "Variable", + "modelType": { + "name": "Property" + }, + "valueType": "boolean", + "kind": "Instance" + }, + { + "value": "", + "semanticId": { + "keys": [ + { + "idType": "Iri", + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ] + }, + "idShort": "LED_green", + "category": "Variable", + "modelType": { + "name": "Property" + }, + "valueType": "boolean", + "kind": "Instance" + }, + { + "value": "", + "semanticId": { + "keys": [ + { + "idType": "Iri", + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ] + }, + "idShort": "LED_yellow", + "category": "Variable", + "modelType": { + "name": "Property" + }, + "valueType": "boolean", + "kind": "Instance" + }, + { + "value": "", + "semanticId": { + "keys": [ + { + "idType": "Iri", + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ] + }, + "idShort": "LED_red", + "category": "Variable", + "modelType": { + "name": "Property" + }, + "valueType": "boolean", + "kind": "Instance" + }, + { + "value": "", + "semanticId": { + "keys": [ + { + "idType": "Iri", + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ] + }, + "idShort": "ConveyorBeltReady", + "category": "Variable", + "modelType": { + "name": "Property" + }, + "valueType": "boolean", + "kind": "Instance" + } + ], + "descriptions": [] + }, + { + "semanticId": { + "keys": [ + { + "idType": "Iri", + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ] + }, + "identification": { + "idType": "Iri", + "id": "https://example.com/ids/sm/2110_9090_6012_8448" + }, + "idShort": "CalculatedAverages", + "modelType": { + "name": "Submodel" + }, + "kind": "Instance", + "submodelElements": [ + { + "value": "0", + "semanticId": { + "keys": [ + { + "idType": "Iri", + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ] + }, + "idShort": "GripperUpAverage", + "category": "Variable", + "modelType": { + "name": "Property" + }, + "valueType": "float", + "kind": "Instance", + "descriptions": [ + { + "language": "en", + "text": "Shows it the gripper is currently pulled up" + } + ] + }, + { + "value": "0", + "semanticId": { + "keys": [ + { + "idType": "Iri", + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ] + }, + "idShort": "GripperOpenAverage", + "category": "Variable", + "modelType": { + "name": "Property" + }, + "valueType": "float", + "kind": "Instance", + "descriptions": [ + { + "language": "en", + "text": "Shows if the gripper claw is currently open" + } + ] + }, + { + "value": "0", + "semanticId": { + "keys": [ + { + "idType": "Iri", + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ] + }, + "idShort": "DistanceSensorAverage", + "category": "Variable", + "modelType": { + "name": "Property" + }, + "valueType": "float", + "kind": "Instance", + "descriptions": [ + { + "language": "en", + "text": "Shows the current distance of the object (height guess)" + } + ] + }, + { + "value": "0", + "semanticId": { + "keys": [ + { + "idType": "Iri", + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ] + }, + "idShort": "LightGateEntranceAverage", + "category": "Variable", + "modelType": { + "name": "Property" + }, + "valueType": "float", + "kind": "Instance" + }, + { + "value": "0", + "semanticId": { + "keys": [ + { + "idType": "Iri", + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ] + }, + "idShort": "LightGateMiddleAverage", + "category": "Variable", + "modelType": { + "name": "Property" + }, + "valueType": "float", + "kind": "Instance" + }, + { + "value": "0", + "semanticId": { + "keys": [ + { + "idType": "Iri", + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ] + }, + "idShort": "LightGateExitAverage", + "category": "Variable", + "modelType": { + "name": "Property" + }, + "valueType": "float", + "kind": "Instance" + }, + { + "value": "0", + "semanticId": { + "keys": [ + { + "idType": "Iri", + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ] + }, + "idShort": "ConveyorBeltForwardAverage", + "category": "Variable", + "modelType": { + "name": "Property" + }, + "valueType": "float", + "kind": "Instance" + }, + { + "value": "0", + "semanticId": { + "keys": [ + { + "idType": "Iri", + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ] + }, + "idShort": "ConveyorBeltBackwardAverage", + "category": "Variable", + "modelType": { + "name": "Property" + }, + "valueType": "float", + "kind": "Instance" + }, + { + "value": "0", + "semanticId": { + "keys": [ + { + "idType": "Iri", + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ] + }, + "idShort": "isRunningAverage", + "category": "Variable", + "modelType": { + "name": "Property" + }, + "valueType": "float", + "kind": "Instance" + }, + { + "value": "0", + "semanticId": { + "keys": [ + { + "idType": "Iri", + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ] + }, + "idShort": "LED_greenAverage", + "category": "Variable", + "modelType": { + "name": "Property" + }, + "valueType": "float", + "kind": "Instance" + }, + { + "value": "0", + "semanticId": { + "keys": [ + { + "idType": "Iri", + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ] + }, + "idShort": "LED_yellowAverage", + "category": "Variable", + "modelType": { + "name": "Property" + }, + "valueType": "float", + "kind": "Instance" + }, + { + "value": "0", + "semanticId": { + "keys": [ + { + "idType": "Iri", + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ] + }, + "idShort": "LED_redAverage", + "category": "Variable", + "modelType": { + "name": "Property" + }, + "valueType": "float", + "kind": "Instance" + }, + { + "value": "0", + "semanticId": { + "keys": [ + { + "idType": "Iri", + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ] + }, + "idShort": "ConveyorBeltReadyAverage", + "category": "Variable", + "modelType": { + "name": "Property" + }, + "valueType": "float", + "kind": "Instance" + } + ] + }, + { + "semanticId": { + "keys": [ + { + "idType": "Iri", + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ] + }, + "identification": { + "idType": "Iri", + "id": "https://example.com/ids/sm/5410_9090_6012_0950" + }, + "idShort": "DaySummary", + "modelType": { + "name": "Submodel" + }, + "kind": "Instance", + "submodelElements": [ + { + "value": "", + "semanticId": { + "keys": [ + { + "idType": "Iri", + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ] + }, + "idShort": "JTS_data", + "modelType": { + "name": "Property" + }, + "valueType": "string", + "kind": "Instance", + "descriptions": [ + { + "language": "en", + "text": "contains the JSON JTS (json time series) data of the whole day" + } + ] + } + ] + }, + { + "semanticId": { + "keys": [ + { + "idType": "Iri", + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ] + }, + "identification": { + "idType": "Iri", + "id": "https://example.com/ids/sm/2402_1191_1022_1090" + }, + "idShort": "ProducerRecommendations", + "modelType": { + "name": "Submodel" + }, + "kind": "Instance", + "submodelElements": [ + { + "value": "4.1", + "semanticId": { + "keys": [ + { + "idType": "Iri", + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ] + }, + "idShort": "Pressure", + "modelType": { + "name": "Property" + }, + "valueType": "float", + "kind": "Instance" + }, + { + "value": "16.2", + "semanticId": { + "keys": [ + { + "idType": "Iri", + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ] + }, + "idShort": "ProcessDuration", + "modelType": { + "name": "Property" + }, + "valueType": "float", + "kind": "Instance" + } + ] + } + ], + "conceptDescriptions": [ + { + "modelType": { + "name": "ConceptDescription" + }, + "administration": { + "revision": "0", + "version": "0.9" + }, + "identification": { + "idType": "Iri", + "id": "https://acplt.org/Test_ConceptDescription" + }, + "idShort": "TestConceptDescription", + "isCaseOf": [ + { + "keys": [ + { + "idType": "Iri", + "type": "GlobalReference", + "value": "http://acplt.org/DataSpecifications/ConceptDescriptions/TestConceptDescription" + } + ] + } + ], + "description": [ + { + "language": "en-us", + "text": "An example concept description for the test application" + }, + { + "language": "de", + "text": "Ein Beispiel-ConceptDescription für eine Test-Anwendung" + } + ] + } + ] +} \ No newline at end of file