MOD10: DNS SD to OI4 Service Registry Interface - GoranErdeljan/TINF19C-Team-4-Service-Registry GitHub Wiki

Created by Benedict Wetzel

1. Introduction

This module binds the submodules MOD11, MOD12 and MOD13. It contains the main.js file, which is the entrypoint of the application and the Dockerfile, which is used to build the Docker-Image of the application.

2. Requirements

The following requirements are covered by this module:

3. Prerequisites

In order to use this module the following prerequisites should be met:

  • The developer should have a working computer that can access the internet
  • The developer should use a Linux-based OS
  • The developer should have Docker version 20.10.2 or higher installed
  • The developer should have NPM version 7.10.0 or higher installed
  • The developer should have at least some basic experience with Node.js

4. Dependencies

This module depends on the following sub-modules:

5. Technical overview

The file main.js is the entry point of the main docker application. It imports the sub-modules MOD11, MOD12 and MOD13 using the require operator.

The module is responsible for reading the configuration from the environment variables and starts the sub-modules depending on the configuration. The addCallback-function is used to pass found DNS-SD entries from the DNS-SD-Listener to the sub-module that adds the the services to the OI4-Service-Registry. To do so, MOD13 is used to build the Master-Asset-Model from the TXT-Records.

The Dockerfile builds a Docker-Image based on main.js and the modules MOD11, MOD12 and MOD13. When building the Docker-Image, the docker build command will run npm install for each submodule that requires NPM-packages, to install the needed dependencies.