Installing Maximo AI Service by using an Ansible collection

You can install Maximo® AI Service by using an Ansible® collection.

Before you begin

Complete the following prerequisites:
  • Gather the values for the required environment variables. For more information, see Environment variables.
  • Ensure that Git is installed on your system.
  • Ensure that a code editor is installed on your system.
  • Create a GitHub account or identify an existing account that you own.
  • Connect your code editor to your GitHub account. For more information, see your code editor's documentation.

About this task

For general information about Ansible, see IBM Maximo Application Suite installation with Ansible collection.

The Ansible playbook for Maximo AI Service can be run against any Red Hat® OpenShift® cluster regardless of the cluster type.

The following table describes the Ansible roles' mapping to tasks.

Table 1. Ansible role and task mapping
Role Tasks
aiservice_odh
  • Install Red Hat OpenShift serverless operator
  • Install Red Hat OpenShift service mesh operator
  • Install Authorino operator
  • Install Open Data Hub operator
  • Create DSCInitialization instance
  • Create Data Science cluster
  • Create Data Science Pipelines application
aiservice_kmodels
  • Install Kmodel controller
  • Install istio
  • Install Kmodel store
  • Install Kmodel watcher
aiservice
  • Install Maximo AI Service API application
  • Create and delete Maximo AI Service API key
  • Create and delete Amazon Web Services S3 API key
aiservice_tenant
  • Create config for Suite License Service
  • Create config for Reliability Strategies
  • Create config for Data Reporter Operator
  • Create and delete Amazon Web Services S3 API key
  • Create and delete watsonx™ API key
  • Create Maximo AI Service tenant

