Ottomata has submitted this change and it was merged.

Change subject: Add error emails to cassandra loading oozie jobs
......................................................................


Add error emails to cassandra loading oozie jobs

Add error emails to cassandra hourly, daily & monthly loading jobs.

Change-Id: I6be444e1b9d069cacfb3fc58d26660051c2b1608
---
M oozie/cassandra/bundle.properties
M oozie/cassandra/bundle.xml
M oozie/cassandra/coord_per_article_daily.properties
M oozie/cassandra/coord_per_project_daily.properties
M oozie/cassandra/coord_per_project_hourly.properties
M oozie/cassandra/coord_per_project_monthly.properties
M oozie/cassandra/coord_top_articles_daily.properties
M oozie/cassandra/coord_top_articles_monthly.properties
M oozie/cassandra/daily/coordinator.xml
M oozie/cassandra/daily/workflow.xml
M oozie/cassandra/hourly/coordinator.xml
M oozie/cassandra/hourly/workflow.xml
M oozie/cassandra/monthly/coordinator.xml
M oozie/cassandra/monthly/workflow.xml
14 files changed, 119 insertions(+), 6 deletions(-)

Approvals:
  Ottomata: Verified; Looks good to me, approved



diff --git a/oozie/cassandra/bundle.properties 
b/oozie/cassandra/bundle.properties
index f644c23..2210aee 100644
--- a/oozie/cassandra/bundle.properties
+++ b/oozie/cassandra/bundle.properties
@@ -39,6 +39,8 @@
 workflow_file_daily               = 
${oozie_directory}/cassandra/daily/workflow.xml
 workflow_file_monthly             = 
${oozie_directory}/cassandra/monthly/workflow.xml
 
+# Workflow to send an error email
+send_error_email_workflow_file    = 
${oozie_directory}/util/send_error_email/workflow.xml
 
 # HDFS path to datasets definitions
 pageview_datasets_file            = ${oozie_directory}/pageview/datasets.xml
diff --git a/oozie/cassandra/bundle.xml b/oozie/cassandra/bundle.xml
index 928791f..9c4bd83 100644
--- a/oozie/cassandra/bundle.xml
+++ b/oozie/cassandra/bundle.xml
@@ -17,6 +17,8 @@
         <property><name>workflow_file_daily</name></property>
         <property><name>workflow_file_monthly</name></property>
 
+        <property><name>send_error_email_workflow_file</name></property>
+
         <property><name>start_time</name></property>
         <property><name>stop_time</name></property>
 
diff --git a/oozie/cassandra/coord_per_article_daily.properties 
b/oozie/cassandra/coord_per_article_daily.properties
index 9d64104..ce49c70 100644
--- a/oozie/cassandra/coord_per_article_daily.properties
+++ b/oozie/cassandra/coord_per_article_daily.properties
@@ -39,6 +39,8 @@
 workflow_file_daily               = 
${oozie_directory}/cassandra/daily/workflow.xml
 workflow_file_monthly             = 
${oozie_directory}/cassandra/monthly/workflow.xml
 
+# Workflow to send an error email
+send_error_email_workflow_file    = 
${oozie_directory}/util/send_error_email/workflow.xml
 
 # HDFS path to datasets definitions
 pageview_datasets_file            = ${oozie_directory}/pageview/datasets.xml
diff --git a/oozie/cassandra/coord_per_project_daily.properties 
b/oozie/cassandra/coord_per_project_daily.properties
index 76818e4..8726a5a 100644
--- a/oozie/cassandra/coord_per_project_daily.properties
+++ b/oozie/cassandra/coord_per_project_daily.properties
@@ -39,6 +39,8 @@
 workflow_file_daily               = 
${oozie_directory}/cassandra/daily/workflow.xml
 workflow_file_monthly             = 
${oozie_directory}/cassandra/monthly/workflow.xml
 
+# Workflow to send an error email
+send_error_email_workflow_file    = 
${oozie_directory}/util/send_error_email/workflow.xml
 
 # HDFS path to datasets definitions
 pageview_datasets_file            = ${oozie_directory}/pageview/datasets.xml
