Преглед изворни кода

AMBARI-1538. Stack Upgrade Wizard - Step 3 (Progress and Retry). (yusaku)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1451732 13f79535-47bb-0310-9956-ffa450edef68
Yusaku Sako пре 12 година
родитељ
комит
9891977144

+ 2 - 0
CHANGES.txt

@@ -12,6 +12,8 @@ Trunk (unreleased changes):
 
 
  NEW FEATURES
  NEW FEATURES
 
 
+ AMBARI-1538. Stack Upgrade Wizard - Step 3 (Progress and Retry). (yusaku) 
+
  AMBARI-1509. Frontend: For service configurations provide ability to 
  AMBARI-1509. Frontend: For service configurations provide ability to 
  enter host level exceptions (srimanth)
  enter host level exceptions (srimanth)
 
 

+ 2 - 2
ambari-web/app/assets/data/dashboard/services.json

@@ -793,8 +793,8 @@
                 },
                 },
                 "cluster_name" : "cl1",
                 "cluster_name" : "cl1",
                 "desired_configs" : { },
                 "desired_configs" : { },
-                "desired_state" : "INSTALLED",
-                "state" : "INSTALLED",
+                "desired_state" : "STARTED",
+                "state" : "STARTED",
                 "component_name" : "JOBTRACKER",
                 "component_name" : "JOBTRACKER",
                 "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal"
                 "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal"
               }
               }

+ 216 - 0
ambari-web/app/assets/data/wizard/upgrade/poll_1.json

