Building TIBCO Foresight REST API Component’s Docker Images

To run the Foresight REST API components on the Docker or Kubernetes platform, you must first build the Docker images for the components and applications.

Before you begin
  1. From TIBCO eDelivery, download the TIB_fs-restapi-1.2.0.tar.gz installation package.
  2. Extract the contents of the package to a local directory.
  3. For initial setup and additional technical details, see the README file located in the fs-restapi-1.2.0 > scripts directory.
    Procedure
  1. Navigate to the <folder>/fsrest-1.2.0/images/config directory.
  2. Open the configuration.properties file and configure the properties listed in the following table.
    Property Description
    docker_repository=<docker_registry_ip>:<docker_registry_port><docker_registry_ip> is the IP address and <docker_registry_port> is the port of the machine to which you want to push the Docker images
    docker_usernameSpecify the username required to log in to Docker
  3. Save and close the configuration.properties file.
  4. Build the Foresight REST API Foresight Instream/Foresight Translator engine as described in the previous section.

  5. Navigate to the <folder>/fsrest-1.2.0/images/scripts directory.
  6. Run the following command:

    ./build-images.sh

    If you are running the script for the first time, the following message is displayed:

    You must accept the License agreement before proceeding. Press ENTER key to read the License. Press q to finish reading.
  7. Press the Enter key to read the license agreement. Press q to finish the reading.
  8. Enter 'y' to accept the license agreement.
  9. You are now prompted to confirm the Foresight REST API engine component paths. Foresight REST API Docker image is built with the following Foresight Validation/Translation engine:

    FSRest Engine Build                        Mon Dec 11 05:49:17 EST 2023
    =======================================================================
    Instream component:   '/home/tibco/FSRest/TIBCO/Instream920/instream/9.2'  (Healthcare Version)
    Translator component: '/home/tibco/FSRest/TIBCO/Translator4.1/translator/4.1'
    Created by user:      tibco  pts/1        2023-12-11 01:18 (xx.xx.xxx.175)
    
    Proceed with this Engine? (y/n)

    Check the details. Enter 'y', if you want to proceed with this engine and 'n' if you do not want to proceed with this engine.

  10. After confirming the engine paths, you are prompted to clean up the path images/services/fsrest/misc/FSRestDirs/guidelines/ where the user might have uploaded customized guidelines and map files and copy the guidelines and maps from the Foresight REST API engine.

    Do you want to clean up the from the guidelines under the FSRest image's guidelines resource directory? Please answer (y)es or (n)o.
    Do you want to copy the guidelines from FSRest Engine? Please answer (y)es or (n)o.
    Do you want to clean up the map files under the FSRest image's maps resource directory? Please answer (y)es or (n)o.
    Do you want to copy the map files from FSRest Engine? Please answer (y)es or (n)o.
    Note: This step copy the guidelines and map files present in the Database directory of Foresight REST API engine to the container. However, coping these guidelines and map files from container to mount_path is not supported in this release.
  11. After clean-up and copying the guidelines, you are prompted to enable SSL.

    By enabling SSL, the user can call Foresight REST API through HTTPS to encrypt communication so that attackers cannot steal data.

    Do you want to enable ssl? Please answer (y)es or (n)o.
    Note: Do not select (y)es unless you intend to update the default deploy script.

    If you enter (n)o, you are directly prompted to the next step. However, if you enter (y)es, you are prompted to enter the following details related to the SSL, before you move to the next step.

    Properties Description
    keystoreFile

    This is the path where the certificate is stored in your local machine.

    < Path to the file > / <keystore-filename>

    keystoreType

    Keystore type

    PKSCS12 or JKS

    keystorePass

    Keystore password

    Note: If you enable SSL, Foresight REST API runs on HTTPS with port 8443. While running the docker image, ensure that you map port 8443 instead of 8080.
    Note: This release of Foresight REST API only supports server-side SSL authentication.
  12. After enableSSL confirmation, you are prompted to configure the API key. An API Key security is a code used to authenticate an application.

    Do you want to secure with API key? Please answer (y)es or (n)o

    If you enter (n)o, you are directly prompted to the next step. However, if you enter (y)es, you are prompted to enter the following details related to the key, before you move to the next step.

    Note: Enabling this requires the application to use a valid API key to communicate with Foresight REST API. Do not select (y)es unless BCCE supports this.
    Property Description
    jdbc.platform

    MYSQL or Oracle

    If you are using an Oracle database, add its connector lib path to the database.driver.path

    jdbc.driver Database driver URL
    jdbc.url Database connection URL
    jdbc.username Database username
    jdbc.password Database password
    jdbc.databasename Database name for MYSQL database
    APIKeyExpireTime Expire time (in seconds) for API key
  13. In the next step, you are prompted to enter the docker password for the details entered in the configuration.properties file. Enter the password.

    Note: This step is optional and the prompt comes only when you have provided the docker_repository.
    ##############################################################################
    Login to xx.xx.x.xxx:5000
    ##############################################################################
    
    Password:
  14. Once you log in, you are prompted to push the docker images to the Docker repository.

    Login Succeeded
    Do you want to push the TIBCO Foresight REST API docker image to 10.65.6.152:5000?
    If not, the TIBCO Foresight REST API docker image will still be built at 'local'.
    (y/n)

    Enter 'y' or 'n' as per the following requirements:

    • If you enter 'y', the Foresight REST API docker image is built and pushed to the Docker repository.

    • If you enter 'n', the Foresight REST API docker image is built locally.

ResultThe Foresight REST API component’s Docker image is built and pushed to the Docker repository.