Attention

You are viewing an older version of the documentation. The latest version is v3.3.

Microservice: EC Protocol Bridge and Plugins

The following section describes the procedure to integrate a containerized Edge Control Protocol Bridge with plugins. These instructions assume that you have an existing ECI installation and you are familiar with building Docker containers and running the Edge Control Protocol Bridge.

Build EC Protocol Bridge Container

The following section is applicable to:

../../_images/linux1.png

Do the following to build a Docker* image that contains the Edge Control Protocol Bridge with plugins.

  1. If not already completed, Prepare Build System for Microservices.

  2. Open a terminal on the build system and navigate to the extracted Dockerfiles directory. This directory should contain the following:

    $ ls
    application-containers  softplc-containers
    
  3. Navigate to the application-containers directory. This directory should contain the following:

    $ ls
    ec-protocol-bridge
    
  4. Navigate to the ec-protocol-bridge directory. This directory should contain the following:

    $ ls
    build.sh  Dockerfile  README.md
    
  5. Run the build.sh script, located in this directory, to build the EC Protocol Bridge Docker* image:

    /bin/bash build.sh
    

    After the build has completed successfully, Docker* images would have been generated and tarballed.

    Docker* Image Archive Name

    Description of Docker* Image

    ec-protocol-bridge.tar

    Contains the EC Protocol Bridge and the available plugins

Execute EC Protocol Bridge Container

The following section is applicable to:

../../_images/target4.png
  1. Install Docker if not already done.

  2. Ensure that the Docker* daemon is active. Restart the Docker* daemon:

    Warning: All Docker* containers that are currently running will also restart.

    $ systemctl restart docker
    
  3. Verify the status of the Docker* daemon:

    $ systemctl status docker
    
  4. Copy the Docker* image created earlier to the target system.

  5. Load the copied Docker* image:

    $ docker load < ec-protocol-bridge.tar
    
  6. Check the Docker* images that are present on the target system:

    $ docker images
    

    The EC Protocol Bridge image that was loaded should be present in the list. Note down the name and tag of the image.

    Here is a sample output:

    $ docker images
    REPOSITORY            TAG                 IMAGE ID            CREATED             SIZE
    ec-protocol-bridge    v2.0                4297400814be        49 seconds ago      913MB
    
  7. Run the container. Note that <container> and <tag> correspond to the values on the target system:

    $ docker run -it --cap-add IPC_LOCK --network host <container>:<tag>
    

    For example, here is the command to run the EC Protocol Bridge container:

    $ docker run --cap-add IPC_LOCK --network host --rm ec-protocol-bridge:v2.0
    

Customize EC Protocol Bridge Container

The following section is applicable to:

../../_images/linux1.png

Do the following to customize the Docker* image that contains the Edge Control Protocol Bridge with plugins.

  1. If not already completed, Prepare Build System for Microservices.

  2. Open a terminal on the build system and navigate to the extracted Dockerfiles directory. This directory should contain the following:

    $ ls
    application-containers  softplc-containers
    
  3. Navigate to the application-containers directory. This directory should contain the following:

    $ ls
    ec-protocol-bridge
    
  4. Navigate to the ec-protocol-bridge directory. This directory should contain the following:

    $ ls
    build.sh  Dockerfile  README.md
    
  5. Add a custom YAML file to the ./assets/config directory. This file will be used by the EC Protocol Bridge.

  6. Open Dockerfile in a text editor, and modify the line that contains the ENTRYPOINT definition to point to the YAML configuration file added in the previous step. For example:

    ENTRYPOINT ["ec-bridge", "/opt/ec-protocol-bridge/config/custom_config.yaml"]
    
  7. Build the EC Protocol Bridge container.

  8. Execute the EC Protocol Bridge container.