def analyze_run(self):
        """
        Analyzing the workload run logs

        """
        logging.info('Analyzing  workload run logs..')
        PillowFight.analyze_all(self)
Beispiel #2
0
    def teardown(self):
        """
        Delete objects created in roughly reverse order of how they were created.

        """
        self.cb_examples.delete()
        self.cb_worker.delete()
        self.cb_deploy.delete()
        self.pod_obj.exec_oc_cmd(
            command="delete rolebinding couchbase-operator-rolebinding")
        self.pod_obj.exec_oc_cmd(
            command="delete serviceaccount couchbase-operator")
        self.operator_role.delete()
        self.couchbase_obj.delete()
        switch_to_project('default')
        self.pod_obj.delete_project(constants.COUCHBASE_OPERATOR)
        for adm_yaml in self.admission_parts:
            adm_data = templating.load_yaml(adm_yaml)
            adm_obj = OCS(**adm_data)
            adm_obj.delete()
        # Before the code below was added, the teardown task would sometimes
        # fail with the leftover objects because it would still see one of the
        # couchbase pods.
        for admin_pod in TimeoutSampler(self.WAIT_FOR_TIME, 3,
                                        get_pod_name_by_pattern, 'couchbase',
                                        'default'):
            if admin_pod:
                continue
            else:
                break
        PillowFight.cleanup(self)
        switch_to_default_rook_cluster_project()
Beispiel #3
0
    def run_workload(self,
                     replicas,
                     num_items=None,
                     num_threads=None,
                     run_in_bg=False):
        """
        Running workload with pillow fight operator
        Args:
            replicas (int): Number of pods
            num_items (int): Number of items to be loaded to the cluster
            num_threads (int): Number of threads
            run_in_bg (bool) : Optional run IOs in background

        """
        self.result = None
        logging.info('Running IOs...')
        if run_in_bg:
            executor = ThreadPoolExecutor(1)
            self.result = executor.submit(PillowFight.run_pillowfights,
                                          self,
                                          replicas=replicas,
                                          num_items=num_items,
                                          num_threads=num_threads)
            return self.result
        PillowFight.run_pillowfights(self,
                                     replicas=replicas,
                                     num_items=num_items,
                                     num_threads=num_threads)
    def run_workload(self, replicas):
        """
        Running workload with pillow fight operator
        Args:
         replicas (int): Number of pods

        """
        logging.info('Running IOs...')
        PillowFight.run_pillowfights(self, replicas=replicas)
Beispiel #5
0
    def analyze_run(self, skip_analyze=False):
        """
        Analyzing the workload run logs

        Args:
            skip_analyze (bool): Option to skip logs analysis

        """
        if not skip_analyze:
            logging.info('Analyzing  workload run logs..')
            PillowFight.analyze_all(self)
Beispiel #6
0
    def run_workload(self, replicas, run_in_bg=False):
        """
        Running workload with pillow fight operator
        Args:
            replicas (int): Number of pods
            run_in_bg (bool) : Optional run IOs in background

        """
        self.result = None
        if run_in_bg:
            logging.info('Running IOs...')
            executor = ThreadPoolExecutor(1)
            self.result = executor.submit(PillowFight.run_pillowfights,
                                          self,
                                          replicas=replicas)
            return self.result
        PillowFight.run_pillowfights(self, replicas=replicas)
Beispiel #7
0
def pillowfight(request):

    # Create RipSaw Operator
    pillowfight = PillowFight()

    def teardown():
        pillowfight.cleanup()
    request.addfinalizer(teardown)
    return pillowfight
Beispiel #8
0
    def teardown(self):
        """
        Cleaning up the resources created during Couchbase deployment

        """
        if self.cb_create_cb_secret:
            self.cb_secrets.delete()
        if self.cb_create_cb_cluster:
            self.cb_example.delete()
        if self.cb_create_bucket:
            self.cb_bucket.delete()
        self.subscription_yaml.delete()
        switch_to_project("default")
        self.ns_obj.delete_project(constants.COUCHBASE_OPERATOR)
        self.ns_obj.wait_for_delete(resource_name=constants.COUCHBASE_OPERATOR,
                                    timeout=90)
        PillowFight.cleanup(self)
        switch_to_default_rook_cluster_project()
Beispiel #9
0
    def teardown(self):
        """
        Delete objects created in roughly reverse order of how they were created.

        """
        self.cb_examples.delete()
        self.cb_worker.delete()
        self.cb_deploy.delete()
        self.pod_obj.exec_oc_cmd(
            command=
            "delete rolebinding couchbase-operator-rolebinding -n couchbase-operator-namespace"
        )
        self.pod_obj.exec_oc_cmd(
            command=
            "delete serviceaccount couchbase-operator -n couchbase-operator-namespace"
        )
        self.operator_role.delete()
        self.couchbase_obj.delete()
        switch_to_project("default")
        self.ns_obj.delete_project(constants.COUCHBASE_OPERATOR)
        self.ns_obj.wait_for_delete(resource_name=constants.COUCHBASE_OPERATOR,
                                    timeout=90)
        for adm_obj in self.adm_objects:
            adm_obj.delete()

        # Before the code below was added, the teardown task would sometimes
        # fail with the leftover objects because it would still see one of the
        # couchbase pods.
        for admin_pod in TimeoutSampler(self.WAIT_FOR_TIME, 3,
                                        get_pod_name_by_pattern, "couchbase",
                                        "default"):
            if admin_pod:
                continue
            else:
                break
        PillowFight.cleanup(self)
        switch_to_default_rook_cluster_project()