Load the H2O DAI License Example | Vantage BYOM - 2.0 - H2O DAI License End-to-End Example - 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)

End-to-End Example

The following actions are included in the example:
  • License is exported in an environment variable
  • License is encrypted with the optional utility
  • License is inserted into a table
  • License is used to run a DAI query
The same workflow can be used to replace and existing license or update an expired license by inserting the new license in the table.
  1. A terminal is opened in the directory where the encrypt_dai_license.sh file is copied.
    If the DAI license does not need encrypting, the license text can be selected and copied and skip to step 5.
    linux1:/tmp/byom # ls
    encrypt_dai_license.sh
  2. The license key source for the utility script is created. There are two options:
    1. Use the export command to set the environment variable DAI_LIC_KEY to the string value of the DAI license key:
      linux1:/tmp/byom # export DAI_LIC_KEY='eZSyRtjA-ibVuvNw53peBVA5sUL9KU_kP35Vq4ZNB97sFY2LICQNr7_NDX7dAhLJzUenS4GXuJKKjJyeRwR7gDeRrzrQdJZH_wGdkglFZB2SBvpVa7UZ40bl3H3zQ3iGY6oVSpE6gVDwmxY7ewddxCzwxp3-9B80-ZjhxVGHMGuuq9KkGal8bjVtUJBeMQfQ0224Yu68ucFHwkdyHrVSm8KbJ2gKWaTVQ8qPBDtfzduMqcfE-BqusTuWQNO_h-VWUtpWnuzIfi5pDZvTmUSK2DRuowKYa264PJGnrY2x6M_fCy9rLbA4w23AWxJeXaEOyFnJCaovzmFWM5zZWVSgN6pY2uWh3ORKmVyc2lvAKbGljZWOlRlcmFkYXRhCmxpY2Vuc2VlVuc2Vfdfb3JnYW5peN0ZXZlLmthbXlzemF0aW9X2VtmlhbF9udW1iZXI6NTEyNTRhLmNvbQwMzFTMDAwMDFISzM3UVFBVApYWlsOnmVrQHRlcmFkYXbjoxCnNlcpc19oMm9faW50ZXJuYWxfdXNpsaWNlbnNlZV91c2VyXWF0ZWRfYZXIGV0b0BoMm8uYWkKY3JlYXRpb25fZGFmxpY2Vuc2VfdHlG0ZToyMDI2lkOjAlOmZhbHNlCmNVzc0FJCxvdAuc29sbGltnlfZW1haWw6cdmVhdGU6MjAyMS8xMi8zMQoX2RzA4CnpleHBpcmF0aW9uwZTpwaWyZxLzA2LybJpByb2R1Y3Q6RH='
      
    2. Create a text file named license.sig in this directory and paste the license key into that file.
  3. The command encrypt_dai_license.sh is run.
    linux1:/tmp/byom # ./encrypt_dai_license.sh
    
    SG+DEyyNB9eRrT4b6Se06t/fqIR0oYIim6uaz+FqVgxefAYt/zzHgWwayA0bJvjc5HKqx+vrmaZKbkYLFo9jGTEkH6dRUGB1mxwLy/G/VTgDjdszYSODHm9lptMKL5SmonnQvylLjpvMt+mf/1m87uW/K10aENmMDVNLT8pl+j0vkwcJqkRNef2bLYeKZ9/ERKV7RGR5xsSVFvogctS4zJjwxdsrxF3BpA9cAVVwTGVUSqkuc77agMFv/uxUmYkd+F7mMJjF4rQPMxVKok8gnnPwrzLH0jUaVU2mML8IVhBnkWBmSIkOi+iRpDpX/nJPjt03j7KcOdWVhjoK3ouQGz4vrcrkmIceQUw8Qgow/xBOH1mrd0FZAT0BHwBQHMrEbElaFxXcQ9GB/sFlde0PuX31ItE5exryTeL+TJXDdQKFbRPvK/1YVPhtS/ve/Xpno4BHsJaZWOdQoViahGl5BctLdrjREqtffGFBFBbpJEoGAXTeRsGLsT6c6wvJxkxgl5gKFnnxiXhIsWPUywJFBdRHe8g6zchbLzebWdCCpy2bI+CVOrRBVPLyI/o2wSCOSci5gh0plEREFtQOo8xbCL0h039XDi5kkh57gXD2iVz1kem3PFfISk2GReDkNei4BSezBAqoriGb+NXf/uj0Dqkg47OdBd5ycbsB9hWcojRTYWx0ZWRfXz/Q6iNcOwgNxAyIwNqsNQR9yBtIgXkk72bm8TDr3BwcqmuvGb40+nFzfUHrgBcq4IoCt8Oy9p+ZBDjpc3qZJryaJjrs4q2vVfE3Valr3slZqnYnZHVWwLBMaI6A6k22WfvxsgJRRGngKE1Kuj3htQ1eELWEv9bihREKHNnzuGL0hz3QoywkJ5d3t7r/mPdGT0K7wcoaMkxzA98mPhMneZfMH7VUyRS+YJrJg8e/xEg5ovLka6abL7qp030CWSsEBLgSrT0BP9kcwcNE7JOftK1Gah4UgCSPZsrOgw0syrcAQiovWveJFEIDMbkkrJnmKOv3O8B2P86OtpmCxzg+yu5KPlmR4/3fxGpUO52+OGa6w62s+hKMInePPQ4W4Ky/y2A9nBmVUFlLicckAWrnvEaKXfvdL+nZ7yEcRwYNBAyJiRK/mJ6Qy7KeOBnNr4tW4kLA5QKqxQIEUDxR15DZPRJ3Fb8oqv+BztjMe4Pq0eEhsITnKac5HeiwdCWueTHh1Mf6vpbpwCajtLGonqNiA1GusUNoc0JqecGjdeBfcogzg4zoxAjQQYXg9GVhxxWInqGPEP66ea/OL9TnXv6kBglA9oNp3c21AQpRZEpheWOHklkVX+/W7HIiUL3h+DzBQLldZVbW4NJdtBm8+eFHdv/UzJAmVJ40gEGEMuTNBg3ZlHX5lBwvw6elw7WmEgq07ZfeXQDc/OPSXQNMuGVWS0HxzqbdEqiooKxjhJGXIQMSgNbbj6MEMdnqCqwRkuyTo94wgpMEkMJPya5UjMvYWmKpZ+SgAahsL2ERE+hfMeF8pPj4eAaRhDPzJBti5ikj3f05z0X56yy0tpcAncpMibp0s40Cbb37m69ZhcHp2GxWWVXdf+Bi+OpO6W/KhS+Cy0vruGYvgd9G5hHPfr+s6owxaqZXfW0/lRycTEyo4qlF/IjWa9T+fZCg4FHBtYssnMUMm4VZj9UQ3tUS4LLbME6lLbPIJBdrRVa889TslTEp0TyI19OIzQ4=
  4. The encrypted license (command output in previous step) is selected and copied, BTEQ is started, and the database is logged on to.
    linux1:/tmp/byom # bteq
     
     Teradata BTEQ 17.00.00.04 (64-bit) for LINUX. PID: 28249
     Copyright 1984-2020 Teradata. All rights reserved.
     Enter your logon or BTEQ command:
     
    .logon
    UserId: userid
    Password: ********
     
     *** Logon successfully completed.
     *** Teradata Database Release is 17.10c.00.08                 
     *** Teradata Database Version is 17.10c.00.08                   
     *** Transaction Semantics are BTET.
     *** Session Character Set Name is 'ASCII'.
      
     *** Total elapsed time was 1 second.
  5. A table is created that stores the license key (or encrypted license key).
    BTEQ -- Enter your SQL request or BTEQ command:
    create table h2o_dai_lic (
    id integer between 1 and 1,
    license varchar(2500)
    ) unique primary index(id);
     
     *** Table has been created.
     *** Total elapsed time was 1 second.
  6. The statement insert into h2o_dai_lic values(1,'license key') is used and the license key is pasted in-between single quotes.
    BTEQ -- Enter your SQL request or BTEQ command:
    insert into h2o_dai_lic values(1,'SG+DEyyNB9eRrT4b6Se06t/fqIR0oYIim6uaz+FqVgxefAYt/zzHgWwayA0bJvjc5HKqx+vrmaZKbkYLFo9jGTEkH6dRUGB1mxwLy/G/VTgDjdszYSODHm9lptMKL5SmonnQvylLjpvMt+mf/1m87uW/K10aENmMDVNLT8pl+j0vkwcJqkRNef2bLYeKZ9/ERKV7RGR5xsSVFvogctS4zJjwxdsrxF3BpA9cAVVwTGVUSqkuc77agMFv/uxUmYkd+F7mMJjF4rQPMxVKok8gnnPwrzLH0jUaVU2mML8IVhBnkWBmSIkOi+iRpDpX/nJPjt03j7KcOdWVhjoK3ouQGz4vrcrkmIceQUw8Qgow/xBOH1mrd0FZAT0BHwBQHMrEbElaFxXcQ9GB/sFlde0PuX31ItE5exryTeL+TJXDdQKFbRPvK/1YVPhtS/ve/Xpno4BHsJaZWOdQoViahGl5BctLdrjREqtffGFBFBbpJEoGAXTeRsGLsT6c6wvJxkxgl5gKFnnxiXhIsWPUywJFBdRHe8g6zchbLzebWdCCpy2bI+CVOrRBVPLyI/o2wSCOSci5gh0plEREFtQOo8xbCL0h039XDi5kkh57gXD2iVz1kem3PFfISk2GReDkNei4BSezBAqoriGb+NXf/uj0Dqkg47OdBd5ycbsB9hWcojRTYWx0ZWRfXz/Q6iNcOwgNxAyIwNqsNQR9yBtIgXkk72bm8TDr3BwcqmuvGb40+nFzfUHrgBcq4IoCt8Oy9p+ZBDjpc3qZJryaJjrs4q2vVfE3Valr3slZqnYnZHVWwLBMaI6A6k22WfvxsgJRRGngKE1Kuj3htQ1eELWEv9bihREKHNnzuGL0hz3QoywkJ5d3t7r/mPdGT0K7wcoaMkxzA98mPhMneZfMH7VUyRS+YJrJg8e/xEg5ovLka6abL7qp030CWSsEBLgSrT0BP9kcwcNE7JOftK1Gah4UgCSPZsrOgw0syrcAQiovWveJFEIDMbkkrJnmKOv3O8B2P86OtpmCxzg+yu5KPlmR4/3fxGpUO52+OGa6w62s+hKMInePPQ4W4Ky/y2A9nBmVUFlLicckAWrnvEaKXfvdL+nZ7yEcRwYNBAyJiRK/mJ6Qy7KeOBnNr4tW4kLA5QKqxQIEUDxR15DZPRJ3Fb8oqv+BztjMe4Pq0eEhsITnKac5HeiwdCWueTHh1Mf6vpbpwCajtLGonqNiA1GusUNoc0JqecGjdeBfcogzg4zoxAjQQYXg9GVhxxWInqGPEP66ea/OL9TnXv6kBglA9oNp3c21AQpRZEpheWOHklkVX+/W7HIiUL3h+DzBQLldZVbW4NJdtBm8+eFHdv/UzJAmVJ40gEGEMuTNBg3ZlHX5lBwvw6elw7WmEgq07ZfeXQDc/OPSXQNMuGVWS0HxzqbdEqiooKxjhJGXIQMSgNbbj6MEMdnqCqwRkuyTo94wgpMEkMJPya5UjMvYWmKpZ+SgAahsL2ERE+hfMeF8pPj4eAaRhDPzJBti5ikj3f05z0X56yy0tpcAncpMibp0s40Cbb37m69ZhcHp2GxWWVXdf+Bi+OpO6W/KhS+Cy0vruGYvgd9G5hHPfr+s6owxaqZXfW0/lRycTEyo4qlF/IjWa9T+fZCg4FHBtYssnMUMm4VZj9UQ3tUS4LLbME6lLbPIJBdrRVa889TslTEp0TyI19OIzQ4=');
     
     *** Insert completed. One row added.
     *** Total elapsed time was 1 second.
  7. Once the key is added, the license column must be referenced in the H2OPredict queries when using DAI models. For Example:
    select * from mldb.H2OPredict(
        on (select top 10 * from iris_input)
        on (select model_id, model, h2o_dai_lic.license from h2o_models where model_id = 'h2odai_iris_model') DIMENSION
        using
            Accumulate('id')
            ModelType('DAI')
            EnableOptions('Contributions')
            OverWriteCachedModel('*')
    ) as td;
     *** Query completed. 10 rows found. 3 columns returned.