Skip to content

Commit 2d907dd

Browse files
committed
Merge remote-tracking branch 'origin/stable' into mascore6072
2 parents 6b36c9c + 2040fc5 commit 2d907dd

File tree

6 files changed

+241
-7
lines changed

6 files changed

+241
-7
lines changed
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
---
2+
# Case bundle configuration for IBM Maximo Operator Catalog 250501
3+
# -----------------------------------------------------------------------------
4+
# In the future this won't be necessary as we'll be able to mirror from the
5+
# catalog itself, but not everything in the catalog supports this yet (including MAS)
6+
# so we need to use the CASE bundle mirror process still.
7+
8+
catalog_digest: sha256:152bb3a71e029d2215a14816ac928bc28054d85d6123a3813c9679fd7eb91650
9+
10+
# Dependencies
11+
# -----------------------------------------------------------------------------
12+
ibm_licensing_version: 4.2.12 # Operator version 4.2.11 (https://github.com/IBM/cloud-pak/tree/master/repo/case/ibm-licensing)
13+
common_svcs_version: 4.7.0 # check once why we have 4.3.0 in all previous versions since so long it's 4.3.0 # Operator version 4.3.1 (https://github.com/IBM/cloud-pak/tree/master/repo/case/ibm-cp-common-services)
14+
common_svcs_version_2: 4.8.0
15+
common_svcs_version_1: 4.3.0 #+20240702.100000 # common_svcs is a mess
16+
17+
cp4d_platform_version: 5.0.0 #+20240716.101015 # Operator version 5.0.0 (https://github.com/IBM/cloud-pak/tree/master/repo/case/ibm-cp-datacore/4.0.0%2B20231213.115030)
18+
19+
ibm_zen_version: 6.0.1+20240708.121250.32 # For CPD5 ibm-zen has to be explicitily mirrored
20+
21+
db2u_version: 6.0.1+20240704.142950.9960 # Operator version 110509.0.2 to find the version 6.0.1, search CASE_VERSION in db2u, catalog.yaml into ibm-maximo-operator-catalog (https://github.com/IBM/cloud-pak/tree/master/repo/case/ibm-db2uoperator)
22+
events_version: 5.0.1 # Operator version 5.0.1 (https://github.com/IBM/cloud-pak/tree/master/repo/case/ibm-events-operator)
23+
uds_version: 2.0.12 # Operator version 2.0.12 # sticking to 2.0.12 version # Please do Not Change
24+
sls_version: 3.11.1 # No update # Operator version 3.10.0 (https://github.ibm.com/maximoappsuite/ibm-sls/releases)
25+
tsm_version: 1.6.2 # No update # Operator version 1.5.4 (https://github.ibm.com/maximoappsuite/ibm-truststore-mgr/releases)
26+
dd_version: 1.1.18 # Updated # Operator version 1.1.14 (https://github.ibm.com/maximoappsuite/ibm-data-dictionary/releases)
27+
appconnect_version: 6.2.0 # Operator version 6.2.0 # sticking to 6.2.0 version # Please do Not Change
28+
wsl_version: 9.0.0 # Operator version 9.0.0
29+
wml_version: 9.0.0 # Operator version 5.0.0
30+
# ccs_build: +20240528.144404.460 # ibm-ccs from version 9.0.0 requires the build version
31+
# datarefinery_build: +20240517.202103.146
32+
spark_version: 9.0.0 # Operator version 5.0.0
33+
cognos_version: 25.0.0 # Operator version 25.0.0
34+
couchdb_version: 1.0.13 # Operator version 2.2.1 (This is required for Assist 9.0, https://github.com/IBM/cloud-pak/blob/master/repo/case/ibm-couchdb/index.yaml)
35+
elasticsearch_version: 1.1.2570 # Operator version 1.1.2470
36+
37+
38+
# Maximo Application Suite
39+
# -----------------------------------------------------------------------------
40+
mas_core_version:
41+
9.1.x-feature: 9.1.0-pre.stable_9718 # Updated
42+
9.0.x: 9.0.11 # Updated
43+
8.10.x: 8.10.25 # Updated
44+
8.11.x: 8.11.22 # Updated
45+
mas_assist_version:
46+
9.0.x: 9.0.5 # Updated
47+
8.10.x: 8.7.8 # No Update
48+
8.11.x: 8.8.7 # No Update
49+
mas_hputilities_version:
50+
9.0.x: "" # Not Supported
51+
8.10.x: 8.6.7 # tbc
52+
8.11.x: "" # Not Supported
53+
mas_iot_version:
54+
9.0.x: 9.0.8 # Updated
55+
8.10.x: 8.7.22 # Updated
56+
8.11.x: 8.8.18 # Updated
57+
mas_manage_version:
58+
9.1.x-feature: 9.1.0-pre.stable_10993 # Updated
59+
9.0.x: 9.0.13 # Updated
60+
8.10.x: 8.6.26 # Updated
61+
8.11.x: 8.7.20 # Updated
62+
mas_monitor_version:
63+
9.0.x: 9.0.9 # Updated
64+
8.10.x: 8.10.19 # Updated
65+
8.11.x: 8.11.17 # Updated
66+
mas_optimizer_version:
67+
9.1.x-feature: 9.1.0-pre.stable_1943 # Updated
68+
9.0.x: 9.0.10 # Updated
69+
8.10.x: 8.4.17 # Updated
70+
8.11.x: 8.5.16 # Updated
71+
mas_predict_version:
72+
9.0.x: 9.0.7 # Updated
73+
8.10.x: 8.8.8 # Updated
74+
8.11.x: 8.9.10 # Updated
75+
mas_visualinspection_version:
76+
9.1.x-feature: 9.1.0-pre.stable_2405 # Updated
77+
9.0.x: 9.0.9 # Updated
78+
8.10.x: 8.8.4 # No Update
79+
8.11.x: 8.9.12 # Updated
80+
81+
# Extra Images for UDS
82+
# ------------------------------------------------------------------------------
83+
uds_extras_version: 1.5.0
84+
85+
# Extra Images for Mongo
86+
# ------------------------------------------------------------------------------
87+
mongo_extras_version_default: 7.0.12
88+
89+
# Variables used to mirror additional mongo image versions
90+
mongo_extras_version_4: 4.4.21
91+
mongo_extras_version_5: 5.0.23
92+
mongo_extras_version_6: 6.0.12
93+
mongo_extras_version_7: 7.0.12
94+
95+
# Extra Images for Db2u
96+
# ------------------------------------------------------------------------------
97+
db2u_extras_version: 1.0.6 # No Update
98+
db2u_filter: db2
99+
100+
# Extra Images for IBM Watson Discovery
101+
# ------------------------------------------------------------------------------
102+
#wd_extras_version: 1.0.4
103+
104+
# Extra Images for Amlen
105+
# ------------------------------------------------------------------------------
106+
amlen_extras_version: 1.1.2
107+
108+
# Default Cloud Pak for Data version
109+
# ------------------------------------------------------------------------------
110+
cpd_product_version_default: 5.0.0
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
# Case bundle configuration for IBM Maximo Operator Catalog 250501
3+
# -----------------------------------------------------------------------------
4+
# In the future this won't be necessary as we'll be able to mirror from the
5+
# catalog itself, but not everything in the catalog supports this yet (including MAS)
6+
# so we need to use the CASE bundle mirror process still.
7+
8+
catalog_digest: sha256:9d0437b2e7391fb4e28ba42294c442fea5d157bd1699d7d7a415dd7a5a27a6f9
9+
10+
uds_version: 2.0.12 # Operator version 2.0.12 # sticking to 2.0.12 version # Please do Not Change
11+
sls_version: 3.11.1 # tbc # Operator version 3.10.0 (https://github.ibm.com/maximoappsuite/ibm-sls/releases)
12+
tsm_version: 1.6.2 # No Update # Operator version 1.5.4 (https://github.ibm.com/maximoappsuite/ibm-truststore-mgr/releases)
13+
14+
15+
# Maximo Application Suite
16+
# -----------------------------------------------------------------------------
17+
mas_core_version:
18+
9.1.x-feature: 9.1.0-pre.stable_9718 # tbc
19+
9.0.x: 9.0.11 # tbc
20+
8.10.x: "" # Not Supported
21+
8.11.x: "" # Not Supported
22+
mas_manage_version:
23+
9.1.x-feature: 9.1.0-pre.stable_10993 # tbc
24+
9.0.x: 9.0.13 # tbc
25+
8.10.x: "" # Not Supported
26+
8.11.x: "" # Not Supported
27+
28+
# Extra Images for UDS
29+
# ------------------------------------------------------------------------------
30+
uds_extras_version: 1.5.0
31+
32+
# Extra Images for Mongo
33+
# ------------------------------------------------------------------------------
34+
mongo_extras_version_default: 7.0.12
35+
36+
# Variables used to mirror additional mongo image versions
37+
mongo_extras_version_4: 4.4.21
38+
mongo_extras_version_5: 5.0.23
39+
mongo_extras_version_6: 6.0.12
40+
mongo_extras_version_7: 7.0.12

