Installing the new device service


The installation process for a device service using the BMC Helix Edge Software Development Kit (SDK) involves several steps for seamless integration and operation in the BMC Helix Edge ecosystem.

Before you begin

  • Make sure that you have a BMC Helix Edge instance. 
  • Gather necessary information about the device service, including communication protocols, device-specific parameters, and any required configurations.

To install a new device service

  1. Use the BMC Helix Edge SDK to build a device service container image customized to the specific requirements of the device.
  2. Modify the Docker Compose file (docker-compose-node.yaml) to include the service definition for the newly built device service.
  3. Add essential configuration parameters, entry points, volumes, and startup commands to the service definition in the Docker Compose file.
    Adhere to a consistent naming convention by prefixing the service, container, and host names with device-. For example: device-rest
  4. Append the service name and associated IP address (127.0.0.1) to the /etc/hosts file on the node machine.
    This step ensures proper name resolution.
  5. Start the service by executing the command: 

    make run env=node <service name>

    This command starts and operationalizes the device service in the BMC Helix Edge environment.

Sample Docker Compose entry

This sample Docker Compose entry showcases the configuration for a device service named device-xyz, including command parameters, environment variables, network settings, and volume mappings.

yaml
device-xyz:
  command: /device-xyz -cp=consul.http://${CURRENT_HEDGE_NODE_SERVER_NAME}:8500 --registry --confdir=/res
 container_name: device-xyz
  entrypoint:
    - /tmp/hedge-scripts/hedge_device_service_wait_install.sh
  environment:
    <<: *x-edgex-env-variables
    SERVICE_HOST: device-xyz
  hostname: device-xyz
  image: ${REGISTRY}hedge-device-xyz:${DOCKER_TAG:-latest}
  networks:
    - edgex-network
  ports:
    - "127.0.0.1:<service port>:<service port>"
  read_only: true
  restart: always
  security_opt:
    - no-new-privileges:true
  user: 2002:2001
  volumes:
    - edgex-init:/edgex-init:ro,z
    - hedge-scripts:/tmp/hedge-scripts:ro,z
    - /tmp/edgex/secrets/device-xyz:/tmp/edgex/secrets/device-xyz:ro,z

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*