本文整理汇总了Python中cm.services.ServiceRole类的典型用法代码示例。如果您正苦于以下问题:Python ServiceRole类的具体用法?Python ServiceRole怎么用?Python ServiceRole使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ServiceRole类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _update_user_data
def _update_user_data(self):
if 'filesystems' in self.app.ud:
old_fs_list = self.app.ud.get('filesystems') or []
new_fs_list = []
# clear 'services' and replace with the new format
for fs in old_fs_list:
svc_roles = ServiceRole.from_string_array(fs['roles'])
if ServiceRole.GALAXY_TOOLS in svc_roles and ServiceRole.GALAXY_DATA in svc_roles:
# This condition should only occur in new configs, but check
# added so that things work properly even if run against a new config
# Only works for default configs though...
new_fs_list.append(fs)
elif ServiceRole.GALAXY_TOOLS in svc_roles:
pass # skip adding the galaxy tools file system, no longer needed.
else:
if ServiceRole.GALAXY_DATA in ServiceRole.from_string_array(fs['roles']):
fs['roles'] = ServiceRole.to_string_array([ServiceRole.GALAXY_TOOLS,
ServiceRole.GALAXY_DATA])
new_fs_list.append(fs)
else:
new_fs_list.append(fs)
self.app.ud['filesystems'] = new_fs_list
self.app.ud['deployment_version'] = 2
self.app.ud.pop('galaxy_home', None) # TODO: Galaxy home is always reset
# to default. Discuss implications
return True
示例2: __init__
def __init__(self, app):
super(PostgresService, self).__init__(app)
self.name = ServiceRole.to_string(ServiceRole.GALAXY_POSTGRES)
self.svc_roles = [ServiceRole.GALAXY_POSTGRES]
self.psql_port = app.path_resolver.psql_db_port
self.dependencies = [ServiceDependency(self, ServiceRole.GALAXY_DATA),
ServiceDependency(self, ServiceRole.MIGRATION)]
示例3: __init__
def __init__(self, app):
super(ClouderaManagerService, self).__init__(app)
self.svc_roles = [ServiceRole.CLOUDERA_MANAGER]
self.name = ServiceRole.to_string(ServiceRole.CLOUDERA_MANAGER)
self.dependencies = []
self.db_pwd = misc.random_string_generator()
# Indicate if the web server has been configured and started
self.started = False
self.cm_port = 7180
# Default cluster configuration
self.cm_host = socket.gethostname()
self.host_list = [self.cm_host]
self.cluster_name = "Cluster 1"
self.cdh_version = "CDH5"
self.cdh_version_number = "5"
self.cm_username = "admin"
self.cm_password = "admin"
self.cm_service_name = "ManagementService"
self.host_username = "ubuntu"
# Read the password from the system!
self.host_password = self.app.config.get('password')
self.cm_repo_url = None
self.service_types_and_names = {
"HDFS": "HDFS",
"YARN": "YARN",
"ZOOKEEPER": "ZooKeeper"
}
示例4: __init__
def __init__(self, app, instance_role='master'):
super(PSSService, self).__init__(app)
self.svc_roles = [ServiceRole.PSS]
self.name = ServiceRole.to_string(ServiceRole.PSS)
self.svc_type = ServiceType.CM_SERVICE
self.instance_role = instance_role
log.debug("Configured PSS as {0}".format(self.instance_role))
示例5: __init__
def __init__(self, app):
super(HadoopService, self).__init__(app)
self.svc_roles = [ServiceRole.HADOOP]
self.name = ServiceRole.to_string(ServiceRole.HADOOP)
self.dependencies = [ServiceDependency(self, ServiceRole.SGE)]
self.id_rsa_path = os.path.join(paths.P_HADOOP_HOME, "id_rsa")
self.id_rsa_pub_key_path = os.path.join(
paths.P_HADOOP_HOME, "id_rsa.pub")
示例6: __init__
def __init__(self, app):
super(MigrationService, self).__init__(app)
self.svc_roles = [ServiceRole.MIGRATION]
self.name = ServiceRole.to_string(ServiceRole.MIGRATION)
self.dependencies = []
if 'filesystems' in self.app.ud:
for fs in self.app.ud.get('filesystems') or []:
# Wait for galaxy data, indices and tools to come up before attempting migration
if ServiceRole.GALAXY_DATA in ServiceRole.from_string_array(fs['roles']):
self.dependencies.append(ServiceDependency(self, ServiceRole.GALAXY_DATA))
if ServiceRole.GALAXY_TOOLS in ServiceRole.from_string_array(fs['roles']):
self.dependencies.append(ServiceDependency(self, ServiceRole.GALAXY_TOOLS))
if ServiceRole.GALAXY_INDICES in ServiceRole.from_string_array(fs['roles']):
self.dependencies.append(ServiceDependency(self, ServiceRole.GALAXY_INDICES))
示例7: __init__
def __init__(self, app):
super(CloudgeneService, self).__init__(app)
self.svc_roles = [ServiceRole.CLOUDGENE]
self.name = ServiceRole.to_string(ServiceRole.CLOUDGENE)
self.dependencies = [ServiceDependency(self, ServiceRole.CLOUDERA_MANAGER)]
self.port = 8085
self.cg_url = "http://cloudgene.uibk.ac.at/downloads/cloudgene-cloudman.tar.gz"
self.cg_base_dir = '/mnt/galaxy/cloudgene/'
self.cg_home = os.path.join(self.cg_base_dir, 'cloudgene-cloudman')
示例8: __init__
def __init__(self, app):
super(NodejsProxyService, self).__init__(app)
self.svc_roles = [ServiceRole.NODEJSPROXY]
self.name = ServiceRole.to_string(ServiceRole.NODEJSPROXY)
self.dependencies = [ServiceDependency(self, ServiceRole.GALAXY_TOOLS),
ServiceDependency(self, ServiceRole.SUPERVISOR)]
self.np_port = 8800
self.supervisor_conf_dir = '/etc/supervisor/conf.d'
self.supervisor_prog_name = 'galaxy_nodejs_proxy'
示例9: __init__
def __init__(self, app):
super(SlurmdService, self).__init__(app)
self.svc_roles = [ServiceRole.SLURMD]
self.name = ServiceRole.to_string(ServiceRole.SLURMD)
self.dependencies = [
ServiceDependency(self, ServiceRole.SLURMCTLD),
]
self.num_restarts = 0
self.max_restarts = 3
示例10: __init__
def __init__(self, app):
super(PulsarService, self).__init__(app)
self.pulsar_home = None
self.pulsar_port = DEFAULT_PULSAR_PORT
self.name = ServiceRole.to_string(ServiceRole.PULSAR)
self.svc_roles = [ServiceRole.PULSAR]
self.dependencies = [
ServiceDependency(self, ServiceRole.JOB_MANAGER)
]
示例11: __init__
def __init__(self, app):
super(GalaxyReportsService, self).__init__(app)
self.galaxy_home = self.app.path_resolver.galaxy_home
self.reports_port = DEFAULT_REPORTS_PORT
self.name = ServiceRole.to_string(ServiceRole.GALAXY_REPORTS)
self.svc_roles = [ServiceRole.GALAXY_REPORTS]
self.dependencies = [ServiceDependency(
self, ServiceRole.GALAXY)] # Hopefully Galaxy dependency alone enough to ensure database migrated, etc...
self.conf_dir = os.path.join(
self.app.path_resolver.galaxy_home, 'reports.conf.d')
示例12: __init__
def __init__(self, app):
super(LwrService, self).__init__(app)
self.lwr_home = self.app.path_resolver.lwr_home
self.lwr_port = DEFAULT_LWR_PORT
self.name = ServiceRole.to_string(ServiceRole.LWR)
self.svc_roles = [ServiceRole.LWR]
self.dependencies = [
ServiceDependency(self, ServiceRole.SGE), # Well someday anyway :)
ServiceDependency(self, ServiceRole.GALAXY_TOOLS) # Anyway to make this depend on where LWR installed?
]
示例13: __init__
def __init__(self, app):
"""
Initialize the service class by setting role and indicating dependencies
"""
super(ProFTPdService, self).__init__(app)
log.debug("Initializing ProFTPdService")
self.svc_roles = [ServiceRole.PROFTPD]
self.name = ServiceRole.to_string(ServiceRole.PROFTPD)
self.dependencies = [ServiceDependency(self, ServiceRole.GALAXY_POSTGRES),
ServiceDependency(self, ServiceRole.GALAXY_DATA)]
示例14: __init__
def __init__(self, app, as_min=-1, as_max=-1, instance_type=None):
super(AutoscaleService, self).__init__(app)
self.state = service_states.UNSTARTED
self.svc_roles = [ServiceRole.AUTOSCALE]
self.svc_type = ServiceType.CM_SERVICE
self.name = ServiceRole.to_string(ServiceRole.AUTOSCALE)
self.dependencies = [ServiceDependency(self, ServiceRole.MIGRATION)]
self.as_max = as_max # Max number of nodes autoscale should maintain
self.as_min = as_min # Min number of nodes autoscale should maintain
self.instance_type = instance_type # Type of instances to start
示例15: __init__
def __init__(self, app):
super(SupervisorService, self).__init__(app)
self.svc_roles = [ServiceRole.SUPERVISOR]
self.name = ServiceRole.to_string(ServiceRole.SUPERVISOR)
self.dependencies = []
self.sv_port = 9002
self.pid_file = '/var/run/supervisord.pid'
self.main_conf_file = '/etc/supervisord.conf'
self.conf_dir = '/etc/supervisor/conf.d'
self.server = None
self.log_file = '/var/log/supervisor/supervisord.log'