فهرست منبع

AMBARI-2546. Simplify Local Repo setup in installer UI. (srimanth)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1499126 13f79535-47bb-0310-9956-ffa450edef68
Srimanth 12 سال پیش
والد
کامیت
4667ca45f2

+ 982 - 36
ambari-web/app/assets/data/wizard/stack/HDP_versions.json

@@ -1,59 +1,1005 @@
 {
-  "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions?fields=Versions",
+  "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions?fields=Versions,operatingSystems/repositories/Repositories",
   "items" : [
     {
-      "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/0.1",
-      "Versions" : {
-        "stack_version" : "0.1",
-        "active" : false,
-        "stack_name" : "HDP",
-        "min_upgrade_version" : null
-      }
-    },
-    {
-      "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/2.0.1",
+      "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.2.0",
       "Versions" : {
-        "stack_version" : "2.0.1",
         "active" : false,
+        "min_upgrade_version" : null,
         "stack_name" : "HDP",
-        "min_upgrade_version" : null
-      }
-    },
-    {
-      "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.3.0",
-      "Versions" : {
-        "stack_version" : "1.3.0",
-        "active" : true,
-        "stack_name" : "HDP",
-        "min_upgrade_version" : "1.2.0"
-      }
+        "stack_version" : "1.2.0"
+      },
+      "operatingSystems" : [
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.2.0/operatingSystems/centos5",
+          "OperatingSystems" : {
+            "os_type" : "centos5",
+            "stack_name" : "HDP",
+            "stack_version" : "1.2.0"
+          },
+          "repositories" : [
+            {
+              "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.2.0/operatingSystems/centos5/repositories/HDP-1.2.0",
+              "Repositories" : {
+                "base_url" : "http://public-repo-1.hortonworks.com/HDP-1.2.0/repos/centos5",
+                "default_base_url" : null,
+                "mirrors_list" : null,
+                "os_type" : "centos5",
+                "repo_id" : "HDP-1.2.0",
+                "repo_name" : "HDP",
+                "stack_name" : "HDP",
+                "stack_version" : "1.2.0"
+              }
+            },
+            {
+              "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.2.0/operatingSystems/centos5/repositories/HDP-epel",
+              "Repositories" : {
+                "base_url" : null,
+                "default_base_url" : null,
+                "mirrors_list" : "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=$basearch",
+                "os_type" : "centos5",
+                "repo_id" : "HDP-epel",
+                "repo_name" : "HDP-epel",
+                "stack_name" : "HDP",
+                "stack_version" : "1.2.0"
+              }
+            }
+          ]
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.2.0/operatingSystems/centos6",
+          "OperatingSystems" : {
+            "os_type" : "centos6",
+            "stack_name" : "HDP",
+            "stack_version" : "1.2.0"
+          },
+          "repositories" : [
+            {
+              "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.2.0/operatingSystems/centos6/repositories/HDP-1.2.0",
+              "Repositories" : {
+                "base_url" : "http://public-repo-1.hortonworks.com/HDP-1.2.0/repos/centos6",
+                "default_base_url" : null,
+                "mirrors_list" : null,
+                "os_type" : "centos6",
+                "repo_id" : "HDP-1.2.0",
+                "repo_name" : "HDP",
+                "stack_name" : "HDP",
+                "stack_version" : "1.2.0"
+              }
+            },
+            {
+              "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.2.0/operatingSystems/centos6/repositories/HDP-epel",
+              "Repositories" : {
+                "base_url" : null,
+                "default_base_url" : null,
+                "mirrors_list" : "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-6&arch=$basearch",
+                "os_type" : "centos6",
+                "repo_id" : "HDP-epel",
+                "repo_name" : "HDP-epel",
+                "stack_name" : "HDP",
+                "stack_version" : "1.2.0"
+              }
+            }
+          ]
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.2.0/operatingSystems/oraclelinux5",
+          "OperatingSystems" : {
+            "os_type" : "oraclelinux5",
+            "stack_name" : "HDP",
+            "stack_version" : "1.2.0"
+          },
+          "repositories" : [
+            {
+              "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.2.0/operatingSystems/oraclelinux5/repositories/HDP-1.2.0",
+              "Repositories" : {
+                "base_url" : "http://public-repo-1.hortonworks.com/HDP-1.2.0/repos/centos5",
+                "default_base_url" : null,
+                "mirrors_list" : null,
+                "os_type" : "oraclelinux5",
+                "repo_id" : "HDP-1.2.0",
+                "repo_name" : "HDP",
+                "stack_name" : "HDP",
+                "stack_version" : "1.2.0"
+              }
+            },
+            {
+              "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.2.0/operatingSystems/oraclelinux5/repositories/HDP-epel",
+              "Repositories" : {
+                "base_url" : null,
+                "default_base_url" : null,
+                "mirrors_list" : "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=$basearch",
+                "os_type" : "oraclelinux5",
+                "repo_id" : "HDP-epel",
+                "repo_name" : "HDP-epel",
+                "stack_name" : "HDP",
+                "stack_version" : "1.2.0"
+              }
+            }
+          ]
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.2.0/operatingSystems/oraclelinux6",
+          "OperatingSystems" : {
+            "os_type" : "oraclelinux6",
+            "stack_name" : "HDP",
+            "stack_version" : "1.2.0"
+          },
+          "repositories" : [
+            {
+              "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.2.0/operatingSystems/oraclelinux6/repositories/HDP-1.2.0",
+              "Repositories" : {
+                "base_url" : "http://public-repo-1.hortonworks.com/HDP-1.2.0/repos/centos6",
+                "default_base_url" : null,
+                "mirrors_list" : null,
+                "os_type" : "oraclelinux6",
+                "repo_id" : "HDP-1.2.0",
+                "repo_name" : "HDP",
+                "stack_name" : "HDP",
+                "stack_version" : "1.2.0"
+              }
+            },
+            {
+              "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.2.0/operatingSystems/oraclelinux6/repositories/HDP-epel",
+              "Repositories" : {
+                "base_url" : null,
+                "default_base_url" : null,
+                "mirrors_list" : "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-6&arch=$basearch",
+                "os_type" : "oraclelinux6",
+                "repo_id" : "HDP-epel",
+                "repo_name" : "HDP-epel",
+                "stack_name" : "HDP",
+                "stack_version" : "1.2.0"
+              }
+            }
+          ]
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.2.0/operatingSystems/redhat5",
+          "OperatingSystems" : {
+            "os_type" : "redhat5",
+            "stack_name" : "HDP",
+            "stack_version" : "1.2.0"
+          },
+          "repositories" : [
+            {
+              "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.2.0/operatingSystems/redhat5/repositories/HDP-1.2.0",
+              "Repositories" : {
+                "base_url" : "http://public-repo-1.hortonworks.com/HDP-1.2.0/repos/centos5",
+                "default_base_url" : null,
+                "mirrors_list" : null,
+                "os_type" : "redhat5",
+                "repo_id" : "HDP-1.2.0",
+                "repo_name" : "HDP",
+                "stack_name" : "HDP",
+                "stack_version" : "1.2.0"
+              }
+            },
+            {
+              "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.2.0/operatingSystems/redhat5/repositories/HDP-epel",
+              "Repositories" : {
+                "base_url" : null,
+                "default_base_url" : null,
+                "mirrors_list" : "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=$basearch",
+                "os_type" : "redhat5",
+                "repo_id" : "HDP-epel",
+                "repo_name" : "HDP-epel",
+                "stack_name" : "HDP",
+                "stack_version" : "1.2.0"
+              }
+            }
+          ]
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.2.0/operatingSystems/redhat6",
+          "OperatingSystems" : {
+            "os_type" : "redhat6",
+            "stack_name" : "HDP",
+            "stack_version" : "1.2.0"
+          },
+          "repositories" : [
+            {
+              "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.2.0/operatingSystems/redhat6/repositories/HDP-1.2.0",
+              "Repositories" : {
+                "base_url" : "http://public-repo-1.hortonworks.com/HDP-1.2.0/repos/centos6",
+                "default_base_url" : null,
+                "mirrors_list" : null,
+                "os_type" : "redhat6",
+                "repo_id" : "HDP-1.2.0",
+                "repo_name" : "HDP",
+                "stack_name" : "HDP",
+                "stack_version" : "1.2.0"
+              }
+            },
+            {
+              "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.2.0/operatingSystems/redhat6/repositories/HDP-epel",
+              "Repositories" : {
+                "base_url" : null,
+                "default_base_url" : null,
+                "mirrors_list" : "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-6&arch=$basearch",
+                "os_type" : "redhat6",
+                "repo_id" : "HDP-epel",
+                "repo_name" : "HDP-epel",
+                "stack_name" : "HDP",
+                "stack_version" : "1.2.0"
+              }
+            }
+          ]
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.2.0/operatingSystems/sles11",
+          "OperatingSystems" : {
+            "os_type" : "sles11",
+            "stack_name" : "HDP",
+            "stack_version" : "1.2.0"
+          },
+          "repositories" : [
+            {
+              "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.2.0/operatingSystems/sles11/repositories/HDP-1.2.0",
+              "Repositories" : {
+                "base_url" : "http://public-repo-1.hortonworks.com/HDP-1.2.0/repos/suse11",
+                "default_base_url" : null,
+                "mirrors_list" : null,
+                "os_type" : "sles11",
+                "repo_id" : "HDP-1.2.0",
+                "repo_name" : "HDP",
+                "stack_name" : "HDP",
+                "stack_version" : "1.2.0"
+              }
+            },
+            {
+              "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.2.0/operatingSystems/sles11/repositories/HDP-UTILS-1.1.0.15",
+              "Repositories" : {
+                "base_url" : "http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.15/repos/suse11",
+                "default_base_url" : null,
+                "mirrors_list" : null,
+                "os_type" : "sles11",
+                "repo_id" : "HDP-UTILS-1.1.0.15",
+                "repo_name" : "HDP-UTILS",
+                "stack_name" : "HDP",
+                "stack_version" : "1.2.0"
+              }
+            }
+          ]
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.2.0/operatingSystems/suse11",
+          "OperatingSystems" : {
+            "os_type" : "suse11",
+            "stack_name" : "HDP",
+            "stack_version" : "1.2.0"
+          },
+          "repositories" : [
+            {
+              "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.2.0/operatingSystems/suse11/repositories/HDP-1.2.0",
+              "Repositories" : {
+                "base_url" : "http://public-repo-1.hortonworks.com/HDP-1.2.0/repos/suse11",
+                "default_base_url" : null,
+                "mirrors_list" : null,
+                "os_type" : "suse11",
+                "repo_id" : "HDP-1.2.0",
+                "repo_name" : "HDP",
+                "stack_name" : "HDP",
+                "stack_version" : "1.2.0"
+              }
+            },
+            {
+              "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.2.0/operatingSystems/suse11/repositories/HDP-UTILS-1.1.0.15",
+              "Repositories" : {
+                "base_url" : "http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.15/repos/suse11",
+                "default_base_url" : null,
+                "mirrors_list" : null,
+                "os_type" : "suse11",
+                "repo_id" : "HDP-UTILS-1.1.0.15",
+                "repo_name" : "HDP-UTILS",
+                "stack_name" : "HDP",
+                "stack_version" : "1.2.0"
+              }
+            }
+          ]
+        }
+      ]
     },
     {
-      "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.3.1",
+      "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.2.1",
       "Versions" : {
-        "stack_version" : "1.3.1",
         "active" : true,
+        "min_upgrade_version" : null,
         "stack_name" : "HDP",
-        "min_upgrade_version" : "1.3.0"
-      }
+        "stack_version" : "1.2.1"
+      },
+      "operatingSystems" : [
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.2.1/operatingSystems/centos5",
+          "OperatingSystems" : {
+            "os_type" : "centos5",
+            "stack_name" : "HDP",
+            "stack_version" : "1.2.1"
+          },
+          "repositories" : [
+            {
+              "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.2.1/operatingSystems/centos5/repositories/HDP-1.2.1",
+              "Repositories" : {
+                "base_url" : "http://public-repo-1.hortonworks.com/HDP/centos5/1.x/updates/1.2.1",
+                "default_base_url" : null,
+                "mirrors_list" : null,
+                "os_type" : "centos5",
+                "repo_id" : "HDP-1.2.1",
+                "repo_name" : "HDP",
+                "stack_name" : "HDP",
+                "stack_version" : "1.2.1"
+              }
+            },
+            {
+              "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.2.1/operatingSystems/centos5/repositories/HDP-epel",
+              "Repositories" : {
+                "base_url" : null,
+                "default_base_url" : null,
+                "mirrors_list" : "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=$basearch",
+                "os_type" : "centos5",
+                "repo_id" : "HDP-epel",
+                "repo_name" : "HDP-epel",
+                "stack_name" : "HDP",
+                "stack_version" : "1.2.1"
+              }
+            }
+          ]
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.2.1/operatingSystems/centos6",
+          "OperatingSystems" : {
+            "os_type" : "centos6",
+            "stack_name" : "HDP",
+            "stack_version" : "1.2.1"
+          },
+          "repositories" : [
+            {
+              "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.2.1/operatingSystems/centos6/repositories/HDP-1.2.1",
+              "Repositories" : {
+                "base_url" : "http://public-repo-1.hortonworks.com/HDP/centos6/1.x/updates/1.2.1",
+                "default_base_url" : null,
+                "mirrors_list" : null,
+                "os_type" : "centos6",
+                "repo_id" : "HDP-1.2.1",
+                "repo_name" : "HDP",
+                "stack_name" : "HDP",
+                "stack_version" : "1.2.1"
+              }
+            },
+            {
+              "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.2.1/operatingSystems/centos6/repositories/HDP-epel",
+              "Repositories" : {
+                "base_url" : null,
+                "default_base_url" : null,
+                "mirrors_list" : "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-6&arch=$basearch",
+                "os_type" : "centos6",
+                "repo_id" : "HDP-epel",
+                "repo_name" : "HDP-epel",
+                "stack_name" : "HDP",
+                "stack_version" : "1.2.1"
+              }
+            }
+          ]
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.2.1/operatingSystems/oraclelinux5",
+          "OperatingSystems" : {
+            "os_type" : "oraclelinux5",
+            "stack_name" : "HDP",
+            "stack_version" : "1.2.1"
+          },
+          "repositories" : [
+            {
+              "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.2.1/operatingSystems/oraclelinux5/repositories/HDP-1.2.1",
+              "Repositories" : {
+                "base_url" : "http://public-repo-1.hortonworks.com/HDP/centos5/1.x/updates/1.2.1",
+                "default_base_url" : null,
+                "mirrors_list" : null,
+                "os_type" : "oraclelinux5",
+                "repo_id" : "HDP-1.2.1",
+                "repo_name" : "HDP",
+                "stack_name" : "HDP",
+                "stack_version" : "1.2.1"
+              }
+            },
+            {
+              "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.2.1/operatingSystems/oraclelinux5/repositories/HDP-epel",
+              "Repositories" : {
+                "base_url" : null,
+                "default_base_url" : null,
+                "mirrors_list" : "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=$basearch",
+                "os_type" : "oraclelinux5",
+                "repo_id" : "HDP-epel",
+                "repo_name" : "HDP-epel",
+                "stack_name" : "HDP",
+                "stack_version" : "1.2.1"
+              }
+            }
+          ]
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.2.1/operatingSystems/oraclelinux6",
+          "OperatingSystems" : {
+            "os_type" : "oraclelinux6",
+            "stack_name" : "HDP",
+            "stack_version" : "1.2.1"
+          },
+          "repositories" : [
+            {
+              "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.2.1/operatingSystems/oraclelinux6/repositories/HDP-1.2.1",
+              "Repositories" : {
+                "base_url" : "http://public-repo-1.hortonworks.com/HDP/centos6/1.x/updates/1.2.1",
+                "default_base_url" : null,
+                "mirrors_list" : null,
+                "os_type" : "oraclelinux6",
+                "repo_id" : "HDP-1.2.1",
+                "repo_name" : "HDP",
+                "stack_name" : "HDP",
+                "stack_version" : "1.2.1"
+              }
+            },
+            {
+              "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.2.1/operatingSystems/oraclelinux6/repositories/HDP-epel",
+              "Repositories" : {
+                "base_url" : null,
+                "default_base_url" : null,
+                "mirrors_list" : "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-6&arch=$basearch",
+                "os_type" : "oraclelinux6",
+                "repo_id" : "HDP-epel",
+                "repo_name" : "HDP-epel",
+                "stack_name" : "HDP",
+                "stack_version" : "1.2.1"
+              }
+            }
+          ]
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.2.1/operatingSystems/redhat5",
+          "OperatingSystems" : {
+            "os_type" : "redhat5",
+            "stack_name" : "HDP",
+            "stack_version" : "1.2.1"
+          },
+          "repositories" : [
+            {
+              "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.2.1/operatingSystems/redhat5/repositories/HDP-1.2.1",
+              "Repositories" : {
+                "base_url" : "http://public-repo-1.hortonworks.com/HDP/centos5/1.x/updates/1.2.1",
+                "default_base_url" : null,
+                "mirrors_list" : null,
+                "os_type" : "redhat5",
+                "repo_id" : "HDP-1.2.1",
+                "repo_name" : "HDP",
+                "stack_name" : "HDP",
+                "stack_version" : "1.2.1"
+              }
+            },
+            {
+              "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.2.1/operatingSystems/redhat5/repositories/HDP-epel",
+              "Repositories" : {
+                "base_url" : null,
+                "default_base_url" : null,
+                "mirrors_list" : "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=$basearch",
+                "os_type" : "redhat5",
+                "repo_id" : "HDP-epel",
+                "repo_name" : "HDP-epel",
+                "stack_name" : "HDP",
+                "stack_version" : "1.2.1"
+              }
+            }
+          ]
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.2.1/operatingSystems/redhat6",
+          "OperatingSystems" : {
+            "os_type" : "redhat6",
+            "stack_name" : "HDP",
+            "stack_version" : "1.2.1"
+          },
+          "repositories" : [
+            {
+              "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.2.1/operatingSystems/redhat6/repositories/HDP-1.2.1",
+              "Repositories" : {
+                "base_url" : "http://public-repo-1.hortonworks.com/HDP/centos6/1.x/updates/1.2.1",
+                "default_base_url" : null,
+                "mirrors_list" : null,
+                "os_type" : "redhat6",
+                "repo_id" : "HDP-1.2.1",
+                "repo_name" : "HDP",
+                "stack_name" : "HDP",
+                "stack_version" : "1.2.1"
+              }
+            },
+            {
+              "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.2.1/operatingSystems/redhat6/repositories/HDP-epel",
+              "Repositories" : {
+                "base_url" : null,
+                "default_base_url" : null,
+                "mirrors_list" : "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-6&arch=$basearch",
+                "os_type" : "redhat6",
+                "repo_id" : "HDP-epel",
+                "repo_name" : "HDP-epel",
+                "stack_name" : "HDP",
+                "stack_version" : "1.2.1"
+              }
+            }
+          ]
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.2.1/operatingSystems/sles11",
+          "OperatingSystems" : {
+            "os_type" : "sles11",
+            "stack_name" : "HDP",
+            "stack_version" : "1.2.1"
+          },
+          "repositories" : [
+            {
+              "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.2.1/operatingSystems/sles11/repositories/HDP-1.2.1",
+              "Repositories" : {
+                "base_url" : "http://public-repo-1.hortonworks.com/HDP/suse11/1.x/updates/1.2.1",
+                "default_base_url" : null,
+                "mirrors_list" : null,
+                "os_type" : "sles11",
+                "repo_id" : "HDP-1.2.1",
+                "repo_name" : "HDP",
+                "stack_name" : "HDP",
+                "stack_version" : "1.2.1"
+              }
+            }
+          ]
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.2.1/operatingSystems/suse11",
+          "OperatingSystems" : {
+            "os_type" : "suse11",
+            "stack_name" : "HDP",
+            "stack_version" : "1.2.1"
+          },
+          "repositories" : [
+            {
+              "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.2.1/operatingSystems/suse11/repositories/HDP-1.2.1",
+              "Repositories" : {
+                "base_url" : "http://public-repo-1.hortonworks.com/HDP/suse11/1.x/updates/1.2.1",
+                "default_base_url" : null,
+                "mirrors_list" : null,
+                "os_type" : "suse11",
+                "repo_id" : "HDP-1.2.1",
+                "repo_name" : "HDP",
+                "stack_name" : "HDP",
+                "stack_version" : "1.2.1"
+              }
+            }
+          ]
+        }
+      ]
     },
     {
-      "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.2.1",
+      "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.3.0",
       "Versions" : {
-        "stack_version" : "1.2.1",
         "active" : true,
+        "min_upgrade_version" : "1.2.0",
         "stack_name" : "HDP",
-        "min_upgrade_version" : null
-      }
+        "stack_version" : "1.3.0"
+      },
+      "operatingSystems" : [
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.3.0/operatingSystems/centos5",
+          "OperatingSystems" : {
+            "os_type" : "centos5",
+            "stack_name" : "HDP",
+            "stack_version" : "1.3.0"
+          },
+          "repositories" : [
+            {
+              "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.3.0/operatingSystems/centos5/repositories/HDP-1.3.0",
+              "Repositories" : {
+                "base_url" : "http://public-repo-1.hortonworks.com/HDP/centos5/1.x/GA/1.3.0.0",
+                "default_base_url" : null,
+                "mirrors_list" : null,
+                "os_type" : "centos5",
+                "repo_id" : "HDP-1.3.0",
+                "repo_name" : "HDP",
+                "stack_name" : "HDP",
+                "stack_version" : "1.3.0"
+              }
+            },
+            {
+              "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.3.0/operatingSystems/centos5/repositories/HDP-epel",
+              "Repositories" : {
+                "base_url" : null,
+                "default_base_url" : null,
+                "mirrors_list" : "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=$basearch",
+                "os_type" : "centos5",
+                "repo_id" : "HDP-epel",
+                "repo_name" : "HDP-epel",
+                "stack_name" : "HDP",
+                "stack_version" : "1.3.0"
+              }
+            }
+          ]
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.3.0/operatingSystems/centos6",
+          "OperatingSystems" : {
+            "os_type" : "centos6",
+            "stack_name" : "HDP",
+            "stack_version" : "1.3.0"
+          },
+          "repositories" : [
+            {
+              "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.3.0/operatingSystems/centos6/repositories/HDP-1.3.0",
+              "Repositories" : {
+                "base_url" : "http://public-repo-1.hortonworks.com/HDP/centos6/1.x/GA/1.3.0.0",
+                "default_base_url" : null,
+                "mirrors_list" : null,
+                "os_type" : "centos6",
+                "repo_id" : "HDP-1.3.0",
+                "repo_name" : "HDP",
+                "stack_name" : "HDP",
+                "stack_version" : "1.3.0"
+              }
+            },
+            {
+              "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.3.0/operatingSystems/centos6/repositories/HDP-epel",
+              "Repositories" : {
+                "base_url" : null,
+                "default_base_url" : null,
+                "mirrors_list" : "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-6&arch=$basearch",
+                "os_type" : "centos6",
+                "repo_id" : "HDP-epel",
+                "repo_name" : "HDP-epel",
+                "stack_name" : "HDP",
+                "stack_version" : "1.3.0"
+              }
+            }
+          ]
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.3.0/operatingSystems/oraclelinux5",
+          "OperatingSystems" : {
+            "os_type" : "oraclelinux5",
+            "stack_name" : "HDP",
+            "stack_version" : "1.3.0"
+          },
+          "repositories" : [
+            {
+              "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.3.0/operatingSystems/oraclelinux5/repositories/HDP-1.3.0",
+              "Repositories" : {
+                "base_url" : "http://cnn.com",
+                "default_base_url" : "http://public-repo-1.hortonworks.com/HDP/centos5/1.x/GA/1.3.0.0",
+                "mirrors_list" : null,
+                "os_type" : "oraclelinux5",
+                "repo_id" : "HDP-1.3.0",
+                "repo_name" : "HDP",
+                "stack_name" : "HDP",
+                "stack_version" : "1.3.0"
+              }
+            },
+            {
+              "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.3.0/operatingSystems/oraclelinux5/repositories/HDP-epel",
+              "Repositories" : {
+                "base_url" : null,
+                "default_base_url" : null,
+                "mirrors_list" : "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=$basearch",
+                "os_type" : "oraclelinux5",
+                "repo_id" : "HDP-epel",
+                "repo_name" : "HDP-epel",
+                "stack_name" : "HDP",
+                "stack_version" : "1.3.0"
+              }
+            }
+          ]
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.3.0/operatingSystems/oraclelinux6",
+          "OperatingSystems" : {
+            "os_type" : "oraclelinux6",
+            "stack_name" : "HDP",
+            "stack_version" : "1.3.0"
+          },
+          "repositories" : [
+            {
+              "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.3.0/operatingSystems/oraclelinux6/repositories/HDP-1.3.0",
+              "Repositories" : {
+                "base_url" : "http://www.twitter.com",
+                "default_base_url" : "http://public-repo-1.hortonworks.com/HDP/centos6/1.x/GA/1.3.0.0",
+                "mirrors_list" : null,
+                "os_type" : "oraclelinux6",
+                "repo_id" : "HDP-1.3.0",
+                "repo_name" : "HDP",
+                "stack_name" : "HDP",
+                "stack_version" : "1.3.0"
+              }
+            },
+            {
+              "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.3.0/operatingSystems/oraclelinux6/repositories/HDP-epel",
+              "Repositories" : {
+                "base_url" : null,
+                "default_base_url" : null,
+                "mirrors_list" : "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-6&arch=$basearch",
+                "os_type" : "oraclelinux6",
+                "repo_id" : "HDP-epel",
+                "repo_name" : "HDP-epel",
+                "stack_name" : "HDP",
+                "stack_version" : "1.3.0"
+              }
+            }
+          ]
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.3.0/operatingSystems/redhat5",
+          "OperatingSystems" : {
+            "os_type" : "redhat5",
+            "stack_name" : "HDP",
+            "stack_version" : "1.3.0"
+          },
+          "repositories" : [
+            {
+              "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.3.0/operatingSystems/redhat5/repositories/HDP-1.3.0",
+              "Repositories" : {
+                "base_url" : "http://public-repo-1.hortonworks.com/HDP/centos5/1.x/GA/1.3.0.0",
+                "default_base_url" : null,
+                "mirrors_list" : null,
+                "os_type" : "redhat5",
+                "repo_id" : "HDP-1.3.0",
+                "repo_name" : "HDP",
+                "stack_name" : "HDP",
+                "stack_version" : "1.3.0"
+              }
+            },
+            {
+              "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.3.0/operatingSystems/redhat5/repositories/HDP-epel",
+              "Repositories" : {
+                "base_url" : null,
+                "default_base_url" : null,
+                "mirrors_list" : "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=$basearch",
+                "os_type" : "redhat5",
+                "repo_id" : "HDP-epel",
+                "repo_name" : "HDP-epel",
+                "stack_name" : "HDP",
+                "stack_version" : "1.3.0"
+              }
+            }
+          ]
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.3.0/operatingSystems/redhat6",
+          "OperatingSystems" : {
+            "os_type" : "redhat6",
+            "stack_name" : "HDP",
+            "stack_version" : "1.3.0"
+          },
+          "repositories" : [
+            {
+              "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.3.0/operatingSystems/redhat6/repositories/HDP-1.3.0",
+              "Repositories" : {
+                "base_url" : "http://public-repo-1.hortonworks.com/HDP/centos6/1.x/GA/1.3.0.0",
+                "default_base_url" : null,
+                "mirrors_list" : null,
+                "os_type" : "redhat6",
+                "repo_id" : "HDP-1.3.0",
+                "repo_name" : "HDP",
+                "stack_name" : "HDP",
+                "stack_version" : "1.3.0"
+              }
+            },
+            {
+              "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.3.0/operatingSystems/redhat6/repositories/HDP-epel",
+              "Repositories" : {
+                "base_url" : null,
+                "default_base_url" : null,
+                "mirrors_list" : "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-6&arch=$basearch",
+                "os_type" : "redhat6",
+                "repo_id" : "HDP-epel",
+                "repo_name" : "HDP-epel",
+                "stack_name" : "HDP",
+                "stack_version" : "1.3.0"
+              }
+            }
+          ]
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.3.0/operatingSystems/sles11",
+          "OperatingSystems" : {
+            "os_type" : "sles11",
+            "stack_name" : "HDP",
+            "stack_version" : "1.3.0"
+          },
+          "repositories" : [
+            {
+              "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.3.0/operatingSystems/sles11/repositories/HDP-1.3.0",
+              "Repositories" : {
+                "base_url" : "http://public-repo-1.hortonworks.com/HDP/suse11/1.x/GA/1.3.0.0",
+                "default_base_url" : null,
+                "mirrors_list" : null,
+                "os_type" : "sles11",
+                "repo_id" : "HDP-1.3.0",
+                "repo_name" : "HDP",
+                "stack_name" : "HDP",
+                "stack_version" : "1.3.0"
+              }
+            }
+          ]
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.3.0/operatingSystems/suse11",
+          "OperatingSystems" : {
+            "os_type" : "suse11",
+            "stack_name" : "HDP",
+            "stack_version" : "1.3.0"
+          },
+          "repositories" : [
+            {
+              "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.3.0/operatingSystems/suse11/repositories/HDP-1.3.0",
+              "Repositories" : {
+                "base_url" : "http://public-repo-1.hortonworks.com/HDP/suse11/1.x/GA/1.3.0.0",
+                "default_base_url" : null,
+                "mirrors_list" : null,
+                "os_type" : "suse11",
+                "repo_id" : "HDP-1.3.0",
+                "repo_name" : "HDP",
+                "stack_name" : "HDP",
+                "stack_version" : "1.3.0"
+              }
+            }
+          ]
+        }
+      ]
     },
     {
-      "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.2.0",
+      "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/2.0.1",
       "Versions" : {
-        "stack_version" : "1.2.0",
         "active" : false,
+        "min_upgrade_version" : null,
         "stack_name" : "HDP",
-        "min_upgrade_version" : null
-      }
+        "stack_version" : "2.0.1"
+      },
+      "operatingSystems" : [
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/2.0.1/operatingSystems/centos5",
+          "OperatingSystems" : {
+            "os_type" : "centos5",
+            "stack_name" : "HDP",
+            "stack_version" : "2.0.1"
+          },
+          "repositories" : [
+            {
+              "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/2.0.1/operatingSystems/centos5/repositories/HDP-2.0.1",
+              "Repositories" : {
+                "base_url" : "http://public-repo-1.hortonworks.com/HDP-2.0.0.2/repos/centos5",
+                "default_base_url" : null,
+                "mirrors_list" : null,
+                "os_type" : "centos5",
+                "repo_id" : "HDP-2.0.1",
+                "repo_name" : "HDP",
+                "stack_name" : "HDP",
+                "stack_version" : "2.0.1"
+              }
+            },
+            {
+              "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/2.0.1/operatingSystems/centos5/repositories/HDP-epel",
+              "Repositories" : {
+                "base_url" : null,
+                "default_base_url" : null,
+                "mirrors_list" : "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=$basearch",
+                "os_type" : "centos5",
+                "repo_id" : "HDP-epel",
+                "repo_name" : "HDP-epel",
+                "stack_name" : "HDP",
+                "stack_version" : "2.0.1"
+              }
+            }
+          ]
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/2.0.1/operatingSystems/centos6",
+          "OperatingSystems" : {
+            "os_type" : "centos6",
+            "stack_name" : "HDP",
+            "stack_version" : "2.0.1"
+          },
+          "repositories" : [
+            {
+              "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/2.0.1/operatingSystems/centos6/repositories/HDP-2.0.1",
+              "Repositories" : {
+                "base_url" : "http://public-repo-1.hortonworks.com/HDP-2.0.0.2/repos/centos6",
+                "default_base_url" : null,
+                "mirrors_list" : null,
+                "os_type" : "centos6",
+                "repo_id" : "HDP-2.0.1",
+                "repo_name" : "HDP",
+                "stack_name" : "HDP",
+                "stack_version" : "2.0.1"
+              }
+            },
+            {
+              "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/2.0.1/operatingSystems/centos6/repositories/HDP-epel",
+              "Repositories" : {
+                "base_url" : null,
+                "default_base_url" : null,
+                "mirrors_list" : "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-6&arch=$basearch",
+                "os_type" : "centos6",
+                "repo_id" : "HDP-epel",
+                "repo_name" : "HDP-epel",
+                "stack_name" : "HDP",
+                "stack_version" : "2.0.1"
+              }
+            }
+          ]
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/2.0.1/operatingSystems/redhat5",
+          "OperatingSystems" : {
+            "os_type" : "redhat5",
+            "stack_name" : "HDP",
+            "stack_version" : "2.0.1"
+          },
+          "repositories" : [
+            {
+              "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/2.0.1/operatingSystems/redhat5/repositories/HDP-2.0.1",
+              "Repositories" : {
+                "base_url" : "http://public-repo-1.hortonworks.com/HDP-2.0.0.2/repos/centos5",
+                "default_base_url" : null,
+                "mirrors_list" : null,
+                "os_type" : "redhat5",
+                "repo_id" : "HDP-2.0.1",
+                "repo_name" : "HDP",
+                "stack_name" : "HDP",
+                "stack_version" : "2.0.1"
+              }
+            },
+            {
+              "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/2.0.1/operatingSystems/redhat5/repositories/HDP-epel",
+              "Repositories" : {
+                "base_url" : null,
+                "default_base_url" : null,
+                "mirrors_list" : "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=$basearch",
+                "os_type" : "redhat5",
+                "repo_id" : "HDP-epel",
+                "repo_name" : "HDP-epel",
+                "stack_name" : "HDP",
+                "stack_version" : "2.0.1"
+              }
+            }
+          ]
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/2.0.1/operatingSystems/redhat6",
+          "OperatingSystems" : {
+            "os_type" : "redhat6",
+            "stack_name" : "HDP",
+            "stack_version" : "2.0.1"
+          },
+          "repositories" : [
+            {
+              "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/2.0.1/operatingSystems/redhat6/repositories/HDP-2.0.1",
+              "Repositories" : {
+                "base_url" : "http://public-repo-1.hortonworks.com/HDP-2.0.0.2/repos/centos6",
+                "default_base_url" : null,
+                "mirrors_list" : null,
+                "os_type" : "redhat6",
+                "repo_id" : "HDP-2.0.1",
+                "repo_name" : "HDP",
+                "stack_name" : "HDP",
+                "stack_version" : "2.0.1"
+              }
+            },
+            {
+              "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/2.0.1/operatingSystems/redhat6/repositories/HDP-epel",
+              "Repositories" : {
+                "base_url" : null,
+                "default_base_url" : null,
+                "mirrors_list" : "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-6&arch=$basearch",
+                "os_type" : "redhat6",
+                "repo_id" : "HDP-epel",
+                "repo_name" : "HDP-epel",
+                "stack_name" : "HDP",
+                "stack_version" : "2.0.1"
+              }
+            }
+          ]
+        }
+      ]
     }
   ]
