Skip to content

Commit

Permalink
Update Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-fox committed Jun 4, 2024
1 parent 39ccf67 commit 21903fd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion NGSI-LD Subscriptions.postman_collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"info": {
"_postman_id": "41c2de83-48e2-46bb-9073-2a9fbe4fc5c3",
"name": "NGSI-LD Subscriptions",
"description": "This tutorial teaches NGSI-LD users about how to create and manage context data subscriptions. The tutorial builds on the\nentities and [Smart Farm](https://github.com/FIWARE/tutorials.Getting-Started/tree/NGSI-LD)\napplication created in the previous examples to enable users to\nunderstand the [NGSI-LD](https://www.etsi.org/deliver/etsi_gs/CIM/001_099/009/01.03.01_60/gs_cim009v010301p.pdf) Subscribe/Notify paradigm and how to\nuse NGSI subscriptions within their own code.\n\nThe tutorial refers to devices and actions made within the browser combined with [cUrl](https://ec.haxx.se/)\ncommands. The cUrl commands are also available as\n[Postman documentation](https://github.com/FIWARE/tutorials.Subscriptions/tree/NGSI-LD).\n\nThe `docker-compose` file for this tutorial can be found on GitHub: \n\n![GitHub](https://fiware.github.io/tutorials.Subscriptions/icon/GitHub-Mark-32px.png) [FIWARE 106: Subscribing to Changes in Context](https://github.com/FIWARE/tutorials.Subscriptions/tree/NGSI-LD)\n\n# Subscribing to Changes of State\n\n> 'Another sandwich!' said the King.\n>\n> 'There's nothing but hay left now,' the Messenger said, peeping into the bag.\n>\n> 'Hay, then,' the King murmured in a faint whisper.\n>\n> Alice was glad to see that it revived him a good deal. 'There's nothing like eating hay when you're faint,' he remarked to her, as he munched away.\n>\n> — Lewis Carroll (Through the Looking-Glass and What Alice Found There)\n\nWithin the FIWARE platform, an entity represents the state of a physical or conceptual object which exists in the real\nworld. Every smart solution needs to know the current state of these object at any given moment in time.\n\nThe context of each of these entities is constantly changing. For example, within the smart farm example, the\ncontext will change as animals and vehicles move, soil dries out, tasks are allocated on the farm and completed and so on. For a smart solution based on IoT\nsensor data, this issue is even more pressing as the system will constantly be reacting to changes in the real world.\n\nUntil now all the operations we have used to change the state of the system have been **synchronous** - changes have\nbeen made by directly by a user or application and they have been informed of the result. The Orion Context Broker\noffers also an **asynchronous** notification mechanism - applications can subscribe to changes of context information so\nthat they can be informed when something happens. This means the application does not need to continuously poll or\nrepeat query requests.\n\nUse of the subscription mechanism will therefore reduce both the volume of requests and amount of data being passed\nbetween components within the system. This reduction in network traffic will improve the overall responsiveness.\n\n## Entities within a smart Agrifood system\n\nThe relationship between our entities is defined as shown:\n\n![](https://fiware.github.io/tutorials.Subscriptions/img/ngsi-ld-entities.png)\n\n## Farm Management Information System frontend\n\nIn a previous tutorial, a simple Node.js Express application\nwas created. This tutorial will use the monitor page to watch the status of recent requests, and the devices page to alter the machines on the farm. Once the services are running these pages can be accessed from the following URLs:\n\n#### Event Monitor\n\nThe event monitor can be found at: `http://localhost:3000/app/monitor`\n\n![FIWARE Monitor](https://fiware.github.io/tutorials.Subscriptions/img/monitor.png)\n\n#### Device Monitor\n\nFor the purpose of this tutorial, a series of dummy agricultural IoT devices have been created, which will be attached\nto the context broker. Details of the architecture and protocol used can be found in the\n[IoT Sensors tutorial](https://github.com/FIWARE/tutorials.IoT-Sensors/tree/NGSI-LD) The state of each device can be\nseen on the UltraLight device monitor web page found at: `http://localhost:3000/device/monitor`\n\n![FIWARE Monitor](https://fiware.github.io/tutorials.Subscriptions/img/farm-devices.png)\n\n# Architecture\n\nThis application will make use of two FIWARE components - the\n[Orion-LD Context Broker](https://fiware-orion.readthedocs.io/en/latest/)and the\n[IoT Agent for UltraLight 2.0](https://fiware-iotagent-ul.readthedocs.io/en/latest/). Usage of any NGSI-LD Context Broker is sufficient\nfor an application to qualify as _“Powered by FIWARE”_.\n\nCurrently, the Orion-LD Context Broker relies on open source [MongoDB](https://www.mongodb.com/) technology to keep\npersistence of the context data it holds. To request context data from external sources, a simple **Context Provider\nNGSI proxy** has also been added. To visualize and interact with the Context we will add a simple Express **Frontend**\napplication\n\nTherefore, the architecture will consist of four elements:\n\n- The [Orion Context Broker](https://fiware-orion.readthedocs.io/en/latest/) which will receive requests using\n [NGSI-LD](https://forge.etsi.org/swagger/ui/?url=https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/spec/updated/full_api.json)\n- The FIWARE [IoT Agent for UltraLight 2.0](https://fiware-iotagent-ul.readthedocs.io/en/latest/) which will receive\n southbound requests using\n [NGSI-LD](https://forge.etsi.org/swagger/ui/?url=https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/spec/updated/full_api.json)\n and convert them to\n [UltraLight 2.0](https://fiware-iotagent-ul.readthedocs.io/en/latest/usermanual/index.html#user-programmers-manual)\n commands for the devices\n- The underlying [MongoDB](https://www.mongodb.com/) database:\n - Used by the Orion Context Broker to hold context data information such as data entities, subscriptions and\n registrations\n- The **Tutorial Application** does the following:\n - Offers static `@context` files defining the context entities within the system.\n - Acts as set of dummy [agricultural IoT devices](https://github.com/FIWARE/tutorials.IoT-Sensors/tree/NGSI-LD)\n using the\n [UltraLight 2.0](https://fiware-iotagent-ul.readthedocs.io/en/latest/usermanual/index.html#user-programmers-manual)\n protocol running over HTTP.\n\nSince all interactions between the elements are initiated by HTTP requests, the entities can be containerized and run\nfrom exposed ports.\n\n![](https://fiware.github.io/tutorials.Subscriptions/img/architecture-ld.png)\n\nThe necessary configuration information can be seen in the services section of the associated `docker-compose.yml` file.\nIt has been described in a previous tutorial\n\n# Prerequisites\n\n## Docker\n\nTo keep things simple both components will be run using [Docker](https://www.docker.com). **Docker** is a container\ntechnology which allows to different components isolated into their respective environments.\n\n- To install Docker on Windows follow the instructions [here](https://docs.docker.com/docker-for-windows/)\n- To install Docker on Mac follow the instructions [here](https://docs.docker.com/docker-for-mac/)\n- To install Docker on Linux follow the instructions [here](https://docs.docker.com/install/)\n\n**Docker Compose** is a tool for defining and running multi-container Docker applications. A\n[YAML file](https://raw.githubusercontent.com/Fiware/tutorials.Entity-Relationships/master/docker-compose.yml) is used\nconfigure the required services for the application. This means all container services can be brought up in a single\ncommand. Docker Compose is installed by default as part of Docker for Windows and Docker for Mac, however Linux users\nwill need to follow the instructions found [here](https://docs.docker.com/compose/install/)\n\nYou can check your current **Docker** and **Docker Compose** versions using the following commands:\n\n```console\ndocker-compose -v\ndocker version\n```\n\nPlease ensure that you are using Docker version 20.10 or higher and Docker Compose 1.29 or higher and upgrade if\nnecessary.\n\n## WSL\n\nWe will start up our services using a simple bash script. Windows users should download the [Windows Subsystem for Linux](https://learn.microsoft.com/en-us/windows/wsl/install)\nto provide a command-line functionality similar to a Linux distribution on Windows.\n\n# Start Up\n\nAll services can be initialized from the command-line by running the bash script provided within the repository. Please\nclone the repository and create the necessary images by running the commands as shown:\n\n```console\ngit clone https://github.com/FIWARE/tutorials.Subscriptions.git\ncd tutorials.Subscriptions\ngit checkout NGSI-LD\n\n./services create;\n./services orion;\n```\n\nThis command will also import seed data from the previous\nFarm Management Information System example on startup, and provision a series of dummy devices on the farm.\n\n> :information_source: **Note:** If you want to clean up and start over again you can do so with the following command:\n>\n> ```console\n> ./services stop\n> ```\n\n# Using Subscriptions\n\nTo follow the tutorial correctly please ensure you have the follow two pages available on separate tabs in your browser before you\nenter any cUrl commands.\n\n#### FMIS System\n\nDetails of various buildings around the farm can be found in the tutorial application. Open `http://localhost:3000/app/farm/urn:ngsi-ld:Building:farm001` to display a building with an associated filling sensor and thermostat.\n\n![](https://fiware.github.io/tutorials.Subscriptions/img/fmis.png)\n\n#### Event Monitor\n\nThe event monitor can be found at: `http://localhost:3000/app/monitor`.\n\n![](https://fiware.github.io/tutorials.Subscriptions/img/low-stock-farm.png)",
"description": "This tutorial teaches NGSI-LD users about how to create and manage context data subscriptions. The tutorial builds on the\nentities and [Smart Farm](https://github.com/FIWARE/tutorials.Getting-Started/tree/NGSI-LD)\napplication created in the previous examples to enable users to\nunderstand the [NGSI-LD](https://www.etsi.org/deliver/etsi_gs/CIM/001_099/009/01.03.01_60/gs_cim009v010301p.pdf) Subscribe/Notify paradigm and how to\nuse NGSI subscriptions within their own code.\n\nThe tutorial refers to devices and actions made within the browser combined with [cUrl](https://ec.haxx.se/)\ncommands. The cUrl commands are also available as\n[Postman documentation](https://github.com/FIWARE/tutorials.Subscriptions/tree/NGSI-LD).\n\nThe `docker-compose` file for this tutorial can be found on GitHub: \n\n![GitHub](https://fiware.github.io/tutorials.Subscriptions/icon/GitHub-Mark-32px.png) [FIWARE 106: Subscribing to Changes in Context](https://github.com/FIWARE/tutorials.Subscriptions/tree/NGSI-LD)\n\n# Subscribing to Changes of State\n\n> 'Another sandwich!' said the King.\n>\n> 'There's nothing but hay left now,' the Messenger said, peeping into the bag.\n>\n> 'Hay, then,' the King murmured in a faint whisper.\n>\n> Alice was glad to see that it revived him a good deal. 'There's nothing like eating hay when you're faint,' he remarked to her, as he munched away.\n>\n> — Lewis Carroll (Through the Looking-Glass and What Alice Found There)\n\nWithin the FIWARE platform, an entity represents the state of a physical or conceptual object which exists in the real\nworld. Every smart solution needs to know the current state of these object at any given moment in time.\n\nThe context of each of these entities is constantly changing. For example, within the smart farm example, the\ncontext will change as animals and vehicles move, soil dries out, tasks are allocated on the farm and completed and so on. For a smart solution based on IoT\nsensor data, this issue is even more pressing as the system will constantly be reacting to changes in the real world.\n\nUntil now all the operations we have used to change the state of the system have been **synchronous** - changes have\nbeen made by directly by a user or application and they have been informed of the result. The Orion Context Broker\noffers also an **asynchronous** notification mechanism - applications can subscribe to changes of context information so\nthat they can be informed when something happens. This means the application does not need to continuously poll or\nrepeat query requests.\n\nUse of the subscription mechanism will therefore reduce both the volume of requests and amount of data being passed\nbetween components within the system. This reduction in network traffic will improve the overall responsiveness.\n\n## Entities within a smart Agrifood system\n\nThe relationship between our entities is defined as shown:\n\n![](https://fiware.github.io/tutorials.Subscriptions/img/ngsi-ld-entities.png)\n\n## Farm Management Information System frontend\n\nIn a previous tutorial, a simple Node.js Express application\nwas created. This tutorial will use the monitor page to watch the status of recent requests, and the devices page to alter the machines on the farm. Once the services are running these pages can be accessed from the following URLs:\n\n#### Event Monitor\n\nThe event monitor can be found at: `http://localhost:3000/app/monitor`\n\n![FIWARE Monitor](https://fiware.github.io/tutorials.Subscriptions/img/monitor.png)\n\n#### Device Monitor\n\nFor the purpose of this tutorial, a series of dummy agricultural IoT devices have been created, which will be attached\nto the context broker. Details of the architecture and protocol used can be found in the\n[IoT Sensors tutorial](https://github.com/FIWARE/tutorials.IoT-Sensors/tree/NGSI-LD) The state of each device can be\nseen on the UltraLight device monitor web page found at: `http://localhost:3000/device/monitor`\n\n![FIWARE Monitor](https://fiware.github.io/tutorials.Subscriptions/img/farm-devices.png)\n\n# Architecture\n\nThis application will make use of two FIWARE components - the\n[Orion-LD Context Broker](https://fiware-orion.readthedocs.io/en/latest/)and the\n[IoT Agent for UltraLight 2.0](https://fiware-iotagent-ul.readthedocs.io/en/latest/). Usage of any NGSI-LD Context Broker is sufficient\nfor an application to qualify as _“Powered by FIWARE”_.\n\nCurrently, the Orion-LD Context Broker relies on open source [MongoDB](https://www.mongodb.com/) technology to keep\npersistence of the context data it holds. To request context data from external sources, a simple **Context Provider\nNGSI proxy** has also been added. To visualize and interact with the Context we will add a simple Express **Frontend**\napplication\n\nTherefore, the architecture will consist of four elements:\n\n- The [Orion Context Broker](https://fiware-orion.readthedocs.io/en/latest/) which will receive requests using\n [NGSI-LD](https://forge.etsi.org/swagger/ui/?url=https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/spec/updated/full_api.json)\n- The FIWARE [IoT Agent for UltraLight 2.0](https://fiware-iotagent-ul.readthedocs.io/en/latest/) which will receive\n southbound requests using\n [NGSI-LD](https://forge.etsi.org/swagger/ui/?url=https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/spec/updated/full_api.json)\n and convert them to\n [UltraLight 2.0](https://fiware-iotagent-ul.readthedocs.io/en/latest/usermanual/index.html#user-programmers-manual)\n commands for the devices\n- The underlying [MongoDB](https://www.mongodb.com/) database:\n - Used by the Orion Context Broker to hold context data information such as data entities, subscriptions and\n registrations\n- The **Tutorial Application** does the following:\n - Offers static `@context` files defining the context entities within the system.\n - Acts as set of dummy [agricultural IoT devices](https://github.com/FIWARE/tutorials.IoT-Sensors/tree/NGSI-LD)\n using the\n [UltraLight 2.0](https://fiware-iotagent-ul.readthedocs.io/en/latest/usermanual/index.html#user-programmers-manual)\n protocol running over HTTP.\n\nSince all interactions between the elements are initiated by HTTP requests, the entities can be containerized and run\nfrom exposed ports.\n\n![](https://fiware.github.io/tutorials.Subscriptions/img/architecture-ld.png)\n\nThe necessary configuration information can be seen in the services section of the associated `docker-compose.yml` file.\nIt has been described in a previous tutorial\n\n# Prerequisites\n\n## Docker\n\nTo keep things simple both components will be run using [Docker](https://www.docker.com). **Docker** is a container\ntechnology which allows to different components isolated into their respective environments.\n\n- To install Docker on Windows follow the instructions [here](https://docs.docker.com/docker-for-windows/)\n- To install Docker on Mac follow the instructions [here](https://docs.docker.com/docker-for-mac/)\n- To install Docker on Linux follow the instructions [here](https://docs.docker.com/install/)\n\n**Docker Compose** is a tool for defining and running multi-container Docker applications. A\n[YAML file](https://raw.githubusercontent.com/Fiware/tutorials.Entity-Relationships/master/docker-compose.yml) is used\nconfigure the required services for the application. This means all container services can be brought up in a single\ncommand. Docker Compose is installed by default as part of Docker for Windows and Docker for Mac, however Linux users\nwill need to follow the instructions found [here](https://docs.docker.com/compose/install/)\n\nYou can check your current **Docker** and **Docker Compose** versions using the following commands:\n\n```console\ndocker-compose -v\ndocker version\n```\n\nPlease ensure that you are using Docker version 24.0.x or higher and Docker Compose 2.24.x or higher and upgrade if\nnecessary.\n\n## WSL\n\nWe will start up our services using a simple bash script. Windows users should download the [Windows Subsystem for Linux](https://learn.microsoft.com/en-us/windows/wsl/install)\nto provide a command-line functionality similar to a Linux distribution on Windows.\n\n# Start Up\n\nAll services can be initialized from the command-line by running the bash script provided within the repository. Please\nclone the repository and create the necessary images by running the commands as shown:\n\n```console\ngit clone https://github.com/FIWARE/tutorials.Subscriptions.git\ncd tutorials.Subscriptions\ngit checkout NGSI-LD\n\n./services create;\n./services orion;\n```\n\nThis command will also import seed data from the previous\nFarm Management Information System example on startup, and provision a series of dummy devices on the farm.\n\n> :information_source: **Note:** If you want to clean up and start over again you can do so with the following command:\n>\n> ```console\n> ./services stop\n> ```\n\n# Using Subscriptions\n\nTo follow the tutorial correctly please ensure you have the follow two pages available on separate tabs in your browser before you\nenter any cUrl commands.\n\n#### FMIS System\n\nDetails of various buildings around the farm can be found in the tutorial application. Open `http://localhost:3000/app/farm/urn:ngsi-ld:Building:farm001` to display a building with an associated filling sensor and thermostat.\n\n![](https://fiware.github.io/tutorials.Subscriptions/img/fmis.png)\n\n#### Event Monitor\n\nThe event monitor can be found at: `http://localhost:3000/app/monitor`.\n\n![](https://fiware.github.io/tutorials.Subscriptions/img/low-stock-farm.png)",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
Expand Down
2 changes: 1 addition & 1 deletion README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ docker-compose -v
docker version
```

Docker バージョン 20.10 以降と Docker Compose 1.29 以上を使用していることを確認し、
Docker バージョン 24.0.x 以降と Docker Compose 2.24.x 以上を使用していることを確認し、
必要に応じてアップグレードしてください。

<A name="prerequisites"></A>
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ docker-compose -v
docker version
```

Please ensure that you are using Docker version 20.10 or higher and Docker Compose 1.29 or higher and upgrade if
Please ensure that you are using Docker version 24.0.x or higher and Docker Compose 2.24.x or higher and upgrade if
necessary.

## WSL
Expand Down

0 comments on commit 21903fd

Please sign in to comment.