Load the H2OPredict DAI License | Vantage BYOM - 2.0 - Load the H20 Driverless AI License - Teradata Vantage

Teradata Vantage™ - Bring Your Own Model User Guide

Product
Teradata Vantage
Release Number
2.0
Release Date
October 2021
Content Type
User Guide
Publication ID
B700-1111-051K
Language
English (United States)

A user license for H2O Driverless AI (DAI) is required when scoring DAI models in H2OPredict.

Options for Loading the DAI License

You can avoid putting the license key as a string value in every H2OPredict query that uses a DAI model by installing the H2O DAI license using one of the following two options:
  • 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.

If the H2O DAI license expires and the license key is in a separate table (option 1), update the license key as follows:
update h2o_dai_lic set license = license key – Encrypted or not
where id = 1;

License Key in H2OPredict Queries on DAI Models

Include the license key in the model ON clause of the H2OPredict call in the query.
You must name the license column license, order does not matter.
Example where the license key is in a license table:
ON (SELECT model_id, model,h2o_lic.license FROM h2o_models WHERE model_id = 'pipeline_model') DIMENSION
Example where the license key is in the models table:
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.