Skip to content

industrial-edge/device-kit-ntp-service

Repository files navigation

Introduction

The IE Device Kit API provides the abstraction layer that decouples the Industrial Edge Runtime from the underlying Linux systems. This allows to adapt the runtime and its behavior to serve for the specific needs of different Industrial Edge products.

The IE Device Kit API is based on gRPC which provides a modern intermediate process communication style for building distributed applications and microservices. The Industrial Edge platform provides and maintains the protobuf specification files for the APIs contained in the IE Device Kit. These protobuf specifications can be used to create stub implementations for both client and server in various programming languages. The Industrial Edge Runtime ships with a client side implementation of these APIs and expects the host system to provide a server side implementation.

Purpose of these repositories is to share reference implementation of IE Device Kit APIs. You can use existing implementation or adapt it based on your needs.

IEDK Ntp Service

NTP Service is a gRPC & Go based NTP configurator microservice for Edge Devices.

Overview

Ntp Service is developed in the go programming language and gRPC. More information can be found here. The Ntp service runs as a systemd service within the device that has a debian-based operating system.

Getting Started

Prerequisities

  • Setting up Go
  • Additional requirements to run or develop the project

Building the service and know-how about other features

Instructions how to build the deb package:

  • For generating a deb package, goreleaser tool is heavily used. For proper execution, goreleaser needs a TAG identifier which indicates version of the deb package. TAG must obey the semantic versioning rules and must include ${major}.${minor}.${hotfix} release identifiers. Only two commands are needed for generating deb package: cd build/package, TAG=X.Y.Z make deb After running these commands, a dist directory will be created under the build/package directory and the deb package will be in dist directory. To install this generated deb package on the device as a daemon cd dist, sudo apt install ./dm-ntp_X.Y.Z_linux_amd64.deb

Instructions how to use the make command:

  • There is a Makefile file under the build/package directory. Unit tests, code coverage and many other similar features can be used via this Makefile. The following commands are used to view all features: cd build/package, make help

Running the service

To see the status and logs of the deb package running as daemon(systemd service) directly from the command line, the following commands are run: systemctl status dm-ntp, journalctl -fu dm-ntp

FAQ

How do I verify dependencies and download them?

The ntp microservice is dependent on the ntpsec service and the ntpq binary. The following command is run to verify that these dependencies exist within the device.

dpkg -l | egrep "ii  ntpsec"
ntpq --version

If you get an output after running the command, these dependencies already installed on device.

If these dependencies are not installed in the device, installation can be performed with the following commands.

sudo apt-get update
sudo apt-get install ntpsec
// The ntpq binary will come by default when ntpsec is installed.

Contributing IE Device Kit Repository

Please check our contribution guideline.

Contribution License Agreement

If you haven't previously signed the Siemens Contributor License Agreement (CLA), the system will automatically prompt you to do so when you submit your Pull Request. This can be conveniently done through the CLA Assistant's online platform. Once the CLA is signed, your Pull Request will automatically be cleared and made ready for merging if all other test stages succeed.

How to be part of Siemens Industrial Edge Ecosystem

Please check this page to learn more information about Industrial Edge.