@@ -0,0 +1,216 @@
+{
+  "href" : "http://localhost:8080/api/clusters/mycluster/requests/1",
+  "Requests" : {
+    "id" : 1
+  },
+  "tasks" : [
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/1",
+      "Tasks" : {
+        "id" : "1",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "PENDING",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "GANGLIA_SERVER",
+        "stderr" : "",
+        "host_name" : "ip-10-191-202-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/2",
+      "Tasks" : {
+        "id" : "2",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "QUEUED",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "GANGLIA_MONITOR",
+        "stderr" : "",
+        "host_name" : "ip-10-191-202-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "3",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "PENDING",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "GANGLIA_MONITOR",
+        "stderr" : "",
+        "host_name" : "ip-10-110-38-164.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "4",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "PENDING",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "GANGLIA_MONITOR",
+        "stderr" : "",
+        "host_name" : "domU-12-31-39-16-48-4B.compute-1.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "5",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "PENDING",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "GANGLIA_MONITOR",
+        "stderr" : "",
+        "host_name" : "ip-10-110-79-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "6",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "PENDING",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "GANGLIA_MONITOR",
+        "stderr" : "",
+        "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/2",
+      "Tasks" : {
+        "id" : "7",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "QUEUED",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "host_name" : "ip-10-191-202-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "8",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "PENDING",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "host_name" : "ip-10-110-38-164.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "9",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "PENDING",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "host_name" : "domU-12-31-39-16-48-4B.compute-1.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "10",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "PENDING",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "host_name" : "ip-10-110-79-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "11",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "PENDING",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "12",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "PENDING",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "NAMENODE",
+        "stderr" : "",
+        "host_name" : "ip-10-191-202-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "13",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "PENDING",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "SECONDARY_NAMENODE",
+        "stderr" : "",
+        "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal",
+        "stage_id" : "1"
+      }
+    }
+  ]
+}

+ 216 - 0
ambari-web/app/assets/data/wizard/upgrade/poll_2.json

@@ -0,0 +1,216 @@
+{
+  "href" : "http://localhost:8080/api/clusters/mycluster/requests/1",
+  "Requests" : {
+    "id" : 1
+  },
+  "tasks" : [
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/1",
+      "Tasks" : {
+        "id" : "1",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "QUEUED",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "GANGLIA_SERVER",
+        "stderr" : "",
+        "host_name" : "ip-10-191-202-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/2",
+      "Tasks" : {
+        "id" : "2",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "PENDING",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "GANGLIA_MONITOR",
+        "stderr" : "",
+        "host_name" : "ip-10-191-202-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "3",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "PENDING",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "GANGLIA_MONITOR",
+        "stderr" : "",
+        "host_name" : "ip-10-110-38-164.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "4",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "PENDING",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "GANGLIA_MONITOR",
+        "stderr" : "",
+        "host_name" : "domU-12-31-39-16-48-4B.compute-1.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "5",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "PENDING",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "GANGLIA_MONITOR",
+        "stderr" : "",
+        "host_name" : "ip-10-110-79-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "6",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "PENDING",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "GANGLIA_MONITOR",
+        "stderr" : "",
+        "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/2",
+      "Tasks" : {
+        "id" : "7",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "QUEUED",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "host_name" : "ip-10-191-202-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "8",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "UPGRADING",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "host_name" : "ip-10-110-38-164.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "9",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "QUEUED",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "host_name" : "domU-12-31-39-16-48-4B.compute-1.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "10",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "QUEUED",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "host_name" : "ip-10-110-79-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "11",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "QUEUED",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "12",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "QUEUED",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "NAMENODE",
+        "stderr" : "",
+        "host_name" : "ip-10-191-202-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "13",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "QUEUED",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "SECONDARY_NAMENODE",
+        "stderr" : "",
+        "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal",
+        "stage_id" : "1"
+      }
+    }
+  ]
+}

+ 216 - 0
ambari-web/app/assets/data/wizard/upgrade/poll_3.json

@@ -0,0 +1,216 @@
+{
+  "href" : "http://localhost:8080/api/clusters/mycluster/requests/1",
+  "Requests" : {
+    "id" : 1
+  },
+  "tasks" : [
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/1",
+      "Tasks" : {
+        "id" : "1",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "QUEUED",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "GANGLIA_SERVER",
+        "stderr" : "",
+        "host_name" : "ip-10-191-202-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/2",
+      "Tasks" : {
+        "id" : "2",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "PENDING",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "GANGLIA_MONITOR",
+        "stderr" : "",
+        "host_name" : "ip-10-191-202-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "3",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "PENDING",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "GANGLIA_MONITOR",
+        "stderr" : "",
+        "host_name" : "ip-10-110-38-164.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "4",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "PENDING",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "GANGLIA_MONITOR",
+        "stderr" : "",
+        "host_name" : "domU-12-31-39-16-48-4B.compute-1.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "5",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "PENDING",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "GANGLIA_MONITOR",
+        "stderr" : "",
+        "host_name" : "ip-10-110-79-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "6",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "PENDING",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "GANGLIA_MONITOR",
+        "stderr" : "",
+        "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/2",
+      "Tasks" : {
+        "id" : "7",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "COMPLETED",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "host_name" : "ip-10-191-202-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "8",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "COMPLETED",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "host_name" : "ip-10-110-38-164.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "9",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "COMPLETED",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "host_name" : "domU-12-31-39-16-48-4B.compute-1.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "10",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "QUEUED",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "host_name" : "ip-10-110-79-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "11",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "QUEUED",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "12",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "UPGRADING",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "NAMENODE",
+        "stderr" : "",
+        "host_name" : "ip-10-191-202-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "13",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "QUEUED",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "SECONDARY_NAMENODE",
+        "stderr" : "",
+        "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal",
+        "stage_id" : "1"
+      }
+    }
+  ]
+}

+ 216 - 0
ambari-web/app/assets/data/wizard/upgrade/poll_4.json

@@ -0,0 +1,216 @@
+{
+  "href" : "http://localhost:8080/api/clusters/mycluster/requests/1",
+  "Requests" : {
+    "id" : 1
+  },
+  "tasks" : [
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/1",
+      "Tasks" : {
+        "id" : "1",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "QUEUED",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "GANGLIA_SERVER",
+        "stderr" : "",
+        "host_name" : "ip-10-191-202-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/2",
+      "Tasks" : {
+        "id" : "2",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "QUEUED",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "GANGLIA_MONITOR",
+        "stderr" : "",
+        "host_name" : "ip-10-191-202-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "3",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "QUEUED",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "GANGLIA_MONITOR",
+        "stderr" : "",
+        "host_name" : "ip-10-110-38-164.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "4",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "QUEUED",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "GANGLIA_MONITOR",
+        "stderr" : "",
+        "host_name" : "domU-12-31-39-16-48-4B.compute-1.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "5",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "QUEUED",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "GANGLIA_MONITOR",
+        "stderr" : "",
+        "host_name" : "ip-10-110-79-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "6",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "UPGRADING",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "GANGLIA_MONITOR",
+        "stderr" : "",
+        "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/2",
+      "Tasks" : {
+        "id" : "7",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "COMPLETED",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "host_name" : "ip-10-191-202-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "8",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "COMPLETED",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "host_name" : "ip-10-110-38-164.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "9",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "COMPLETED",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "host_name" : "domU-12-31-39-16-48-4B.compute-1.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "10",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "COMPLETED",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "host_name" : "ip-10-110-79-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "11",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "COMPLETED",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "12",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "COMPLETED",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "NAMENODE",
+        "stderr" : "",
+        "host_name" : "ip-10-191-202-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "13",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "COMPLETED",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "SECONDARY_NAMENODE",
+        "stderr" : "",
+        "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal",
+        "stage_id" : "1"
+      }
+    }
+  ]
+}

+ 216 - 0
ambari-web/app/assets/data/wizard/upgrade/poll_5.json

@@ -0,0 +1,216 @@
+{
+  "href" : "http://localhost:8080/api/clusters/mycluster/requests/1",
+  "Requests" : {
+    "id" : 1
+  },
+  "tasks" : [
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/1",
+      "Tasks" : {
+        "id" : "1",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "COMPLETED",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "GANGLIA_SERVER",
+        "stderr" : "",
+        "host_name" : "ip-10-191-202-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/2",
+      "Tasks" : {
+        "id" : "2",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "COMPLETED",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "GANGLIA_MONITOR",
+        "stderr" : "",
+        "host_name" : "ip-10-191-202-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "3",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "COMPLETED",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "GANGLIA_MONITOR",
+        "stderr" : "",
+        "host_name" : "ip-10-110-38-164.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "4",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "COMPLETED",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "GANGLIA_MONITOR",
+        "stderr" : "",
+        "host_name" : "domU-12-31-39-16-48-4B.compute-1.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "5",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "COMPLETED",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "GANGLIA_MONITOR",
+        "stderr" : "",
+        "host_name" : "ip-10-110-79-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "6",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "FAILED",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "GANGLIA_MONITOR",
+        "stderr" : "",
+        "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/2",
+      "Tasks" : {
+        "id" : "7",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "COMPLETED",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "host_name" : "ip-10-191-202-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "8",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "COMPLETED",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "host_name" : "ip-10-110-38-164.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "9",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "COMPLETED",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "host_name" : "domU-12-31-39-16-48-4B.compute-1.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "10",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "COMPLETED",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "host_name" : "ip-10-110-79-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "11",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "COMPLETED",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "DATANODE",
+        "stderr" : "",
+        "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "12",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "COMPLETED",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "NAMENODE",
+        "stderr" : "",
+        "host_name" : "ip-10-191-202-42.ec2.internal",
+        "stage_id" : "1"
+      }
+    },
+    {
+      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/3",
+      "Tasks" : {
+        "id" : "13",
+        "attempt_cnt" : "0",
+        "exit_code" : "999",
+        "stdout" : "",
+        "status" : "COMPLETED",
+        "command" : "UPGRADE",
+        "start_time" : "-1",
+        "role" : "SECONDARY_NAMENODE",
+        "stderr" : "",
+        "host_name" : "domU-12-31-39-0E-E6-01.compute-1.internal",
+        "stage_id" : "1"
+      }
+    }
+  ]
+}

+ 1 - 0
ambari-web/app/controllers.js

@@ -82,5 +82,6 @@ require('controllers/wizard/step10_controller');
 require('controllers/wizard/step11_controller');
 require('controllers/wizard/step11_controller');
 require('controllers/wizard/stack_upgrade/step1_controller');
 require('controllers/wizard/stack_upgrade/step1_controller');
 require('controllers/wizard/stack_upgrade/step2_controller');
 require('controllers/wizard/stack_upgrade/step2_controller');
+require('controllers/wizard/stack_upgrade/step3_controller');
 require('controllers/global/cluster_controller');
 require('controllers/global/cluster_controller');
 require('controllers/global/update_controller');
 require('controllers/global/update_controller');

+ 27 - 0
ambari-web/app/controllers/main/admin/stack_upgrade_controller.js

@@ -67,6 +67,28 @@ App.StackUpgradeController = App.WizardController.extend({
   upgradeOptionsTemplate:{
   upgradeOptionsTemplate:{
     localRepo: false
     localRepo: false
   },
   },
+  stopServices: function(){
+    var method = App.testMode ? "GET" : "PUT";
+    var url = '';
+    var data = '';
+    $.ajax({
+      type: method,
+      url: url,
+      data: data,
+      async: false,
+      dataType: 'text',
+      timeout: App.timeout,
+      success: function (data) {
+
+      },
+
+      error: function (request, ajaxOptions, error) {
+
+      },
+
+      statusCode: require('data/statusCodes')
+    });
+  },
   clear: function () {
   clear: function () {
     this.set('content', Ember.Object.create({
     this.set('content', Ember.Object.create({
       servicesInfo: function(){
       servicesInfo: function(){
@@ -81,10 +103,15 @@ App.StackUpgradeController = App.WizardController.extend({
     this.set('currentStep', 0);
     this.set('currentStep', 0);
     this.clearStorageData();
     this.clearStorageData();
   },
   },
+  clearStorageData: function(){
+    App.db.setCluster(undefined);
+    App.db.setUpgradeOptions(undefined);
+  },
   /**
   /**
    * Finish upgrade
    * Finish upgrade
    */
    */
   finish: function () {
   finish: function () {
+    this.clear();
     this.setCurrentStep('1');
     this.setCurrentStep('1');
     App.router.get('updateController').updateAll();
     App.router.get('updateController').updateAll();
   }
   }

+ 0 - 1
ambari-web/app/controllers/wizard.js

@@ -421,7 +421,6 @@ App.WizardController = Em.Controller.extend({
     App.db.setSlaveProperties(undefined);
     App.db.setSlaveProperties(undefined);
     App.db.setInstallOptions(undefined);
     App.db.setInstallOptions(undefined);
     App.db.setAllHostNamesPattern(undefined);
     App.db.setAllHostNamesPattern(undefined);
-    App.db.setUpgradeOptions(undefined);
   },
   },
 
 
   installOptionsTemplate: {
   installOptionsTemplate: {

+ 2 - 2
ambari-web/app/controllers/wizard/stack_upgrade/step2_controller.js

@@ -24,7 +24,7 @@ App.StackUpgradeStep2Controller = Em.Controller.extend({
    * check whether all services are running
    * check whether all services are running
    * @return {Array}
    * @return {Array}
    */
    */
-  isAllServicesRunning:function(){
+  isAllServicesRunning: function(){
     var masterComponents = App.HostComponent.find().filterProperty('isMaster', true);
     var masterComponents = App.HostComponent.find().filterProperty('isMaster', true);
     return masterComponents.everyProperty('workStatus', 'STARTED');
     return masterComponents.everyProperty('workStatus', 'STARTED');
   },
   },
@@ -33,7 +33,7 @@ App.StackUpgradeStep2Controller = Em.Controller.extend({
    * @param event
    * @param event
    */
    */
   upgradeAction: function(event){
   upgradeAction: function(event){
-    if(this.get('isAllServicesRunning')){
+    if(this.isAllServicesRunning()){
       App.db.setUpgradeOptions(this.get('content.upgradeOptions'));
       App.db.setUpgradeOptions(this.get('content.upgradeOptions'));
       App.router.send('next');
       App.router.send('next');
     } else {
     } else {

+ 496 - 0
ambari-web/app/controllers/wizard/stack_upgrade/step3_controller.js

@@ -0,0 +1,496 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var App = require('app');
+
+App.StackUpgradeStep3Controller = Em.Controller.extend({
+  name: 'stackUpgradeStep3Controller',
+
+  POLL_INTERVAL: 4000,
+  isPolling: false,
+  isUpgradeStarted: false,
+  servicesOrder: [
+    'HDFS',
+    'MAPREDUCE',
+    'ZOOKEEPER',
+    'HBASE',
+    'HIVE',
+    'OOZIE',
+    'NAGIOS',
+    'GANGLIA',
+    'PIG',
+    'SQOOP'
+  ],
+
+  /**
+   * overall status of Upgrade
+   * FAILED - some service is FAILED
+   * SUCCESS - every services are SUCCESS
+   * WARNING - some service is WARNING
+   */
+  status: function () {
+    //TODO set saveClusterStatus()
+    var services = this.get('services');
+    var withoutWarning = [];
+    if (services.someProperty('status', 'FAILED')) {
+      this.set('isPolling', false);
+      return 'FAILED';
+    }
+    if (services.someProperty('status', 'WARNING')) {
+      withoutWarning = services.filter(function(service){
+        if(service.get('status') !== "WARNING"){
+          return true;
+        }
+      });
+      if(withoutWarning.everyProperty('status', 'SUCCESS')){
+        this.set('isPolling', false);
+        return "WARNING";
+      }
+    }
+    if (services.everyProperty('status', 'SUCCESS')) {
+      this.set('isPolling', false);
+      return 'SUCCESS';
+    }
+    return 'IN_PROGRESS';
+  }.property('services.@each.status'),
+  /**
+   * The dependence of the status of service to status of the tasks
+   * FAILED - any task is TIMEDOUT, ABORTED, FAILED (depends on component is master)
+   * WARNING - any task is TIMEDOUT, ABORTED, FAILED (depends on component is slave or client)
+   * SUCCESS - every tasks are COMPLETED
+   * IN_PROGRESS - any task is UPGRADING(IN_PROGRESS)
+   * PENDING - every tasks are QUEUED or PENDING
+   */
+  services: [],
+  /**
+   * load installed services on cluster
+   */
+  loadServices: function(){
+    var installedServices = App.testMode ? this.get('mockServices') : this.get('content.servicesInfo');
+    var services = [];
+    var order = this.get('servicesOrder');
+    installedServices.sort(function(a, b){
+      return order.indexOf(a.get('serviceName')) - order.indexOf(b.get('serviceName'));
+    });
+    installedServices.forEach(function(_service){
+      services.push(Em.Object.create({
+        name: _service.get('serviceName'),
+        displayName: _service.get('displayName'),
+        hosts: this.loadHosts(_service),
+        progress: 0,
+        message: function(){
+          switch(this.get('status')){
+            case "FAILED":
+              return Em.I18n.t('installer.stackUpgrade.step3.service.failedUpgrade').format(this.get('name'));
+              break;
+            case "WARNING":
+              return Em.I18n.t('installer.stackUpgrade.step3.service.upgraded').format(this.get('name'));
+              break;
+            case "SUCCESS":
+              return Em.I18n.t('installer.stackUpgrade.step3.service.upgraded').format(this.get('name'));
+              break;
+            case "IN_PROGRESS":
+              return Em.I18n.t('installer.stackUpgrade.step3.service.upgrading').format(this.get('name'));
+              break;
+            case "PENDING":
+            default:
+              return Em.I18n.t('installer.stackUpgrade.step3.service.pending').format(this.get('name'));
+              break;
+          }
+        }.property('status'),
+        status: "PENDING",
+        detailMessage:''
+      }));
+    }, this);
+    this.set('services', services);
+  }.observes('content.servicesInfo'),
+  /**
+   * load hosts as services property
+   * @param service
+   * @return {Array}
+   */
+  loadHosts: function(service){
+    var hostComponents = App.HostComponent.find().filterProperty('service.serviceName', service.get('serviceName'));
+    var hostNames = hostComponents.mapProperty('host.hostName').uniq();
+    var hosts = [];
+    hostNames.forEach(function(hostName){
+      hosts.push(Em.Object.create({
+        name: hostName,
+        logTasks: [],
+        components: hostComponents.filterProperty('host.hostName', hostName).mapProperty('componentName')
+      }));
+    });
+    return hosts;
+  },
+  /**
+   * upgrade status SUCCESS - submit button enabled with label "Done"
+   * upgrade status WARNING - submit button enabled with label "Proceed with Warning"
+   * upgrade status FAILED or IN_PROGRESS - submit button disabled
+   */
+  submitButton: function(){
+    if(this.get('status') == 'SUCCESS'){
+      return Em.I18n.t('common.done');
+    } else if(this.get('status') == 'WARNING'){
+      return Em.I18n.t('installer.stackUpgrade.step3.ProceedWithWarning');
+    } else {
+      return false;
+    }
+  }.property('status'),
+  showRetry: function () {
+    return (this.get('status') === 'FAILED' || this.get('status') === 'WARNING');
+  }.property('status'),
+  isServicesStopped: function(){
+    return this.get('servicesStopProgress') === 100;
+  }.property('servicesStopProgress'),
+  installedServices: App.Service.find(),
+  /**
+   * progress of stopping services process
+   */
+  servicesStopProgress: function(){
+    var services = App.testMode ? this.get('mockServices') : this.get('installedServices').toArray();
+    var progress = (services.filterProperty('workStatus', 'STOPPING').length / services.length) * 0.2;
+    return Math.round((progress + services.filterProperty('workStatus', 'INSTALLED').length / services.length) * 100);
+  }.property('installedServices.@each.workStatus', 'mockServices.@each.workStatus'),
+  /**
+   * restart upgrade if fail or warning occurred
+   * @param event
+   */
+  retry: function(event){
+    this.set('isUpgradeStarted', false);
+    this.resetMockConfig(true);
+    this.loadServices();
+    this.runUpgrade();
+  },
+  /**
+   * send request to run upgrade all services
+   */
+  runUpgrade: function(){
+    // call to run upgrade on server
+    var method = App.testMode ? "GET" : "PUT";
+    var url = '';
+    var data = '';
+    var self = this;
+    if(this.get('isServicesStopped') && !this.get('isUpgradeStarted')){
+      //TODO remove assignment isUpgradeStarted true to Ajax success callback
+      this.set('isUpgradeStarted', true);
+      /* $.ajax({
+       type: method,
+       url: url,
+       data: data,
+       async: false,
+       dataType: 'text',
+       timeout: App.timeout,
+       success: function (data) {
+
+       },
+
+       error: function (request, ajaxOptions, error) {
+
+       },
+
+       statusCode: require('data/statusCodes')
+       });*/
+      /*App.clusterStatus.setClusterStatus({
+       clusterName: this.get('clusterName'),
+       clusterState: 'UPGRADING_STACK',
+       wizardControllerName: 'stackUpgradeController',
+       localdb: App.db.data
+       });*/
+      this.startPolling();
+    }
+  }.observes('isServicesStopped'),
+  /**
+   * start polling on upgrade progress
+   */
+  startPolling: function(){
+    //TODO set actual URL to poll upgrade progress
+    var url = '';
+    if(!this.get('isPolling')){
+      this.set('isPolling', true);
+      if (App.testMode) {
+        this.simulatePolling();
+      } else {
+        //pass an interval "1" to start poll immediately first time
+        this.doPoll(url, 1);
+      }
+    }
+  },
+
+  mockServices: [
+    Em.Object.create({
+      serviceName: 'GANGLIA',
+      displayName: 'Ganglia',
+      workStatus: 'STARTED'
+    }),
+    Em.Object.create({
+      serviceName: 'HDFS',
+      displayName: 'HDFS',
+      workStatus: 'STARTED'
+    })
+  ],
+  simulateAttempt:0,
+  /**
+   * simulate actual poll, using mock data
+   */
+  simulatePolling: function(){
+    var simulateAttempt = this.get('simulateAttempt');
+    var URLs = [
+      '/data/wizard/upgrade/poll_1.json',
+      '/data/wizard/upgrade/poll_2.json',
+      '/data/wizard/upgrade/poll_3.json',
+      '/data/wizard/upgrade/poll_4.json',
+      '/data/wizard/upgrade/poll_5.json'
+    ];
+    if(simulateAttempt < 5){
+      this.doPoll(URLs[simulateAttempt]);
+      this.set('simulateAttempt', ++simulateAttempt);
+    }
+  },
+  /**
+   * simulate stopping services before upgrade,
+   * using mockServices data
+   */
+  simulateStopService: function(){
+    var services = this.get('mockServices');
+    var self = this;
+    setTimeout(function(){
+      services[0].set('workStatus', 'STOPPING');
+    }, 4000);
+    setTimeout(function(){
+      services[0].set('workStatus', 'INSTALLED');
+    }, 8000);
+    setTimeout(function(){
+      services[1].set('workStatus', 'STOPPING');
+    }, 12000);
+    setTimeout(function(){
+      services[1].set('workStatus', 'INSTALLED');
+      services.setEach('workStatus', 'INSTALLED');
+    }, 16000);
+  },
+
+  /**
+   * poll server for tasks, which contain upgrade progress data
+   * @param url
+   * @param interval
+   */
+  doPoll: function(url, interval){
+    var self = this;
+    var pollInterval = interval || self.POLL_INTERVAL;
+    if (self.get('isPolling')) {
+      setTimeout(function () {
+        $.ajax({
+          utype: 'GET',
+          url: url,
+          async: true,
+          timeout: App.timeout,
+          dataType: 'json',
+          success: function (data) {
+            var result = self.parseTasks(data);
+            if (!App.testMode) {
+              self.doPoll();
+            } else {
+              self.simulatePolling();
+            }
+          },
+          error: function () {
+
+          },
+          statusCode: require('data/statusCodes')
+        }).retry({times: App.maxRetries, timeout: App.timeout}).then(null,
+          function () {
+            App.showReloadPopup();
+            console.log('Install services all retries failed');
+          }
+        );
+      }, pollInterval);
+    }
+  },
+  /**
+   * parse tasks from poll
+   * change status, message, progress on services according to tasks
+   * @param data
+   * @return {Boolean}
+   */
+  parseTasks: function(data){
+    var tasks = data.tasks || [];
+    this.get('services').forEach(function (service) {
+      var hosts = service.get('hosts');
+      var tasksPerService = [];
+      if(hosts.length){
+        hosts.forEach(function (host) {
+          var tasksPerHost = tasks.filter(function(task){
+            if(task.Tasks.host_name == host.name && host.get('components').contains(task.Tasks.role)){
+              return true;
+            }
+          });
+          if (tasksPerHost.length) {
+            this.setLogTasksStatePerHost(tasksPerHost, host);
+            tasksPerService = tasksPerService.concat(tasksPerHost);
+          }
+        }, this);
+        this.progressOnService(service, tasksPerService);
+        this.statusOnService(service, tasksPerService);
+      } else {
+        service.set('status', 'PENDING');
+        service.set('detailedMessage', Em.I18n.t('installer.stackUpgrade.step3.host.nothingToUpgrade'));
+        console.log('None tasks matched to service ' + service);
+      }
+    }, this);
+    return true;
+  },
+  /**
+   * evaluate status of service depending on the tasks
+   * also set detailMessage that show currently running process
+   * @param service
+   * @param actions
+   */
+  statusOnService: function(service, actions){
+    var status;
+    var errorActions = actions.filter(function(action){
+      if(action.Tasks.status == 'FAILED' || action.Tasks.status == 'ABORTED' || action.Tasks.status == 'TIMEDOUT'){
+        return true;
+      }
+    });
+    var masterComponents = ['NAMENODE', 'SECONDARY_NAMENODE', 'SNAMENODE', 'JOBTRACKER', 'ZOOKEEPER_SERVER', 'HIVE_SERVER',
+      'HIVE_METASTORE', 'MYSQL_SERVER', 'HBASE_MASTER', 'NAGIOS_SERVER', 'GANGLIA_SERVER', 'OOZIE_SERVER','WEBHCAT_SERVER'];
+    var failedComponents = errorActions.mapProperty('Tasks.role');
+    if(failedComponents.length){
+      for(var i = 0; i < failedComponents.length; i++){
+        if(masterComponents.contains(failedComponents[i])){
+          status = "FAILED";
+          break;
+        } else {
+          status = "WARNING";
+        }
+      }
+    } else if(actions.everyProperty('Tasks.status', 'COMPLETED')){
+      status = 'SUCCESS';
+    } else {
+      var activeAction = actions.findProperty('Tasks.status', 'UPGRADING');
+      status = 'IN_PROGRESS';
+      if (activeAction === undefined || activeAction === null) {
+        activeAction = actions.findProperty('Tasks.status', 'QUEUED');
+        status = 'PENDING';
+      }
+      if (activeAction === undefined || activeAction === null) {
+        activeAction = actions.findProperty('Tasks.status', 'PENDING');
+        status = 'PENDING';
+      }
+      if(activeAction){
+        service.set('detailMessage', this.displayMessage(activeAction.Tasks));
+      }
+    }
+    service.set('status', status);
+  },
+  /**
+   * calculate progress of service depending on the tasks
+   * @param service
+   * @param actions
+   */
+  progressOnService: function(service, actions){
+    var progress = 0;
+    var actionsNumber = actions.length;
+    var completedActions = actions.filterProperty('Tasks.status', 'COMPLETED').length
+      + actions.filterProperty('Tasks.status', 'FAILED').length
+      + actions.filterProperty('Tasks.status', 'ABORTED').length
+      + actions.filterProperty('Tasks.status', 'TIMEDOUT').length;
+    var queuedActions = actions.filterProperty('Tasks.status', 'QUEUED').length;
+    var inProgressActions = actions.filterProperty('Tasks.status', 'UPGRADING').length;
+    progress = Math.ceil(((queuedActions * 0.09) + (inProgressActions * 0.35) + completedActions ) / actionsNumber * 100);
+    console.log('INFO: progressPerService is: ' + progress);
+    service.set('progress', progress);
+  },
+  /**
+   * determine description of current running process
+   * @param task
+   * @return {*}
+   */
+  displayMessage: function (task) {
+    var role = App.format.role(task.role);
+    // accept only default command - "UPGRADE"
+    console.log("In display message with task command value: " + task.command);
+    switch (task.status) {
+      case 'PENDING':
+        return Em.I18n.t('installer.step9.serviceStatus.upgrade.pending') + role;
+      case 'QUEUED' :
+        return Em.I18n.t('installer.step9.serviceStatus.upgrade.queued') + role;
+      case 'UPGRADING':
+        return Em.I18n.t('installer.step9.serviceStatus.upgrade.inProgress') + role;
+      case 'COMPLETED' :
+        return Em.I18n.t('installer.step9.serviceStatus.upgrade.completed') + role;
+      case 'FAILED':
+        return Em.I18n.t('installer.step9.serviceStatus.upgrade.failed') + role;
+    }
+  },
+  /**
+   * set and update logTasks to each host
+   * @param tasksPerHost
+   * @param host
+   */
+  setLogTasksStatePerHost: function (tasksPerHost, host) {
+    console.log('In step3 setTasksStatePerHost function.');
+    tasksPerHost.forEach(function (_task) {
+      console.log('In step3 _taskPerHost function.');
+      var task = host.get('logTasks').findProperty('Tasks.id', _task.Tasks.id);
+      if (task) {
+        host.get('logTasks').removeObject(task);
+      }
+      host.get('logTasks').pushObject(_task);
+      //}
+    }, this);
+  },
+  /**
+   * clear config and data after completion of upgrade
+   */
+  clearStep: function(){
+    this.get('services').clear();
+    this.set('isUpgradeStarted', false);
+    this.resetMockConfig(false);
+  },
+  /**
+   * reset mock configs to run upgrade simulation again
+   */
+  resetMockConfig: function(retry){
+    if(!retry){
+      this.get('mockServices').setEach('workStatus', 'STARTED');
+    }
+    this.set('simulateAttempt', 0);
+  },
+  /**
+   * run necessary operations depending on cluster status
+   */
+  navigateStep: function(){
+    if (App.testMode) {
+      this.set('content.cluster.status', 'PENDING');
+      this.set('content.cluster.isCompleted', false);
+    }
+    var clusterStatus = this.get('content.cluster.status');
+    if (this.get('content.cluster.isCompleted') === false) {
+      if (this.get('isServicesStopped') === false) {
+        //services stopping yet
+
+      } else if (clusterStatus === 'UPGRADE_FAILED') {
+
+      } else {
+        this.startPolling();
+      }
+    } else {
+
+    }
+  }
+});

+ 19 - 0
ambari-web/app/messages.js

@@ -106,6 +106,7 @@ Em.I18n.translations = {
   'common.search': 'Search',
   'common.search': 'Search',
   'common.confirm': 'Confirm',
   'common.confirm': 'Confirm',
   'common.upgrade': 'Upgrade',
   'common.upgrade': 'Upgrade',
+  'common.done': 'Done',
 
 
   'question.sure':'Are you sure {0}?',
   'question.sure':'Are you sure {0}?',
 
 
@@ -362,6 +363,11 @@ Em.I18n.translations = {
   'installer.step9.serviceStatus.abort.inProgress':'Aborting ',
   'installer.step9.serviceStatus.abort.inProgress':'Aborting ',
   'installer.step9.serviceStatus.abort.completed':' aborted successfully',
   'installer.step9.serviceStatus.abort.completed':' aborted successfully',
   'installer.step9.serviceStatus.abort.failed':' failed to abort',
   'installer.step9.serviceStatus.abort.failed':' failed to abort',
+  'installer.step9.serviceStatus.upgrade.pending':'Preparing to upgrade ',
+  'installer.step9.serviceStatus.upgrade.queued':'Waiting to upgarde ',
+  'installer.step9.serviceStatus.upgrade.inProgress':'Upgrading ',
+  'installer.step9.serviceStatus.upgrade.completed':' upgraded successfully',
+  'installer.step9.serviceStatus.upgrade.failed':' failed to upgrade',
 
 
   'installer.step10.header':'Summary',
   'installer.step10.header':'Summary',
   'installer.step10.body':'Here is the summary of the install process.',
   'installer.step10.body':'Here is the summary of the install process.',
@@ -407,6 +413,19 @@ Em.I18n.translations = {
   'installer.stackUpgrade.step2.advancedOption':'Advanced Option',
   'installer.stackUpgrade.step2.advancedOption':'Advanced Option',
   'installer.stackUpgrade.step2.localRepository':'Use a local repository',
   'installer.stackUpgrade.step2.localRepository':'Use a local repository',
   'installer.stackUpgrade.step2.popup.body':'We cannot proceed since some of the master components are not currently running. Please ensure that all services are running before continuing.',
   'installer.stackUpgrade.step2.popup.body':'We cannot proceed since some of the master components are not currently running. Please ensure that all services are running before continuing.',
+  'installer.stackUpgrade.step3.ProceedWithWarning':'Proceed with Warning',
+  'installer.stackUpgrade.step3.status.success':'Successfully upgraded the cluster to {0}',
+  'installer.stackUpgrade.step3.status.info':"Upgrading the cluster. \nPlease wait while we perform cluster upgrade.",
+  'installer.stackUpgrade.step3.status.warning':"Upgraded the cluster to {0} with some warnings.\nYou can start using the cluster but the components that failed to upgrade will not be functional."+
+  "You can click on the Retry button to retry upgrading the failed components. Alternatively you can proceed and retry upgrade on individual components in the Host Detail page.",
+  'installer.stackUpgrade.step3.status.failed':"Failed to upgrade hosts. Click on each host to see what might have gone wrong.\n After fixing the problem, click the Retry button",
+  'installer.stackUpgrade.step3.host.nothingToUpgrade':'Waiting (Nothing to upgrade)',
+  'installer.stackUpgrade.step3.service.upgraded':'{0} upgraded',
+  'installer.stackUpgrade.step3.service.upgrading':'{0} upgrade in progress',
+  'installer.stackUpgrade.step3.service.pending':'{0} upgrade pending',
+  'installer.stackUpgrade.step3.service.failedUpgrade':'{0} failed to upgrade',
+  'installer.stackUpgrade.step3.service.stopped':'All Services stopped',
+  'installer.stackUpgrade.step3.service.stopping':'All Services stopping',
 
 
   'form.create':'Create',
   'form.create':'Create',
   'form.save':'Save',
   'form.save':'Save',

+ 15 - 11
ambari-web/app/routes/stack_upgrade.js

@@ -48,7 +48,7 @@ module.exports = Em.Route.extend({
 
 
        if (currentClusterStatus) {
        if (currentClusterStatus) {
        switch (currentClusterStatus.clusterState) {
        switch (currentClusterStatus.clusterState) {
-       case 'STACK_UPGRADING' :
+       case 'UPGRADING_STACK' :
        case 'STACK_UPGRADED' :
        case 'STACK_UPGRADED' :
        stackUpgradeController.setCurrentStep('3');
        stackUpgradeController.setCurrentStep('3');
        App.db.data = currentClusterStatus.localdb;
        App.db.data = currentClusterStatus.localdb;
@@ -85,13 +85,14 @@ module.exports = Em.Route.extend({
     },
     },
     back: Em.Router.transitionTo('step1'),
     back: Em.Router.transitionTo('step1'),
     next: function(router){
     next: function(router){
-      /*router.transitionTo('step3');
-       App.clusterStatus.setClusterStatus({
-       clusterName: this.get('clusterName'),
-       clusterState: 'UPGRADING_STACK',
-       wizardControllerName: 'stackUpgradeController',
-       localdb: App.db.data
-       });*/
+      var controller = router.get('stackUpgradeController');
+      var stepController = router.get('stackUpgradeStep3Controller');
+      router.transitionTo('step3');
+      if(App.testMode){
+        stepController.simulateStopService();
+      } else {
+        controller.stopServices();
+      }
     }
     }
   }),
   }),
 
 
@@ -105,11 +106,14 @@ module.exports = Em.Route.extend({
       controller.loadAllPriorSteps();
       controller.loadAllPriorSteps();
       controller.connectOutlet('stackUpgradeStep3', controller.get('content'));
       controller.connectOutlet('stackUpgradeStep3', controller.get('content'));
     },
     },
-    retry: function(router){
-    },
-    done: function (router, context) {
+    finish: function (router, context) {
+      var controller = router.get('stackUpgradeController');
+      var stepController = router.get('stackUpgradeStep3Controller');
+      stepController.clearStep();
+      controller.finish();
       App.router.get('updateController').set('isWorking', true);
       App.router.get('updateController').set('isWorking', true);
       $(context.currentTarget).parents("#modal").find(".close").trigger('click');
       $(context.currentTarget).parents("#modal").find(".close").trigger('click');
+      //App.set('currentStackVersion', controller.get('content.upgradeVersion'));
 
 
       // We need to do recovery based on whether we are in Add Host or Installer wizard
       // We need to do recovery based on whether we are in Add Host or Installer wizard
      /* App.clusterStatus.setClusterStatus({
      /* App.clusterStatus.setClusterStatus({

+ 11 - 0
ambari-web/app/styles/application.less

@@ -411,6 +411,17 @@ h1 {
   .btn-area {
   .btn-area {
     margin-top: 30px;
     margin-top: 30px;
   }
   }
+  .service {
+    .item {
+      line-height: 30px;
+      i {
+        font-size: 20px;
+      }
+    }
+    .row {
+      margin-left: 0;
+    }
+  }
 }
 }
 
 
 #host-log {
 #host-log {

+ 75 - 0
ambari-web/app/templates/wizard/stack_upgrade/step3.hbs

@@ -0,0 +1,75 @@
+{{!
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+}}
+<div id="deploy">
+    <div {{bindAttr class="view.statusClass :alert"}}>{{view.statusMessage}}</div>
+  {{#if showRetry}}
+    <div class="box">
+        <a class="btn btn-primary"
+           href="#" {{action retry target="controller"}}><i class="icon-repeat icon-white"></i>
+          {{t common.retry}}
+        </a>
+    </div>
+  {{/if}}
+    <div class="service">
+        {{#if isServicesStopped}}
+            <div class="item">
+                <i class="text-success icon-ok"></i>
+                <a href="javascript:void(0)">{{t installer.stackUpgrade.step3.service.stopped}}</a>
+            </div>
+        {{else}}
+            <div class="item">
+                <i class="text-info icon-cog"></i>
+                <a href="true">{{t installer.stackUpgrade.step3.service.stopping}}</a>
+            </div>
+            <div class="row span12">
+                <div class="progress-bar span4">
+                    <div {{bindAttr class="isServicesStopped::progress-striped isServicesStopped::active :progress-info :progress"}}>
+                        <div class="bar" {{bindAttr style="view.servicesStopWidth"}}></div>
+                    </div>
+                </div>
+                <div class="span1">{{servicesStopProgress}}&#37;</div>
+                <div class="span7"></div>
+            </div>
+        {{/if}}
+    {{#each service in services}}
+      {{#view view.serviceView contentBinding="service"}}
+      <div class="item">
+          <i {{bindAttr class="view.icon view.iconColor"}}></i>
+          <a href="true" {{action "hostsLogPopup" service.name view.bindingProperty target="view"}}>{{service.message}}</a>
+      </div>
+      {{#if view.inProgress}}
+      <div class="row span12">
+          <div class="progress-bar span4">
+              <div {{bindAttr class="view.isServiceCompleted::progress-striped view.isServiceCompleted::active view.barColor :progress"}}>
+                  <div class="bar" {{bindAttr style="view.barWidth"}}></div>
+              </div>
+          </div>
+          <div class="span1">{{service.progress}}&#37;</div>
+          <div class="span7">{{service.detailMessage}}</div>
+      </div>
+      {{/if}}
+      {{/view}}
+    {{/each}}
+    </div>
+</div>
+    <div class="btn-area">
+      {{#if submitButton}}
+          <a class="btn btn-success pull-right" {{action finish}}>{{submitButton}}</a>
+      {{/if}}
+    </div>
+</div>

+ 1 - 0
ambari-web/app/views.js

@@ -133,4 +133,5 @@ require('views/wizard/step10_view');
 require('views/wizard/step11_view');
 require('views/wizard/step11_view');
 require('views/wizard/stack_upgrade/step1_view');
 require('views/wizard/stack_upgrade/step1_view');
 require('views/wizard/stack_upgrade/step2_view');
 require('views/wizard/stack_upgrade/step2_view');
+require('views/wizard/stack_upgrade/step3_view');
 require('views/loading');
 require('views/loading');

+ 111 - 0
ambari-web/app/views/wizard/stack_upgrade/step3_view.js

@@ -0,0 +1,111 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+var App = require('app');
+
+App.StackUpgradeStep3View = Em.View.extend({
+  templateName: require('templates/wizard/stack_upgrade/step3'),
+  didInsertElement: function(){
+    this.get('controller').navigateStep();
+    this.onStatus();
+  },
+  statusMessage: null,
+  statusClass: 'alert-info',
+  barColor: '',
+  servicesStopWidth: function(){
+    return 'width: ' + this.get('controller.servicesStopProgress') + '%;';
+  }.property('controller.servicesStopProgress'),
+  /**
+   * change message of Upgrade status depending on the Upgrade status
+   */
+  onStatus: function(){
+    switch (this.get('controller.status')){
+      case 'SUCCESS':
+        this.set('statusMessage', Em.I18n.t('installer.stackUpgrade.step3.status.success').format(this.get('controller.content.upgradeVersion')));
+        this.set('statusClass', 'alert-success');
+        break;
+      case 'FAILED':
+        this.set('statusMessage', Em.I18n.t('installer.stackUpgrade.step3.status.failed'));
+        this.set('statusClass', 'alert-error');
+        break;
+      case 'WARNING':
+        this.set('statusMessage', Em.I18n.t('installer.stackUpgrade.step3.status.warning').format(this.get('controller.content.upgradeVersion')));
+        this.set('statusClass', 'alert-block');
+        break;
+      case 'IN_PROGRESS':
+      default:
+        this.set('statusMessage', Em.I18n.t('installer.stackUpgrade.step3.status.info'));
+        this.set('statusClass', 'alert-info');
+    }
+  }.observes('controller.status'),
+
+  serviceView: Em.View.extend({
+    barColor: '',
+    icon:'',
+    iconColor:'',
+    didInsertElement: function(){
+      this.onStatus();
+    },
+    isServiceCompleted: function(){
+      return this.get('content.status') === 'SUCCESS';
+    }.property('content.status'),
+    barWidth: function(){
+      return 'width: ' + this.get('content.progress') + '%;';
+    }.property('content.progress'),
+    /**
+     * change service appearance(icon, progress-bar color,) depending on the service status
+     */
+    onStatus:function () {
+      if (this.get('content.status') === 'IN_PROGRESS') {
+        this.set('barColor', 'progress-info');
+        this.set('icon', 'icon-cog');
+        this.set('iconColor', 'text-info');
+      } else if (this.get('content.status') === 'WARNING') {
+        this.set('barColor', 'progress-warning');
+        this.set('icon', 'icon-warning-sign');
+        this.set('iconColor', 'text-warning');
+      } else if (this.get('content.status') === 'FAILED') {
+        this.set('barColor', 'progress-danger');
+        this.set('icon', 'icon-exclamation-sign');
+        this.set('iconColor', 'text-error');
+      } else if (this.get('content.status') === 'SUCCESS') {
+        this.set('barColor', 'progress-success');
+        this.set('icon', 'icon-ok');
+        this.set('iconColor', 'text-success');
+      } else {
+        this.set('barColor', 'progress-info');
+        this.set('icon', 'icon-cog');
+        this.set('iconColor', '');
+      }
+    }.observes('content.status'),
+    inProgress: function(){
+      return this.get('content.status') === "IN_PROGRESS";
+    }.property('content.status'),
+    bindingProperty: 'App.router.stackUpgradeStep3Controller.services',
+    /**
+     * open popup with list of hosts, that associated to service
+     * @param event
+     */
+    hostsLogPopup: function(event){
+      //TODO show popup with hosts
+      var serviceName = event.contexts[0];
+      var bindingProperty = event.contexts[1];
+    }
+  })
+});