Ejemplo n.º 1
0
    def setup_env(self, kube_master_site, kube_namespace):
        logger.info("STARTING SETTING THE EXPERIMENT ENVIRONMENT")
        logger.info("Starting provisioning nodes on G5K")
        logger.info("Init provisioner: g5k_provisioner")
        provisioner = g5k_provisioner(configs=self.configs,
                                      keep_alive=self.args.keep_alive,
                                      out_of_chart=self.args.out_of_chart,
                                      oar_job_ids=self.args.oar_job_ids,
                                      no_deploy_os=self.args.no_deploy_os,
                                      is_reservation=self.args.is_reservation,
                                      job_name="cloudal_k8s")

        provisioner.provisioning()
        self.hosts = provisioner.hosts
        oar_job_ids = provisioner.oar_result
        self.oar_result = provisioner.oar_result

        logger.info("STARTING CONFIGURING NODES")
        kube_master = self.args.kube_master
        if kube_master is None:
            for host in self.hosts:
                if host.startswith(kube_master_site):
                    kube_master = host
                    break

        if self.args.kube_master is None:
            self.config_host(kube_master, kube_namespace)
        else:
            logger.info('Kubernetes master: %s' % kube_master)
            self._get_credential(kube_master)

        logger.info("FINISH CONFIGURING NODES")
        self.args.oar_job_ids = None
        logger.info("FINISH SETTING THE EXPERIMENT ENVIRONMENT\n")
        return kube_master, oar_job_ids
Ejemplo n.º 2
0
    def setup_env(self, kube_master_site, kube_namespace):
        logger.info('Starting configuring the experiment environment')
        logger.debug('Init provisioner: g5k_provisioner')
        provisioner = g5k_provisioner(
            configs=self.configs,
            keep_alive=self.args.keep_alive,
            out_of_chart=self.args.out_of_chart,
            oar_job_ids=self.args.oar_job_ids,
            no_deploy_os=self.args.no_deploy_os,
            is_reservation=self.args.is_reservation,
            job_name='cloudal_elmerfs_k8s',
        )

        provisioner.provisioning()
        self.hosts = provisioner.hosts
        oar_job_ids = provisioner.oar_result
        self.oar_result = provisioner.oar_result

        logger.info('Starting configuring nodes')
        kube_master = self.args.kube_master
        if kube_master is None:
            for host in self.hosts:
                if host.startswith(kube_master_site):
                    kube_master = host
                    break

        self.config_host(kube_master, kube_namespace)

        logger.info('Finish configuring nodes\n')

        self.args.oar_job_ids = None
        logger.info('Finish configuring the experiment environment\n')
        return oar_job_ids, kube_master
Ejemplo n.º 3
0
    def run(self):
        logger.info("Init provisioner: g5k_provisioner")
        provisioner = g5k_provisioner(
            config_file_path=self.args.config_file_path,
            keep_alive=self.args.keep_alive,
            out_of_chart=self.args.out_of_chart,
            oar_job_ids=self.args.oar_job_ids,
            no_deploy_os=self.args.no_deploy_os,
            is_reservation=self.args.is_reservation,
            job_name="cloudal")
        provisioner.provisioning()
        hosts = provisioner.hosts
        self.oar_result = provisioner.oar_result

        self.config_host(hosts)
Ejemplo n.º 4
0
    def run(self):
        logger.info("Starting provision nodes")
        logger.info("Init provisioner: g5k_provisioner")
        provisioner = g5k_provisioner(config_file_path=self.args.config_file_path,
                                      keep_alive=self.args.keep_alive,
                                      out_of_chart=self.args.out_of_chart,
                                      oar_job_ids=self.args.oar_job_ids,
                                      no_deploy_os=self.args.no_deploy_os,
                                      is_reservation=self.args.is_reservation,
                                      job_name="cloudal_docker")
        provisioner.provisioning()
        hosts = provisioner.hosts
        self.oar_result = provisioner.oar_result
        logger.info("Provisioning nodes: DONE")

        logger.info("Starting configure Docker on nodes")
        self.config_host(hosts)
        logger.info("Configuring Docker on nodes: DONE")
