Overview
This article outlines how to quickly set up and use Senzing with Podman using the example Docker container images on RHEL8. Podman is able to build Docker container images. With the new example Docker images built on the senzingapi-runtime Linux package (available since Senzing 3.2), running and building your own Podman or Docker images is very simple.
These instructions are experimental. They have been tested on RHEL8, but Podman deployments can be finicky depending on your environment. If you require any assistance when following this guide, please reach out to support for free help!
Prerequisites
- A PostgreSQL database setup per this article and the username, password, IP address, port, and database name needed to connect.
- RHEL8 with Podman installed
- To run the Podman commands without sudo, you will need to configure Podman namespaces
- If your userid is not a member of the Podman group and you use sudo to run the Podman command, you must use sudo --preserve-env to persist the environment variables in the sudo session:
-
sudo --preserve-env podman run ...
- Access to container registries to pull images
- Senzing supports air-gapped deployments, but this quickstart won't cover pulling the images for offline use. Those running air-gapped deployments should be familiar with that already.
Getting it Done!
Set up the Environment
The Senzing engine configuration used in the new container images is set via the SENZING_ENGINE_CONFIGURATION_JSON environment variable. To set the environment variable, run the following command in your environment, replacing the CONNECTION details with those of your database:
export SENZING_ENGINE_CONFIGURATION_JSON="{
\"PIPELINE\" : {
\"CONFIGPATH\" : \"/etc/opt/senzing\",
\"RESOURCEPATH\" : \"/opt/senzing/g2/resources\",
\"SUPPORTPATH\" : \"/opt/senzing/data\"
},
\"SQL\" : { \"CONNECTION\" : \"postgresql://username:password@localhost:5432:G2\"}
}"
Initialize
It takes about 30 seconds to initialize the Senzing database with a single Podman command:
podman run -e SENZING_ENGINE_CONFIGURATION_JSON -e SENZING_SUBCOMMAND=mandatory -it --log-level=debug --network=host --rm senzing/init-postgresql
Important to note, Senzing doesn't require schema or configuration changes within the same major product version (e.g, any 3.x version), you don't need to repeat this step again. "Upgrading" is merely running the new version of any container using this Senzing database.
DONE! Yes, REALLY
At this point, the Senzing database is initialized.
Use Senzing!
To run the senzingapi-tools container to utilize G2Explorer.py, G2ConfigTool.py, or G2Command.py, run the following command:
podman run -e SENZING_ENGINE_CONFIGURATION_JSON -it --log-level=debug --network=host --rm senzing/senzingapi-tools
Or the demonstrable web application:
podman run --detach -e SENZING_ENGINE_CONFIGURATION_JSON -it --log-level=debug --network=host -p 8251:8251 -p 8250:8250 --rm senzing/web-app-demo
Start developing
Members of our team have made some GitHub projects that show more of what you can do quickly:
- API reference documentation
- 3 API Calls
- Task based code-snippets
- Streamlined SQS, RabbitMQ, and Redo processing examples
Other stuff you can do
Loading the Truth Set Data
To get started with some data, load the Senzing example truthset by:
- Download the Senzing example truthset JSON files
- Add the data sources that the files use to the Senzing configuration
- Load the files using senzing/file-loader via Podman
Download the files
wget https://raw.githubusercontent.com/Senzing/truth-sets/main/truthsets/demo/customers.json
wget https://raw.githubusercontent.com/Senzing/truth-sets/main/truthsets/demo/reference.json
wget https://raw.githubusercontent.com/Senzing/truth-sets/main/truthsets/demo/watchlist.json
Add the data sources
$ podman run -e SENZING_ENGINE_CONFIGURATION_JSON -it --log-level=debug --network=host --rm senzing/senzingapi-tools
# G2ConfigTool.py
Initializing Senzing engines...
Welcome to G2Config Tool. Type help or ? to list commands.
(g2cfg) addDataSource CUSTOMERS
Successfully added!
(g2cfg) addDataSource REFERENCE
Successfully added!
(g2cfg) addDataSource WATCHLIST
Successfully added!
(g2cfg) save
WARNING: This will immediately update the current configuration in the Senzing repository with the current configuration!
Are you certain you wish to proceed and save changes? (y/n) y
Configuration saved to Senzing repository.
Initializing Senzing engines...
(g2cfg) quit
# exit
exit
Load the Files
Keep in mind that the file path is from the perspective of the Podman container and this example script requires the location of the files (${PWD} in this case) to be mapped into /input inside the container.
podman run -it --log-level=debug -e SENZING_ENGINE_CONFIGURATION_JSON -e SENZING_INPUT_FILE=/input/customers.json --network=host --rm -u $UID --volume ${PWD}:/input --volume ${PWD}:/output senzing/file-loader
podman run -it --log-level=debug -e SENZING_ENGINE_CONFIGURATION_JSON -e SENZING_INPUT_FILE=/input/reference.json --network=host --rm -u $UID --volume ${PWD}:/input --volume ${PWD}:/output senzing/file-loader
podman run -it --log-level=debug -e SENZING_ENGINE_CONFIGURATION_JSON -e SENZING_INPUT_FILE=/input/watchlist.json --network=host --rm -u $UID --volume ${PWD}:/input --volume ${PWD}:/output senzing/file-loader
Explore the results
$ podman run -e SENZING_ENGINE_CONFIGURATION_JSON -it --log-level=debug --network=host --rm senzing/senzingapi-tools # G2Explorer.py ____| __ \ \ __| | | _ \ Senzing G2 | | | ___ \ Exploratory Data Analysis _____| ____/ _/ _\ Type help or ? to list commands. (g2) get CUSTOMERS 1070 Entity summary for entity 556800056: Jie Wang ┌───────────┬───────────────────────────────┬─────────────────┐ │ Record ID │ Entity Data │ Additional Data │ ├───────────┼───────────────────────────────┼─────────────────┤ │ CUSTOMERS │ PRIMARY: Wang Jie │ AMOUNT: 100 │ │ 1069 │ NATIVE: 王杰 │ AMOUNT: 200 │ │ 1070 │ DOB: 9/14/93 │ DATE: 1/26/18 │ │ │ GENDER: M │ DATE: 1/27/18 │ │ │ GENDER: Male │ STATUS: Active │ │ │ RECORD_TYPE: PERSON │ │ │ │ NATIONAL_ID: 832721 │ │ │ │ NATIONAL_ID: 832721 Hong Kong │ │ │ │ HOME: 12 Constitution Street │ │ ├───────────┼───────────────────────────────┼─────────────────┤ │ REFERENCE │ PRIMARY: Wang Jie │ CATEGORY: Owner │ │ 2013 │ DOB: 1993-09-14 │ STATUS: Current │ │ │ RECORD_TYPE: PERSON │ │ └───────────┴───────────────────────────────┴─────────────────┘ 1 related entities ┌───────────┬──────────────────────────┬───────────────┬────────────────────┬────────────────────────┐ │ Entity ID │ Entity Name │ Data Sources │ Match Level │ Match Key │ ├───────────┼──────────────────────────┼───────────────┼────────────────────┼────────────────────────┤ │ 91 │ Hajah Mamunah Jln Pisang │ CUSTOMERS (1) │ Disclosed Relation │ REL_POINTER(OWNS 60%:) │ │ │ │ REFERENCE (1) │ │ │ └───────────┴──────────────────────────┴───────────────┴───────
Comments
0 comments
Please sign in to leave a comment.