Skip to content
Merged
34 changes: 31 additions & 3 deletions python/src/mas/cli/aiservice/install/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,29 @@ def configAibroker(self):

self.configOperationMode()

@logMethodCall
def chooseInstallFlavour(self) -> None:
self.printH1("Choose Install Mode")
self.printDescription([
"There are two flavours of the interactive install to choose from: <u>Simplified</u> and <u>Advanced</u>. The simplified option will present fewer dialogs, but you lose the ability to configure the following aspects of the installation:",
" - Configure certificate issuer",
])
self.showAdvancedOptions = self.yesOrNo("Show advanced installation options")

@logMethodCall
def interactiveMode(self, simplified: bool, advanced: bool) -> None:
# Interactive mode
self.interactiveMode = True

if simplified:
self.showAdvancedOptions = False
elif advanced:
self.showAdvancedOptions = True
else:
self.chooseInstallFlavour()

self.storageClassProvider = "custom"
self.slsLicenseFileLocal = None
self.showAdvancedOptions = True

# Catalog
self.configCatalog()
Expand All @@ -150,7 +165,7 @@ def interactiveMode(self, simplified: bool, advanced: bool) -> None:
self.configCertManager()
self.configAibroker()
if self.devMode:
self.configAppChannel("aibroker")
self.configAppChannel()

self.aiServiceSettings()
self.aiServiceTenantSettings()
Expand Down Expand Up @@ -505,6 +520,7 @@ def setupApprovals(self, namespace: str) -> None:
logger.debug(f"Approval workflow for {approval['id']} will be enabled during install ({approval['maxRetries']} / {approval['retryDelay']}s / {approval['ignoreFailure']})")
self.initializeApprovalConfigMap(namespace, approval['id'], True, approval['maxRetries'], approval['retryDelay'], approval['ignoreFailure'])

@logMethodCall
def aiServiceSettings(self) -> None:
self.printH1("AI Service Settings")

Expand Down Expand Up @@ -537,6 +553,18 @@ def aiServiceSettings(self) -> None:
self.promptForString("Storage tenants bucket", "aiservice_s3_tenants_bucket")
self.promptForString("Storage templates bucket", "aiservice_s3_templates_bucket")

# Configure Certificate Issuer
self.configCertIssuer()

@logMethodCall
def configCertIssuer(self):
if self.showAdvancedOptions:
self.printH1("Configure Certificate Issuer")
configureCertIssuer = self.yesOrNo('Configure certificate issuer')
if configureCertIssuer:
self.promptForString("Certificate issuer name", "aiservice_certificate_issuer")

@logMethodCall
def aiServiceTenantSettings(self) -> None:
self.printH1("AI Service Tenant Settings")
self.printDescription([
Expand Down Expand Up @@ -829,7 +857,7 @@ def configDRO(self) -> None:
self.promptForString("IBM Data Reporter Operator (DRO) Namespace", "dro_namespace", default="redhat-marketplace")

@logMethodCall
def configAppChannel(self, appId):
def configAppChannel(self):
self.params["aiservice_channel"] = prompt(HTML('<Yellow>Custom channel for AI Service</Yellow> '))

@logMethodCall
Expand Down
5 changes: 5 additions & 0 deletions python/src/mas/cli/aiservice/install/argBuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ def buildCommand(self) -> str:

# AI Service Advanced Settings
# -----------------------------------------------------------------------------

# Certificate Issuer
if self.getParam('aiservice_certificate_issuer') != "":
command += f" --aiservice-certificate-issuer \"{self.getParam('aiservice_certificate_issuer')}\"{newline}"

if self.getParam('aiservice_s3_accesskey') != "":
command += f" --s3-accesskey \"{self.getParam('aiservice_s3_accesskey')}\"{newline}"
if self.getParam('aiservice_s3_secretkey') != "":
Expand Down
6 changes: 6 additions & 0 deletions python/src/mas/cli/aiservice/install/argParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,12 @@ def isValidFile(parser, arg) -> str:
default="non-production",
help="Environment type (default: non-production)"
)
aiServiceArgGroup.add_argument(
"--aiservice-certificate-issuer",
dest="aiservice_certificate_issuer",
required=False,
help="Provide the name of the Issuer to configure AI Service to issue certificates",
)


# IBM Db2 Universal Operator
Expand Down
3 changes: 3 additions & 0 deletions python/src/mas/cli/aiservice/install/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,7 @@
"rsl_token",
"rsl_ca_crt",
"environment_type",

# Certificate Issuer
"aiservice_certificate_issuer",
]
3 changes: 3 additions & 0 deletions python/src/mas/cli/aiservice/install/summarizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ def aiServiceSummary(self) -> None:
self.printParamSummary("Instance ID", "aiservice_instance_id")
self.printParamSummary("Environment Type", "environment_type")

if "aiservice_certificate_issuer" in self.params:
self.printParamSummary("Certificate Issuer", "aiservice_certificate_issuer")

self.printH2("AI Service Tenant Entitlement")
self.printParamSummary("Entitlement Type", "tenant_entitlement_type")
self.printParamSummary("Start Date", "tenant_entitlement_start_date")
Expand Down
11 changes: 11 additions & 0 deletions python/src/mas/cli/install/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1026,6 +1026,17 @@ def aiServiceSettings(self) -> None:
self.promptForString("Storage tenants bucket", "aiservice_s3_tenants_bucket")
self.promptForString("Storage templates bucket", "aiservice_s3_templates_bucket")

# Configure Certificate Issuer
self.configAIServiceCertIssuer()

@logMethodCall
def configAIServiceCertIssuer(self):
if self.showAdvancedOptions:
self.printH1("Configure Certificate Issuer")
configureCertIssuer = self.yesOrNo('Configure certificate issuer')
if configureCertIssuer:
self.promptForString("Certificate issuer name", "aiservice_certificate_issuer")

@logMethodCall
def aiServiceTenantSettings(self) -> None:
if self.installAIService:
Expand Down
5 changes: 5 additions & 0 deletions python/src/mas/cli/install/argBuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,11 @@ def buildCommand(self) -> str:
command += f" --aiservice-instance-id \"{self.getParam('aiservice_instance_id')}\"{newline}"
if self.getParam('aiservice_channel') != "":
command += f" --aiservice-channel \"{self.getParam('aiservice_channel')}\"{newline}"

# Certificate Issuer for AI Service
if self.getParam('aiservice_certificate_issuer') != "":
command += f" --aiservice-certificate-issuer \"{self.getParam('aiservice_certificate_issuer')}\"{newline}"

if self.getParam('aiservice_s3_accesskey') != "" and self.getParam('minio_root_user') == "":
command += f" --s3-accesskey \"{self.getParam('aiservice_s3_accesskey')}\"{newline}"
if self.getParam('aiservice_s3_secretkey') != "" and self.getParam('minio_root_user') == "":
Expand Down
Loading