diff --git a/python/src/mas/cli/aiservice/install/app.py b/python/src/mas/cli/aiservice/install/app.py index 41ab26ccc8..299dc011a4 100644 --- a/python/src/mas/cli/aiservice/install/app.py +++ b/python/src/mas/cli/aiservice/install/app.py @@ -254,11 +254,15 @@ def nonInteractiveMode(self) -> None: self.operationalMode = 1 self.setParam("environment_type", "production") self.setParam("aiservice_odh_model_deployment_type", "raw") + self.setParam("aiservice_rhoai_model_deployment_type", "raw") + self.setParam("rhoai", "false") else: self.operationalMode = 2 self.setParam("mas_annotations", "mas.ibm.com/operationalMode=nonproduction") self.setParam("environment_type", "non-production") self.setParam("aiservice_odh_model_deployment_type", "serverless") + self.setParam("aiservice_rhoai_model_deployment_type", "serverless") + self.setParam("rhoai", "false") elif key == "additional_configs": self.localConfigDir = value @@ -875,6 +879,10 @@ def configOperationMode(self): if self.operationalMode == 1: self.setParam("environment_type", "production") self.setParam("aiservice_odh_model_deployment_type", "raw") + self.setParam("aiservice_rhoai_model_deployment_type", "raw") + self.setParam("rhoai", "false") else: self.setParam("environment_type", "non-production") self.setParam("aiservice_odh_model_deployment_type", "serverless") + self.setParam("aiservice_rhoai_model_deployment_type", "serverless") + self.setParam("rhoai", "false") diff --git a/python/src/mas/cli/aiservice/install/argBuilder.py b/python/src/mas/cli/aiservice/install/argBuilder.py index c24b43ec76..6616b3b930 100644 --- a/python/src/mas/cli/aiservice/install/argBuilder.py +++ b/python/src/mas/cli/aiservice/install/argBuilder.py @@ -129,6 +129,10 @@ def buildCommand(self) -> str: if self.getParam('aiservice_odh_model_deployment_type') != "": command += f" --odh-model-deployment-type \"{self.getParam('aiservice_odh_model_deployment_type')}\"{newline}" + if self.getParam('aiservice_rhoai_model_deployment_type') != "": + command += f" --rhoai-model-deployment-type \"{self.getParam('aiservice_rhoai_model_deployment_type')}\"{newline}" + if self.getParam('rhoai') == "true": + command += f" --rhoai{newline}" if self.getParam('aiservice_watsonxai_apikey') != "": command += f" --watsonxai-apikey \"{self.getParam('aiservice_watsonxai_apikey')}\"{newline}" diff --git a/python/src/mas/cli/aiservice/install/argParser.py b/python/src/mas/cli/aiservice/install/argParser.py index 883a958be7..79288c0158 100644 --- a/python/src/mas/cli/aiservice/install/argParser.py +++ b/python/src/mas/cli/aiservice/install/argParser.py @@ -186,6 +186,27 @@ def isValidFile(parser, arg) -> str: help="Model deployment type for ODH" ) +# Red Hat Openshift AI +# ----------------------------------------------------------------------------- +rhoaiArgGroup = aiServiceinstallArgParser.add_argument_group("RedHat Openshift AI") + +rhoaiArgGroup.add_argument( + "--rhoai-model-deployment-type", + dest="aiservice_rhoai_model_deployment_type", + required=False, + default="raw", + help="Model deployment type for RedHat Openshift AI" +) + +rhoaiArgGroup.add_argument( + "--rhoai", + dest="rhoai", + required=False, + help="temporary flag to install Redhat Openshift AI instead of Opendatahub", + action="store_const", + const="true" +) + # S3 - General # ----------------------------------------------------------------------------- s3ArgGroup = aiServiceinstallArgParser.add_argument_group("S3 Storage") diff --git a/python/src/mas/cli/aiservice/install/params.py b/python/src/mas/cli/aiservice/install/params.py index 39047dc267..c17287f8af 100644 --- a/python/src/mas/cli/aiservice/install/params.py +++ b/python/src/mas/cli/aiservice/install/params.py @@ -59,6 +59,9 @@ "artifactory_token", # ODH "aiservice_odh_model_deployment_type", + # RHOAI + "aiservice_rhoai_model_deployment_type", + "rhoai", # AI Service "aiservice_s3_accesskey", "aiservice_s3_secretkey", diff --git a/python/src/mas/cli/install/app.py b/python/src/mas/cli/install/app.py index 306af5024f..1059a111fb 100644 --- a/python/src/mas/cli/install/app.py +++ b/python/src/mas/cli/install/app.py @@ -579,9 +579,13 @@ def configOperationMode(self): if self.operationalMode == 1: self.setParam("environment_type", "production") self.setParam("aiservice_odh_model_deployment_type", "raw") + self.setParam("aiservice_rhoai_model_deployment_type", "raw") + self.setParam("rhoai", "false") else: self.setParam("environment_type", "non-production") self.setParam("aiservice_odh_model_deployment_type", "serverless") + self.setParam("aiservice_rhoai_model_deployment_type", "serverless") + self.setParam("rhoai", "false") @logMethodCall def configRoutingMode(self): diff --git a/python/src/mas/cli/install/argBuilder.py b/python/src/mas/cli/install/argBuilder.py index 71ddb0002c..0fe8c04a0c 100644 --- a/python/src/mas/cli/install/argBuilder.py +++ b/python/src/mas/cli/install/argBuilder.py @@ -338,6 +338,13 @@ def buildCommand(self) -> str: if self.getParam('aiservice_odh_model_deployment_type') != "": command += f" --odh-model-deployment-type \"{self.getParam('aiservice_odh_model_deployment_type')}\"{newline}" + if self.getParam('aiservice_rhoai_model_deployment_type') != "": + command += f" --rhoai-model-deployment-type \"{self.getParam('aiservice_rhoai_model_deployment_type')}\"{newline}" + if self.getParam('rhoai') == "true": + command += f" --rhoai{newline}" + + if self.getParam('mas_app_settings_persistent_volumes_flag') == "true": + command += f" --manage-persistent-volumes{newline}" if self.getParam('aiservice_watsonxai_apikey') != "": command += f" --watsonxai-apikey \"{self.getParam('aiservice_watsonxai_apikey')}\"{newline}" diff --git a/python/src/mas/cli/install/argParser.py b/python/src/mas/cli/install/argParser.py index 48990e1c93..383b2ac06a 100644 --- a/python/src/mas/cli/install/argParser.py +++ b/python/src/mas/cli/install/argParser.py @@ -765,6 +765,26 @@ def isValidFile(parser: argparse.ArgumentParser, arg: str) -> str: help="Model deployment type for ODH" ) +# Red Hat Openshift AI +# ----------------------------------------------------------------------------- +rhoaiArgGroup = installArgParser.add_argument_group("RedHat Openshift AI") + +rhoaiArgGroup.add_argument( + "--rhoai-model-deployment-type", + dest="aiservice_rhoai_model_deployment_type", + required=False, + default="raw", + help="Model deployment type for RedHat Openshift AI" +) + +rhoaiArgGroup.add_argument( + "--rhoai", + dest="rhoai", + required=False, + help="temporary flag to install Redhat Openshift AI instead of Opendatahub", + action="store_const", + const="true" +) # S3 Storage # ----------------------------------------------------------------------------- aiServiceS3ArgGroup = installArgParser.add_argument_group( diff --git a/python/src/mas/cli/install/params.py b/python/src/mas/cli/install/params.py index bf6b89aefc..5a5326e7f8 100644 --- a/python/src/mas/cli/install/params.py +++ b/python/src/mas/cli/install/params.py @@ -167,6 +167,9 @@ "mas_special_characters", # ODH "aiservice_odh_model_deployment_type", + # RHOAI + "aiservice_rhoai_model_deployment_type", + "rhoai", # AI Service "aiservice_s3_accesskey", "aiservice_s3_secretkey", diff --git a/tekton/generate-tekton-tasks.yml b/tekton/generate-tekton-tasks.yml index ef06369f38..73c5d6dd56 100644 --- a/tekton/generate-tekton-tasks.yml +++ b/tekton/generate-tekton-tasks.yml @@ -52,6 +52,7 @@ - minio - aiservice - odh + - rhoai - aiservice-upgrade # 4. Generate Tasks (FVT) diff --git a/tekton/src/params/install-aiservice.yml.j2 b/tekton/src/params/install-aiservice.yml.j2 index 9e57c1f76d..3da99e59c9 100644 --- a/tekton/src/params/install-aiservice.yml.j2 +++ b/tekton/src/params/install-aiservice.yml.j2 @@ -64,6 +64,14 @@ type: string description: Model deployment type for ODH. Must be one of; [raw, serverless] default: "raw" +- name: aiservice_rhoai_model_deployment_type + type: string + description: Model deployment type for Redhat Openshift AI. Must be one of; [raw, serverless] + default: "raw" +- name: rhoai + type: string + description: flag to install rhoai + default: "" - name: minio_root_user type: string diff --git a/tekton/src/pipelines/mas-install.yml.j2 b/tekton/src/pipelines/mas-install.yml.j2 index 015f5d9211..340876ab5e 100644 --- a/tekton/src/pipelines/mas-install.yml.j2 +++ b/tekton/src/pipelines/mas-install.yml.j2 @@ -203,6 +203,12 @@ spec: runAfter: - cert-manager + # 4.6 Redhat Openshift AI ( for AI Service ) + # ------------------------------------------------------------------------- + {{ lookup('template', pipeline_src_dir ~ '/taskdefs/aiservice/rhoai.yml.j2', template_vars={'application': 'aiservice'}) | indent(4) }} + runAfter: + - cert-manager + # 5. Install & Configure IBM MAS # ------------------------------------------------------------------------- # 5.1 Configure Workspace @@ -377,6 +383,7 @@ spec: - db2-aiservice - minio - aiservice-odh + - aiservice-rhoai # 15. Verify health of the cluster before we consider the install complete # ------------------------------------------------------------------------- diff --git a/tekton/src/pipelines/taskdefs/aiservice/aiservice.yml.j2 b/tekton/src/pipelines/taskdefs/aiservice/aiservice.yml.j2 index f9c3f9ddab..2e443c266f 100644 --- a/tekton/src/pipelines/taskdefs/aiservice/aiservice.yml.j2 +++ b/tekton/src/pipelines/taskdefs/aiservice/aiservice.yml.j2 @@ -87,6 +87,9 @@ - name: environment_type value: $(params.environment_type) + # RHOAI flag + - name: rhoai + value: $(params.rhoai) - name: aiservice_certificate_issuer value: $(params.aiservice_certificate_issuer) diff --git a/tekton/src/pipelines/taskdefs/aiservice/odh.yml.j2 b/tekton/src/pipelines/taskdefs/aiservice/odh.yml.j2 index 0ab804824b..009cc7ca67 100644 --- a/tekton/src/pipelines/taskdefs/aiservice/odh.yml.j2 +++ b/tekton/src/pipelines/taskdefs/aiservice/odh.yml.j2 @@ -22,6 +22,8 @@ value: $(params.custom_labels) - name: aiservice_odh_model_deployment_type value: $(params.aiservice_odh_model_deployment_type) + - name: rhoai + value: $(params.rhoai) taskRef: name: mas-devops-aiservice-odh @@ -29,4 +31,7 @@ when: - input: "$(params.aiservice_channel)" operator: notin - values: [""] \ No newline at end of file + values: [""] + - input: "$(params.rhoai)" + operator: notin + values: ["true"] diff --git a/tekton/src/pipelines/taskdefs/aiservice/rhoai.yml.j2 b/tekton/src/pipelines/taskdefs/aiservice/rhoai.yml.j2 new file mode 100644 index 0000000000..d63e90d084 --- /dev/null +++ b/tekton/src/pipelines/taskdefs/aiservice/rhoai.yml.j2 @@ -0,0 +1,37 @@ +- name: aiservice-rhoai + params: + {{ lookup('template', 'taskdefs/common/cli-params.yml.j2') | indent(4) }} + - name: devops_suite_name + value: aiservice-rhoai + + - name: mas_instance_id +{% if application is defined and application == "aiservice" %} + value: $(params.aiservice_instance_id) +{% else %} + value: $(params.mas_instance_id) +{% endif %} + - name: artifactory_username + value: $(params.artifactory_username) + - name: artifactory_token + value: $(params.artifactory_token) + - name: aiservice_channel + value: "$(params.aiservice_channel)" + - name: ibm_entitlement_key + value: $(params.ibm_entitlement_key) + - name: custom_labels + value: $(params.custom_labels) + - name: aiservice_rhoai_model_deployment_type + value: $(params.aiservice_rhoai_model_deployment_type) + - name: rhoai + value: $(params.rhoai) + + taskRef: + name: mas-devops-aiservice-rhoai + kind: Task + when: + - input: "$(params.aiservice_channel)" + operator: notin + values: [""] + - input: "$(params.rhoai)" + operator: in + values: ["true"] diff --git a/tekton/src/tasks/aiservice/aiservice.yml.j2 b/tekton/src/tasks/aiservice/aiservice.yml.j2 index 62dc2977e2..252414cfce 100644 --- a/tekton/src/tasks/aiservice/aiservice.yml.j2 +++ b/tekton/src/tasks/aiservice/aiservice.yml.j2 @@ -152,6 +152,8 @@ spec: - name: rsl_token type: string + # RHOAI flag + - name: rhoai # Certificate Issuer - name: aiservice_certificate_issuer type: string diff --git a/tekton/src/tasks/aiservice/rhoai.yml.j2 b/tekton/src/tasks/aiservice/rhoai.yml.j2 new file mode 100644 index 0000000000..fd72e96465 --- /dev/null +++ b/tekton/src/tasks/aiservice/rhoai.yml.j2 @@ -0,0 +1,91 @@ +--- +apiVersion: tekton.dev/v1beta1 +kind: Task +metadata: + name: mas-devops-aiservice-rhoai +spec: + params: + {{ lookup('template', task_src_dir ~ '/common/cli-params.yml.j2') | indent(4) }} + + # Pre-Release Support + - name: artifactory_username + default: '' + type: string + description: Required to use development MAS builds + - name: artifactory_token + default: '' + type: string + description: Required to use development MAS builds + + # Entitlement + - name: ibm_entitlement_key + type: string + + # MAS Details + - name: mas_instance_id + type: string + description: Instance ID + + # Application - Operator + - name: aiservice_channel + type: string + description: Catalog channel for the application operator subscription + + # Application - Operand + - name: mas_app_bindings_jdbc + default: "" + type: string + - name: mas_app_plan + type: string + description: Application installation plan + default: "" + + # Custom Label Support + - name: custom_labels + type: string + description: Optional MAS custom labels, comma separated list of key=value pairs + default: "" + + # Model deployment type + - name: aiservice_rhoai_model_deployment_type + type: string + description: Model deployment type for RHOAI + default: "raw" + + stepTemplate: + env: + {{ lookup('template', task_src_dir ~ '/common/cli-env.yml.j2') | indent(6) }} + + # Pre-Release Support + - name: ARTIFACTORY_USERNAME + value: $(params.artifactory_username) + - name: ARTIFACTORY_TOKEN + value: $(params.artifactory_token) + + # Entitlement + - name: IBM_ENTITLEMENT_KEY + value: $(params.ibm_entitlement_key) + + # MAS Details + - name: MAS_INSTANCE_ID + value: $(params.mas_instance_id) + + # Application - Operator + - name: MAS_APP_CHANNEL + value: $(params.aiservice_channel) + + # Custom Label Support + - name: CUSTOM_LABELS + value: $(params.custom_labels) + + # Model deployment type + - name: AISERVICE_RHOAI_MODEL_DEPLOYMENT_TYPE + value: $(params.aiservice_rhoai_model_deployment_type) + + steps: + - name: aiservice-rhoai + command: + - /opt/app-root/src/run-role.sh + - aiservice_rhoai + image: quay.io/ibmmas/cli:latest + imagePullPolicy: $(params.image_pull_policy)