Git Example
All secrets in JSON files used during deployment are secured with an AES key stored in the intelligencehub-settings.json. In order to share deployments hub instances, copy the intelligencehub-certificates.pkcs12
files to the appData directory used by the hubs that are sharing configuration.
The following example shows how to use the IntelligenceHub deployment settings to:
- Pull a model and instance configuration using Git
- Combine the configuration with a connection and input stored locally, and
- Start the IntelligenceHub with the combined configuration.
1. Setup the deployment settings JSON file
The deployment settings file below defines two fragments:
- Fragment 1: Uses the repo defined in the file by setting
"repoName": "highbyte"
and gets deployment JSON from a file namedmodel-deployment.json
at the root of the repository. The keyPath selects only the modeling components of this file. - Fragment 2: References a deployment file stored at
/usr/local/highbyte/deployments/connection-deployment.json
and uses keyPaths to select only connections, inputs, and outputs from this file.
{
"version" : 0,
"repos" : [ {
"type" : "git",
"uri" : "<uri>",
"name" : "highbyte",
"author" : "",
"email" : "",
"auth" : {
"type" : "pass",
"password" : "<token>",
"username" : "<user>"
}
} ],
"fragments" : [ {
"details" : {
"type" : "git",
"deployFile" : "model-deployment.json",
"repoName" : "highbyte",
"ref" : "models"
},
"keyPaths" : [ ".project.modeling" ]
}, {
"details" : {
"type" : "dir",
"deployFile" : "/usr/local/highbyte/deployments/connection-deployment.json"
},
"keyPaths" : [ ".project.connections", ".project.inputs", ".project.outputs" ]
} ]
}
To encrypt the token in the deployment settings file (or any highbyte JSON file), use the encrypt
command. For example:
java -jar intelligencehub-runtime.jar encrypt deployment-settings.json
This command encrypts deployment-settings.json
in place, the result is shown below, note the password has been encrypted.
{
"version" : 0,
"repos" : [ {
"type" : "git",
"uri" : "<uri>",
"name" : "highbyte",
"author" : "",
"email" : "",
"auth" : {
"type" : "pass",
"password" : {
"type" : "Encrypted",
"value" : {
"keyId" : "AnBU7AXftXCS7+EZNM+9Zw==",
"iv" : "gEma6X9PPh38XoqC1dFcew==",
"ciphertext" : "dQMlw3rRfzBVrVxfW5a/LQ=="
}
},
"username" : "<user>"
}
} ],
"fragments" : [ {
"details" : {
"type" : "git",
"deployFile" : "model-deployment.json",
"repoName" : "highbyte",
"ref" : "models"
},
"keyPaths" : [ ".project.modeling" ]
}, {
"details" : {
"type" : "dir",
"deployFile" : "/usr/local/highbyte/deployments/connection-deployment.json"
},
"keyPaths" : [ ".project.connections", ".project.inputs", ".project.outputs" ]
} ]
}
2. Setup deployment JSON files
Deployment files containing an IntelligenceHub instance configuration can be exported using the export
command. The following example exports a deployment json to /usr/local/highbyte/deployments/connection-deployment.json
. The export
command exports to `intelligencehub-deployment.json in the working directory when a path is not specified.
java -jar intelligencehub-runtime.jar export /usr/local/highbyte/deployments/connection-deployment.json
This example deployment settings combines the model-deployment.json stored in the model
branch of the configured repo with the connection-deployment.json stored in /usr/local/highbyte/data/intelligencehub-deployment.json
.
3. Start the IntelligenceHub using the deployment JSON files
Specify the deployment settings file using an environment variable or java property.
Example Linux start script:
HIGHBYTE_DEPLOYMENT_FILE=./deployment-settings.json ./start-linux.sh
Example using java command on windows:
java !JAVA_OPTS! -Dhighbyte.deployment.file="./deployment-settings.json" -jar intelligencehub-runtime.jar
The IntelligenceHub uses the settings json file to reconfigure the hub at start-up if either the environment variable or java property are set. Any errors the occur during this process will stop start-up, error information is printed to console stdout.
An example of the resulting hub deployment configuration is shown in combined-deployment.json.