Skip to content

senzing-garage/configurator

Repository files navigation

configurator

If you are beginning your journey with Senzing, please start with Senzing Quick Start guides.

You are in the Senzing Garage where projects are "tinkered" on. Although this GitHub repository may help you understand an approach to using Senzing, it's not considered to be "production ready" and is not considered to be part of the Senzing product. Heck, it may not even be appropriate for your application of Senzing!

Synopsis

The configurator.py python script is used to configure Senzing via HTTP. The senzing/configurator docker image is a wrapper for use in docker formations (e.g. docker-compose, kubernetes).

Overview

To see all of the subcommands, run:

$ ./configurator.py
usage: configurator.py [-h] {service,sleep,version,docker-acceptance-test} ...

Perform Senzing configuration. For more information, see
https://github.com/senzing-garage/configurator

positional arguments:
  {service,sleep,version,docker-acceptance-test}
                        Subcommands (SENZING_SUBCOMMAND):
    service             Receive HTTP requests.
    sleep               Do nothing but sleep. For Docker testing.
    version             Print version of configurator.py.
    docker-acceptance-test
                        For Docker acceptance testing.

optional arguments:
  -h, --help            show this help message and exit

To see the options for a subcommand, run commands like:

./configurator.py service --help

Contents

  1. Demonstrate using Docker
    1. Set environment variables for Docker
    2. Run Docker container
  2. Demonstrate using docker-compose
    1. Download artifacts
    2. Prerequisite docker-compose stack
    3. Bring up docker-compose stack
  3. Demonstrate using Command Line
    1. Install
    2. Set environment variables for command line
    3. Run command
  4. Configuration
  5. References

Legend

  1. 🤔 - A "thinker" icon means that a little extra thinking may be required. Perhaps you'll need to make some choices. Perhaps it's an optional step.
  2. ✏️ - A "pencil" icon means that the instructions may need modification before performing.
  3. ⚠️ - A "warning" icon means that something tricky is happening, so pay attention.

Expectations

  • Space: This repository and demonstration require 6 GB free disk space.
  • Time: Budget 40 minutes to get the demonstration up-and-running, depending on CPU and network speeds.
  • Background knowledge: This repository assumes a working knowledge of:

Demonstrate using Docker

Set environment variables for Docker

  1. Construct URL to database containing Senzing data. Example:

    export SENZING_DATABASE_URL="postgresql://username:password@hostname:5432/G2"

Run Docker container

  1. Run docker container. Example:

    docker run \
      --env SENZING_DATABASE_URL \
      --publish 8253:8253 \
      --rm \
      senzing/configurator
    
  2. To try it out, see Test.

Demonstrate using docker-compose

Download artifacts

  1. Specify a new directory to place artifacts in. Example:

    export SENZING_VOLUME=~/my-senzing
    
  2. Create directories. Example:

    export PGADMIN_DIR=${SENZING_VOLUME}/pgadmin
    export POSTGRES_DIR=${SENZING_VOLUME}/postgres
    export RABBITMQ_DIR=${SENZING_VOLUME}/rabbitmq
    export SENZING_UID=$(id -u)
    export SENZING_GID=$(id -g)
    mkdir -p ${PGADMIN_DIR} ${POSTGRES_DIR} ${RABBITMQ_DIR}
    chmod -R 777 ${SENZING_VOLUME}
    
  3. Download artifacts. Example:

    wget \
      -O ${SENZING_VOLUME}/docker-compose-backing-services-only.yaml \
      "https://raw.githubusercontent.com/Senzing/docker-compose-demo/main/resources/postgresql/docker-compose-rabbitmq-postgresql-backing-services-only.yaml"
    
    wget \
      -O ${SENZING_VOLUME}/docker-compose.yaml \
      "https://raw.githubusercontent.com/Senzing/configurator/main/docker-compose.yaml"
    

Prerequisite docker-compose stack

  1. Bring up a Docker Compose stack with backing services. Example:

    docker-compose -f ${SENZING_VOLUME}/docker-compose-backing-services-only.yaml pull
    docker-compose -f ${SENZING_VOLUME}/docker-compose-backing-services-only.yaml up
    

Bring up docker-compose stack

  1. Download docker-compose.yaml file and deploy stack. Note: SENZING_VOLUME needs to be set. Example:

    docker-compose -f ${SENZING_VOLUME}/docker-compose.yaml pull
    docker-compose -f ${SENZING_VOLUME}/docker-compose.yaml up
    
  2. To try it out, see Test.

Demonstrate using Command Line

Install

  1. Install prerequisites:
    1. Debian-based installation - For Ubuntu and others
    2. RPM-based installation - For Red Hat, CentOS, openSuse and others.

Set environment variables for command line

  1. ✏️ Identify where senzing/apt placed the Senzing directories. Example:

    export SENZING_DATA_VERSION_DIR=/opt/senzing/data/3.0.0
    export SENZING_ETC_DIR=/etc/opt/senzing
    export SENZING_G2_DIR=/opt/senzing/g2
    export SENZING_VAR_DIR=/var/opt/senzing
  2. ✏️ Identify database. Example:

    export SENZING_DATABASE_URL="sqlite3://na:na@${SENZING_VAR_DIR}/sqlite/G2C.db"
  3. Set environment variables. Example:

    export SENZING_CONFIG_PATH=${SENZING_ETC_DIR}
    export SENZING_SUPPORT_PATH=${SENZING_DATA_VERSION_DIR}
    export PYTHONPATH=${SENZING_G2_DIR}/python
    export LD_LIBRARY_PATH=${SENZING_G2_DIR}/lib:${SENZING_G2_DIR}/lib/debian
    

Run command

  1. Run command. Note: GIT_REPOSITORY_DIR needs to be set. Example:

    cd ${GIT_REPOSITORY_DIR}
    ./configurator.py service
    
  2. To try it out, see Test.

Configuration

Configuration values specified by environment variable or command line parameter.

References

  1. Development
  2. Errors
  3. Examples
  4. Related artifacts:
    1. DockerHub
    2. Helm Chart