Skip to content

thin-edge/tedge-demo-container

Repository files navigation

tedge-demo-container

thin-edge.io demo container setup to showcase thin-edge.io and all its features

Pre-requisites

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.

Getting started

  1. 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.yaml

    Or alternatively you can download it using wget

    wget https://raw.githubusercontent.com/thin-edge/tedge-demo-container/main/demos/docker-compose/device/docker-compose.yaml
  2. Start the docker-compose project (in the background)

    docker compose up -d
  3. Bootstrap the device

    docker compose exec tedge bootstrap.sh
  4. 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

Building the project yourself

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:

  1. Create the .env template file

    just create-env

    Fill in the values for each of the environment variables in the .env file. Whilst the settings in the .env file 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.

  2. Start the docker compose project (this will also build the containers)

    just up
  3. 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 .env file from the first step.

  4. Click on the device link shown on your console

  5. That's it 🚀

Running Tests

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:

  1. Edit the .env file and add the following environment variables

    DEVICE_ID=tedge_unique_name_abcdef
    C8Y_BASEURL=example.tenant.c8y.io
    C8Y_USER=myuser@example.com
    C8Y_PASSWORD="your_password"
  2. Start the demo and bootstrap it

    just up
    just bootstrap --no-prompt
  3. Run the tests

    just test

What is included?

The following features are covered by the demo.

Main device

  • Configuration management
  • mqtt-logger (to better understand what messages are going in and out)
  • Device reboot
  • Events
    • On boot-up service: sends an event on startup
  • Log management
    • log files
  • Measurements (via collectd)
  • Remote Access
    • SSH
  • Services
    • tedge services
  • Shell
  • Software management
    • apt
    • container (docker, docker-compose)
  • Telemetry
    • Collectd

Child devices

  • Configuration management
  • Firmware management
    • Sending events before and after the operation transition are being delayed and sent at once
  • Measurements
  • Services

Known issues

There are currently no known issues.