-}
+}

+ 2 - 1
ambari-web/app/config.js

@@ -54,7 +54,8 @@ App.supports = {
   addMasters: false,
   customizeSmokeTestUser: true,
   hue: false,
-  ldapGroupMapping: false
+  ldapGroupMapping: false,
+  localRepositories: false
 };
 
 if (App.enableExperimental) {

+ 44 - 6
ambari-web/app/controllers/installer.js

@@ -171,12 +171,50 @@ App.InstallerController = App.WizardController.extend({
       return 0;
     });
     stackVersions.forEach(function (version) {
-          result.push(
-              Ember.Object.create({
-                name: version.Versions.stack_name + "-" + version.Versions.stack_version,
-                isSelected: false
-              })
-          );
+      /*
+       * operatingSystems:[
+       *  {
+       *    osType: 'centos5',
+       *    baseUrl: 'http://...',
+       *    originalBaseUrl: 'http://...',
+       *    defaultBaseUrl: 'http://...',
+       *    mirrorsList: '';
+       *  },
+       *  {
+       *    osType: 'centos6',
+       *    baseUrl: 'http://...',
+       *    originalBaseUrl: 'http://...',
+       *    defaultBaseUrl: 'http://...',
+       *    mirrorsList: '';
+       *  },
+       * ]
+       */
+      var oses = [];
+      if (version.operatingSystems) {
+        version.operatingSystems.forEach(function (os) {
+          if (os.repositories) {
+            os.repositories.forEach(function (repo) {
+              if(repo.Repositories.repo_name == version.Versions.stack_name){
+                oses.push({
+                  osType: os.OperatingSystems.os_type,
+                  baseUrl: repo.Repositories.base_url,
+                  originalBaseUrl: repo.Repositories.base_url,
+                  defaultBaseUrl: repo.Repositories.default_base_url ? 
+                      repo.Repositories.default_base_url : repo.Repositories.base_url,
+                  mirrorsList: repo.Repositories.mirrors_list
+                });
+              }
+            });
+          }
+        });
+      }
+      result.push(
+          Ember.Object.create({
+            name: version.Versions.stack_name + "-" + version.Versions.stack_version,
+            isSelected: false,
+            operatingSystems: oses
+          })
+      );
     }, this);
     this.get('stacks').pushObjects(result);
   },

