Skip to content

Configuring the Environment

Warning

Ask your instructor if these pre-requirements have already been done for your workshop. You can skip this section in that case.

This document contains the details for initially configuring your Cloud Pak for Data environment so it's ready to follow this lab. Instructions assume you already have access to a Cloud Pak for Data environment as the admin user. If not, please follow the instructions in the Request an environment section.

Create the required CP4D role

Info

A new role will be created with the permissions the workshop attendees need.

  1. Login to CP4D as the admin user.

    Screenshot

  2. Navigate to Access control by clicking on the navigation menu (top left hamburger menu) and then clicking Administration Access control.

    Screenshot

  3. Go to the Roles tab and click New role

    Screenshot

  4. Set the role name MLOps Workshop and add the following permissions:

    • Catalogs > Access Catalogs
    • Deployments > Create deployment spaces
    • Deployments > Monitor deployment activity
    • Projects > Create projects
    • Projects > Monitor project workloads
  5. Click Next then Create to create the new role.

    Screenshot

Give the Administrator Role all permissions

  1. From the Access Control menu, go to tab Roles and open the Administrator Role.

    Screenshot

  2. Click Add Permissions +.

    Screenshot

  3. Select all available permissions, then click Add N permissions.

    Screenshot

Create the required users in CP4D

Info

In this workshop, attendees will be sharing a single environment to optimize the available hardware resources.

Create one user per attendee numbering them in ascending order, like this:

Full name Username Password Role
user1 user1 user1 MLOps Workshop
user2 user2 user2 MLOps Workshop
user3 user3 user3 MLOps Workshop
userX userX userX MLOps Workshop

The way you create users in CP4D will depend on the method you followed to deploy the environment in the section Request an Environment:

  1. If you used the pre-installed environment or the CP4D deployer, login CP4D as the admin user, then go to Administration > Access Control. You can create the users there.

    IMPORTANT

    Create your users with a Full Name. If they don't have a full name, AI Factsheets will fail when a new use case is created.

  2. If you installed CP4D manually, the IAM Service should be active. Therefore, add a new Openshift htpasswd-based Auth Provider with the workshop users. See this Red Hat's Documentation for information on how to do it. Login with each user in Openshift so they're active, then assign them the workshop role in CP4D Administration > Access Control

Data Upload

In this section, you will upload the data in customer_training_data.csv to the Db2 database you created in section Request an Environment. Download the file to your local computer: customer_training_data.csv.

  1. Login CP4D with the admin user.

  2. Navigate to Databases by clicking the Navigation menu and selecting Data > Databases.

    Screenshot

  3. Find the database you created. Click the 3-dot menu and then Open database. If you get an error related to the Data Management Console, wait for some minutes then try again. If the page just doesn't load, try to open it in an incognito window.

    Screenshot

  4. Click the Summary drop down, expand Load drop down and select Load Data.

    Screenshot

  5. Click the browse files link and select the customer_training_data.csv file you downloaded before. Then click Next.

    Screenshot

  6. On the schema page, click New schema +, specify the schema name as CUSTOMER and click Create.

    Tip

    For future uploads of data sets to the CUSTOMER schema, you can select the CUSTOMER schema if it is already created.

    Screenshot

  7. On the Table page, click New table + (annotated with red oval), provide a table name as CUSTOMER_TRAINING_DATA (annotated with red rectangle) and click Create (annotated with red arrow).

    Screenshot

  8. Select the CUSTOMER_TRAINING_DATA as the table to upload data to (annotated with red rectangle) and click Next twice (annotated with red arrow).

    Screenshot

  9. Click Begin Load (annotated with red arrow) to begin loading the csv file into the CUSTOMER_TRAINING_DATA table on your Db2 instance which is provisioned on the same Cloud Pak for Data cluster.

    Screenshot

  10. The load operation will run for a minute or two and you can monitor progress through the steps.

    Screenshot

  11. When data is loaded, you should see a summary message indicating the data load job succeeded.

    Screenshot

Platform connection

Create a Platform Connection named BLUDB that connects to your Db2 Database. You can use the internal Db2 service name for this:

  1. To get the Db2 Deployment ID, go to the Databases menu Data > Databases.

    Screenshot

  2. Find the database you created. Click the 3-dot menu and then Details.

    Screenshot

  3. Copy the Deployment ID, in this example it's db2oltp-1712170077943241.

    Screenshot

  4. Go to Menu > Data > Platform Connections.

    Screenshot

  5. Click New Connection +

    Screenshot

  6. Select the IBM Db2 connector and click Select

    Screenshot

  7. Insert the following values:

    • Name: BLUDB
    • Description: BLUDB Db2 Database
    • Database: BLUDB
    • Hostname: c-<DeploymentID>-db2u-engn-svc (<DeploymentID> being the Db2 ID you got before. In this example: c-db2oltp-1712170077943241-db2u-engn-svc)
    • Port: 50000
    • Username: admin (or your CP4D Administrator username)
    • Password: admin's password

    Then click Test Connection to make sure the connection is successful. If it is, click Create

    Screenshot

