diff --git a/README.md b/README.md index a7dbebf..4ea1ed9 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,109 @@ # Demo Services +The tool has been developed to gather information from cockpit and +send it to https://demo-insurance.aoscloud.io/. +# Install tool at AosEdg +## Required precondition(s) +- the following python layer has to be compiled and installed: **aos-pylibs-layer-spider**. + + +The information how to create and add the layer can be found \ +at https://docs.aosedge.tech/docs/how-to/create-layer \ +Shortly the following steps have to be done: + +### Build the aos-pylibs-layer-spider + +Use the meta-aos layer. Path: https://https://github.com/aosedge/meta-aos + +Recipe: meta-aos/recipes-aos-layers/aos-pylibs-layer/aos-pylibs-layer.bb + +### Upload layer +#### Precondition +User must have OEM permissions to login into aoscloud.io. + +- Login into https://aoscloud.io as OEM user. +- Go to the tab 'Layers' (see RED circle at the picture below) +- Then click on '+' (see orange circle at the piscture - top right corner) + +![Alt text](./img/layers.png "Validation batches tab.") + +# Configuration AosEdge +The information how prepare AosEdge to install the demo-insurance service \ +can be found at https://docs.aosedge.tech/docs/quick-start. + +## Install required tools at host machine. +pip3 install aos-prov -U + +## Steps to upload service. +### demo_insurance +#### Set the correct service UUID +Firstly, it is necessary to make the modifications in the code of the demo_insurancein +file ./demo_insurance/meta/config.yaml + +url: aoscloud.io +``` +service_uid: d75bf5cd-cef0-40f7-9e74-73ce49df2bcb +``` +tls_pkcs12: aos-user-sp.p12 + +### Certificates +- Service provider certificat : aos-user-sp.p12 +- OEM user certificat: aos-user-oem.p12 + +### Sign the service +``` +cd demo_insurance +ls +``` + +Output + +``` +meta src +``` + +run: +``` +aos-signer sign +``` + +### Upload service + +run: +``` + aos-signer upload +``` + +### Validate service + +- Login into https://demo-insurance.aoscloud.io/ as user 'OEM' +- Got to tab 'Validation batches' and click at the 'Waiting validation' and than click 'Approve'. + +![Alt text](./img/validation-batches.png "Validation batches tab.") + +## Configuration of cockpit-rcar (release: v1.0.4 release) +The following configuration must be added to the Unit configuration + +"nodes": [ \ + { \ + "nodeType": "Node0-Linux", \ + "priority": 1, +``` + "resources": [ + { + "name": "vis", + "hosts": [ + { + "ip": "192.168.5.86", + "hostname": "wwwivi" + } + ] + } + ] +``` + }, +.... \ +] + +Use tab 'Target Systems' \ +![Alt text](./img/target-systems.png "Validation batches tab.") \ No newline at end of file diff --git a/demo_insurance/meta/config.yaml b/demo_insurance/meta/config.yaml index efb24e6..9092d75 100644 --- a/demo_insurance/meta/config.yaml +++ b/demo_insurance/meta/config.yaml @@ -83,5 +83,5 @@ configuration: # minTime: string # minThreshold: 10, # maxThreshold: 150 - #layers: - # - py-libs-layer + layers: + - aos-pylibs-layer-spider diff --git a/demo_insurance/src/telemetry_emulator/config.py b/demo_insurance/src/telemetry_emulator/config.py index 11ccc56..faeb526 100644 --- a/demo_insurance/src/telemetry_emulator/config.py +++ b/demo_insurance/src/telemetry_emulator/config.py @@ -23,7 +23,7 @@ CONTROL_API_ADDRESS = ("0.0.0.0", 8800) TELEMETRY_REST_HOST = os.environ.get("TELEMETRY_REST_HOST", "demo-insurance.aoscloud.io") -TELEMETRY_REST_URL = "http://{host}/api/v1/telemetry/data/".format( +TELEMETRY_REST_URL = "https://{host}/api/v1/telemetry/data/".format( host=TELEMETRY_REST_HOST ) diff --git a/demo_insurance/src/telemetry_emulator/services/http_client.py b/demo_insurance/src/telemetry_emulator/services/http_client.py index bc180d0..e0c6b58 100644 --- a/demo_insurance/src/telemetry_emulator/services/http_client.py +++ b/demo_insurance/src/telemetry_emulator/services/http_client.py @@ -32,7 +32,7 @@ class HTTPClient(Thread): TIMESTAMP = "timestamp" IN_RECTANGLE = "in_rectangle" - SENDING_INTERVAL = 0.1 + SENDING_INTERVAL = 2.0 def __init__(self, type, emulator=None, *args, **kwargs): super().__init__(*args, **kwargs) diff --git a/img/layers.png b/img/layers.png new file mode 100644 index 0000000..ef7ea3f Binary files /dev/null and b/img/layers.png differ diff --git a/img/target-systems.png b/img/target-systems.png new file mode 100644 index 0000000..dc0a973 Binary files /dev/null and b/img/target-systems.png differ diff --git a/img/validation-batches.png b/img/validation-batches.png new file mode 100644 index 0000000..f373558 Binary files /dev/null and b/img/validation-batches.png differ