I need help, How to use Eclipse Vorto with Eclipse Ditto ( and Eclipse Hono if possible ) in docker desktop?

46 Views Asked by At

I am currently working on configuring Eclipse Hono, Eclipse Vorto, and Eclipse Ditto in a stack using Docker. Despite going through the GitHub repositories (Eclipse Hono Github, Eclipse Vorot Github, Eclipse Ditto Github) and official website (Eclipse Hono, Eclipse Vorto, Eclipse Ditto) of these projects, I am having trouble establishing connections between them. Here's what I've done so far:

  1. I downloaded Eclipse Ditto and Eclipse Vorto images using a docker-compose.yml file.
  2. I obtained Eclipse Hono images via a Maven command (not yet create a containers of Hono).

First, I tried to set up Eclipse Vorto with Eclipse Ditto. Below is the content of my docker-compose.yml file:

version: '3'
services:
  mongodb:
    container_name: mongodb
    image: docker.io/mongo:6.0
    deploy:
      resources:
        limits:
          memory: 256m
    networks:
      vorto_ditto:
        aliases:
          - mongodb
    command: mongod --storageEngine wiredTiger --noscripting
    user: mongodb
    ports:
      - 27017:27017
    environment:
       TZ: Europe/Berlin
    logging:
      options:
        max-size: 50m

  policies:
    container_name: policies
    image: docker.io/eclipse/ditto-policies:${DITTO_VERSION:-latest}
    deploy:
      resources:
        limits:
          memory: 512m
    networks:
      vorto_ditto:
        aliases:
          - ditto-cluster
    environment:
      - TZ=Europe/Berlin
      - BIND_HOSTNAME=0.0.0.0
      # Set additional configuration options here appending JAVTOOL_OPTIONS: -Dditto.policies...
      - JAVTOOL_OPTIONS=-XX:ActiveProcessorCount=2 -XX:+ExitOnOutOfMemoryError -XX:+UseContainerSupport -XX:+UseStringDeduplication -Xss512k -XX:MaxRAMPercentage=50 -XX:+UseG1GC -XX:MaxGCPauseMillis=150 -Dpekko.coordinated-shutdown.exit-jvm=on -Dpekko.cluster.shutdown-after-unsuccessful-join-seed-nodes=180s -Dpekko.cluster.failure-detector.threshold=15.0 -Dpekko.cluster.failure-detector.expected-response-after=10s -Dpekko.cluster.failure-detector.acceptable-heartbeat-pause=20s -Dpekko.cluster.downing-provider-class=
      - MONGO_DB_HOSTNAME=mongodb
      # in order to write logs into a file you can enable this by setting the following env variable
      # the log file(s) can be found in /var/log/ditto directory on the host machine
      # - DITTO_LOGGING_FILE_APPENDER=true
    # only needed if DITTO_LOGGING_FILE_APPENDER is set
    # volumes:
    #  - ditto_log_files:/var/log/ditto
    healthcheck:
      test: curl --fail `hostname`:7626/alive || exit 1
      interval: 30s
      timeout: 15s
      retries: 4
      start_period: 120s
    logging:
      options:
        max-size: 50m
        
  things:
    container_name: things
    image: docker.io/eclipse/ditto-things:${DITTO_VERSION:-latest}
    deploy:
      resources:
        limits:
          memory: 512m
    networks:
      vorto_ditto:
        aliases:
          - ditto-cluster
    depends_on:
      - policies
    environment:
      - TZ=Europe/Berlin
      - BIND_HOSTNAME=0.0.0.0
      # Set additional configuration options here appending JAVTOOL_OPTIONS: -Dditto.things...
      - JAVTOOL_OPTIONS=-XX:ActiveProcessorCount=2 -XX:+ExitOnOutOfMemoryError -XX:+UseContainerSupport -XX:+UseStringDeduplication -Xss512k -XX:MaxRAMPercentage=50 -XX:+UseG1GC -XX:MaxGCPauseMillis=150 -Dpekko.coordinated-shutdown.exit-jvm=on -Dpekko.cluster.shutdown-after-unsuccessful-join-seed-nodes=180s -Dpekko.cluster.failure-detector.threshold=15.0 -Dpekko.cluster.failure-detector.expected-response-after=10s -Dpekko.cluster.failure-detector.acceptable-heartbeat-pause=20s -Dpekko.cluster.downing-provider-class=
      - MONGO_DB_HOSTNAME=mongodb
      # in order to write logs into a file you can enable this by setting the following env variable
      # the log file(s) can be found in /var/log/ditto directory on the host machine
      # - DITTO_LOGGING_FILE_APPENDER=true
    # only needed if DITTO_LOGGING_FILE_APPENDER is set
    # volumes:
    #  - ditto_log_files:/var/log/ditto
    healthcheck:
      test: curl --fail `hostname`:7626/alive || exit 1
      interval: 30s
      timeout: 15s
      retries: 4
      start_period: 120s
    logging:
      options:
        max-size: 50m
        
  things-search:
    container_name: things-search
    image: docker.io/eclipse/ditto-things-search:${DITTO_VERSION:-latest}
    deploy:
      resources:
        limits:
          memory: 512m
    networks:
      vorto_ditto:
        aliases:
          - ditto-cluster
    depends_on:
      - policies
    environment:
      - TZ=Europe/Berlin
      - BIND_HOSTNAME=0.0.0.0
      # Set additional configuration options here appending JAVTOOL_OPTIONS: -Dditto.search...
      - JAVTOOL_OPTIONS=-XX:ActiveProcessorCount=2 -XX:+ExitOnOutOfMemoryError -XX:+UseContainerSupport -XX:+UseStringDeduplication -Xss512k -XX:MaxRAMPercentage=50 -XX:+UseG1GC -XX:MaxGCPauseMillis=150 -Dpekko.coordinated-shutdown.exit-jvm=on -Dpekko.cluster.shutdown-after-unsuccessful-join-seed-nodes=180s -Dpekko.cluster.failure-detector.threshold=15.0 -Dpekko.cluster.failure-detector.expected-response-after=10s -Dpekko.cluster.failure-detector.acceptable-heartbeat-pause=20s -Dpekko.cluster.downing-provider-class=
      - MONGO_DB_HOSTNAME=mongodb
      # in order to write logs into a file you can enable this by setting the following env variable
      # the log file(s) can be found in /var/log/ditto directory on the host machine
      # - DITTO_LOGGING_FILE_APPENDER=true
    # only needed if DITTO_LOGGING_FILE_APPENDER is set
    # volumes:
    #  - ditto_log_files:/var/log/ditto
    healthcheck:
      test: curl --fail `hostname`:7626/alive || exit 1
      interval: 30s
      timeout: 15s
      retries: 4
      start_period: 120s
    logging:
      options:
        max-size: 50m
        
  connectivity:
    container_name: connectivity
    image: docker.io/eclipse/ditto-connectivity:${DITTO_VERSION:-latest}
    deploy:
      resources:
        limits:
          memory: 768m
    networks:
      vorto_ditto:
        aliases:
          - ditto-cluster
    depends_on:
      - policies
    environment:
      - TZ=Europe/Berlin
      - BIND_HOSTNAME=0.0.0.0
      # if connections to rabbitmq broker are used, you might want to disable ExitOnOutOfMemoryError, because the amqp-client has a bug throwing OOM exceptions and causing a restart loop
      # Set additional configuration options here appending JAVTOOL_OPTIONS: -Dditto.connectivity...
      - JAVTOOL_OPTIONS=-XX:ActiveProcessorCount=2 -XX:+ExitOnOutOfMemoryError -XX:+UseContainerSupport -XX:+UseStringDeduplication -Xss512k -XX:MaxRAMPercentage=50 -XX:+UseG1GC -XX:MaxGCPauseMillis=150 -Dpekko.coordinated-shutdown.exit-jvm=on -Dpekko.cluster.shutdown-after-unsuccessful-join-seed-nodes=180s -Dpekko.cluster.failure-detector.threshold=15.0 -Dpekko.cluster.failure-detector.expected-response-after=10s -Dpekko.cluster.failure-detector.acceptable-heartbeat-pause=20s -Dpekko.cluster.downing-provider-class=
      - MONGO_DB_HOSTNAME=mongodb
      # in order to write logs into a file you can enable this by setting the following env variable
      # the log file(s) can be found in /var/log/ditto directory on the host machine
      # - DITTO_LOGGING_FILE_APPENDER=true
    # only needed if DITTO_LOGGING_FILE_APPENDER is set
    #volumes:
    #  - ditto_log_files:/var/log/ditto
    healthcheck:
      test: curl --fail `hostname`:7626/alive || exit 1
      interval: 30s
      timeout: 15s
      retries: 4
      start_period: 120s
    logging:
      options:
        max-size: 50m
        
  gateway:
    container_name: gateway
    image: docker.io/eclipse/ditto-gateway:${DITTO_VERSION:-latest}
    deploy:
      resources:
        limits:
          memory: 512m
    networks:
      vorto_ditto:
        aliases:
          - ditto-cluster
    depends_on:
      - policies
    ports:
      - "8081:8080"
    environment:
      - TZ=Europe/Berlin
      - BIND_HOSTNAME=0.0.0.0
      - ENABLE_PRE_AUTHENTICATION=true
      # Set additional configuration options here appending JAVTOOL_OPTIONS: -Dditto.gateway.authentication.devops.password=foobar -Dditto.gateway...
      - JAVTOOL_OPTIONS=-XX:ActiveProcessorCount=2 -XX:+ExitOnOutOfMemoryError -XX:+UseContainerSupport -XX:+UseStringDeduplication -Xss512k -XX:MaxRAMPercentage=50 -XX:+UseG1GC -XX:MaxGCPauseMillis=150 -Dpekko.coordinated-shutdown.exit-jvm=on -Dpekko.cluster.shutdown-after-unsuccessful-join-seed-nodes=180s -Dpekko.cluster.failure-detector.threshold=15.0 -Dpekko.cluster.failure-detector.expected-response-after=10s -Dpekko.cluster.failure-detector.acceptable-heartbeat-pause=20s -Dpekko.cluster.downing-provider-class=
      # in order to write logs into a file you can enable this by setting the following env variable
      # the log file(s) can be found in /var/log/ditto directory on the host machine
      # - DITTO_LOGGING_FILE_APPENDER=true
      # You may use the environment for setting the devops password
      #- DEVOPS_PASSWORD=foobar
    # only needed if DITTO_LOGGING_FILE_APPENDER is set
    # volumes:
    #  - ditto_log_files:/var/log/ditto
    healthcheck:
      test: curl --fail `hostname`:7626/alive || exit 1
      interval: 30s
      timeout: 15s
      retries: 4
      start_period: 120s
    logging:
      options:
        max-size: 50m
        
  ditto-ui:
    container_name: ditto-ui
    image: docker.io/eclipse/ditto-ui:${DITTO_VERSION:-latest}
    deploy:
      resources:
        limits:
          memory: 32m
    logging:
      options:
        max-size: 10m
    networks:
      vorto_ditto:
        aliases:
          - ditto-ui
        
  swagger-ui:
    container_name: swagger-ui
    image: docker.io/swaggerapi/swagger-ui:v5.9.1
    deploy:
      resources:
        limits:
          memory: 32m
    environment:
      - QUERY_CONFIG_ENABLED=true
    volumes:
       - ./ditto/documentation/src/main/resources/openapi:/usr/share/nginx/html/openapi:ro
       - ./ditto/documentation/src/main/resources/images:/usr/share/nginx/html/images:ro
       - ./ditto/swagger3-index.html:/usr/share/nginx/html/index.html:ro
    command: nginx -g 'daemon off;'
    logging:
      options:
        max-size: 10m
    networks:
      vorto_ditto:
        aliases:
          - swagger-ui
        
  nginx:
    container_name: nginx
    image: docker.io/nginx:1.21-alpine
    deploy:
      resources:
        limits:
          memory: 32m
    volumes:
       - ./ditto/nginx.conf:/etc/nginx/nginx.conf:ro
       - ./ditto/nginx.htpasswd:/etc/nginx/nginx.htpasswd:ro
       - ./ditto/nginx-cors.conf:/etc/nginx/nginx-cors.conf:ro
       - ./ditto/mime.types:/etc/nginx/mime.types:ro
       - ./ditto/index.html:/etc/nginx/html/index.html:ro
       - ./ditto/documentation/src/main/resources/images:/etc/nginx/html/images:ro
       - ./ditto/documentation/src/main/resources/wot:/etc/nginx/html/wot:ro
    ports:
      - "${DITTO_EXTERNAL_PORT:-8080}:80"
    depends_on:
      - gateway
      - swagger-ui
    logging:
      options:
        max-size: 10m
    networks:
      vorto_ditto:
        aliases:
          - nginx


  repository:
    depends_on:
      - "db"
    container_name: repository
    image: eclipsevorto/vorto-repo
    volumes:
      - ~/.vorto:/root/.vorto
    ports:
      - "8083:8080"
    env_file:
      - ./vorto/vorto-variables.env
    networks:
      vorto_ditto:
        aliases:
          - repository
  db:
    volumes:
       - ./opt/mysql_data:/var/lib/mysql
    container_name: db
    image: mysql
    command: --default-authentication-plugin=mysql_native_password
    env_file:
      - ./vorto/vorto-variables.env
    networks:
      vorto_ditto:
        aliases:
          - db


