Attention

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

Microservice: EC Protocol Bridge & Plugins

The following section describes how to integrate a containerized Edge Control Protocol Bridge with plugins. These instructions assume an existing ECI installation, familiarity with building Docker containers and running the Edge Control Protocol Bridge.

Building: EC Protocol Bridge Container

The following section is applicable to:

../../_images/linux5.png

The following steps detail how to build a Docker image which contains the Edge Control Protocol Bridge with plugins.

  1. If not already completed, follow section Prepare the Build System for Microservices to prepare the build system.

  2. Open a terminal on the build system and navigate to the extracted Dockerfiles directory. The contents of this directory should be as follows:

    $ ls
    application-containers  bpf  display-containers  softplc-containers
    
  3. Navigate to the application-containers directory. The contents of this directory should be as follows:

    $ ls
    ec-protocol-bridge  tsn-vnet-txtime-assisted  web-browser
    
  4. Navigate to the ec-protocol-bridge directory. The contents of this directory should be as follows:

    $ ls
    assets  build.sh  Dockerfile  README.md
    
  5. Execute 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, there will be a Docker image that has generated and tarballed:

    Docker Image archive name

    Description of Docker Image

    ec-protocol-bridge.tar

    Docker image which contains the EC Protocol Bridge and all the available plugins.

Executing: EC Protocol Bridge Container

The following section is applicable to:

../../_images/target5.png
  1. Ensure that the Docker daemon is active. Run the following command to restart the Docker daemon.

    Warning

    All running Docker containers will also restart.

    $ systemctl restart docker
    

    The status of the Docker daemon can be verified with the following command:

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

  3. Load the copied Docker image by performing the following command:

    $ docker load < ec-protocol-bridge.tar
    
  4. Check which Docker images are present on the target system with the following command:

    $ docker images
    

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

    For example, on our system the output is as follows:

    $ docker images
    REPOSITORY            TAG                 IMAGE ID            CREATED             SIZE
    ec-protocol-bridge    v2.0                4297400814be        49 seconds ago      913MB
    
  5. Run the container with the following command, where <container> and <tag> correspond to the value on the target system:

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

    For example, on our system we performed the following command:

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

Customizing: EC Protocol Bridge Container

The following section is applicable to:

../../_images/linux5.png

The following steps detail how to customer the Docker image which contains the Edge Control Protocol Bridge with plugins.

  1. If not already completed, follow section Prepare the Build System for Microservices to prepare the build system.

  2. Open a terminal on the build system and navigate to the extracted Dockerfiles directory. The contents of this directory should be as follows:

    $ ls
    application-containers  bpf  display-containers  softplc-containers
    
  3. Navigate to the application-containers directory. The contents of this directory should be as follows:

    $ ls
    ec-protocol-bridge  tsn-vnet-txtime-assisted  web-browser
    
  4. Navigate to the ec-protocol-bridge directory. The contents of this directory should be as follows:

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

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

    ENTRYPOINT ["ec-bridge", "/opt/ec-protocol-bridge/config/custom_config.yaml"]
    
  7. Follow the steps from Building: EC Protocol Bridge Container to build the EC Protocol Bridge container.

  8. Follow the steps from Executing: EC Protocol Bridge Container to execute the EC Protocol Bridge container.