diff --git a/oozie/cassandra/coord_per_project_hourly.properties 
b/oozie/cassandra/coord_per_project_hourly.properties
index d2d338f..f250d95 100644
--- a/oozie/cassandra/coord_per_project_hourly.properties
+++ b/oozie/cassandra/coord_per_project_hourly.properties
@@ -39,6 +39,8 @@
 workflow_file_daily               = 
${oozie_directory}/cassandra/daily/workflow.xml
 workflow_file_monthly             = 
${oozie_directory}/cassandra/monthly/workflow.xml
 
+# Workflow to send an error email
+send_error_email_workflow_file    = 
${oozie_directory}/util/send_error_email/workflow.xml
 
 # HDFS path to datasets definitions
 pageview_datasets_file            = ${oozie_directory}/pageview/datasets.xml
diff --git a/oozie/cassandra/coord_per_project_monthly.properties 
b/oozie/cassandra/coord_per_project_monthly.properties
index 36c449a..7faf4d9 100644
--- a/oozie/cassandra/coord_per_project_monthly.properties
+++ b/oozie/cassandra/coord_per_project_monthly.properties
@@ -39,6 +39,8 @@
 workflow_file_daily               = 
${oozie_directory}/cassandra/daily/workflow.xml
 workflow_file_monthly             = 
${oozie_directory}/cassandra/monthly/workflow.xml
 
+# Workflow to send an error email
+send_error_email_workflow_file    = 
${oozie_directory}/util/send_error_email/workflow.xml
 
 # HDFS path to datasets definitions
 pageview_datasets_file            = ${oozie_directory}/pageview/datasets.xml
diff --git a/oozie/cassandra/coord_top_articles_daily.properties 
b/oozie/cassandra/coord_top_articles_daily.properties
index a028c15..382ed4a 100644
--- a/oozie/cassandra/coord_top_articles_daily.properties
+++ b/oozie/cassandra/coord_top_articles_daily.properties
@@ -39,6 +39,8 @@
 workflow_file_daily               = 
${oozie_directory}/cassandra/daily/workflow.xml
 workflow_file_monthly             = 
${oozie_directory}/cassandra/monthly/workflow.xml
 
+# Workflow to send an error email
+send_error_email_workflow_file    = 
${oozie_directory}/util/send_error_email/workflow.xml
 
 # HDFS path to datasets definitions
 pageview_datasets_file            = ${oozie_directory}/pageview/datasets.xml
diff --git a/oozie/cassandra/coord_top_articles_monthly.properties 
b/oozie/cassandra/coord_top_articles_monthly.properties
index 2926656..75650ed 100644
--- a/oozie/cassandra/coord_top_articles_monthly.properties
+++ b/oozie/cassandra/coord_top_articles_monthly.properties
@@ -39,6 +39,8 @@
 workflow_file_daily               = 
${oozie_directory}/cassandra/daily/workflow.xml
 workflow_file_monthly             = 
${oozie_directory}/cassandra/monthly/workflow.xml
 
+# Workflow to send an error email
+send_error_email_workflow_file    = 
${oozie_directory}/util/send_error_email/workflow.xml
 
 # HDFS path to datasets definitions
 pageview_datasets_file            = ${oozie_directory}/pageview/datasets.xml
diff --git a/oozie/cassandra/daily/coordinator.xml 
b/oozie/cassandra/daily/coordinator.xml
index c3aa5c2..dbab7e0 100644
--- a/oozie/cassandra/daily/coordinator.xml
+++ b/oozie/cassandra/daily/coordinator.xml
@@ -51,6 +51,7 @@
         <property><name>constant_output_tid_field</name></property>
         <property><name>constant_output_tid_value</name></property>
 
+        <property><name>send_error_email_workflow_file</name></property>
 
     </parameters>
 
