diff --git a/infra/wasmcloud/wasmcloud-edge-host/docker-compose.yaml b/infra/wasmcloud/wasmcloud-edge-host/docker-compose.yaml index 44e3990..094ee73 100644 --- a/infra/wasmcloud/wasmcloud-edge-host/docker-compose.yaml +++ b/infra/wasmcloud/wasmcloud-edge-host/docker-compose.yaml @@ -3,7 +3,7 @@ services: image: nats:alpine container_name: nats restart: always - command: -c /etc/nats/nats.conf + command: -js -c /etc/nats/nats.conf ports: - "4222:4222" # client port - "8222:8222" # monitoring port diff --git a/project/img/infra.png b/project/img/infra.png new file mode 100644 index 0000000..6d14b4f Binary files /dev/null and b/project/img/infra.png differ diff --git a/project/schemi.drawio b/project/schemi.drawio new file mode 100644 index 0000000..4555b7b --- /dev/null +++ b/project/schemi.drawio @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/readme.md b/readme.md index edb9df5..9b48a46 100644 --- a/readme.md +++ b/readme.md @@ -1,21 +1,46 @@ -# Scope of project -Tha annotation must tell the splitter how to aggregate and where to send each task. +# Infrastuttura -## Possible implementation +L'infrastuttura simula un flusso IoT ed è composta da: +- ambiente Cloud, deployato su kubernetes e dotato di cluster NATS, WADM e Wasmcloud Host +- ambiente Edge, semplice macchina Linux con docker compose, Wasmcloud e NATS Leaf come docker container +- dispositivi IoT collegati all'ambiente Edge -The code will be processed and splitted into possible modules. Inside the path /build will be created a directory for each module. Inside there will be the wasm compiled bytecode, a file scheduler.config that will list all the information that schedule could need to schedule the module. +![infra](/project/img/infra.png) -## Targets -Possible devices that run the task: -- Cloud device, prossibly the same cloud that runs the scheduler -- Edge device -- IoT device, the only one that can run device specific tasks +# Pipeline -## Annotations +Il processo si divide in due fasi principali, cioè quello di generazione del componente wasm e quella di deploy. -List of possible annotations: +## Generazione del componente WASM -- `@TaskGeneric` defines a generic task that can run everywere -- `@CloudSpecific` runs only on cloud -- `@EdgeSpecific` runs only on edge -- `@EndDeviceSpecific` runs only on end device, in particular the device can be specified with `@EndDeviceSpecific(device_name)` \ No newline at end of file +Questa fase si occupa di trasformare una serie di files descrittivi in codice, selezionare il template corretto, buildare il progetto, generare il file di deploy e quindi pushare l'artifact OCI in un registry. + +### Parsing del codice + +Il progetto di partenza è composto da un file `workflow.yaml`, nel quale vengono descritti tutti i componenti, e da una cartella `tasks` contenente le porzioni di codice che devono essere eseguite dai vari componenti. + +``` +├─ workflow.yaml +└─ tasks +   ├─ sensor_read.go +   ├─ aggregate.go +   └─ db_sync.go +``` + +#### Workflow +Nel file workflow vengono descritti i vari componenti, un esempio potrebbe essere + +```yaml +tasks: + - name: Data Aggregation # Displayed name + type: processing # Used to select template + code: aggregate.go # Go code file inside tasks/ dir + target: # Where the component will be deployed + - edge + - cloud + source_topic: temp_sensor # Source NATS topic + dest_topic: aggregated_data # Destination NATS topic + component_name: data_aggregation # Component name displayed in the OCI artifact + version: 1.0.0 # Component version +... +```