Ejemplo n.º 5
0
    def setup_env(self, kube_master_site, kube_namespace):
        logger.info("Starting configuring the experiment environment")
        logger.debug("Init provisioner: g5k_provisioner")
        provisioner = g5k_provisioner(configs=self.configs,
                                      keep_alive=self.args.keep_alive,
                                      out_of_chart=self.args.out_of_chart,
                                      oar_job_ids=self.args.oar_job_ids,
                                      no_deploy_os=self.args.no_deploy_os,
                                      is_reservation=self.args.is_reservation,
                                      job_name="cloudal")

        provisioner.provisioning()
        self.hosts = provisioner.hosts
        self.oar_result = provisioner.oar_result

        logger.info("Starting configuring nodes")
        self.config_host(kube_master_site, kube_namespace)

        logger.info("Finish configuring nodes\n")
    def run(self):
        logger.info("STARTING PROVISIONING NODES")
        logger.info("Init provisioner: g5k_provisioner")
        provisioner = g5k_provisioner(
            config_file_path=self.args.config_file_path,
            keep_alive=self.args.keep_alive,
            out_of_chart=self.args.out_of_chart,
            oar_job_ids=self.args.oar_job_ids,
            no_deploy_os=self.args.no_deploy_os,
            is_reservation=self.args.is_reservation,
            job_name="cloudal_k8s")
        provisioner.provisioning()
        self.hosts = provisioner.hosts
        self.oar_result = provisioner.oar_result
        self.configs = provisioner.configs
        logger.info("FINISH PROVISIONING NODES")

        logger.info("STARTING CONFIGURING HOSTS")
        self.config_host()
        logger.info("FINISH CONFIGURING HOSTS")
    def run(self):
        # make reservation from requested nodes in config file
        logger.info("Init provisioner: g5k_provisioner")
        provisioner = g5k_provisioner(
            config_file_path=self.args.config_file_path,
            keep_alive=self.args.keep_alive,
            out_of_chart=self.args.out_of_chart,
            oar_job_ids=self.args.oar_job_ids,
            no_deploy_os=self.args.no_deploy_os,
            is_reservation=self.args.is_reservation,
            job_name="cloudal")
        provisioner.provisioning()
        hosts = provisioner.hosts
        self.oar_result = provisioner.oar_result

        # deploy docker swarm on all reserved hosts
        logger.info("Init configurator: docker_swarm_configurator")
        configurator = docker_swarm_configurator(hosts)
        ds_manager, ds_workers = configurator.deploy_docker_swarm_cluster()
        logger.info('Docker Swarm workers: %s' % ds_workers)
    def setup_env(self):
        """Setting the experiment environment base on the user's requirements

        This function normally contains two steps:
            1. Provisioning hosts on G5k if needed
               (if you provided the OAR_JOB_ID of the already reserved hosts,
               the provisioner will not make a reservation again)
            2. Configuring all your necessary packages/services on those hosts.
        """
        provisioner = g5k_provisioner(
            config_file_path=self.args.config_file_path,
            keep_alive=self.args.keep_alive,
            out_of_chart=self.args.out_of_chart,
            oar_job_ids=self.args.oar_job_ids,
            no_deploy_os=self.args.no_deploy_os,
            is_reservation=self.args.is_reservation,
            job_name="cloudal")
        provisioner.provisioning()
        self.hosts = provisioner.hosts
        oar_job_ids = provisioner.oar_result
        self.oar_result = provisioner.oar_result

        ##################################################
        #  Configuring hosts with your applications here #
        ##################################################

        # For example: install some dependencies
        configurator = packages_configurator()
        configurator.install_packages(['sysstat', 'htop'], self.hosts)

        # or call the provided configurator (by cloudal) to deploy some well-known services
        configurator = docker_configurator(self.hosts)
        configurator.config_docker()

        # or perform some commands on all of hosts
        logger.info("Downloading cloudal")
        cmd = "cd /tmp/ && git clone https://github.com/ntlinh16/cloudal.git"
        execute_cmd(cmd, self.hosts)

        return oar_job_ids
Ejemplo n.º 9
0
    def setup_env(self, kube_master_site, kube_namespace):
        logger.info('STARTING SETTING THE EXPERIMENT ENVIRONMENT')
        logger.info('Starting provisioning nodes on G5K')
        logger.info('Init provisioner: g5k_provisioner')
        provisioner = g5k_provisioner(configs=self.configs,
                                      keep_alive=self.args.keep_alive,
                                      out_of_chart=self.args.out_of_chart,
                                      oar_job_ids=self.args.oar_job_ids,
                                      no_deploy_os=self.args.no_deploy_os,
                                      is_reservation=self.args.is_reservation,
                                      job_name='cloudal_k8s_fmke')

        provisioner.provisioning()
        self.hosts = provisioner.hosts
        oar_job_ids = provisioner.oar_result
        self.oar_result = provisioner.oar_result

        kube_master = self.config_host(kube_master_site, kube_namespace)

        self.args.oar_job_ids = None
        logger.info('FINISH SETTING THE EXPERIMENT ENVIRONMENT\n')
        return kube_master, oar_job_ids