diff --git a/oozie/cassandra/daily/workflow.xml 
b/oozie/cassandra/daily/workflow.xml
index fe2a8db..89c40af 100644
--- a/oozie/cassandra/daily/workflow.xml
+++ b/oozie/cassandra/daily/workflow.xml
@@ -35,6 +35,10 @@
             <name>temporary_directory</name>
             <description>A temporary directory to store data.</description>
         </property>
+        <property>
+            <name>send_error_email_workflow_file</name>
+            <description>Workflow for sending an email</description>
+        </property>
 
         <!-- cassandra loader -->
         <property>
@@ -174,7 +178,7 @@
         </hive>
 
         <ok to="load_cassandra"/>
-        <error to="kill"/>
+        <error to="send_error_email"/>
     </action>
 
     <action name="load_cassandra">
@@ -385,7 +389,7 @@
 
         </map-reduce>
         <ok to="remove_temporary_data"/>
-        <error to="kill"/>
+        <error to="send_error_email"/>
     </action>
 
     <action name="remove_temporary_data">
@@ -393,6 +397,33 @@
             <delete 
path="${temporary_directory}/${wf:id()}-${cassandra_keyspace}"/>
         </fs>
         <ok to="end"/>
+        <error to="send_error_email"/>
+    </action>
+
+    <action name="send_error_email">
+        <sub-workflow>
+            <app-path>${send_error_email_workflow_file}</app-path>
+            <propagate-configuration/>
+            <configuration>
+                <property>
+                    <name>parent_name</name>
+                    <value>${wf:name()}</value>
+                </property>
+                <property>
+                    <name>parent_failed_action</name>
+                    <value>${wf:lastErrorNode()}</value>
+                </property>
+                <property>
+                    <name>parent_error_code</name>
+                    <value>${wf:errorCode(wf:lastErrorNode())}</value>
+                </property>
+                <property>
+                    <name>parent_error_message</name>
+                    <value>${wf:errorMessage(wf:lastErrorNode())}</value>
+                </property>
+            </configuration>
+        </sub-workflow>
+        <ok to="kill"/>
         <error to="kill"/>
     </action>
 
diff --git a/oozie/cassandra/hourly/coordinator.xml 
b/oozie/cassandra/hourly/coordinator.xml
index 05439ae..5957b7b 100644
--- a/oozie/cassandra/hourly/coordinator.xml
+++ b/oozie/cassandra/hourly/coordinator.xml
@@ -53,6 +53,7 @@
         <property><name>constant_output_tid_field</name></property>
         <property><name>constant_output_tid_value</name></property>
 
+        <property><name>send_error_email_workflow_file</name></property>
 
     </parameters>
 
diff --git a/oozie/cassandra/hourly/workflow.xml 
b/oozie/cassandra/hourly/workflow.xml
index 590b1c9..443c2fe 100644
--- a/oozie/cassandra/hourly/workflow.xml
+++ b/oozie/cassandra/hourly/workflow.xml
@@ -35,6 +35,10 @@
             <name>temporary_directory</name>
             <description>A temporary directory to store data.</description>
         </property>
+        <property>
+            <name>send_error_email_workflow_file</name>
+            <description>Workflow for sending an email</description>
+        </property>
 
         <!-- cassandra loader -->
         <property>
@@ -187,7 +191,7 @@
         </hive>
 
         <ok to="load_cassandra"/>
-        <error to="kill"/>
+        <error to="send_error_email"/>
     </action>
 
     <action name="load_cassandra">
@@ -398,7 +402,7 @@
 
         </map-reduce>
         <ok to="remove_temporary_data"/>
-        <error to="kill"/>
+        <error to="send_error_email"/>
     </action>
 
     <action name="remove_temporary_data">
@@ -406,6 +410,33 @@
             <delete 
path="${temporary_directory}/${wf:id()}-${cassandra_keyspace}"/>
         </fs>
         <ok to="end"/>
