run.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:slippin-jimmy 作者: scm-spain 项目源码 文件源码
def run_cluster(self, cluster_configuration):
        """
        Launch a cluster based on given configuration
        :param cluster_configuration: string
        """
        aws_arguments = self.__job_flow_configuration.convert_to_arguments(cluster_configuration)

        self.__logger.debug('Launching cluster with given configuration')
        response = self.__aws_emr_client.run_job_flow(**aws_arguments)
        self.__logger.info('Cluster launched with ID: {cluster_id}'.format(cluster_id=response['JobFlowId']))
        try:
            waiter = self.__aws_emr_client.get_waiter('cluster_running')
            self.__logger.info('Waiting for cluster to be ready')
            waiter.wait(ClusterId=response['JobFlowId'])
            self.__logger.info('Cluster up and running ID: {cluster_id}'.format(cluster_id=response['JobFlowId']))
        except WaiterError:
            self.__logger.error('Cluster creation failed')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号