From db8c0be631c6573802c15d0ca41e2f65572319da Mon Sep 17 00:00:00 2001 From: Daniel Osypenko Date: Tue, 13 Aug 2024 17:50:00 +0300 Subject: [PATCH 1/7] login_ui and namespace selection for rosa hcp clusters Signed-off-by: Daniel Osypenko --- conf/deployment/aws/rosa_hcp_1az_6w_m5.2x.yaml | 13 +++++++++++++ ocs_ci/ocs/ui/base_ui.py | 16 ++++++++++++---- ocs_ci/ocs/ui/validation_ui.py | 7 ++++--- 3 files changed, 29 insertions(+), 7 deletions(-) create mode 100644 conf/deployment/aws/rosa_hcp_1az_6w_m5.2x.yaml diff --git a/conf/deployment/aws/rosa_hcp_1az_6w_m5.2x.yaml b/conf/deployment/aws/rosa_hcp_1az_6w_m5.2x.yaml new file mode 100644 index 00000000000..c3e49d02d73 --- /dev/null +++ b/conf/deployment/aws/rosa_hcp_1az_6w_m5.2x.yaml @@ -0,0 +1,13 @@ +DEPLOYMENT: + allow_lower_instance_requirements: false +RUN: + username: 'cluster-admin' +ENV_DATA: + platform: 'rosa_hcp' + deployment_type: 'ipi' + region: 'us-west-2' + worker_availability_zones: + - 'us-west-2a' + worker_replicas: 6 + worker_instance_type: 'm5.2xlarge' + cluster_namespace: "odf-storage" diff --git a/ocs_ci/ocs/ui/base_ui.py b/ocs_ci/ocs/ui/base_ui.py index 0684f12faa8..27f0044c7b7 100644 --- a/ocs_ci/ocs/ui/base_ui.py +++ b/ocs_ci/ocs/ui/base_ui.py @@ -973,7 +973,7 @@ def login_ui(console_url=None, username=None, password=None, **kwargs): username_el = wait_for_element_to_be_clickable(login_loc["username"], 60) if username is None: - username = constants.KUBEADMIN + username = config.RUN["username"] username_el.send_keys(username) password_el = wait_for_element_to_be_clickable(login_loc["password"], 60) @@ -982,11 +982,15 @@ def login_ui(console_url=None, username=None, password=None, **kwargs): confirm_login_el = wait_for_element_to_be_clickable(login_loc["click_login"], 60) confirm_login_el.click() - hci_platform_conf_confirmed = ( + hci_platform_conf = ( config.ENV_DATA["platform"].lower() in HCI_PROVIDER_CLIENT_PLATFORMS ) - if hci_platform_conf_confirmed: + platform_rosa_hcp = ( + config.ENV_DATA["platform"].lower() == constants.ROSA_HCP_PLATFORM + ) + + if hci_platform_conf: dashboard_url = console_url + "/dashboards" # automatically proceed to load-cluster if test marked with provider decorator if ( @@ -1009,7 +1013,11 @@ def login_ui(console_url=None, username=None, password=None, **kwargs): if default_console is True and username is constants.KUBEADMIN: wait_for_element_to_be_visible(page_nav_loc["page_navigator_sidebar"], 180) - if username is not constants.KUBEADMIN and not hci_platform_conf_confirmed: + if ( + username is not constants.KUBEADMIN + and not hci_platform_conf + and not platform_rosa_hcp + ): # OCP 4.14 and OCP 4.15 observed default user role is an admin skip_tour_el = wait_for_element_to_be_clickable(login_loc["skip_tour"], 180) skip_tour_el.click() diff --git a/ocs_ci/ocs/ui/validation_ui.py b/ocs_ci/ocs/ui/validation_ui.py index cd43d5420d5..0f073391c46 100644 --- a/ocs_ci/ocs/ui/validation_ui.py +++ b/ocs_ci/ocs/ui/validation_ui.py @@ -213,11 +213,12 @@ def odf_console_plugin_check(self): if default_projects_is_checked.get_attribute("data-checked-state") == "false": logger.info("Show default projects") self.do_click(self.validation_loc["show-default-projects"]) - logger.info("Search for 'openshift-storage' project") + logger.info("Search for 'cluster_namespace' project") self.do_send_keys( - self.validation_loc["project-search-bar"], text="openshift-storage" + self.validation_loc["project-search-bar"], + text=config.ENV_DATA["cluster_namespace"], ) - logger.info("Select 'openshift-storage' project") + logger.info("Select 'cluster_namespace' project") time.sleep(2) self.do_click( self.dep_loc["choose_openshift-storage_project"], enable_screenshot=True From a0d4970dafef40b44f0901d99ae39b18ced311c0 Mon Sep 17 00:00:00 2001 From: Daniel Osypenko Date: Wed, 14 Aug 2024 22:17:56 +0300 Subject: [PATCH 2/7] toolbox for odf-storage ns Signed-off-by: Daniel Osypenko --- ocs_ci/ocs/utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ocs_ci/ocs/utils.py b/ocs_ci/ocs/utils.py index 361ad35003d..990d9e3d071 100644 --- a/ocs_ci/ocs/utils.py +++ b/ocs_ci/ocs/utils.py @@ -20,7 +20,7 @@ from libcloud.compute.types import Provider from paramiko.ssh_exception import SSHException -from ocs_ci.framework import config as ocsci_config +from ocs_ci.framework import config as ocsci_config, config from ocs_ci.ocs import constants from ocs_ci.ocs.external_ceph import RolesContainer, Ceph, CephNode from ocs_ci.ocs.clients import WinNode @@ -883,7 +883,9 @@ def setup_ceph_toolbox(force_setup=False, storage_cluster=None): '"/spec/enableCephTools", "value": true }]\'' ) run_cmd(cmd) - toolbox_pod = OCP(kind=constants.POD, namespace=namespace) + toolbox_pod = OCP( + kind=constants.POD, namespace=config.ENV_DATA["cluster_namespace"] + ) toolbox_pod.wait_for_resource( condition="Running", selector="app=rook-ceph-tools", From fc9f5c1d1e5756bf9db89d7e288653b3209dd859 Mon Sep 17 00:00:00 2001 From: Daniel Osypenko Date: Wed, 14 Aug 2024 22:25:26 +0300 Subject: [PATCH 3/7] toolbox for odf-storage ns Signed-off-by: Daniel Osypenko --- ocs_ci/ocs/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ocs_ci/ocs/utils.py b/ocs_ci/ocs/utils.py index 990d9e3d071..1a49c921343 100644 --- a/ocs_ci/ocs/utils.py +++ b/ocs_ci/ocs/utils.py @@ -878,7 +878,7 @@ def setup_ceph_toolbox(force_setup=False, storage_cluster=None): # https://github.com/openshift/ocs-operator/pull/207/ log.info("starting ceph toolbox pod") cmd = ( - f"oc patch storagecluster {storage_cluster} -n openshift-storage --type " + f"oc patch storagecluster {storage_cluster} -n {config.ENV_DATA['cluster_namespace']} --type " 'json --patch \'[{ "op": "replace", "path": ' '"/spec/enableCephTools", "value": true }]\'' ) From 037109d03a04f29a8835e36199e89b105ced57d1 Mon Sep 17 00:00:00 2001 From: Daniel Osypenko Date: Sun, 18 Aug 2024 20:32:35 +0300 Subject: [PATCH 4/7] dont generate certificate Signed-off-by: Daniel Osypenko --- conf/deployment/aws/rosa_hcp_1az_6w_m5.12x.yaml | 13 +++++++++++++ ocs_ci/utility/prometheus.py | 1 + 2 files changed, 14 insertions(+) create mode 100644 conf/deployment/aws/rosa_hcp_1az_6w_m5.12x.yaml diff --git a/conf/deployment/aws/rosa_hcp_1az_6w_m5.12x.yaml b/conf/deployment/aws/rosa_hcp_1az_6w_m5.12x.yaml new file mode 100644 index 00000000000..c94b9142806 --- /dev/null +++ b/conf/deployment/aws/rosa_hcp_1az_6w_m5.12x.yaml @@ -0,0 +1,13 @@ +DEPLOYMENT: + allow_lower_instance_requirements: false +RUN: + username: 'cluster-admin' +ENV_DATA: + platform: 'rosa_hcp' + deployment_type: 'managed' + region: 'us-west-2' + worker_availability_zones: + - 'us-west-2a' + worker_replicas: 6 + worker_instance_type: 'm5.12xlarge' + cluster_namespace: "odf-storage" diff --git a/ocs_ci/utility/prometheus.py b/ocs_ci/utility/prometheus.py index d47fcbc2caf..8fe67e63da1 100644 --- a/ocs_ci/utility/prometheus.py +++ b/ocs_ci/utility/prometheus.py @@ -344,6 +344,7 @@ def __init__(self, user=None, password=None, threading_lock=None): # TODO: generate certificate for IBM cloud platform if ( not config.ENV_DATA["platform"].lower() == "ibm_cloud" + and not config.ENV_DATA["platform"].lower() == constants.ROSA_HCP_PLATFORM and config.ENV_DATA["deployment_type"] == "managed" ): self.generate_cert() From 41f044af3a4d7f7e994a2a15e4a49ba08d0e05ad Mon Sep 17 00:00:00 2001 From: Daniel Osypenko Date: Mon, 19 Aug 2024 12:10:35 +0300 Subject: [PATCH 5/7] remove comment with mistake Signed-off-by: Daniel Osypenko --- ocs_ci/utility/prometheus.py | 1 - 1 file changed, 1 deletion(-) diff --git a/ocs_ci/utility/prometheus.py b/ocs_ci/utility/prometheus.py index 8fe67e63da1..d5e8150754a 100644 --- a/ocs_ci/utility/prometheus.py +++ b/ocs_ci/utility/prometheus.py @@ -341,7 +341,6 @@ def __init__(self, user=None, password=None, threading_lock=None): self._password = password self._threading_lock = threading_lock self.refresh_connection() - # TODO: generate certificate for IBM cloud platform if ( not config.ENV_DATA["platform"].lower() == "ibm_cloud" and not config.ENV_DATA["platform"].lower() == constants.ROSA_HCP_PLATFORM From 2aff11861cba6bdeae817788517beca548973c18 Mon Sep 17 00:00:00 2001 From: Daniel Osypenko Date: Mon, 19 Aug 2024 12:12:47 +0300 Subject: [PATCH 6/7] reduce wn number at config file Signed-off-by: Daniel Osypenko --- ...{rosa_hcp_1az_6w_m5.12x.yaml => rosa_hcp_1az_3w_m5.12x.yaml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename conf/deployment/aws/{rosa_hcp_1az_6w_m5.12x.yaml => rosa_hcp_1az_3w_m5.12x.yaml} (93%) diff --git a/conf/deployment/aws/rosa_hcp_1az_6w_m5.12x.yaml b/conf/deployment/aws/rosa_hcp_1az_3w_m5.12x.yaml similarity index 93% rename from conf/deployment/aws/rosa_hcp_1az_6w_m5.12x.yaml rename to conf/deployment/aws/rosa_hcp_1az_3w_m5.12x.yaml index c94b9142806..cdad8a1cf7c 100644 --- a/conf/deployment/aws/rosa_hcp_1az_6w_m5.12x.yaml +++ b/conf/deployment/aws/rosa_hcp_1az_3w_m5.12x.yaml @@ -8,6 +8,6 @@ ENV_DATA: region: 'us-west-2' worker_availability_zones: - 'us-west-2a' - worker_replicas: 6 + worker_replicas: 3 worker_instance_type: 'm5.12xlarge' cluster_namespace: "odf-storage" From 54004a2069bd2392b9acea425a250a6f40defe3e Mon Sep 17 00:00:00 2001 From: Daniel Osypenko Date: Tue, 20 Aug 2024 12:06:07 +0300 Subject: [PATCH 7/7] logs improvements Signed-off-by: Daniel Osypenko --- ocs_ci/ocs/ui/validation_ui.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ocs_ci/ocs/ui/validation_ui.py b/ocs_ci/ocs/ui/validation_ui.py index 0f073391c46..6488710be65 100644 --- a/ocs_ci/ocs/ui/validation_ui.py +++ b/ocs_ci/ocs/ui/validation_ui.py @@ -213,12 +213,12 @@ def odf_console_plugin_check(self): if default_projects_is_checked.get_attribute("data-checked-state") == "false": logger.info("Show default projects") self.do_click(self.validation_loc["show-default-projects"]) - logger.info("Search for 'cluster_namespace' project") + logger.info("Search for '%s' project", config.ENV_DATA["cluster_namespace"]) self.do_send_keys( self.validation_loc["project-search-bar"], text=config.ENV_DATA["cluster_namespace"], ) - logger.info("Select 'cluster_namespace' project") + logger.info("Select '%s' project", config.ENV_DATA["cluster_namespace"]) time.sleep(2) self.do_click( self.dep_loc["choose_openshift-storage_project"], enable_screenshot=True