+        <error to="send_error_email"/>
+    </action>
+
+    <action name="send_error_email">
+        <sub-workflow>
+            <app-path>${send_error_email_workflow_file}</app-path>
+            <propagate-configuration/>
+            <configuration>
+                <property>
+                    <name>parent_name</name>
+                    <value>${wf:name()}</value>
+                </property>
+                <property>
+                    <name>parent_failed_action</name>
+                    <value>${wf:lastErrorNode()}</value>
+                </property>
+                <property>
+                    <name>parent_error_code</name>
+                    <value>${wf:errorCode(wf:lastErrorNode())}</value>
+                </property>
+                <property>
+                    <name>parent_error_message</name>
+                    <value>${wf:errorMessage(wf:lastErrorNode())}</value>
+                </property>
+            </configuration>
+        </sub-workflow>
+        <ok to="kill"/>
         <error to="kill"/>
     </action>
 
diff --git a/oozie/cassandra/monthly/coordinator.xml 
b/oozie/cassandra/monthly/coordinator.xml
index 6fb95eb..a4ba2f7 100644
--- a/oozie/cassandra/monthly/coordinator.xml
+++ b/oozie/cassandra/monthly/coordinator.xml
@@ -51,6 +51,7 @@
         <property><name>constant_output_tid_field</name></property>
         <property><name>constant_output_tid_value</name></property>
 
+        <property><name>send_error_email_workflow_file</name></property>
 
     </parameters>
 
diff --git a/oozie/cassandra/monthly/workflow.xml 
b/oozie/cassandra/monthly/workflow.xml
index 00a7aac..89c67f3 100644
--- a/oozie/cassandra/monthly/workflow.xml
+++ b/oozie/cassandra/monthly/workflow.xml
@@ -35,6 +35,10 @@
             <name>temporary_directory</name>
             <description>A temporary directory to store data.</description>
         </property>
+        <property>
+            <name>send_error_email_workflow_file</name>
+            <description>Workflow for sending an email</description>
+        </property>
 
         <!-- cassandra loader -->
         <property>
@@ -169,7 +173,7 @@
         </hive>
 
         <ok to="load_cassandra"/>
-        <error to="kill"/>
+        <error to="send_error_email"/>
     </action>
 
     <action name="load_cassandra">
@@ -381,7 +385,7 @@
 
         </map-reduce>
         <ok to="remove_temporary_data"/>
-        <error to="kill"/>
+        <error to="send_error_email"/>
     </action>
 
     <action name="remove_temporary_data">
@@ -389,9 +393,37 @@
             <delete 
path="${temporary_directory}/${wf:id()}-${cassandra_keyspace}"/>
         </fs>
         <ok to="end"/>
+        <error to="send_error_email"/>
+    </action>
+
+    <action name="send_error_email">
+        <sub-workflow>
+            <app-path>${send_error_email_workflow_file}</app-path>
+            <propagate-configuration/>
+            <configuration>
+                <property>
+                    <name>parent_name</name>
+                    <value>${wf:name()}</value>
+                </property>
+                <property>
+                    <name>parent_failed_action</name>
+                    <value>${wf:lastErrorNode()}</value>
+                </property>
+                <property>
+                    <name>parent_error_code</name>
+                    <value>${wf:errorCode(wf:lastErrorNode())}</value>
+                </property>
+                <property>
+                    <name>parent_error_message</name>
+                    <value>${wf:errorMessage(wf:lastErrorNode())}</value>
+                </property>
+            </configuration>
+        </sub-workflow>
+        <ok to="kill"/>
         <error to="kill"/>
     </action>
 
+
     <kill name="kill">
         <message>Action failed, error 
message[${wf:errorMessage(wf:lastErrorNode())}]</message>
     </kill>

-- 
To view, visit https://gerrit.wikimedia.org/r/274714
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I6be444e1b9d069cacfb3fc58d26660051c2b1608
Gerrit-PatchSet: 2
Gerrit-Project: analytics/refinery
Gerrit-Branch: master
Gerrit-Owner: Joal <j...@wikimedia.org>
Gerrit-Reviewer: Elukey <ltosc...@wikimedia.org>
Gerrit-Reviewer: Madhuvishy <mviswanat...@wikimedia.org>
Gerrit-Reviewer: Nuria <nu...@wikimedia.org>
Gerrit-Reviewer: Ottomata <o...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to