def config_path_option(): return click.option( "--config-path", default=config.get_heron_conf_dir(), show_default=True, help="Path to heron's config clusters config directory" )
def add_config(parser): """ add config """ # the default config path default_config_path = config.get_heron_conf_dir() parser.add_argument( '--config-path', metavar='(a string; path to cluster config; default: "' + default_config_path + '")', default=os.path.join(config.get_heron_dir(), default_config_path)) return parser
def download(uri, cluster): tmp_dir = tempfile.mkdtemp() cmd_downloader = config.get_heron_bin_dir() + "/heron-downloader.sh" cmd_uri = "-u " + uri cmd_destination = "-f " + tmp_dir cmd_heron_root = "-d " + config.get_heron_dir() cmd_heron_config = "-p " + config.get_heron_cluster_conf_dir(cluster, config.get_heron_conf_dir()) cmd_mode = "-m local" cmd = [cmd_downloader, cmd_uri, cmd_destination, cmd_heron_root, cmd_heron_config, cmd_mode] Log.debug("download uri command: %s", cmd) subprocess.call(cmd) suffix = (".jar", ".tar", ".tar.gz", ".pex", ".dylib", ".so") for f in os.listdir(tmp_dir): if f.endswith(suffix): return os.path.join(tmp_dir, f)
def add_config(parser): ''' :param parser: :return: ''' # the default config path default_config_path = config.get_heron_conf_dir() parser.add_argument( '--config-path', metavar='(a string; path to cluster config; default: "' + default_config_path + '")', default=os.path.join(config.get_heron_dir(), default_config_path)) parser.add_argument( '--config-property', metavar='(key=value; a config key and its value; default: [])', action='append', default=[]) return parser
def add_config(parser): ''' :param parser: :return: ''' # the default config path default_config_path = config.get_heron_conf_dir() parser.add_argument('--config-path', default=os.path.join(config.get_heron_dir(), default_config_path), help='Path to cluster configuration files') parser.add_argument( '--config-property', metavar='PROPERTY=VALUE', action='append', default=[], help='Configuration properties that overrides default options') return parser
def add_config(parser): ''' :param parser: :return: ''' # the default config path default_config_path = config.get_heron_conf_dir() parser.add_argument( '--config-path', default=os.path.join(config.get_heron_dir(), default_config_path), help='Path to cluster configuration files') parser.add_argument( '--config-property', metavar='PROPERTY=VALUE', action='append', default=[], help='Configuration properties that overrides default options') return parser
def get_heron_tools_job_file(cl_args): ''' get path to api server job file ''' return "%s/standalone/resources/heron_tools.hcl" % config.get_heron_conf_dir()
def get_nomad_slave_config_file(cl_args): ''' get path to nomad slave config file ''' return "%s/standalone/resources/slave.hcl" % config.get_heron_conf_dir()
def get_nomad_master_config_file(cl_args): ''' get path to nomad master config file ''' return "%s/standalone/resources/master.hcl" % config.get_heron_conf_dir()
def get_heron_tools_job_file(cl_args): ''' get path to api server job file ''' return "%s/standalone/resources/heron_tools.hcl" % config.get_heron_conf_dir( )