thin-edge.io demo container setup to showcase thin-edge.io and all its features
The following pre-requisites are required before you can get started:
- docker
- docker compose v2 (not the python one)
Check out the list of known working setups to see what software you can use for your Operating Systemd to meet the pre-requisites.
If you're a Cumulocity user, then you can use the Cumulocity CLI tool, go-c8y-cli and the thin-edge.io extension for it (c8y-tedge), to quickly launch demo containers without having to checkout this project.
First, you'll need to install go-c8y-cli (in addition to having docker and docker compose already installed):
Then, install the c8y-tedge extension:
c8y extensions install thin-edge/c8y-tedge
# or update it to the latest version
c8y extensions update tedgeBefore you can launch the container demo, you'll need to activate a go-c8y-cli session, using set-session. This will will configure which Cumulocity instance you wish to use with the demo. If you don't have an existing session then please follow the go-c8y-cli Getting Started guide.
# Activate the go-c8y-cli session
set-sessionNow you can launch a new container demo using (note: this will also open your web browser to the device after it is onboarded):
c8y tedge demo start mydemo01Like most cli commands, you can view extra options by looking at the help, using the --help flag on any given command.
c8y tedge demo start --helpAfterwards, you can stop the demo and delete the related devices in the cloud using:
c8y tedge demo stop-
Download the docker compose file from the repository
curl -LSs https://raw.githubusercontent.com/thin-edge/tedge-demo-container/main/demos/docker-compose/device/docker-compose.yaml > docker-compose.yamlOr alternatively you can download it using
wgetwget https://raw.githubusercontent.com/thin-edge/tedge-demo-container/main/demos/docker-compose/device/docker-compose.yaml
-
Start the docker-compose project (in the background)
docker compose up -d
-
Bootstrap the device
docker compose exec tedge bootstrap.sh -
Click on the link to your tedge device which is shown on the console
Check out the USER GUIDE for more details on other commands that can be run.
Note
The tedge container has the following default SSH user which can be used with the SSH protocol of the Cumulocity IoT Cloud Remote Access (CRA) feature.
| Property | Value |
|---|---|
| SSH User | iotadmin |
| SSH Password | iotadmin |
The project also includes another docker-compose file to build the project locally. This allows you to manually tweak any of the container images to add/remove things as you see fit.
After you have cloned the project you still need to install, just. just is used as the project's task runner to simplify the commands required during development. Check out their installation instructions to see how to install it on your machine.
Once you have just installed, you can proceed with the following instructions:
-
Create the
.envtemplate filejust create-env
Fill in the values for each of the environment variables in the .env file. Whilst the settings in the
.envfile are not mandatory, it does allow you to set sensible defaults for your setup so that you don't have to enter your username or Cumulocity URL multiple times during the bootstrapping phase. -
Start the docker compose project (this will also build the containers)
just up
-
Bootstrap the main device (don't worry you only have to do this once)
just bootstrap
You will be prompted for the required details. You can hit
<enter>to accept the default values. The default values are provided via the.envfile from the first step.Alternatively, if you're a go-c8y-cli user, and have the c8y-tedge extension installed, then you can bootstrap the device using:
just bootstrap-c8y
-
Click on the device link shown on your console
-
That's it 🚀
Integration tests are included in the demo to ensure that everything is working as it should. The tests can be run using the following steps:
-
Edit the
.envfile and add the following environment variablesDEVICE_ID=tedge_unique_name_abcdef C8Y_BASEURL=example.tenant.c8y.io C8Y_USER=myuser@example.com C8Y_PASSWORD="your_password" -
Start the demo and bootstrap it
just up just bootstrap --no-prompt
-
Run the tests
just test
The following features are covered by the demo.
Main device
- Availability Monitoring
- Configuration management
- mqtt-logger (to better understand what messages are going in and out)
- Device reboot
- Device Profile
- Firmware Update (simulated)
- Log management
- log files
- Remote Access
- SSH
- Services
- tedge services
- Shell
- Software management
- apt
- container (docker, docker-compose)
- Telemetry
- Measurements (via collectd)
- Events
- On boot-up service: sends an event on startup
Child devices
- Availability Monitoring
- Configuration management
- Device reboot
- Device Profile
- Firmware Update (simulated)
- Log management
- log files
- Services
- tedge services
- Shell
- Software management
- apk (Alpine based image)
- apt (Debian based image)
There are currently no known issues.