i2 Analyze Tool
An i2 Analyze Tool container is an ephemeral container that is used to run the i2 Analyze tools. For more information about the tools, see i2 Analyze tools.
Building the i2 Analyze Tool image
The i2 Analyze Tool image is built from the Dockerfile in images/i2a_tools.
The image contains the i2-tools & scripts folder from the toolkit.
Docker build command
The following docker build command builds the i2 Analyze Tool image:
docker image build -t "i2a_tools_redhat:4.4.6" "images/i2a_tools"
For examples of the build commands, see build-images script.
Running an i2 Analyze Tool container
An i2 Analyze Tool container uses the i2 Analyze Tool image. In the docker run command, you can use -e to pass environment variables to the container. The environment variables are described in environment variables
The default user is called i2analyze with User ID and Group ID 1000 (this can be changed with the USER_ID and GROUP_ID env variables).
For more information about the command, see docker run reference.
Docker run command
The following docker run command runs an i2 Analyze Tool container:
docker run \
--rm \
--network "eia" \
-v "/home/<user-name>/analyze-deployment-tooling/examples/pre-prod/configuration:/opt/configuration" \
-v "/home/<user-name>/analyze-deployment-tooling/examples/pre-prod/database-scripts/generated:/opt/databaseScripts/generated" \
-e USER_ID="$(id -u)" -e GROUP_ID="$(id -g)" \
-e LIC_AGREEMENT="ACCEPT" \
-e ZK_HOST="zk1.eia:2281,zk2.eia:2281,zk3.eia:2281" \
-e DB_DIALECT="sqlserver" \
-e DB_SERVER="sqlserver.eia" \
-e DB_PORT=1433 \
-e DB_NAME="ISTORE" \
-e CONFIG_DIR="/opt/configuration" \
-e GENERATED_DIR="/opt/databaseScripts/generated" \
-e DB_USERNAME="dba" \
-e DB_PASSWORD="DBA_PASSWORD" \
-e DB_OS_TYPE="UNIX" \
-e DB_INSTALL_DIR="/opt/mssql-tools" \
-e DB_LOCATION_DIR="/var/opt/mssql/data" \
-e SOLR_ADMIN_DIGEST_USERNAME="solr" \
-e SOLR_ADMIN_DIGEST_PASSWORD="SOLR_ADMIN_DIGEST_PASSWORD" \
-e ZOO_DIGEST_USERNAME="solr" \
-e ZOO_DIGEST_PASSWORD="ZOO_DIGEST_PASSWORD" \
-e ZOO_DIGEST_READONLY_USERNAME="readonly-user" \
-e ZOO_DIGEST_READONLY_PASSWORD="ZOO_DIGEST_READONLY_PASSWORD" \
-e DB_SSL_CONNECTION="true" \
-e SOLR_ZOO_SSL_CONNECTION="true" \
-e SSL_PRIVATE_KEY="SSL_PRIVATE_KEY" \
-e SSL_CERTIFICATE="SSL_CERTIFICATE" \
-e SSL_CA_CERTIFICATE="SSL_CA_CERTIFICATE" \
-e SSL_ADDITIONAL_TRUST_CERTIFICATES="/run/secrets/additional_trust_certificates.cer" \
"i2a_tools_redhat:4.4.6" "$@"
The local user ID is required so that a user is created in the Docker container with a USER_ID that is the same as the local user. The user is required to ensure that the local user can access any files that are generated on the container. The value of $id comes from your shell.
Bind mounts
Configuration:
The i2 Analyze Tool container requires the i2 Analyze configuration. To access the configuration, theconfigurationdirectory must be mounted into the container. TheCONFIG_DIRenvironment variable must specify the location where the configuration is mounted.Generated scripts directory:
Some of the i2 Analyze tools generate scripts to be run against the Information Store database, or run scripts that were generated by other i2 Analyze tools. For the i2 Analyze Tool container to interact with these scripts, the directory where they are generated must be mounted into the container.
In the example scripts, this is defaulted to/database-scripts/generated. TheGENERATED_DIRenvironment variable must specify the location where the generated scripts are mounted.
This directory must be created with your local user before mounting it to the container, otherwise docker will create this directory as a root.
Environment variables
To configure the i2 Analyze Tool container, you provide environment variables to the Docker container in the docker run command.
The following table describes the supported environment variables that you can use:
| Environment variable | Description |
|---|---|
LIC_AGREEMENT |
The license agreement for use the i2 Analyze tools. |
ZK_HOST |
The connection string the ZooKeeper client to connect to. |
DB_DIALECT |
See i2a Tools Environment Variables. |
DB_SERVER |
See i2a Tools Environment Variables. |
DB_PORT |
See i2a Tools Environment Variables. |
DB_NAME |
See i2a Tools Environment Variables. |
CONFIG_DIR |
The root location of the configuration directory. |
GENERATED_DIR |
The root location where any generated scripts are created. |
CLASSES_PATH |
The location to the files required by the i2 Analyze tools. The files are built into the image. |
DB_USERNAME |
See i2a Tools Environment Variables. |
DB_PASSWORD |
See i2a Tools Environment Variables. |
SOLR_ADMIN_DIGEST_USERNAME |
The name of the administrator user for performing administration tasks. |
SOLR_ADMIN_DIGEST_PASSWORD |
The password for the administrator user. |
ZOO_DIGEST_USERNAME |
The ZooKeeper administrator user name. This environment variable maps to the zkDigestUsername system property. |
ZOO_DIGEST_PASSWORD |
The ZooKeeper administrator password. This environment variable maps to the zkDigestPassword system property. |
ZOO_DIGEST_READONLY_USERNAME |
The ZooKeeper read-only user name. This environment variable maps to the zkDigestReadonlyUsername system property. |
ZOO_DIGEST_READONLY_PASSWORD |
The ZooKeeper read-only password. This environment variable maps to the zkDigestReadonlyPassword system property. |
USER_ID |
The id of the current user. |
GROUP_ID |
The id of the current user's group. |
The following environment variables enable you to use SSL:
| Environment variable | Description |
|---|---|
SERVER_SSL |
See Secure Environment variables. |
DB_SSL_CONNECTION |
See Secure Environment variables. |
SOLR_ZOO_SSL_CONNECTION |
See Secure Environment variables. |
SSL_PRIVATE_KEY |
See Secure Environment variables. |
SSL_CERTIFICATE |
See Secure Environment variables. |
SSL_CA_CERTIFICATE |
See Secure Environment variables. |
GATEWAY_SSL_CONNECTION |
See Secure Environment variables. |
SSL_OUTBOUND_PRIVATE_KEY |
See Secure Environment variables. |
SSL_OUTBOUND_CERTIFICATE |
See Secure Environment variables. |
SSL_ADDITIONAL_TRUST_CERTIFICATES |
See Secure Environment variables. |
NOTE:
- when you set
SERVER_SSLandSSL_CA_CERTIFICATEenvironment variables, theCA.cercertificate will be located at/tmp/i2acerts/CA.cer. - when you set
GATEWAY_SSL_CONNECTION,SSL_OUTBOUND_PRIVATE_KEYandSSL_OUTBOUND_CERTIFICATEenvironment variables, the certificated will be located at/tmp/i2acerts/i2Analyze.pem.