Skip to main content

CLI library to automate the onboarding process to IBM Watson OpenScale

Project description

Status Latest Stable Version

This tool allows user to get started real quick by exploring the environment to understand what user has, and then provision corresponding services needed to run Watson OpenScale, then setup the models and setup monitoring conditions.

Before you begin

Installation

To install, use pip or easy_install:

pip install -U ibm-ai-openscale-cli

or

easy_install -U ibm-ai-openscale-cli

️️ ## Usage

ibm-ai-openscale-cli --help
usage: -c [-h] -a APIKEY [--env {ypprod,ypqa,ys1dev,icp}]
          [--resource-group RESOURCE_GROUP] [--postgres POSTGRES] [--icd ICD]
          [--db2 DB2] [--wml WML] [--azure AZURE] [--spss SPSS]
          [--custom CUSTOM] [--aws AWS] [--deployment-name DEPLOYMENT_NAME]
          [--username USERNAME] [--password PASSWORD] [--url URL]
          [--datamart-name DATAMART_NAME] [--keep-schema] [--history HISTORY]
          [--verbose] [--version]
          [--model {all,GermanCreditRiskModel,DrugSelectionModel,GolfModel}]
          [--reset {metrics,monitors,datamart,model}]

optional arguments:
  -h, --help            show this help message and exit
  --env {ypprod,ypqa,ys1dev,icp}
                        Environment. Default "ypprod"
  --resource-group RESOURCE_GROUP
                        Resource Group to use. If not specified, then
                        "default" group is used
  --postgres POSTGRES   Path to postgres credentials file for the datamart
                        database. If --postgres, --icd, and --db2 all are not
                        specified, then the internal Watson OpenScale database
                        is used
  --icd ICD             Path to IBM Cloud Database credentials file for the
                        datamart database
  --db2 DB2             Path to IBM DB2 credentials file for the datamart
                        database
  --wml WML             Path to IBM WML credentials file
  --azure AZURE         Path to Microsoft Azure credentials file
  --spss SPSS           Path to SPSS credentials file
  --custom CUSTOM       Path to Custom Engine credentials file
  --aws AWS             Path to Amazon Web Services credentials file
  --deployment-name DEPLOYMENT_NAME
                        Name of the deployment to use. Required for Azure ML
                        Studio, SPSS Engine and Custom ML Engine
  --username USERNAME   ICP username. Required if "icp" environment is chosen
  --password PASSWORD   ICP password. Required if "icp" environment is chosen
  --url URL             ICP url. Required if "icp" environment is chosen
  --datamart-name DATAMART_NAME
                        Specify data mart name and schema, default is
                        "aiosfastpath"
  --keep-schema         Use pre-existing datamart schema, only dropping all
                        tables. If not specified, datamart schema is dropped
                        and re-created
  --history HISTORY     Days of history to preload. Default is 7
  --verbose             verbose flag
  --version             show program's version number and exit
  --model {all,GermanCreditRiskModel,DrugSelectionModel,GolfModel}
                        Model to set up with Watson OpenScale (default
                        "GermanCreditRiskModel")
  --reset {metrics,monitors,datamart,model}
                        Reset existing datamart then exit

required arguments:
  -a APIKEY, --apikey APIKEY
                        IBM Cloud APIKey

Example

export APIKEY=<PLATFORM_API_KEY>
ibm-ai-openscale-cli --apikey $APIKEY

FAQ

Q: How do the reset options work?

A: The reset options each affect a different level of data in the datamart:

  • --reset metrics : Clean up the payload logging table, monitoring history tables etc, so that it restores the system to a fresh state with datamart configured, model deployments added, all monitors configured, but no actual metrics in the system yet. The system is ready to go. Not supported for Watson OpenScale internal databases.

  • --reset monitors : Remove all configured monitors and corresponding metrics and history, but leave the actual model deployments (if any) in the datamart. User can proceed to configure the monitors via user interface, API, or fastpath.

  • -- reset datamart : “Factory reset” the datamart to a fresh state as if there was not any configuration.

  • -- reset model : Delete the model and deployment from WML. Not yet supported for non-WML engines. Does not affect the datamart.

Q: Can I use SSL for connecting to the datamart DB2 database?

A: Yes. DB2 Warehouse on Cloud databases automatically support SSL, using the VCAP json file generated on the “Service Credentials” page. For on-prem or ICP4D DB2 databases, you can specify the path on the local client machine to a copy of the DB2 server’s SSL certificate “arm” file, using an “ssldsn” connection string in the VCAP json file:

{
  "hostname": "<ipaddr>",
  "host": "<ipaddr>",
  "username": "<uid>",
  "password": "<pw>",
  "port": 50000,
  "jdbcurl": "jdbc:db2://<ipaddr>:50000/<dbname>",
  "uri": "db2://<uid>:<pw>@<ipaddr>:50000/<dbname>",
  "db": "<dbname>",
  "dsn": "DATABASE=<dbname>;HOSTNAME=<ipaddr>;PORT=50000;PROTOCOL=TCPIP;UID=<uid>;PWD=<pw>",
  "ssldsn": "DATABASE=<dbname>;HOSTNAME=<ipaddr>;PORT=50001;PROTOCOL=TCPIP;UID=<uid>;PWD=<pw>;Security=ssl;SSLServerCertificate=/path_on_local_client_machine_to/db2server_instance.arm;"
}

If SSL connections are not needed, or not configured on the DB2 server, you can remove the “ssldsn” tag and ibm-ai-openscale-cli will use the non-SSL “dsn” tag instead. If the VCAP has both dsn and ssldsn tags, ibm-ai-openscale-cli will use “ssldsn” tag to create an SSL connection.

Python version

✅ Tested on Python 3.4, 3.5, and 3.6.

Contributing

See CONTRIBUTING.md.

License

This library is licensed under the Apache 2.0 license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ibm-ai-openscale-cli-0.2.3.tar.gz (9.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ibm_ai_openscale_cli-0.2.3-py3-none-any.whl (10.3 MB view details)

Uploaded Python 3

File details

Details for the file ibm-ai-openscale-cli-0.2.3.tar.gz.

File metadata

  • Download URL: ibm-ai-openscale-cli-0.2.3.tar.gz
  • Upload date:
  • Size: 9.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.2

File hashes

Hashes for ibm-ai-openscale-cli-0.2.3.tar.gz
Algorithm Hash digest
SHA256 a5a306a11c644c5b79c56ca0c9b355203e77bd2c51b23640206311e2eacf5a7b
MD5 ee04a6f85e68db7b28d65366ca94c4da
BLAKE2b-256 6f36b6ea0fb3e844e9b963e08d4b8e3a47fa038b1b241624d6c41b6401204ac1

See more details on using hashes here.

File details

Details for the file ibm_ai_openscale_cli-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: ibm_ai_openscale_cli-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 10.3 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.2

File hashes

Hashes for ibm_ai_openscale_cli-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 93536efdcfe85554a234b5bca04310f51c571956e556bb4cd1ef68285a8b2925
MD5 64413711c54789f5c290807bf3c93f8d
BLAKE2b-256 30df55e2e3f8384b4950f7557cb9f25487b2ada369f195cbff6ba5ff70d029d1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page