You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@heron.apache.org by GitBox <gi...@apache.org> on 2019/01/10 22:07:43 UTC

[GitHub] nwangtw closed pull request #3150: Add a release-yaml-file argument to CLI

nwangtw closed pull request #3150: Add a release-yaml-file argument to CLI
URL: https://github.com/apache/incubator-heron/pull/3150
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/heron/tools/cli/src/python/args.py b/heron/tools/cli/src/python/args.py
index 2e47b31bb0..3d280ce3e9 100644
--- a/heron/tools/cli/src/python/args.py
+++ b/heron/tools/cli/src/python/args.py
@@ -165,6 +165,18 @@ def add_extra_launch_classpath(parser):
       help='Additional JVM class path for launching topology')
   return parser
 
+def add_release_yaml_file(parser):
+  '''
+  :param parser:
+  :return:
+  '''
+  parser.add_argument(
+      '--release-yaml-file',
+      default="",
+      help='YAML file that contains release info. Default value is the '
+           'path of the release file in this CLI')
+  return parser
+
 def add_dry_run(parser):
   '''
   :param parser:
diff --git a/heron/tools/cli/src/python/submit.py b/heron/tools/cli/src/python/submit.py
index e474f6cf3e..cf43f7f3b5 100644
--- a/heron/tools/cli/src/python/submit.py
+++ b/heron/tools/cli/src/python/submit.py
@@ -75,6 +75,7 @@ def create_parser(subparsers):
   cli_args.add_deactive_deploy(parser)
   cli_args.add_dry_run(parser)
   cli_args.add_extra_launch_classpath(parser)
+  cli_args.add_release_yaml_file(parser)
   cli_args.add_service_url(parser)
   cli_args.add_system_property(parser)
   cli_args.add_verbose(parser)
@@ -98,7 +99,7 @@ def launch_a_topology(cl_args, tmp_dir, topology_file, topology_defn_file, topol
   topology_pkg_path = config.normalized_class_path(os.path.join(tmp_dir, 'topology.tar.gz'))
 
   # get the release yaml file
-  release_yaml_file = config.get_heron_release_file()
+  release_yaml_file = cl_args['release_yaml_file']
 
   # create a tar package with the cluster configuration and generated config files
   config_path = cl_args['config_path']
@@ -455,6 +456,9 @@ def run(command, parser, cl_args, unknown_args):
   opts.set_config('cmdline.topology.role', cl_args['role'])
   opts.set_config('cmdline.topology.environment', cl_args['environ'])
 
+  # Use CLI release yaml file if the release_yaml_file config is empty
+  if not cl_args['release_yaml_file']:
+    cl_args['release_yaml_file'] = config.get_heron_release_file()
 
   # check the extension of the file name to see if it is tar/jar file.
   if jar_type:
diff --git a/heron/tools/common/src/python/utils/config.py b/heron/tools/common/src/python/utils/config.py
index 6f52af3ef7..e08c403e2d 100644
--- a/heron/tools/common/src/python/utils/config.py
+++ b/heron/tools/common/src/python/utils/config.py
@@ -211,7 +211,7 @@ def get_heron_lib_dir():
 def get_heron_release_file():
   """
   This will provide the path to heron release.yaml file
-  :return: absolute path of heron release.yaml file
+  :return: absolute path of heron release.yaml file in CLI
   """
   return os.path.join(get_heron_dir(), RELEASE_YAML)
 


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services