src/mas/devops/mas.py

Lines changed: 64 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import re
1313
import yaml
1414
from os import path
15+
from time import sleep
1516
from types import SimpleNamespace
1617
from kubernetes.dynamic.resource import ResourceInstance
1718
from openshift.dynamic import DynamicClient
@@ -159,8 +160,8 @@ def verifyMasInstance(dynClient: DynamicClient, instanceId: str) -> bool:
159160
except ResourceNotFoundError:
160161
# The MAS Suite CRD has not even been installed in the cluster
161162
return False
162-
except UnauthorizedError:
163-
logger.error("Error: Unable to verify MAS instance due to failed authorization: {e}")
163+
except UnauthorizedError as e:
164+
logger.error(f"Error: Unable to verify MAS instance due to failed authorization: {e}")
164165
return False
165166

166167

@@ -243,3 +244,64 @@ def updateIBMEntitlementKey(dynClient: DynamicClient, namespace: str, icrUsernam
243244

244245
secret = secretsAPI.apply(body=secret, namespace=namespace)
245246
return secret
247+
248+
249+
def waitForPVC(dynClient: DynamicClient, namespace: str, pvcName: str) -> bool:
250+
pvcAPI = dynClient.resources.get(api_version="v1", kind="PersistentVolumeClaim")
251+
maxRetries = 60
252+
foundReadyPVC = False
253+
retries = 0
254+
while not foundReadyPVC and retries < maxRetries:
255+
retries += 1
256+
try:
257+
pvc = pvcAPI.get(name=pvcName, namespace=namespace)
258+
if pvc.status.phase == "Bound":
259+
foundReadyPVC = True
260+
else:
261+
logger.debug(f"Waiting 5s for PVC {pvcName} to be ready before checking again ...")
262+
sleep(5)
263+
except NotFoundError:
264+
logger.debug(f"Waiting 5s for PVC {pvcName} to be created before checking again ...")
265+
sleep(5)
266+
267+
return foundReadyPVC
268+
269+
270+
def patchPendingPVC(dynClient: DynamicClient, namespace: str, pvcName: str, storageClassName: str = None) -> bool:
271+
pvcAPI = dynClient.resources.get(api_version="v1", kind="PersistentVolumeClaim")
272+
try:
273+
pvc = pvcAPI.get(name=pvcName, namespace=namespace)
274+
if pvc.status.phase == "Pending" and pvc.spec.storageClassName is None:
275+
if storageClassName is not None and storageClassName(dynClient, name=storageClassName) is not None:
276+
pvc.spec.storageClassName = storageClassName
277+
else:
278+
defaultStorageClasses = getDefaultStorageClasses(dynClient)
279+
if defaultStorageClasses.provider is not None:
280+
pvc.spec.storageClassName = defaultStorageClasses.rwo
281+
else:
282+
logger.error(f"Unable to set storageClassName in PVC {pvcName}.")
283+
return False
284+
285+
pvcAPI.patch(body=pvc, namespace=namespace)
286+
287+
maxRetries = 60
288+
foundReadyPVC = False
289+
retries = 0
290+
while not foundReadyPVC and retries < maxRetries:
291+
retries += 1
292+
try:
293+
patchedPVC = pvcAPI.get(name=pvcName, namespace=namespace)
294+
if patchedPVC.status.phase == "Bound":
295+
foundReadyPVC = True
296+
else:
297+
logger.debug(f"Waiting 5s for PVC {pvcName} to be bound before checking again ...")
298+
sleep(5)
299+
except NotFoundError:
300+
logger.error(f"The patched PVC {pvcName} does not exist.")
301+
return False
302+
303+
return foundReadyPVC
304+
305+
except NotFoundError:
306+
logger.error(f"PVC {pvcName} does not exist")
307+
return False

src/mas/devops/ocp.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,10 @@ def waitForDeployment(dynClient: DynamicClient, namespace: str, deploymentName:
150150
# NoneType and int comparison TypeError
151151
foundReadyDeployment = True
152152
else:
153-
logger.debug("Waiting 5s for deployment {deploymentName} to be ready before checking again ...")
153+
logger.debug(f"Waiting 5s for deployment {deploymentName} to be ready before checking again ...")
154154
sleep(5)
155155
except NotFoundError:
156-
logger.debug("Waiting 5s for deployment {deploymentName} to be created before checking again ...")
156+
logger.debug(f"Waiting 5s for deployment {deploymentName} to be created before checking again ...")
157157
sleep(5)
158158
return foundReadyDeployment
159159

src/mas/devops/tekton.py

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,14 @@
2323
from jinja2 import Environment, FileSystemLoader
2424

2525
from .ocp import getConsoleURL, waitForCRD, waitForDeployment, crdExists
26+
from .mas import waitForPVC, patchPendingPVC
2627

2728
logger = logging.getLogger(__name__)
2829

2930

30-
def installOpenShiftPipelines(dynClient: DynamicClient) -> bool:
31+
# customStorageClassName is used when no default Storageclass is available on cluster,
32+
# openshift-pipelines creates PVC which looks for default. customStorageClassName is patched into PVC when default is unavailable.
33+
def installOpenShiftPipelines(dynClient: DynamicClient, customStorageClassName: str = None) -> bool:
3134
"""
3235
Install the OpenShift Pipelines Operator and wait for it to be ready to use
3336
"""
@@ -79,11 +82,30 @@ def installOpenShiftPipelines(dynClient: DynamicClient) -> bool:
7982
foundReadyWebhook = waitForDeployment(dynClient, namespace="openshift-pipelines", deploymentName="tekton-pipelines-webhook")
8083
if foundReadyWebhook:
8184
logger.info("OpenShift Pipelines Webhook is installed and ready")
82-
return True
8385
else:
8486
logger.error("OpenShift Pipelines Webhook is NOT installed and ready")
8587
return False
8688

89+
# Wait for the postgredb-tekton-results-postgres-0 PVC to be ready
90+
# this PVC doesn't come up when there's no default storage class is in the cluster,
91+
# this is causing the pvc to be in pending state and causing the tekton-results-postgres statefulSet in pending,
92+
# due to these resources not coming up, the MAS pre-install check in the pipeline times out checking the health of this statefulSet,
93+
# causing failure in pipeline.
94+
# Refer https://github.com/ibm-mas/cli/issues/1511
95+
logger.debug("Waiting for postgredb-tekton-results-postgres-0 PVC to be ready")
96+
foundReadyPVC = waitForPVC(dynClient, namespace="openshift-pipelines", pvcName="postgredb-tekton-results-postgres-0")
97+
if foundReadyPVC:
98+
logger.info("OpenShift Pipelines postgres is installed and ready")
99+
return True
100+
else:
101+
patchedPVC = patchPendingPVC(dynClient, namespace="openshift-pipelines", pvcName="postgredb-tekton-results-postgres-0", storageClassName=customStorageClassName)
102+
if patchedPVC:
103+
logger.info("OpenShift Pipelines postgres is installed and ready")
104+
return True
105+
else:
106+
logger.error("OpenShift Pipelines postgres PVC is NOT ready")
107+
return False
108+
87109

88110
def updateTektonDefinitions(namespace: str, yamlFile: str) -> None:
89111
"""

test/src/test_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def test_list_catalogs():
2626
def test_get_newest_catalog_tag():
2727
catalogTag = getNewestCatalogTag("amd64")
2828
# Reminder: update this test when adding a new catalog each month!
29-
assert catalogTag == "v9-250403-amd64"
29+
assert catalogTag == "v9-250501-amd64"
3030

3131

3232
def test_get_newest_catalog_tag_fail():

0 commit comments

Comments
 (0)