networks:
  vorto_ditto:
    driver: bridge

volumes:
  ditto_log_files:
    driver: local
    driver_opts:
      type: none
      device: /var/log/ditto
      o: bind,uid=1000,gid=1000

  1. I can create Policies, Things and connection in Eclipse Ditto via Postman, also in Eclipse Vorto Repository I can create Information Models, Function Bloks, ..., but I can't generate Ditto codes because the Generators section is empty "There are no generators configured" : image: Vorto Repository : There are no generators configured

Additionally, I have a couple of questions:

1. Are those Eclipse Projects still supported now (in 2024 or in futur)?

2. I know that we can control Eclipse Ditto using API, but I can't find the API documentation of Eclipse Vorto, is it exist ? and what about Eclipse Hono?

3. Is there any tutorial/demo available on configuring Eclipse Hono with Eclipse Vorto and Eclipse Vorto with Eclipse Ditto?

4. What is the role of the Bosch IoT Suite, and is it necessary for my mini project?

5. I'm facing issues with not being able to see the generators in the Eclipse Vorto Repository. Any insights into why this might be happening?

6. The website vorto.eclipse.org is not working anymore, in that website we can generate Postman scrip for device provisionig, is ther any alternative solution?

I've spent about two weeks searching for a solution to configure Eclipse Hono, Vorto, and Ditto using Docker. Most videos I've watched focus on theory and demos, lacking practical details :) .

Note: I faced some website no longer working like vorto.eclipse.org and the URLs of demos.

I appreciate any guidance or resources with hands-on information you can provide to help me overcome these challenges.

Thank you in advance!

1

There are 1 best solutions below

1
On

You do not need Vorto for running/using Hono with Ditto. In order to try out Hono and Ditto together, the Eclipse cloud2edge IoT Package will probably be the easiest way.

ad 1) The Vorto project is not being maintained actively anymore. Hono and Ditto are.

ad 2) Maybe you can try to use Google: https://www.google.com/search?q=eclipse+hono+api

ad 4) The Bosch IoT Suite is a commercial offering based on Eclipse Hono, Ditto and hawkBit.

In general, I would suggest not to spend so much time on finding ready to use solutions but spending more time understanding the core technologies and then building your solution on top.