Db2 access to users

  1. Go to your Db2 Database and select the option Manage access.

    Screenshot

  2. Add all workshop users with the role User.

  3. Now open the Database and go to Menu > Run SQL.

    Screenshot

  4. Run the following SQL code. This will grant the workshops users access to the CUSTOMER training data.

    GRANT SELECT ON CUSTOMER.CUSTOMER_TRAINING_DATA TO USER USER0;
    GRANT SELECT ON CUSTOMER.CUSTOMER_TRAINING_DATA TO USER USER1;
    GRANT SELECT ON CUSTOMER.CUSTOMER_TRAINING_DATA TO USER USER2;
    GRANT SELECT ON CUSTOMER.CUSTOMER_TRAINING_DATA TO USER USER3;
    GRANT SELECT ON CUSTOMER.CUSTOMER_TRAINING_DATA TO USER USER4;
    GRANT SELECT ON CUSTOMER.CUSTOMER_TRAINING_DATA TO USER USER5;
    GRANT SELECT ON CUSTOMER.CUSTOMER_TRAINING_DATA TO USER USER6;
    GRANT SELECT ON CUSTOMER.CUSTOMER_TRAINING_DATA TO USER USER7;
    GRANT SELECT ON CUSTOMER.CUSTOMER_TRAINING_DATA TO USER USER8;
    GRANT SELECT ON CUSTOMER.CUSTOMER_TRAINING_DATA TO USER USER9;
    GRANT SELECT ON CUSTOMER.CUSTOMER_TRAINING_DATA TO USER USER10;
    GRANT SELECT ON CUSTOMER.CUSTOMER_TRAINING_DATA TO USER USER11;
    GRANT SELECT ON CUSTOMER.CUSTOMER_TRAINING_DATA TO USER USER12;
    GRANT SELECT ON CUSTOMER.CUSTOMER_TRAINING_DATA TO USER USER13;
    GRANT SELECT ON CUSTOMER.CUSTOMER_TRAINING_DATA TO USER USER14;
    GRANT SELECT ON CUSTOMER.CUSTOMER_TRAINING_DATA TO USER USER15;
    GRANT SELECT ON CUSTOMER.CUSTOMER_TRAINING_DATA TO USER USER16;
    GRANT SELECT ON CUSTOMER.CUSTOMER_TRAINING_DATA TO USER USER17;
    GRANT SELECT ON CUSTOMER.CUSTOMER_TRAINING_DATA TO USER USER18;
    GRANT SELECT ON CUSTOMER.CUSTOMER_TRAINING_DATA TO USER USER19;
    GRANT SELECT ON CUSTOMER.CUSTOMER_TRAINING_DATA TO USER USER20;
    

Deployment spaces

  1. Create two new Deployment Spaces:

    • Deployment space churnUATspace with Deployment Stage Testing
    • Deployment space churn_prod_space with Deployment Stage Production
  2. Give the role Editor to the group "All Users" on both deployment spaces.

    Screenshot Screenshot

Create Factsheets inventory

  1. Go to menu AI Governance > AI use cases.

    Screenshot

  2. Click the Manage settings button.

    Screenshot

  3. In the Inventories tab, click New inventory +.

    Screenshot

  4. Insert the name AI_inventory then click Next.

    Screenshot

  5. Click Add collaborators then Add user group.

    Screenshot

  6. Select the Editor role. Then search for the group All users and add it. Finally, click Add

    Screenshot

  7. Click the x button to close this window.

    Screenshot

Watson OpenScale Setup

  1. Go to the menu Services > Instances.

    Screenshot

  2. Find the openscale-defaultinstance, click the open drop down and select Manage access.

    Screenshot

  3. Click Add users + and add all workshop users with role Admin.

    Screenshot

  4. Go back to the list of Service Instances. Find the openscale-defaultinstance instance, click the open drop down and select Open.

    Screenshot

  5. Click Manual setup.

    Screenshot

  6. In the Database tab, click pencil icon to configure the database where model payload, predictions as well as calculated quality metrics will be stored.

    Screenshot

  7. Choose Db2 as database type and fill teh same Db2 credentials we used for the Platform Connection. Then click Connect.

    Screenshot

  8. For Schema, select Auto-create a new schema and click Save.

    Screenshot

  9. Go to the Machine learning providers tab and click Add machine learning provider.

    Screenshot

  10. Provide a Name WML and Description (Watson Machine Learning provider on Cloud Pak for Data) for the machine learning provider by clicking the pencil icons. Then click the pencil icon next to Connection.

    Screenshot

  11. For the Connection configuration, you need to specify a number of parameters for OpenScale to connect to the Watson Machine Learning as the provider:

    • Service provider: Select Watson Machine Learning (V2) service
    • Location: Local
    • Deployment space: churnUATspace
    • Environment type: Pre-production

    Then click Save.

    Screenshot

  12. Add another provider for the Production deployment space:

    • Service provider: Select Watson Machine Learning (V2) service
    • Location: Local
    • Deployment space: churn_prod_space
    • Environment type: Production