Skip to content

Commit

Permalink
Making sure Manage Foundation is installed when MAS 9.1 channel is se…
Browse files Browse the repository at this point in the history
…lected and user chooses not to install Manage.
  • Loading branch information
Marcelo Blechner committed Feb 24, 2025
1 parent 8cd01c4 commit 38fb233
Show file tree
Hide file tree
Showing 4 changed files with 200 additions and 170 deletions.
13 changes: 12 additions & 1 deletion python/src/mas/cli/install/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,18 @@ def configApps(self):
if self.installMonitor:
self.configAppChannel("monitor")

self.installManage = self.yesOrNo("Install Manage")
self.manageAppName = "Manage"
self.isManageFoundation = False
self.installManage = self.yesOrNo(f"Install {self.manageAppName}")

# If the selection was to not install manage but we are in mas_channel 9.1 or later, we need to set self.isManageFoundation to True
# Also, we need to force self.installManage to be True because Manage must always be installed in MAS 9.1 or later
if not self.installManage:
if not self.getParam("mas_channel").startswith("8.") and not self.getParam("mas_channel").startswith("9.0"):
self.installManage = True
self.isManageFoundation = True
self.manageAppName = "Manage Foundation"
self.printDescription([f"{self.manageAppName} will be installed with the following apps: User, Group, Graphite Tool and Mobile Configurator"])

if self.installManage:
self.configAppChannel("manage")
Expand Down
32 changes: 16 additions & 16 deletions python/src/mas/cli/install/settings/db2Settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,19 @@ def configDb2(self) -> None:

# Check if a configuration already exists before creating a new one
jdbcCfgFile = path.join(self.localConfigDir, f"jdbc-{instanceId}-manage.yaml")
print_formatted_text(f"Searching for Manage database configuration file in {jdbcCfgFile} ...")
print_formatted_text(f"Searching for {self.manageAppName} database configuration file in {jdbcCfgFile} ...")
if path.exists(jdbcCfgFile):
if self.yesOrNo(f"Manage database configuration file 'jdbc-{instanceId}-manage.yaml' already exists. Do you want to generate a new one"):
if self.yesOrNo(f"{self.manageAppName} database configuration file 'jdbc-{instanceId}-manage.yaml' already exists. Do you want to generate a new one"):
self.generateJDBCCfg(instanceId=instanceId, scope="workspace-application", workspaceId=workspaceId, appId="manage", destination=jdbcCfgFile)
else:
print_formatted_text(f"Expected file ({jdbcCfgFile}) was not found, generating a valid Manage database configuration file now ...")
print_formatted_text(f"Expected file ({jdbcCfgFile}) was not found, generating a valid {self.manageAppName} database configuration file now ...")
self.generateJDBCCfg(instanceId=instanceId, scope="workspace-application", workspaceId=workspaceId, appId="manage", destination=jdbcCfgFile)
return

# Proceed as normal
# We know we are installing either IoT or Manage, and on amd64 target architecture
self.printDescription([
"The installer can setup one or more IBM Db2 instances in your OpenShift cluster for the use of applications that require a JDBC datasource (IoT, Manage, Monitor, & Predict) or you may choose to configure MAS to use an existing database"
f"The installer can setup one or more IBM Db2 instances in your OpenShift cluster for the use of applications that require a JDBC datasource (IoT, {self.manageAppName}, Monitor, & Predict) or you may choose to configure MAS to use an existing database"
])

self.setParam("db2_cpu_requests", "4000m")
Expand Down Expand Up @@ -111,28 +111,28 @@ def configDb2(self) -> None:
self.setParam("db2_action_system", "none")