+ 35 - 0
ambari-web/app/controllers/wizard/step8_controller.js

@@ -922,6 +922,7 @@ App.WizardStep8Controller = Em.Controller.extend({
       var clusterNames = this.getExistingClusterNames();
       this.deleteClusters(clusterNames);
     }
+    this.setLocalRepositories();
     this.createCluster();
     this.createSelectedServices();
     this.createConfigurations();
@@ -1023,6 +1024,40 @@ App.WizardStep8Controller = Em.Controller.extend({
   deleteClustersErrorCallback: function(request, ajaxOptions, error, opt) {
     console.log('DELETE cluster failed');
   },
+  
+
+  /**
+   * Updates local repositories for the Ambari server.
+   */
+  setLocalRepositories: function () {
+    if (this.get('content.controllerName') !== 'installerController' || !App.supports.localRepositories) {
+      return false;
+    }
+    var self = this;
+    var apiUrl = App.get('stack2VersionURL');
+    var stacks = this.get('content.stacks');
+    stacks.forEach(function (stack) {
+      stack.operatingSystems.forEach(function (os) {
+        if (os.baseUrl !== os.originalBaseUrl) {
+          console.log("Updating local repository URL from " + os.originalBaseUrl + " -> " + os.baseUrl + ". ", os);
+          var url = App.apiPrefix + apiUrl + "/operatingSystems/" + os.osType + "/repositories/" + stack.name;
+          self.ajax({
+            type: 'PUT',
+            url: url,
+            data: JSON.stringify({
+              "Repositories": {
+                "base_url": os.baseUrl
+              }
+            }),
+            beforeSend: function () {
+              console.log("BeforeSend: setLocalRepositories PUT to ", url);
+            }
+          });
+        }
+      });
+    });
+  },
+
 
   /**
    *  The following create* functions are called upon submitting Step 8.

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

@@ -244,6 +244,14 @@ Em.I18n.translations = {
 
   'installer.step1.header':'Select Stack',
   'installer.step1.body':'Please select the service stack that you want to use to install your Hadoop cluster.',
+  'installer.step1.advancedRepo.title':'Advaned Repository Options',
+  'installer.step1.advancedRepo.message':'Specify the repository where software packages will be downloaded from. If your hosts do not have access to the internet, you will have to create a local mirror of the repository accessible by all hosts and specify the Base URL here.',
+  'installer.step1.advancedRepo.localRepo.error.modifyUrl':'Local repository URL must be modified',
+  'installer.step1.advancedRepo.localRepo.error.noUrl':'Base URL required for a local repository',
+  'installer.step1.advancedRepo.localRepo.column.baseUrl':'Base URL',
+  'installer.step1.advancedRepo.localRepo.label.os':'Operating System',
+  'installer.step1.advancedRepo.localRepo.label.baseUrl':'Repository Base URL',
+  'installer.step1.advancedRepo.localRepo.label.stack':'Stack',
 
   'installer.step2.header':'Install Options',
   'installer.step2.body':'Enter the list of hosts to be included in the cluster and provide your SSH key.',

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

@@ -4356,3 +4356,25 @@ i.icon-asterisks {
     cursor: default;
   }
 }
+
+#advancedRepoAccordion{
+  #collapseOne{
+    .pull-right{
+      margin-bottom: 5px;
+    }
+    th.os{
+      width: 15%;
+    }
+    th.actions{
+      width: 15%;
+    }
+    .action{
+      cursor: pointer;
+      .icon-minus-sign{
+        color: #FF4B4B;
+        margin-right: 2px;
+      }
+    }
+    
+  }
+}

+ 43 - 0
ambari-web/app/templates/wizard/step1.hbs

@@ -25,5 +25,48 @@
     <label class="radio">{{view view.stackRadioButton contentBinding="stack"}} {{stack.name}}</label>
   {{/each}}
 </form>
+
+{{#if App.supports.localRepositories}}
+<div class="accordion" id="advancedRepoAccordion">
+  <div class="accordion-group">
+    <div class="accordion-heading">
+      <a class="accordion-toggle" data-toggle="collapse" data-parent="#advancedRepoAccordion" href="#collapseOne">
+        {{t installer.step1.advancedRepo.title}}
+      </a>
+    </div>
+    <div id="collapseOne" class="accordion-body collapse">
+      <div class="accordion-inner">
+        <div class="alert alert-info">
+          {{t installer.step1.advancedRepo.message}}
+        </div>
+        <table class="table table-striped">
+          <thead>
+            <tr>
+              <th class="os">{{t common.os}}</th>
+              <th class="baseUrl">{{t installer.step1.advancedRepo.localRepo.column.baseUrl}}</th>
+              <th class="actions"></th>
+            </tr>
+          </thead>
+          <tbody>
+          {{#each localRepo in view.localRepositories}}
+            <tr>
+              <td>{{localRepo.osType}}</td>
+              <td>{{localRepo.baseUrl}}</td>
+              <td>
+                <a class="action" {{action "removeLocalRepository" localRepo target="view" }} >
+                  <i class="icon-minus-sign"></i>{{t common.remove}}
+                </a>
+              </td>
+            </tr>
+          {{/each}}
+          </tbody>
+        </table>
+        <a {{bindAttr class=":btn :pull-right view.isAddOSDisabled:disabled"}} {{action addLocalRepository target="view"}}><i class="icon-plus"></i> Add OS</a>
+      </div>
+    </div>
+  </div>
+</div>
+{{/if}}
+
 <a class="btn pull-left" {{action back}}>&larr; {{t common.back}}</a>
 <a class="btn btn-success pull-right" {{action next}}>{{t common.next}} &rarr;</a>

+ 61 - 0
ambari-web/app/templates/wizard/step1_addLocalRepository.hbs

@@ -0,0 +1,61 @@
+{{!
+* 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.
+}}
+  <form class="form-horizontal" id="addLocalRepositoryPopup">
+    <div class="each-row">
+      <label class="control-label">{{t installer.step1.advancedRepo.localRepo.label.os}}</label>
+      <div class="controls">
+        <div class="btn-group">
+				  <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
+				    {{view.selectedOS.osType}}
+				    <span class="caret"></span>
+				  </a>
+				  <ul class="dropdown-menu">
+  				  {{#each os in view.oses}}
+					    <li>
+  					    <a href="#" {{action selectOS os target="view"}}>
+                  {{os.osType}}
+                </a>
+              </li>
+				    {{/each}}
+				  </ul>
+				</div>
+      </div>
+    </div>
+    <div class="each-row">
+      <label class="control-label">{{t installer.step1.advancedRepo.localRepo.label.baseUrl}}</label>
+      <div class="controls">
+        {{view Em.TextField valueBinding="view.enteredUrl" classNames="span6"}}
+      </div>
+    </div>
+    <div class="each-row">
+      <label class="control-label">{{t installer.step1.advancedRepo.localRepo.label.stack}}</label>
+      <div class="controls">
+        {{view.stackName}}
+      </div>
+    </div>
+    <div style="height:100px;"></div>
+    {{#if view.errorMessage}}
+	    <div class="alert">
+			  <strong>{{t common.warning}}</strong>  {{view.errorMessage}}
+			</div>
+	  {{else}}
+	    <div class="alert alert-info">
+        Provide location of the local repository for the selected OS
+      </div>
+		{{/if}}
+  </form>

+ 3 - 0
ambari-web/app/templates/wizard/step2.hbs

@@ -100,6 +100,7 @@
   <div class="advancedOptions">
     <h5>{{t installer.step2.advancedOptions.header}}</h5>
 
+    {{#unless App.supports.localRepositories}}
     <label {{bindAttr class=":checkbox"}}>
       {{view Ember.Checkbox checkedBinding="content.installOptions.localRepo"}}
 
@@ -111,6 +112,8 @@
         {{t installer.step2.localRepo.tooltip.title}}</a>
       {{t installer.step2.localRepo.label_instead}}
     </label>
+    {{/unless}}
+    
     {{#if isInstaller}}
     <label {{bindAttr class=":checkbox"}}>
       <div class="java-home">

+ 1 - 1
ambari-web/app/utils/ajax.js

@@ -711,7 +711,7 @@ var urls = {
     }
   },
   'wizard.stacks_versions': {
-    'real': '/stacks2/{stackName}/versions?fields=Versions',
+    'real': '/stacks2/{stackName}/versions?fields=Versions,operatingSystems/repositories/Repositories',
     'mock': '/data/wizard/stack/{stackName}_versions.json',
     'format': function (data) {
       return {

+ 103 - 19
ambari-web/app/views/wizard/step1_view.js

@@ -1,30 +1,28 @@
 /**
- * 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
- *
+ * 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.
+ * 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.WizardStep1View = Em.View.extend({
   templateName: require('templates/wizard/step1'),
 
-  stacks: function() {
+  stacks: function () {
     var stacks = [];
-    this.get('controller.content.stacks').forEach(function(stack){
+    this.get('controller.content.stacks').forEach(function (stack) {
       stacks.pushObject(Em.Object.create({
         name: stack.get('name').replace('-', ' '),
         isSelected: stack.get('isSelected')
@@ -33,9 +31,30 @@ App.WizardStep1View = Em.View.extend({
     return stacks;
   }.property('controller.content.stacks.@each.isSelected'),
 
+  isAddOSDisabled: true,
+  localRepositories: [],
+  defaultRepositories: [],
+  refreshRepositoryInfo: function () {
+    var selectedStack = this.get('controller.content.stacks').findProperty('isSelected', true);
+    var localRepos = [];
+    var defaultRepos = [];
+    if (selectedStack && selectedStack.operatingSystems) {
+      selectedStack.operatingSystems.forEach(function (os) {
+        if (os.baseUrl !== os.defaultBaseUrl) {
+          localRepos.push($.extend({}, os));
+        } else {
+          defaultRepos.push($.extend({}, os));
+        }
+      });
+    }
+    this.set('localRepositories', localRepos);
+    this.set('defaultRepositories', defaultRepos);
+    this.set('isAddOSDisabled', defaultRepos.get('length') < 1);
+  }.observes('controller.content.stacks.@each.isSelected', 'controller.content.stacks.@each.operatingSystems.@each.baseUrl'),
+
   stackRadioButton: Ember.Checkbox.extend({
     tagName: 'input',
-    attributeBindings: ['type', 'checked'],
+    attributeBindings: [ 'type', 'checked' ],
     checked: function () {
       return this.get('content.isSelected');
     }.property('content.isSelected'),
@@ -45,5 +64,70 @@ App.WizardStep1View = Em.View.extend({
       this.get('controller.content.stacks').setEach('isSelected', false);
       this.get('controller.content.stacks').findProperty('name', this.get('content.name').replace(' ', '-')).set('isSelected', true);
     }
-  })
+  }),
+
+  removeLocalRepository: function (event) {
+    var localRepo = event.context;
+
+    var selectedStack = this.get('controller.content.stacks').findProperty('isSelected', true);
+    var cos = selectedStack.operatingSystems.findProperty('osType', localRepo.osType);
+    cos.baseUrl = cos.defaultBaseUrl;
+
+    this.refreshRepositoryInfo();
+  },
+
+  addLocalRepository: function () {
+    var self = this;
+    var defaultRepos = self.get('defaultRepositories');
+    var selectedStack = this.get('controller.content.stacks').findProperty('isSelected', true);
+
+    App.ModalPopup.show({
+      // classNames: ['big-modal'],
+      classNames: [ 'sixty-percent-width-modal' ],
+      header: "Add Local Repository",
+      primary: 'Add',
+      secondary: 'Cancel',
+      onPrimary: function () {
+        var error = null;
+        var childViews = this.get('childViews');
+        if (childViews && childViews.get('length') > 0) {
+          var childView = childViews.objectAt(0);
+          if (childView) {
+            if (childView.get('enteredUrl')) {
+              if (childView.get('selectedOS').baseUrl !== childView.get('enteredUrl') && childView.get('selectedOS').defaultBaseUrl !== childView.get('enteredUrl')) {
+                var selectedStack = self.get('controller.content.stacks').findProperty('isSelected', true);
+                var cos = selectedStack.operatingSystems.findProperty('osType', childView.get('selectedOS').osType);
+                cos.baseUrl = childView.get('enteredUrl');
+                self.refreshRepositoryInfo();
+                this.hide();
+              } else {
+                error = Em.I18n.t('installer.step1.advancedRepo.localRepo.error.modifyUrl');
+              }
+            } else {
+              error = Em.I18n.t('installer.step1.advancedRepo.localRepo.error.noUrl')
+            }
+            if (!childView.get('isDestroyed') && !childView.get('isDestroying') && childView.get('isVisible'))
+              childView.set('errorMessage', error);
+          }
+        }
+      },
+      onSecondary: function () {
+        this.hide();
+      },
+      bodyClass: Ember.View.extend({
+        templateName: require('templates/wizard/step1_addLocalRepository'),
+        controller: self.get('controller'),
+        stackName: selectedStack.get('name'),
+        selectedOS: defaultRepos.objectAt(0),
+        enteredUrl: defaultRepos.objectAt(0).baseUrl,
+        oses: defaultRepos,
+        errorMessage: null,
+        selectOS: function (event) {
+          var os = event.context;
+          this.set('selectedOS', os);
+          this.set('enteredUrl', os.baseUrl);
+        }
+      })
+    });
+  }
 });