Coder Social home page Coder Social logo

docker-g2loader-db2-cluster's Introduction

docker-g2loader-db2-cluster

โ›” Deprecated

This repository has not been updated to use the RPM/DEB installation of Senzing.

No Maintenance Intended

Overview

This Dockerfile is a wrapper over Senzing's G2Loader.py using the DB2 database cluster.

Contents

  1. Expectations
    1. Space
    2. Time
    3. Background knowledge
  2. Demonstrate
    1. Build docker image
    2. Create SENZING_DIR
    3. Set environment variables for demonstration
    4. Docker network
    5. Run docker container
  3. Develop
    1. Prerequisite software
    2. Clone repository
    3. Build docker image for development
  4. Examples
  5. Errors
  6. 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:

  1. Docker

Demonstrate

Build docker image

  1. 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

  2. Build image:

    sudo docker build \
      --tag senzing/g2loader-db2-cluster \
      https://github.com/senzing/docker-g2loader-db2-cluster.git#main

Create SENZING_DIR

  1. If you do not already have an /opt/senzing directory on your local system, visit HOWTO - Create SENZING_DIR.

Set environment variables for demonstration

  1. Identify the Senzing directory. Example:

    export SENZING_DIR=/opt/senzing
  2. 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
  3. 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
  4. 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
  5. 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

๐Ÿค” Optional: Use if docker container is part of a docker network.

  1. List docker networks. Example:

    sudo docker network ls
  2. โœ๏ธ Specify docker network. Choose value from NAME column of docker network ls. Example:

    export SENZING_NETWORK=*nameofthe_network*
  3. Construct parameter for docker run. Example:

    export SENZING_NETWORK_PARAMETER="--net ${SENZING_NETWORK}"

Run docker container

  1. 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:

  1. git
  2. make
  3. docker

Clone repository

For more information on environment variables, see Environment Variables.

  1. 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}"
  2. Follow steps in clone-repository to install the Git repository.

Build docker image for development

  1. Option #1: Using docker command and local repository.

    cd ${GIT_REPOSITORY_DIR}
    sudo docker build --tag senzing/g2loader-db2-cluster .
  2. 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

  1. See docs/errors.md.

References

docker-g2loader-db2-cluster's People

Contributors

docktermj avatar sammacy avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-g2loader-db2-cluster's Issues

Refactor to template

See Senzing/template-repository#12

Tasks

โ˜‘๏ธ Check History. In pull request, add issue number. In issue, add Pull Requests
โ˜‘๏ธ Update CHANGELOG.md
โ˜‘๏ธ Update to Dockerfile version 1.3.0
โ˜‘๏ธ Update to PULL_REQUEST_TEMPLATE.md
โ˜‘๏ธ Compare to docker-template
โ˜‘๏ธ Pull into master
โ˜‘๏ธ Close GitHub issue

Legend

๐Ÿ”ฒ Not done
โ˜‘๏ธ Done

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.