if self.installManage:
self.printH2("Database Configuration for Maximo Manage")
self.printH2(f"Database Configuration for Maximo {self.manageAppName}")
self.printDescription([
"Maximo Manage can be configured to share the system Db2 instance or use it's own dedicated database:",
f"Maximo {self.manageAppName} can be configured to share the system Db2 instance or use it's own dedicated database:",
" - Use of a shared instance has a significant footprint reduction but is only recommended for development/test/demo installs",
" - In most production systems you will want to use a dedicated database",
" - IBM Db2, Oracle Database, & Microsoft SQL Server are all supported database options"
])
# Determine whether to use the system or a dedicated database
if self.installIoT and self.yesOrNo("Re-use System Db2 instance for Manage application"):
if self.installIoT and self.yesOrNo(f"Re-use System Db2 instance for {self.manageAppName} application"):
# We are going to bind Manage to the system database, which has already been set up in the previous step
self.setParam("mas_appws_bindings_jdbc_manage", "system")
self.setParam("db2_action_manage", "none")
else:
self.setParam("mas_appws_bindings_jdbc_manage", "workspace-application")
if self.yesOrNo("Create manage dedicated Db2 instance using the IBM Db2 Universal Operator"):
if self.yesOrNo(f"Create {self.manageAppName} dedicated Db2 instance using the IBM Db2 Universal Operator"):
self.setParam("db2_action_manage", "install")
self.printDescription([
"Available Db2 instance types for Manage:",
f"Available Db2 instance types for {self.manageAppName}:",
" 1. DB2 Warehouse (Default option)",
" 2. DB2 Online Transactional Processing (OLTP)"
])
self.promptForListSelect(message="Select the Manage dedicated DB2 instance type", options=["db2wh", "db2oltp"], param="db2_type", default="1")
self.promptForListSelect(message=f"Select the {self.manageAppName} dedicated DB2 instance type", options=["db2wh", "db2oltp"], param="db2_type", default="1")
else:
workspaceId = self.getParam("mas_workspace_id")
self.setParam("db2_action_manage", "byo")
Expand All @@ -141,12 +141,12 @@ def configDb2(self) -> None:

# Check if a configuration already exists before creating a new one
jdbcCfgFile = path.join(self.localConfigDir, f"jdbc-{instanceId}-manage.yaml")
print_formatted_text(f"Searching for Manage database configuration file in {jdbcCfgFile} ...")
print_formatted_text(f"Searching for {self.manageAppName} database configuration file in {jdbcCfgFile} ...")
if path.exists(jdbcCfgFile):
if self.yesOrNo(f"Manage database configuration file 'jdbc-{instanceId}-manage.yaml' already exists. Do you want to generate a new one"):
if self.yesOrNo(f"{self.manageAppName} database configuration file 'jdbc-{instanceId}-manage.yaml' already exists. Do you want to generate a new one"):
self.generateJDBCCfg(instanceId=instanceId, scope="workspace-application", workspaceId=workspaceId, appId="manage", destination=jdbcCfgFile)
else:
print_formatted_text(f"Expected file ({jdbcCfgFile}) was not found, generating a valid Manage database configuration file now ...")
print_formatted_text(f"Expected file ({jdbcCfgFile}) was not found, generating a valid {self.manageAppName} database configuration file now ...")
self.generateJDBCCfg(instanceId=instanceId, scope="workspace-application", workspaceId=workspaceId, appId="manage", destination=jdbcCfgFile)
else:
self.setParam("db2_action_manage", "none")
Expand All @@ -161,7 +161,7 @@ def configDb2(self) -> None:
# -------------------------------------------------------------------------
self.printH2("Node Affinity and Tolerations")
self.printDescription([
"Note that the same settings are applied to both the IoT and Manage Db2 instances",
f"Note that the same settings are applied to both the IoT and {self.manageAppName} Db2 instances",
"Use existing node labels and taints to control scheduling of the Db2 workload in your cluster",
"For more information refer to the Red Hat documentation:",
" - <Orange><u>https://docs.openshift.com/container-platform/4.16/nodes/scheduling/nodes-scheduler-node-affinity.html</u></Orange>",
Expand All @@ -179,7 +179,7 @@ def configDb2(self) -> None:

self.printH2("Database CPU & Memory")
self.printDescription([
"Note that the same settings are applied to both the IoT and Manage Db2 instances"
f"Note that the same settings are applied to both the IoT and {self.manageAppName} Db2 instances"
])

if self.yesOrNo("Customize CPU and memory request/limit"):
Expand All @@ -190,7 +190,7 @@ def configDb2(self) -> None:

self.printH2("Database Storage Capacity")
self.printDescription([
"Note that the same settings are applied to both the IoT and Manage Db2 instances"
f"Note that the same settings are applied to both the IoT and {self.manageAppName} Db2 instances"
])

if self.yesOrNo("Customize storage capacity"):
Expand Down
Loading

0 comments on commit 38fb233

Please sign in to comment.