Install AI Service¤
Important
These playbooks are samples to demonstrate how to use the roles in this collection.
They are not intended for production use as-is, they are a starting point for power users to aid in the development of their own Ansible playbooks using the roles in this collection.
The recommended way to install AI Service is to use the MAS CLI, which uses this Ansible Collection to deliver a complete managed lifecycle for your MAS instance.
Dependencies¤
- IBM Suite License Service installed on OCP cluster or external instance or details from external instance
- IBM Data Reporter Operator installed on OCP cluster or external instance or details from external instance
- Object Storage
- Minio (installed on the same cluster as aiservice)
- AWS S3 (Provide details to connect to AWS S3. Bucket names must be unique globally. Ensure to use a unique bucket prefix when using AWS S3)
Overview¤
This playbook will add AI Service v9.1.x to OCP cluster.
This playbook can be ran against any OCP cluster regardless of its type; whether it's running in IBM Cloud, Azure, AWS, or your local datacenter.
- Install dependencies:
- IBM Maximo Operator Catalog
- RedHat Certificate Manager
- MongoDb optional if SLS is not being installed on same cluster
- IBM Suite License Service (~10 Minutes) optional if customer chooses to use SLS from external cluster
- IBM Data Reporter Operator (~10 Minutes) optional if customer chooses to use DRO from external cluster
- IBM Db2
- Minio (~5 minutes) optional if customer choose to use external object storage
- Install ODH:
- Install Red Hat OpenShift Serverless Operator Required when using serverless deployment mode for ODH
- Install Red Hat OpenShift Service Mesh Operator Required when using serverless deployment mode for ODH
- Install Authorino Operator
- Install Open Data Hub Operator
- Create DSCInitialization instance
- Create DataScienceCluster instance
- Install AI Service (using playbook):
- Install application (~20 Minutes)
- Configure AI Service (kmodels, tenant, etc) (~20 Minutes)
All timings are estimates, see the individual pages for each of these playbooks for more information. Use this sample playbook as a starting point for installing application, just customize the application install and configure stages at the end of the playbook.
Required environment variables¤
AISERVICE_INSTANCE_IDDeclare the instance ID for the AI service installMAS_ENTITLEMENT_KEYYour IBM Entitlement key to access the IBM Container RegistryMAS_ENTITLEMENT_USERNAMEYour IBM Entitlement user to access the IBM Container RegistryAISERVICE_CHANNELAiservice application channelAISERVICE_S3_ACCESSKEYAccess Key for object storage providerAISERVICE_S3_SECRETKEYSecret key for object storage providerAISERVICE_S3_HOSTYour object storage provider hostAISERVICE_S3_REGIONYour object storage provider region - only when use AWS S3 instanceAISERVICE_S3_SSLIs your object storage SSL enabled? (true/false)AISERVICE_S3_TENANTS_BUCKETBucket name to store tenants infoAISERVICE_S3_TEMPLATES_BUCKETBucket name to store templates infoAISERVICE_S3_BUCKET_PREFIXBucket prefix configured with object storage providerAISERVICE_WATSONXAI_APIKEYYou WatsonX AI api keyAISERVICE_WATSONXAI_URLYou WatsonX AI urlAISERVICE_WATSONXAI_PROJECT_IDYou WatsonX projedt Id
Tip
AI service supports AWS and Minio storage providers.
Required environment variables (SaaS)¤
AISERVICE_SAASspecify if saas deployment (default value is: false)MAS_CONFIG_DIRspecify config location, mandatory whenAISERVICE_SAAS=trueAISERVICE_DOMAINspecify cluster domain, mandatory whenAISERVICE_SAAS=trueAISERVICE_SLS_URLspecify SLS url, mandatory whenAISERVICE_SAAS=trueAISERVICE_SLS_REGISTRATION_KEYspecify sls registration key, mandatory whenAISERVICE_SAAS=true, to get value: look inibm-slsnamespace, podsls-api-licensing-xxxand inEnvironmenttab checkREGISTRATION_KEYvalueAISERVICE_DRO_URLspecify DRO url, mandatory whenAISERVICE_SAAS=trueAISERVICE_DRO_TOKENspecify DRO token, mandatory whenAISERVICE_SAAS=trueto get value: go tomas-{{ instance_id }}-coreand look in secretdro-apikeyDB2_INSTANCE_NAMEspecify DB2 instance name (default value is: aiservice), mandatory whenAISERVICE_SAAS=trueIBM_ENTITLEMENT_KEYspecify IBM Entitlement key, mandatory whenAISERVICE_SAAS=true
Optional environment variables¤
MAS_ICR_CPProvide custom registry for AI service applicationsMAS_ICR_CPOPENProvide custom registry for AI service operatorMAS_CATALOG_VERSIONYour custom AI service catalog versionARTIFACTORY_USERNAMEYour artifactory user name to access - this is needed if user deploy from custom registry for exampledocker-na-public.artifactory.swg-devops.comARTIFACTORY_TOKENYour artifactory token for user to access - this is needed if user deploy from custom registry for exampledocker-na-public.artifactory.swg-devops.comAISERVICE_TENANT_ACTIONWhether to install or remove tenant (default value is: install)AISERVICE_APIKEY_ACTIONWhether to install or remove or update apikey (default value is: install)AISERVICE_WATSONX_ACTIONWhether to install or remove watsonx secret (default value is: install)AISERVICE_S3_ACTIONWhether to install or remove s3 (default value is: install)INSTALL_DB2Whether to install DB2 (default value is: false)INSTALL_MINIOWhether to install minio (default value is: false)INSTALL_SLSWhether to install IBM Suite License Service (default value is: false)INSTALL_DROWhether to install IBM Data Reporter Operator (default value is: false)AISERVICE_DB2_USERNAMEThe username to use for authentication with the databaseAISERVICE_DB2_PASSWORDThe password to use for authentication with the databaseAISERVICE_DB2_JDBC_URLThe JDBC URL specifying the host and port of the database, typically in the format jdbc:db2://host:port/AISERVICE_DB2_SSL_ENABLEDA flag indicating whether to enable SSL encryption for the database connection (default value is: true)USE_AWS_DB2A flag indicating whether to use an AWS-hosted DB2 instance (default value is: false)AISERVICE_DOMAINProvide custom domain (default value is: empty)AISERVICE_WATSONXAI_CA_CRTprovide WatsonX AI CA certificateAISERVICE_WATSONXAI_FULLoptional on prem to define if WatsonX AI engine is full or light (true/false)AISERVICE_WATSONXAI_DEPLOYMENT_IDoptional on prem define deployment IdAISERVICE_WATSONXAI_SPACE_IDoptional on prem define space IdAISERVICE_WATSONXAI_INSTANCE_IDoptional on prem define instance id (default: openshift)AISERVICE_WATSONXAI_USERNAMEoptional on prem define user nameAISERVICE_WATSONXAI_VERSIONoptional on prem define version of CPDAISERVICE_CERTIFICATE_ISSUEROptional to specify pre-configured certificate issuer to use for AI Service public certificatesAISERVICE_CERTIFICATE_DURATIONOptional to specify expiration duration for public certificates (default: 8760h0m0s)AISERVICE_CERTIFICATE_RENEW_BEFOREOptional to specify when to renew public certificates before they expire (default: 72h0m0s)
Usage¤
AI service deployment steps¤
Tip
For S3 manage please make sure you have deployed dependencies
Install boto3 python module (use python environment):
python3 -m venv /tmp/venv
source /tmp/venv/bin/activate
python3 -m pip install boto3
Run playbooks for deploy AI service:
AISERVICE_SLS_REGISTRATION_KEY- value can be found inibm-slsnamespace, in podsls-api-licensing-85699fb57-9lmrqplease look in environments tab, then valueREGISTRATION_KEYAISERVICE_DRO_TOKEN- go tomas-instance_id-corenamespace and in secrets finddro-apikey- In
AWSforAISERVICE_S3_TENANTS_BUCKET,AISERVICE_S3_TEMPLATES_BUCKETuser need to create S3 buckets with unique name
export ARTIFACTORY_USERNAME=""
export ARTIFACTORY_TOKEN=""
export MAS_ICR_CP=""
export MAS_ICR_CPOPEN=""
export MAS_ENTITLEMENT_USERNAME=""
export MAS_ENTITLEMENT_KEY=""
export MAS_INSTANCE_ID=""
export MAS_APP_CHANNEL=""
export MAS_CATALOG_VERSION=""
export IBM_ENTITLEMENT_KEY=${MAS_ENTITLEMENT_KEY}
export MAS_CONFIG_DIR=""
export DRO_CONTACT_EMAIL=""
export DRO_CONTACT_FIRSTNAME=""
export DRO_CONTACT_LASTNAME=""
export SLS_MONGODB_CFG_FILE=${MAS_CONFIG_DIR}/mongo-mongoce.yml
export SLS_LICENSE_ID=""
export SLS_LICENSE_FILE=""
export INSTALL_DB2=""
export INSTALL_MINIO=""
export INSTALL_MONGO=""
export INSTALL_SLS=""
export INSTALL_DRO=""
export AISERVICE_S3_BUCKET_PREFIX=""
export AISERVICE_S3_REGION=""
export AISERVICE_S3_ENDPOINT_URL=""
export AISERVICE_TENANT_S3_REGION=""
export AISERVICE_TENANT_S3_ENDPOINT_URL=""
export AISERVICE_TENANT_S3_BUCKET_PREFIX=""
export AISERVICE_TENANT_S3_ACCESS_KEY=""
export AISERVICE_TENANT_S3_SECRET_KEY=""
export RSL_URL=""
export RSL_ORG_ID=""
export RSL_TOKEN=""
export MINIO_ROOT_PASSWORD=""
export AISERVICE_S3_ACCESSKEY=""
export AISERVICE_S3_SECRETKEY=${MINIO_ROOT_PASSWORD}
export AISERVICE_S3_HOST=""
export AISERVICE_S3_SSL=""
export AISERVICE_S3_PROVIDER=""
export AISERVICE_S3_PORT=""
export AISERVICE_S3_REGION=""
export AISERVICE_S3_TENANTS_BUCKET=""
export AISERVICE_S3_TEMPLATES_BUCKET=""
export AISERVICE_WATSONXAI_APIKEY=""
export AISERVICE_WATSONXAI_URL=""
export AISERVICE_WATSONXAI_PROJECT_ID=""
export AISERVICE_SUBSCRIPTION_ID=""
export AISERVICE_DRO_TENANT_ID=""
export AISERVICE_TENANT_ENTITLEMENT_START_DATE="YYYY-MM-DD"
export AISERVICE_TENANT_ENTITLEMENT_END_DATE="YYYY-MM-DD"
oc login --token=xxxx --server=https://myocpserver
ansible-playbook playbooks/aiservice.yml
Create S3¤
export MAS_INSTANCE_ID="<instanceId>"
export AISERVICE_S3_ACCESSKEY="<storage provider access key>"
export AISERVICE_S3_SECRETKEY="<storage provider secret key>"
export AISERVICE_S3_HOST="<storage provider host>"
export AISERVICE_S3_REGION="<storage provider region>"
export AISERVICE_S3_ACTION="install"
export ROLE_NAME="aiservice"
oc login --token=xxxx --server=https://myocpserver
ansible-playbook playbooks/run_role.yml
Delete S3¤
export MAS_INSTANCE_ID="<instanceId>"
export AISERVICE_S3_ACCESSKEY="<storage provider access key>"
export AISERVICE_S3_SECRETKEY="<storage provider secret key>"
export AISERVICE_S3_HOST="<storage provider host>"
export AISERVICE_S3_REGION="<storage provider region>"
export AISERVICE_S3_ACTION="remove"
export ROLE_NAME="aiservice"
oc login --token=xxxx --server=https://myocpserver
ansible-playbook playbooks/run_role.yml
Create API Key¤
export MAS_INSTANCE_ID="<instanceId>"
export AISERVICE_APIKEY_ACTION="install"
export ROLE_NAME="aiservice"
oc login --token=xxxx --server=https://myocpserver
ansible-playbook playbooks/run_role.yml
Delete API Key¤
export MAS_INSTANCE_ID="<instanceId>"
export AISERVICE_APIKEY_ACTION="remove"
export ROLE_NAME="aiservice"
oc login --token=xxxx --server=https://myocpserver
ansible-playbook playbooks/run_role.yml
Create WatsonX API Key¤
export MAS_INSTANCE_ID="<instanceId>"
export AISERVICE_WATSONX_ACTION="install"
export ROLE_NAME="aiservice"
oc login --token=xxxx --server=https://myocpserver
ansible-playbook playbooks/run_role.yml
Delete WatsonX API Key¤
export MAS_INSTANCE_ID="<instanceId>"
export AISERVICE_WATSONX_ACTION="remove"
export ROLE_NAME="aiservice"
oc login --token=xxxx --server=https://myocpserver
ansible-playbook playbooks/run_role.yml
Create Tenant¤
The AISERVICE_SLS_REGISTRATION_KEY value can be found in ibm-sls namespace, in pod sls-api-licensing-85699fb57-9lmrq please look in environments tab, then value REGISTRATION_KEY . To obtain the AISERVICE_DRO_TOKEN go to mas-instance_id-core namespace and in secrets find dro-apikey
export AISERVICE_TENANT_NAME="user7"
export AISERVICE_SLS_SUBSCRIPTION_ID="007"
export TENANT_ACTION="install"
export ROLE_NAME="aiservice_tenant"
export AISERVICE_SAAS="true"
export AISERVICE_DOMAIN=""
export AISERVICE_SLS_URL="https://sls.ibm-sls.ibm-sls."${AISERVICE_DOMAIN}
export AISERVICE_SLS_REGISTRATION_KEY=""
export AISERVICE_DRO_URL="https://ibm-data-reporter-redhat-marketplace."${AISERVICE_DOMAIN}
export AISERVICE_DRO_TOKEN=""
export AISERVICE_SLS_CACERT=""
export AISERVICE_DRO_CACERT=""
export AISERVICE_WATSONXAI_APIKEY=""
export AISERVICE_WATSONXAI_URL=""
export AISERVICE_WATSONXAI_PROJECT_ID=""
export AISERVICE_S3_ACCESSKEY=""
export AISERVICE_S3_SECRETKEY=""
export AISERVICE_S3_HOST=""
export AISERVICE_S3_SSL=""
export AISERVICE_S3_PROVIDER=""
export AISERVICE_S3_PORT=""
export AISERVICE_S3_REGION=""
export AISERVICE_S3_TENANTS_BUCKET=""
export AISERVICE_S3_TEMPLATES_BUCKET=""
oc login --token=xxxx --server=https://myocpserver
ansible-playbook playbooks/run_role.yml
Tip
To create addidional tenants we don't need to specify buckets