A user license for H2O Driverless AI (DAI) is required when scoring DAI models in H2OPredict.
Options for Loading the DAI License
- Option 1: [Recommended] Create a table to store the H2O DAI license key and load it into the table (encrypted or non-encrypted) as a long string without a carriage return.
create table h2o_dai_lic ( id integer between 1 and 1, license varchar(2500) ) unique primary index(id); insert into h2o_dai_lic values (1, License key text here, encrypted or not)The table must restrict the ID value to be between 1 and 1 so only one license resides in the table and the ID must be 1. The column must be named license. When there are multiple license keys, multiple tables must be created with one license per table.
- Option 2: Add the license key into the models table instead of creating license tables. This requires including the license key for every DAI model row in the table and adding a new license column as in the following example:
alter h2o_models add license varchar(2500);In option 2, you have the option to set the license column to the license key value so it is automatically included for all the models (all the rows) by updating the column using the following SQL statement:
update models_table set license = license key text here. Encrypted or not;Use the following SQL statement to add the license key for an individual model already in the models table:
update models_table set license = license key text here. Encrypted or not where model_id = 'DAI model_id';
You can provide the license information at any time using one of the above options. However, when running a query that uses a DAI model, an error is thrown if the license key has not been provided.
update h2o_dai_lic set license = license key – Encrypted or not where id = 1;
License Key in H2OPredict Queries on DAI Models
ON (SELECT model_id, model,h2o_lic.license FROM h2o_models WHERE model_id = 'pipeline_model') DIMENSION
on (SELECT model_id, model, license FROM h2o_models WHERE model_id = 'pipeline_model') DIMENSION
DAI User License Encryption
- A utility (shell script), encrypt_dai_license.sh, is included in the BYOM package to optionally encrypt the license and can be found in the /opt/Teradata/byom/02.00.00.00 directory. The utility can also be found at https://downloads.teradata.com/.
Encryption is based on the RSA algorithm, which involves both a public and private key.
- When encrypting the license, you must perform one of the following actions:
Action Create an environment variable DAI_LIC_KEY The string value is the DAI license key.
The utility encrypts the value and returns the encrypted key value.
Save the file license.sig in the same location as the script The license.sig file contains the license key as a flat file located in /var/opt/teradata/byom/02.00.00.00.
Only one license can be added in the file.
The utility encrypts the key in the flat file and returns the encrypted key.The utility script only runs on Linux or Macintosh systems.
- When a license expires, the same utility must be used to encrypt the updated license before loading the new license.
- The license key is decrypted by H2OPredict using a private key.
- See H2O DAI License End-to-End Example for an example of how to encrypt, install, and use an H2O DAI license in the H2OPredict call in a query.