From de85e02aa7f81f6ca79c6e5135ed82eedde83a7e Mon Sep 17 00:00:00 2001 From: Coady LaCroix Date: Thu, 17 Oct 2024 16:09:15 -0700 Subject: [PATCH] Support deployment of pre-GA versions of Fusion and FDF Signed-off-by: Coady LaCroix --- conf/ocsci/fdf_deployment_pre_ga.yaml | 11 +++++++++ ocs_ci/deployment/deployment.py | 23 +++++++++++++++---- ocs_ci/deployment/fusion.py | 5 +++- ocs_ci/ocs/constants.py | 2 ++ .../catalog-source.yaml.j2 | 13 +++++++++++ .../data-foundation-instance.yaml | 2 +- 6 files changed, 50 insertions(+), 6 deletions(-) create mode 100644 conf/ocsci/fdf_deployment_pre_ga.yaml create mode 100644 ocs_ci/templates/fusion-data-foundation/catalog-source.yaml.j2 diff --git a/conf/ocsci/fdf_deployment_pre_ga.yaml b/conf/ocsci/fdf_deployment_pre_ga.yaml new file mode 100644 index 00000000000..1c8ae3c2102 --- /dev/null +++ b/conf/ocsci/fdf_deployment_pre_ga.yaml @@ -0,0 +1,11 @@ +DEPLOYMENT: + fusion_deployment: True + fdf_deployment: True + channel: v2.0 + fusion_pre_ga_sds_version: 2.8.0 + fusion_pre_ga_image: 2.8.1-23197396 + fusion_pre_ga: true + + +ENV_DATA: + skip_ocs_deployment: true diff --git a/ocs_ci/deployment/deployment.py b/ocs_ci/deployment/deployment.py index 1b942b27e7b..a544b74d029 100644 --- a/ocs_ci/deployment/deployment.py +++ b/ocs_ci/deployment/deployment.py @@ -2655,9 +2655,24 @@ def create_fusion_catalog_source(): Create catalog source for fusion operator """ logger.info("Adding CatalogSource for IBM Fusion") - fusion_catalog_source_data = templating.load_yaml( - constants.FUSION_CATALOG_SOURCE_YAML - ) + fusion_pre_ga = config.DEPLOYMENT.get("fusion_pre_ga", False) + + if fusion_pre_ga: + render_data = { + "sds_version": config.DEPLOYMENT.get("fusion_pre_ga_sds_version"), + "image_tag": config.DEPLOYMENT.get("fusion_pre_ga_image"), + } + catalog_source_name = constants.ISF_CATALOG_SOURCE_NAME + _templating = templating.Templating(base_path=constants.FDF_TEMPLATE_DIR) + template = _templating.render_template( + constants.ISF_OPERATOR_SOFTWARE_CATALOG_SOURCE_YAML, render_data + ) + fusion_catalog_source_data = yaml.load(template, Loader=yaml.Loader) + else: + catalog_source_name = constants.IBM_OPERATOR_CATALOG_SOURCE_NAME + fusion_catalog_source_data = templating.load_yaml( + constants.FUSION_CATALOG_SOURCE_YAML + ) fusion_catalog_source_manifest = tempfile.NamedTemporaryFile( mode="w+", prefix="fusion_catalog_source_manifest", delete=False ) @@ -2666,7 +2681,7 @@ def create_fusion_catalog_source(): ) run_cmd(f"oc apply -f {fusion_catalog_source_manifest.name}") ibm_catalog_source = CatalogSource( - resource_name=constants.IBM_OPERATOR_CATALOG_SOURCE_NAME, + resource_name=catalog_source_name, namespace=constants.MARKETPLACE_NAMESPACE, ) diff --git a/ocs_ci/deployment/fusion.py b/ocs_ci/deployment/fusion.py index bfe1219ea42..153a65dc131 100644 --- a/ocs_ci/deployment/fusion.py +++ b/ocs_ci/deployment/fusion.py @@ -6,7 +6,7 @@ import tempfile from ocs_ci.framework import config -from ocs_ci.ocs.constants import FUSION_SUBSCRIPTION_YAML +from ocs_ci.ocs.constants import FUSION_SUBSCRIPTION_YAML, ISF_CATALOG_SOURCE_NAME from ocs_ci.utility import templating from ocs_ci.utility.utils import run_cmd @@ -22,6 +22,9 @@ def deploy_fusion(): subscription_fusion_file = FUSION_SUBSCRIPTION_YAML subscription_fusion_yaml_data = templating.load_yaml(subscription_fusion_file) subscription_fusion_yaml_data["spec"]["channel"] = config.DEPLOYMENT["channel"] + fusion_pre_ga = config.DEPLOYMENT.get("fusion_pre_ga", False) + if fusion_pre_ga: + subscription_fusion_yaml_data["spec"]["source"] = ISF_CATALOG_SOURCE_NAME subscription_fusion_manifest = tempfile.NamedTemporaryFile( mode="w+", prefix="subscription_fusion_manifest", delete=False ) diff --git a/ocs_ci/ocs/constants.py b/ocs_ci/ocs/constants.py index 49ed44a4484..a91460e5b79 100644 --- a/ocs_ci/ocs/constants.py +++ b/ocs_ci/ocs/constants.py @@ -3050,3 +3050,5 @@ FDF_SERVICE_CR = os.path.join(FDF_TEMPLATE_DIR, "data-foundation-instance.yaml") FDF_SPECTRUM_FUSION_CR = os.path.join(FDF_TEMPLATE_DIR, "spectrum-fusion.yaml") FDF_NAMESPACE = "ibm-spectrum-fusion-ns" +ISF_CATALOG_SOURCE_NAME = "isf-catalog" +ISF_OPERATOR_SOFTWARE_CATALOG_SOURCE_YAML = "catalog-source.yaml.j2" diff --git a/ocs_ci/templates/fusion-data-foundation/catalog-source.yaml.j2 b/ocs_ci/templates/fusion-data-foundation/catalog-source.yaml.j2 new file mode 100644 index 00000000000..94b6ceb9d6f --- /dev/null +++ b/ocs_ci/templates/fusion-data-foundation/catalog-source.yaml.j2 @@ -0,0 +1,13 @@ +apiVersion: operators.coreos.com/v1alpha1 +kind: CatalogSource +metadata: + name: isf-catalog + namespace: openshift-marketplace +spec: + displayName: isf-catalog + publisher: IBM + sourceType: grpc + image: docker-na-public.artifactory.swg-devops.com/hyc-abell-devops-team-dev-docker-local/sds-{{ sds_version }}/isf-operator-software-catalog:{{ image_tag }} + updateStrategy: + registryPoll: + interval: 15m diff --git a/ocs_ci/templates/fusion-data-foundation/data-foundation-instance.yaml b/ocs_ci/templates/fusion-data-foundation/data-foundation-instance.yaml index adf0b17860b..dbd18dd1a17 100644 --- a/ocs_ci/templates/fusion-data-foundation/data-foundation-instance.yaml +++ b/ocs_ci/templates/fusion-data-foundation/data-foundation-instance.yaml @@ -18,6 +18,6 @@ spec: value: Dynamic - name: autoUpgrade provided: false - value: "true" + value: "false" serviceDefinition: data-foundation-service triggerUpdate: false