Răsfoiți Sursa

HUE-2645 [oozie] Better Spark action UX

Do not show class name when using PySpark.
Default to yarn-client mode to simplify configuration.
Try to hints about adding jar/py files as Files too.
Romain Rigaux 9 ani în urmă
părinte
comite
ecc87f8

+ 5 - 5
apps/oozie/src/oozie/models2.py

@@ -1835,21 +1835,21 @@ class SparkAction(Action):
           'name': 'files',
           'label': _('Files'),
           'value': [],
-          'help_text': _('Files put in the running directory.'),
+          'help_text': _('Path to files put in the running directory.'),
           'type': ''
      },
     'class': {
           'name': 'class',
           'label': _('Main class'),
           'value': '',
-          'help_text': _("e.g. org.apache.spark.examples.mllib.JavaALS."),
+          'help_text': _("Only if using jars, e.g. org.apache.spark.examples.mllib.JavaALS"),
           'type': 'text'
      },
      'jars': {
           'name': 'jars',
-          'label': _('Jars/py files'),
+          'label': _('Jar/py names'),
           'value': '',
-          'help_text': _('Comma separated list of jars or python HDFS files.'),
+          'help_text': _('Comma separated list of filenames.'),
           'type': ''
      },
      'spark_opts': {
@@ -1903,7 +1903,7 @@ class SparkAction(Action):
 
   @classmethod
   def get_mandatory_fields(cls):
-    return [cls.FIELDS['spark_master'], cls.FIELDS['mode'], cls.FIELDS['jars']]
+    return [cls.FIELDS['jars'], cls.FIELDS['files']]
 
 
 class KillAction(Action):

+ 20 - 22
apps/oozie/src/oozie/templates/editor2/common_workflow.mako

@@ -800,40 +800,23 @@
 
     <div data-bind="visible: ! $root.isEditing()">
       <span data-bind="template: { name: 'logs-icon' }"></span>
-      <span data-bind="text: properties.app_name" />
+      <span data-bind="text: properties.app_name"></span>
       &nbsp;&nbsp;&nbsp;
-      <span data-bind="text: properties.spark_master" />
-      <span data-bind="text: properties.mode" />
+      <span data-bind="text: properties.class"></span>
       <br/>
-      <span data-bind="text: properties.jars" />
-      <span data-bind="text: properties.class" />
+      <span data-bind="text: properties.jars"></span>
     </div>
 
     <div data-bind="visible: $root.isEditing">
       <div data-bind="visible: ! $parent.ooziePropertiesExpanded()" class="nowrap">
 
-        <div class="airy">
-          <span class="widget-label" data-bind="text: $root.workflow_properties.spark_master.label"></span>
-          <input type="text" class="input-medium" data-bind="value: properties.spark_master, attr: { placeholder: $root.workflow_properties.spark_master.help_text }" />
-        </div>
-
-        <div class="airy">
-          <span class="widget-label" data-bind="text: $root.workflow_properties.mode.label"></span>
-          <input type="text" class="input-medium" data-bind="value: properties.mode, attr: { placeholder: $root.workflow_properties.mode.help_text }" />
-        </div>
-
-        <div class="airy">
-          <span class="widget-label" data-bind="text: $root.workflow_properties.app_name.label"></span>
-          <input type="text" class="input-xlarge seventy" data-bind="value: properties.app_name, attr: { placeholder: $root.workflow_properties.app_name.help_text }" />
-        </div>
-
         <div class="airy">
           <span class="widget-label" data-bind="text: $root.workflow_properties.jars.label"></span>
-          <input type="text" class="filechooser-input" data-bind="filechooser: properties.jars, filechooserOptions: globalFilechooserOptions, hdfsAutocomplete: properties.jars, attr: { placeholder:  $root.workflow_properties.jars.help_text }" validate="nonempty"/>
+          <input type="text" class="filechooser-input" data-bind="filechooser: properties.jars, valueUpdate:'afterkeydown', filechooserOptions: globalFilechooserOptions, hdfsAutocomplete: properties.jars, attr: { placeholder:  $root.workflow_properties.jars.help_text }" validate="nonempty"/>
           <span data-bind='template: { name: "common-fs-link", data: {path: properties.jars(), with_label: false}}'></span>
         </div>
 
-        <div class="airy">
+        <div class="airy" data-bind="visible: $.grep( properties.jars().split(','), function(val, index) { return val.toLowerCase().endsWith('.jar'); }).length > 0">
           <span class="widget-label" data-bind="text: $root.workflow_properties.class.label"></span>
           <input type="text" class="input-xlarge seventy" data-bind="value: properties.class, attr: { placeholder: $root.workflow_properties.class.help_text }" />
         </div>
@@ -874,6 +857,21 @@
       </ul>
       <div class="tab-content">
         <div class="tab-pane active" data-bind="attr: { id: 'properties-' + id() }">
+          <div class="airy">
+            <span class="widget-label" data-bind="text: $root.workflow_properties.spark_master.label"></span>
+            <input type="text" class="input-medium" data-bind="value: properties.spark_master, attr: { placeholder: $root.workflow_properties.spark_master.help_text }" />
+          </div>
+
+          <div class="airy">
+            <span class="widget-label" data-bind="text: $root.workflow_properties.mode.label"></span>
+            <input type="text" class="input-medium" data-bind="value: properties.mode, attr: { placeholder: $root.workflow_properties.mode.help_text }" />
+          </div>
+
+          <div class="airy">
+            <span class="widget-label" data-bind="text: $root.workflow_properties.app_name.label"></span>
+            <input type="text" class="input-xlarge seventy" data-bind="value: properties.app_name, attr: { placeholder: $root.workflow_properties.app_name.help_text }" />
+          </div>
+
           <span class="widget-label"  data-bind="text: $root.workflow_properties.spark_opts.label"></span>
           <input type="text" class="input-xlarge seventy" data-bind="value: properties.spark_opts, attr: { placeholder: $root.workflow_properties.spark_opts.help_text }" />