docker-g2loader-db2-cluster
โ Deprecated
This repository has not been updated to use the RPM/DEB installation of Senzing.
Overview
This Dockerfile is a wrapper over Senzing's G2Loader.py using the DB2 database cluster.
Contents
Legend
๐ค - 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.โ๏ธ - A "pencil" icon means that the instructions may need modification before performing.โ ๏ธ - 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
Build docker image
-
If
senzing/python-db2-cluster-base
image is not in local docker repository, it must be built manually. Follow the build instructions at github.com/Senzing/docker-python-db2-cluster-base -
Build image:
sudo docker build \ --tag senzing/g2loader-db2-cluster \ https://github.com/senzing/docker-g2loader-db2-cluster.git#main
Create SENZING_DIR
- If you do not already have an
/opt/senzing
directory on your local system, visit HOWTO - Create SENZING_DIR.
Set environment variables for demonstration
-
Identify the Senzing directory. Example:
export SENZING_DIR=/opt/senzing
-
Identify the host and port running DB2 server. Example:
sudo docker ps # Choose value from NAMES column of docker ps export DB2_HOST_CORE=docker-container-name-1 export DB2_HOST_RES=docker-container-name-2 export DB2_HOST_LIBFE=docker-container-name-3
export DB2_PORT_CORE=50000 export DB2_PORT_RES=50000 export DB2_PORT_LIBFE=50000
-
Identify the database username and password. Example:
export DB2_USERNAME_CORE=db2inst1 export DB2_USERNAME_RES=db2inst1 export DB2_USERNAME_LIBFE=db2inst1 export DB2_PASSWORD_CORE=db2inst1 export DB2_PASSWORD_RES=db2inst1 export DB2_PASSWORD_LIBFE=db2inst1
-
Identify the database that is the target of the SQL statements. Example:
export DB2_DATABASE_ALIAS_CORE=G2_CORE export DB2_DATABASE_ALIAS_RES=G2_RES export DB2_DATABASE_ALIAS_LIBFE=G2_LIBFE
-
Identify the Docker network of the DB2 database. Example:
sudo docker network ls # Choose value from NAME column of docker network ls export DB2_NETWORK=nameofthe_network
Docker network
-
List docker networks. Example:
sudo docker network ls
-
โ๏ธ Specify docker network. Choose value from NAME column ofdocker network ls
. Example:export SENZING_NETWORK=*nameofthe_network*
-
Construct parameter for
docker run
. Example:export SENZING_NETWORK_PARAMETER="--net ${SENZING_NETWORK}"
Run docker container
-
Run the docker container.
sudo docker run -it \ --env SENZING_CORE_DATABASE_URL="db2://${DB2_USERNAME_CORE}:${DB2_PASSWORD_CORE}@${DB2_HOST_CORE}:${DB2_PORT_CORE}/${DB2_DATABASE_ALIAS_CORE}" \ --env SENZING_RES_DATABASE_URL="db2://${DB2_USERNAME_RES}:${DB2_PASSWORD_RES}@${DB2_HOST_RES}:${DB2_PORT_RES}/${DB2_DATABASE_ALIAS_RES}" \ --env SENZING_LIBFE_DATABASE_URL="db2://${DB2_USERNAME_LIBFE}:${DB2_PASSWORD_LIBFE}@${DB2_HOST_LIBFE}:${DB2_PORT_LIBFE}/${DB2_DATABASE_ALIAS_LIBFE}" \ --volume ${SENZING_DIR}:/opt/senzing \ ${SENZING_NETWORK_PARAMETER} \ senzing/g2loader-db2-cluster \ --purgeFirst \ --projectFile /opt/senzing/g2/python/demo/sample/project.csv
Develop
Prerequisite software
The following software programs need to be installed:
Clone repository
For more information on environment variables, see Environment Variables.
-
Set these environment variable values:
export GIT_ACCOUNT=senzing export GIT_REPOSITORY=docker-g2loader-db2-cluster export GIT_ACCOUNT_DIR=~/${GIT_ACCOUNT}.git export GIT_REPOSITORY_DIR="${GIT_ACCOUNT_DIR}/${GIT_REPOSITORY}"
-
Follow steps in clone-repository to install the Git repository.
Build docker image for development
-
Option #1: Using
docker
command and local repository.cd ${GIT_REPOSITORY_DIR} sudo docker build --tag senzing/g2loader-db2-cluster .
-
Option #2: Using
make
command.cd ${GIT_REPOSITORY_DIR} sudo make docker-build
Note:
sudo make docker-build-development-cache
can be used to create cached docker layers.
Examples
Errors
- See docs/errors.md.