Using HCL Compass RESTful and search features in the same Docker Compose service

This quick start guide shows you how to use Docker Compose to setup and run an HCL Compass with RESTful and search features in the same Docker Compose service.

Before you begin

Note: Using HCL Compass on Docker and Docker Compose is not supported when deployed in a production environment. To use HCL Compass in a container in a production environment, deploy HCL Compass to a Kubernetes environment. For more information, see Deploying HCL Compass on SoFy Sandbox.
Before you can use HCL Compass RESTful services with search features in the same Docker Compose service, you must first:
  1. Define the RESTful services.
  2. Define environment files.
  3. Define the services in a docker-compose.yaml file.

    These steps are detailed as steps 1-3 in Getting Started with Docker Compose.

    Note:
    • Each Search configuration requires approximately 5 GB of memory. Ensure that your system has enough memory before configuring Seach with HCL Compass.
    • The Docker compose example in this document includes a two database schema connection and two search configurations. You will need at least 12 GB of memory to deploy this configuration.

About this task

You can create RESTful servcies for HCL Compass running on Docker Compose by performing the following steps:

Procedure

  1. Create an environment file for the Search feature environment variables.
    1. Create an environment file named search.env in your project directory and paste your username, user password, and user database name into the file:
      SEARCH_CONFIG_SET=[("SEARCH_CONFIG_1" "SEARCH_CONFIG_2" ..... "SEARCH_CONFIG_n")]
      Each Search configuration must be set with the following format:
       -username [Username] -password [User password] -dbset [dbset_name] -userdb [User database] -searchPort [search_port_number]
      The following example illustrates the proper configuration for a two Search configuration. In this case, one is for DefectTracking-SAMPL and the other is for EssentialSAFe-SAMPL applications:
      SEARCH_CONFIG_SET=(" -username admin -password "" -dbset DefectTracking -userdb SAMPL -searchPort 8983" "-username admin -password "" -dbset EssentialSAFe -userdb SAMPL -searchPort 8984") 
      Note: Valid parameters for the seach.env file include:
      • SEARCH_ENABLED: You can set the search configuration to enabled by setting to TRUE. Setting this value to FALSE disables the search configuration.
      • USER_NAME: The user name that is used to login to the user database. The user must have the role of admin.
      • USER_PASSWORD: The password for the login to the user database.
      • USER_DB: The user database name.
    If you need to update the default full text search properties values, you must add the SEARCH_PROPERTIES_VALUE_SET environment variable in the search.env file and set your new properties values for search1.
     SEARCH_PROPERTIES_VALUE_SET=("-IndexWorkspace <true/false> -MaxHeapSize <val> -RetryAttempts <val> -RetryAttemptsPause <val> -IncrIndexMaxHe apSize <val> -FullIndexMaxHeapSize <val> -ProcRetryAttempts <val> -ProcRetryAttemptsPause <val>")
  2. Define the service in a Docker compose file.
    1. Create a YAML file named docker-compose-search-model1.yaml in your project directory as shown below.
      version: '3'
      
      services:
        hcl-compass:
          env_file:
            - search.env         # environment variables file for the search.
      
          ports:
            - 8983:8983          # search port
            - 8994:8984          # search port
      
          volumes:
            - your_project_directory:/opt/hcl/compass/compass-rest-server-distribution/data/search

      The docker-compose-model1.yaml file updates the hcl-compass service as follows:

      • Sets environment variables defined in the search.envfile.
      • Binds the container and the host machine to the exposed ports 8983 and 8984 that you defined in the searchPort variable in the db.env file for two DefectTracking-SAMPL and EssentialSAFe-SAMPL applications.
      • Creates volume mountpoint folder location for search files.
  3. Build and run the HCL Compass application with Docker Compose
    1. From your project directory, start your application by running the following command:
      $ docker-compose -f docker-compose.yaml -f docker-compose-search-model1.yaml up -d
      
      Creating network "compass_hcl-compass" with driver "bridge"
      Creating volume "compass_hcl-compass-logs" with default driver
      Creating volume "compass_hcl-compass-config" with default driver
      Creating compass_hcl-compass_1 ... done

      Docker Compose pulls and builds the HCL Compass RESTful service and starts the hcl-compass service.

    2. After the command has been launched, you can check to see that the service and the container are started by using the following command:
      $ docker-compose --f docker-compose.yaml -f docker-compose-search-model1.yaml ps
    3. Optionally, you can view the container logs by using the following command:
      $ docker-compose -f docker-compose.yaml -f docker-compose-search-model1.yaml logs
    4. Enter http://localhost:8190/ in a browser to see the HCL Compass application running.

What to do next

After logging into the HCL Compass browser, the search box appears in the top right corner of the browser. You can now use search in HCL Compass on Docker Compose.