You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by jl...@apache.org on 2015/09/01 01:40:27 UTC
ambari git commit: AMBARI-12950: [PluggableStackDefinition] FE: Copy
pluggable stack resources (jluniya)
Repository: ambari
Updated Branches:
refs/heads/trunk ba04e8df9 -> 55b13a9dd
AMBARI-12950: [PluggableStackDefinition] FE: Copy pluggable stack resources (jluniya)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/55b13a9d
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/55b13a9d
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/55b13a9d
Branch: refs/heads/trunk
Commit: 55b13a9dd1179f135c5a7cf3b609ce646bbff0f3
Parents: ba04e8d
Author: Jayush Luniya <jl...@hortonworks.com>
Authored: Mon Aug 31 16:40:17 2015 -0700
Committer: Jayush Luniya <jl...@hortonworks.com>
Committed: Mon Aug 31 16:40:17 2015 -0700
----------------------------------------------------------------------
ambari-admin/copy-pluggable-stack-resources.sh | 38 ++++++
ambari-admin/pom.xml | 30 +++++
.../GenerateStackDefinition.py | 25 ----
.../pluggable_stack_definition/configs/ODP.json | 131 +++++++++++++++++++
.../resources/ODP/custom_stack_map.js | 46 +++++++
.../resources/PHD/custom_stack_map.js | 52 ++++++++
.../resources/SAPHD/custom_stack_map.js | 46 +++++++
ambari-server/pom.xml | 18 ---
ambari-web/copy-pluggable-stack-resources.sh | 48 +++++++
ambari-web/pom.xml | 30 +++++
10 files changed, 421 insertions(+), 43 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/55b13a9d/ambari-admin/copy-pluggable-stack-resources.sh
----------------------------------------------------------------------
diff --git a/ambari-admin/copy-pluggable-stack-resources.sh b/ambari-admin/copy-pluggable-stack-resources.sh
new file mode 100644
index 0000000..970cd7e
--- /dev/null
+++ b/ambari-admin/copy-pluggable-stack-resources.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+#
+# 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.
+#
+
+if [[ $# -eq 0 ]] ; then
+ echo 'Usage: copy-pluggable-stack-resources.sh <stack.distribution>'
+ exit 1
+fi
+
+resources_dir="../ambari-common/src/main/python/pluggable_stack_definition/resources/$1"
+if [ ! -d $resources_dir ];
+then
+ echo "No resources to copy for [ $1 ]"
+ exit 0
+fi
+
+echo "Copying pluggable stack resources for [ $1 ]"
+if [ -f "$resources_dir/custom-admin-ui.css" ]
+then
+ echo cp $resources_dir/custom-admin-ui.css src/main/resources/ui/admin-web/app/styles/custom-admin-ui.css
+ cp $resources_dir/custom-admin-ui.css src/main/resources/ui/admin-web/app/styles/custom-admin-ui.css
+fi
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/55b13a9d/ambari-admin/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-admin/pom.xml b/ambari-admin/pom.xml
index 9e26f34..ce387e8 100644
--- a/ambari-admin/pom.xml
+++ b/ambari-admin/pom.xml
@@ -262,5 +262,35 @@
<args.shell></args.shell>
</properties>
</profile>
+ <profile>
+ <id>pluggable-stack-definition</id>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <version>1.2.1</version>
+ <executions>
+ <execution>
+ <id>copy-pluggable-stack-resources</id>
+ <phase>initialize</phase>
+ <goals>
+ <goal>exec</goal>
+ </goals>
+ <configuration>
+ <!-- Copy stack specific UI resources -->
+ <executable>${executable.shell}</executable>
+ <workingDirectory>${basedir}</workingDirectory>
+ <commandlineArgs>${args.shell} ${basedir}${dirsep}copy-pluggable-stack-resources.${fileextension.shell} ${stack.distribution}</commandlineArgs>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
</profiles>
</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/55b13a9d/ambari-common/src/main/python/pluggable_stack_definition/GenerateStackDefinition.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/pluggable_stack_definition/GenerateStackDefinition.py b/ambari-common/src/main/python/pluggable_stack_definition/GenerateStackDefinition.py
index 275501d..79cf362 100644
--- a/ambari-common/src/main/python/pluggable_stack_definition/GenerateStackDefinition.py
+++ b/ambari-common/src/main/python/pluggable_stack_definition/GenerateStackDefinition.py
@@ -30,12 +30,6 @@ from os.path import join
import random
import string
-UI_MAPPING_TEMPLATE = """var App = require('app');
-module.exports = {0};
-"""
-UI_MAPPING_MAP = {"2.2":"HDP2.2",
- "2.3":"HDP2.3"}
-
def generate_random_string(size=7, chars=string.ascii_uppercase + string.digits):
return ''.join(random.choice(chars) for _ in range(size))
@@ -597,24 +591,6 @@ class GeneratorHelper(object):
else:
out_file.write(line)
- def generate_ui_mapping(self):
- stack_name = self.config_data.stackName
- records = []
- for _from, _to in self.stack_version_changes.iteritems():
- base_stack_folder = UI_MAPPING_MAP[_from] if _from in UI_MAPPING_MAP else "HDP2"
- record = {"stackName": stack_name,
- "stackVersionNumber": _to,
- "sign": "=",
- "baseStackFolder": base_stack_folder}
- records.append(record)
- if "uiMapping" in self.config_data:
- for mapping in self.config_data.uiMapping:
- mapping["stackName"] = stack_name
- records.append(mapping)
- js_file_content = UI_MAPPING_TEMPLATE.format(json.dumps(records, indent=2))
- open(os.path.join(self.output_folder, "custom_stack_map.js"),"w").write(js_file_content)
- pass
-
def copy_custom_actions(self):
original_folder = os.path.join(self.resources_folder, 'custom_actions')
target_folder = os.path.join(self.output_folder, 'custom_actions')
@@ -659,7 +635,6 @@ def main(argv):
gen_helper.copy_resource_management()
gen_helper.copy_common_services()
gen_helper.copy_ambari_properties()
- gen_helper.generate_ui_mapping()
gen_helper.copy_custom_actions()
http://git-wip-us.apache.org/repos/asf/ambari/blob/55b13a9d/ambari-common/src/main/python/pluggable_stack_definition/configs/ODP.json
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/pluggable_stack_definition/configs/ODP.json b/ambari-common/src/main/python/pluggable_stack_definition/configs/ODP.json
new file mode 100644
index 0000000..f55b642
--- /dev/null
+++ b/ambari-common/src/main/python/pluggable_stack_definition/configs/ODP.json
@@ -0,0 +1,131 @@
+{
+ "stackName": "ODP",
+ "baseStackName": "HDP",
+ "performCommonReplacements": true,
+ "textReplacements": [
+ ["hdp-select", "distro-select"]
+ ],
+ "preservedText": ["ext-2.2", "HDP-oozie", "hdp.version", "HDP_VERSION"],
+ "uiMapping": [
+ {
+ "stackVersionNumber": "0.9",
+ "sign": "<",
+ "baseStackFolder": "HDP2"
+ }
+ ],
+ "ambariProperties": {
+ "jdk.download.supported" : "false",
+ "jce.download.supported" : "false",
+ "jdk1.7.url" : "http://DOWNLOAD_NOT_SUPPORTED",
+ "jdk1.8.url" : "http://DOWNLOAD_NOT_SUPPORTED",
+ "jdk1.7.jcpol-url" : "http://DOWNLOAD_NOT_SUPPORTED",
+ "jdk1.8.jcpol-url" : "http://DOWNLOAD_NOT_SUPPORTED",
+ "rolling.upgrade.min.stack" : "ODP-0.8"
+ },
+ "versions": [
+ {
+ "version": "0.6",
+ "baseVersion": "2.0.6",
+ "family": "redhat6,suse11",
+ "active": "false",
+ "services": [
+ {
+ "name": "KERBEROS"
+ },
+ {
+ "name": "AMBARI_METRICS"
+ },
+ {
+ "name": "HDFS"
+ },
+ {
+ "name": "ZOOKEEPER"
+ },
+ {
+ "name": "YARN"
+ },
+ {
+ "name": "MAPREDUCE2"
+ }
+ ]
+ },
+ {
+ "version": "0.7",
+ "baseVersion": "2.1",
+ "active": "false",
+ "family": "redhat6,suse11",
+ "services": [
+ {
+ "name": "KERBEROS"
+ },
+ {
+ "name": "AMBARI_METRICS"
+ },
+ {
+ "name": "HDFS"
+ },
+ {
+ "name": "ZOOKEEPER"
+ },
+ {
+ "name": "YARN"
+ },
+ {
+ "name": "MAPREDUCE2"
+ }
+ ]
+ },
+ {
+ "version": "0.8",
+ "baseVersion": "2.2",
+ "active": "false",
+ "family": "redhat6,suse11",
+ "services": [
+ {
+ "name": "KERBEROS"
+ },
+ {
+ "name": "AMBARI_METRICS"
+ },
+ {
+ "name": "HDFS"
+ },
+ {
+ "name": "ZOOKEEPER"
+ },
+ {
+ "name": "YARN"
+ },
+ {
+ "name": "MAPREDUCE2"
+ }
+ ]
+ },
+ {
+ "version": "0.9",
+ "baseVersion": "2.3",
+ "active": "true",
+ "family": "redhat6,redhat7,suse11",
+ "services": [
+ {
+ "name": "KERBEROS"
+ },
+ {
+ "name": "AMBARI_METRICS"
+ },
+ {
+ "name": "HDFS"
+ },
+ {
+ "name": "ZOOKEEPER"
+ },
+ {
+ "name": "YARN"
+ },
+ {
+ "name": "MAPREDUCE2"
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/55b13a9d/ambari-common/src/main/python/pluggable_stack_definition/resources/ODP/custom_stack_map.js
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/pluggable_stack_definition/resources/ODP/custom_stack_map.js b/ambari-common/src/main/python/pluggable_stack_definition/resources/ODP/custom_stack_map.js
new file mode 100644
index 0000000..6bb49c8
--- /dev/null
+++ b/ambari-common/src/main/python/pluggable_stack_definition/resources/ODP/custom_stack_map.js
@@ -0,0 +1,46 @@
+/**
+ * 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');
+
+/*
+sign will be compared like: <clusterSelectedStackVersion> sign <stackVersionNumber> if true use this baseStackFolder
+Example:
+ {
+ "stackName": "PHD",
+ "stackVersionNumber": "3.0",
+ "sign": "<",
+ "baseStackFolder": "HDP2"
+ }
+ This rule will work for any PHD version number that is lower than 3.0 (2.9,2.8, e.t.c)
+*/
+
+module.exports = [
+ {
+ "stackName": "ODP",
+ "stackVersionNumber": "0.9",
+ "sign": "=",
+ "baseStackFolder": "HDP2.3"
+ },
+ {
+ "stackName": "ODP",
+ "stackVersionNumber": "0.9",
+ "sign": "<",
+ "baseStackFolder": "HDP2"
+ }
+];
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/55b13a9d/ambari-common/src/main/python/pluggable_stack_definition/resources/PHD/custom_stack_map.js
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/pluggable_stack_definition/resources/PHD/custom_stack_map.js b/ambari-common/src/main/python/pluggable_stack_definition/resources/PHD/custom_stack_map.js
new file mode 100644
index 0000000..1834ead
--- /dev/null
+++ b/ambari-common/src/main/python/pluggable_stack_definition/resources/PHD/custom_stack_map.js
@@ -0,0 +1,52 @@
+/**
+ * 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');
+
+/*
+sign will be compared like: <clusterSelectedStackVersion> sign <stackVersionNumber> if true use this baseStackFolder
+Example:
+ {
+ "stackName": "PHD",
+ "stackVersionNumber": "3.0",
+ "sign": "<",
+ "baseStackFolder": "HDP2"
+ }
+ This rule will work for any PHD version number that is lower than 3.0 (2.9,2.8, e.t.c)
+*/
+
+module.exports = [
+ {
+ "stackName": "PHD",
+ "stackVersionNumber": "3.1",
+ "sign": "=",
+ "baseStackFolder": "HDP2.3"
+ },
+ {
+ "stackName": "PHD",
+ "stackVersionNumber": "3.0",
+ "sign": "=",
+ "baseStackFolder": "HDP2.2"
+ },
+ {
+ "stackName": "PHD",
+ "stackVersionNumber": "3.0",
+ "sign": "<",
+ "baseStackFolder": "HDP2"
+ }
+];
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/55b13a9d/ambari-common/src/main/python/pluggable_stack_definition/resources/SAPHD/custom_stack_map.js
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/pluggable_stack_definition/resources/SAPHD/custom_stack_map.js b/ambari-common/src/main/python/pluggable_stack_definition/resources/SAPHD/custom_stack_map.js
new file mode 100644
index 0000000..5a1f2d8
--- /dev/null
+++ b/ambari-common/src/main/python/pluggable_stack_definition/resources/SAPHD/custom_stack_map.js
@@ -0,0 +1,46 @@
+/**
+ * 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');
+
+/*
+sign will be compared like: <clusterSelectedStackVersion> sign <stackVersionNumber> if true use this baseStackFolder
+Example:
+ {
+ "stackName": "PHD",
+ "stackVersionNumber": "3.0",
+ "sign": "<",
+ "baseStackFolder": "HDP2"
+ }
+ This rule will work for any PHD version number that is lower than 3.0 (2.9,2.8, e.t.c)
+*/
+
+module.exports = [
+ {
+ "stackName": "SAPHD",
+ "stackVersionNumber": "1.0",
+ "sign": "=",
+ "baseStackFolder": "HDP2.3"
+ },
+ {
+ "stackName": "SAPHD",
+ "stackVersionNumber": "1.0",
+ "sign": "<",
+ "baseStackFolder": "HDP2"
+ }
+];
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/55b13a9d/ambari-server/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-server/pom.xml b/ambari-server/pom.xml
index 01301da..1b4189a 100644
--- a/ambari-server/pom.xml
+++ b/ambari-server/pom.xml
@@ -41,7 +41,6 @@
<ambari-admin-dir>${basedir}/../ambari-admin</ambari-admin-dir>
<contrib-views-dir>${basedir}/../contrib/views</contrib-views-dir>
<resourceManagementSrcLocation>${project.basedir}/../ambari-common/src/main/python/resource_management</resourceManagementSrcLocation>
- <customStackMap>${basedir}/../ambari-web/app/data/custom_stack_map.js</customStackMap>
<customActionsRoot>src/main/resources/custom_actions</customActionsRoot>
<ambariProperties>conf/unix/ambari.properties</ambariProperties>
<commonServicesSrcLocation>target/classes/common-services</commonServicesSrcLocation>
@@ -297,14 +296,6 @@
</dependency>
</mapping>
<mapping>
- <directory>/usr/lib/ambari-server/app/data</directory>
- <sources>
- <source>
- <location>${customStackMap}</location>
- </source>
- </sources>
- </mapping>
- <mapping>
<directory>/usr/lib/ambari-server/web</directory>
<sources>
<source>
@@ -1115,14 +1106,6 @@
</mapper>
</data>
<data>
- <src>${customStackMap}</src>
- <type>file</type>
- <mapper>
- <type>perm</type>
- <prefix>/usr/lib/ambari-server/app/data</prefix>
- </mapper>
- </data>
- <data>
<src>src/main/python/os_check_type.py</src>
<type>file</type>
<mapper>
@@ -1561,7 +1544,6 @@
</activation>
<properties>
<customActionsRoot>target/pluggable-stack-definition/custom_actions</customActionsRoot>
- <customStackMap>target/pluggable-stack-definition/custom_stack_map.js</customStackMap>
<ambariProperties>target/pluggable-stack-definition/conf/unix/ambari.properties</ambariProperties>
<resourceManagementSrcLocation>target/pluggable-stack-definition/python/resource_management</resourceManagementSrcLocation>
<commonServicesSrcLocation>target/pluggable-stack-definition/common-services</commonServicesSrcLocation>
http://git-wip-us.apache.org/repos/asf/ambari/blob/55b13a9d/ambari-web/copy-pluggable-stack-resources.sh
----------------------------------------------------------------------
diff --git a/ambari-web/copy-pluggable-stack-resources.sh b/ambari-web/copy-pluggable-stack-resources.sh
new file mode 100644
index 0000000..4dc9205
--- /dev/null
+++ b/ambari-web/copy-pluggable-stack-resources.sh
@@ -0,0 +1,48 @@
+#!/bin/sh
+#
+# 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.
+#
+
+if [[ $# -eq 0 ]] ; then
+ echo 'Usage: copy-pluggable-stack-resources.sh <stack.distribution>'
+ exit 1
+fi
+
+resources_dir="../ambari-common/src/main/python/pluggable_stack_definition/resources/$1"
+if [ ! -d $resources_dir ];
+then
+ echo "No resources to copy for [ $1 ]"
+ exit 0
+fi
+
+echo "Copying pluggable stack resources for [ $1 ]"
+if [ -f "$resources_dir/custom_stack_map.js" ];
+then
+ echo cp $resources_dir/custom_stack_map.js app/data/custom_stack_map.js
+ cp $resources_dir/custom_stack_map.js app/data/custom_stack_map.js
+fi
+if [ -f "$resources_dir/custom-ui.less" ]
+then
+ echo cp $resources_dir/custom-ui.less app/styles/custom-ui.less
+ cp $resources_dir/custom-ui.less app/styles/custom-ui.less
+fi
+if [ -f "$resources_dir/messages.js" ]
+then
+ echo cp $resources_dir/messages.js app/messages.js
+ cp $resources_dir/messages.js app/messages.js
+fi
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/55b13a9d/ambari-web/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-web/pom.xml b/ambari-web/pom.xml
index 8f8b191..b124a21 100644
--- a/ambari-web/pom.xml
+++ b/ambari-web/pom.xml
@@ -308,5 +308,35 @@
<args.shell></args.shell>
</properties>
</profile>
+ <profile>
+ <id>pluggable-stack-definition</id>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <version>1.2.1</version>
+ <executions>
+ <execution>
+ <id>copy-pluggable-stack-resources</id>
+ <phase>initialize</phase>
+ <goals>
+ <goal>exec</goal>
+ </goals>
+ <configuration>
+ <!-- Copy stack specific UI resources -->
+ <executable>${executable.shell}</executable>
+ <workingDirectory>${basedir}</workingDirectory>
+ <commandlineArgs>${args.shell} ${basedir}${dirsep}copy-pluggable-stack-resources.${fileextension.shell} ${stack.distribution}</commandlineArgs>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
</profiles>
</project>