Procedure

  1. Clone the ansible-devops repository, which is at the following link: https://github.com/ibm-mas/ansible-devops. Do not use the CLI container. You must clone the repository.
    You can clone the repository by using the following command or manually clone the repository in your code editor. For more information on how to clone GitHub repositories in your code editor, see your code editor's documentation and the documentation for your operating system. Different operating systems can require unique steps for cloning a repository from GitHub.
    git clone https://github.com/ibm-mas/ansible-devops.git
  2. Run the following command to build and install the Ansible collection.
    cd git/ansible-devops/ibm/mas_devops/
    ansible-galaxy collection build
    ansible-galaxy collection install ibm-mas_devops-*.tar.gz --ignore-certs --force
    rm ibm-mas_devops-*.tar.gz
  3. Run the following command to set up the virtual environment.
    Do not install the environment globally.
    python3 -m venv ~/venv/
    source ~/venv/bin/activate
    python3 -m pip install --upgrade pip
    python3 -m pip install ansible junit_xml pymongo xmljson jmespath kubernetes==12.0.1 openshift==0.12.1 boto3 requests mas-devops
  4. For your Red Hat OpenShift cluster, set the environment variables.
    For more information about the variables and what values to specify, see Environment variables. The following content is an example structure for how you set the environment variables. The example does not include example values for the variables.
    # General environment variables
    export IBM_ENTITLEMENT_KEY=${MAS_ENTITLEMENT_KEY}
    export MAS_CATALOG_VERSION="<value>"
    export MAS_CONFIG_DIR="<value>"
    export ENVIRONMENT_TYPE="<value>"
    export AISERVICE_INSTANCE_ID="<value>"
    export MAS_ENTITLEMENT_KEY="<value>"
    export MAS_ENTITLEMENT_USERNAME="<value>"
    export AISERVICE_CHANNEL="9.1.x"
    export MAS_AISERVICE_TENANT_ENTITLEMENT_TYPE="standard"
    #Storage provider environment variables
    export INSTALL_MINIO="<value>"
    export MINIO_ROOT_PASSWORD="<value>"
    export AISERVICE_S3_ACCESSKEY="<value>"
    export AISERVICE_S3_SECRETKEY=${MINIO_ROOT_PASSWORD}
    export AISERVICE_S3_HOST="<value>"
    export AISERVICE_S3_SSL="<value>"
    export AISERVICE_S3_PROVIDER="<value>"
    export AISERVICE_S3_PORT="<value>"
    export AISERVICE_S3_REGION="<value>"
    export AISERVICE_S3_PIPELINES_BUCKET="<value>"
    export AISERVICE_S3_TENANTS_BUCKET="<value>"
    export AISERVICE_S3_TEMPLATES_BUCKET="<value>"
    export AISERVICE_S3_BUCKET_PREFIX="<value>"
    export AISERVICE_S3_REGION="<value>"
    export AISERVICE_S3_ENDPOINT_URL="<value>"
    #Watsonx environment variables
    export AISERVICE_WATSONXAI_APIKEY="<value>"
    export AISERVICE_WATSONXAI_URL="<value>"
    export AISERVICE_WATSONXAI_PROJECT_ID="<value>"
    export AISERVICE_WATSONXAI_CA_CRT="<value>"
    export AISERVICE_WATSONXAI_USERNAME="<value>"
    export AISERVICE_WATSONXAI_VERSION="<value>"
    #Data Reporter Operator environment variables
    export INSTALL_DRO="<value>"
    export DRO_CONTACT_EMAIL="<value>"
    export DRO_CONTACT_FIRSTNAME="<value>"
    export DRO_CONTACT_LASTNAME="<value>"
    export AISERVICE_DRO_TENANT_ID="<value>"
    export AISERVICE_DRO_SECRET_NAME="<value>"
    export AISERVICE_DRO_API_KEY="<value>"
    export AISERVICE_DRO_URL="<value>"
    export AISERVICE_DRO_CA_CERT="<value>"
    #Suite License Service environment variables
    export INSTALL_SLS="<value>"
    export INSTALL_MONGO="<value>"
    export SLS_MONGODB_CFG_FILE=${MAS_CONFIG_DIR}/mongo-mongoce.yml
    export SLS_LICENSE_ID="<value>"
    export SLS_LICENSE_FILE="<value>"
    export AISERVICE_SLS_SUBSCRIPTION_ID="<value>"
    export AISERVICE_SLS_SECRET_NAME="<value>"
    export AISERVICE_SLS_REGISTRATION_KEY="<value>"
    export AISERVICE_SLS_URL="<value>"
    export AISERVICE_SLS_CA_CERT="<value>"
    #Reliability Strategy Library environment variables
    export RSL_URL="<value>"
    export RSL_ORG_ID="<value>"
    export RSL_TOKEN="<value>"
    #Db2 environment variables
    export INSTALL_DB2="<value>"
    export AISERVICE_DB2_USERNAME="<value>"
    export AISERVICE_DB2_PASSWORD="<value>" 
    export AISERVICE_DB2_JDBC_URL="<value>"
    export AISERVICE_DB2_SSL_ENABLED="<value>"
    export AISERVICE_DB2_CA_CERT="<value>"
  5. Run the following command to run the Ansible playbook.
    Replace all variables with your values.
    oc login --token=<token> --server=https://<server>:<port>
    oc projects 
    ansible-playbook playbooks/aiservice.yml
  6. Create a tenant.
    When you create a tenant, a custom resource is also created that contains the configuration that is related to that tenant. Each custom resource is customized to a specific tenant. You can create more than one custom resource. The tenant reuses the specific environmental variables unless the values are defined by the associated dependency.
    Run the following command to create the tenant. Replace all variables with your values.
    For more information about the variables and what values to specify, see Environment variables.
    export TENANT_ACTION="install"
    export AISERVICE_INSTANCE_ID="value"
    export AISERVICE_TENANT_ID="value"
    export AISERVICE_NAMESPACE="aiservice-${AISERVICE_INSTANCE_ID}"
    export ROLE_NAME="aiservice_tenant"
    
    # Data Reporter Operator variables
    export AISERVICE_DRO_SECRET_NAME="value"
    export AISERVICE_DRO_API_KEY="value" 
    export AISERVICE_DRO_URL="value"
    export AISERVICE_DRO_CA_CERT="value"
    
    # Suite License Server variables
    export AISERVICE_SLS_SECRET_NAME="value"
    export AISERVICE_SLS_REGISTRATION_KEY="value"
    export AISERVICE_SLS_URL="value"
    export AISERVICE_SLS_CA_CERT="value"
    
    # Reliability Strategy Library variables (optional)
    export RSL_URL="value"
    export RSL_ORG_ID="value"
    export RSL_TOKEN="Bearer value"
    export RSL_CA_CRT="value"
    
    # Watsonx.ai variables
    export AISERVICE_WATSONXAI_APIKEY="value"
    export AISERVICE_WATSONXAI_URL="value"
    export AISERVICE_WATSONXAI_PROJECT_ID="value"
    export AISERVICE_WATSONXAI_CA_CRT="<value>"
    export AISERVICE_WATSONXAI_USERNAME="<value>"
    export AISERVICE_WATSONXAI_VERSION="<value>"
    
    # TENANT
    export AISERVICE_SLS_SUBSCRIPTION_ID="value"
    export AISERVICE_TENANT_ENTITLEMENT_START_DATE="value"
    export AISERVICE_TENANT_ENTITLEMENT_END_DATE="value"
    
    ansible-playbook playbooks/run_role.yml

What to do next

If any updates are made to the playbooks, you must use the following command to rebuild the collection:
cd git/ansible-devops/ibm/mas_devops/
ansible-galaxy collection build
ansible-galaxy collection install ibm-mas_devops-*.tar.gz --ignore-certs --force
rm ibm-mas_devops-*.tar.gz