Skip to content

Commit

Permalink
Support deployment of pre-GA versions of Fusion and FDF
Browse files Browse the repository at this point in the history
Signed-off-by: Coady LaCroix <[email protected]>
  • Loading branch information
clacroix12 committed Oct 17, 2024
1 parent 596f384 commit de85e02
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 6 deletions.
11 changes: 11 additions & 0 deletions conf/ocsci/fdf_deployment_pre_ga.yaml
Original file line number Diff line number Diff line change
@@ -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
23 changes: 19 additions & 4 deletions ocs_ci/deployment/deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand All @@ -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,
)

Expand Down
5 changes: 4 additions & 1 deletion ocs_ci/deployment/fusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
)
Expand Down
2 changes: 2 additions & 0 deletions ocs_ci/ocs/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
13 changes: 13 additions & 0 deletions ocs_ci/templates/fusion-data-foundation/catalog-source.yaml.j2
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ spec:
value: Dynamic
- name: autoUpgrade
provided: false
value: "true"
value: "false"
serviceDefinition: data-foundation-service
triggerUpdate: false

0 comments on commit de85e02

Please sign in to comment.