Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 2BEAF200BB3 for ; Wed, 2 Nov 2016 21:53:40 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 2A735160AFB; Wed, 2 Nov 2016 20:53:40 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 7E02E160AF0 for ; Wed, 2 Nov 2016 21:53:38 +0100 (CET) Received: (qmail 42946 invoked by uid 500); 2 Nov 2016 20:53:37 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 42934 invoked by uid 99); 2 Nov 2016 20:53:37 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Nov 2016 20:53:37 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id E9186E09DE; Wed, 2 Nov 2016 20:53:36 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: alejandro@apache.org To: commits@ambari.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: ambari git commit: AMBARI-18732. Perf: Create PERF stack with mix of HDP core services and dummy services (alejandro) Date: Wed, 2 Nov 2016 20:53:36 +0000 (UTC) archived-at: Wed, 02 Nov 2016 20:53:40 -0000 Repository: ambari Updated Branches: refs/heads/trunk c9362c897 -> fca6f1c3a AMBARI-18732. Perf: Create PERF stack with mix of HDP core services and dummy services (alejandro) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/fca6f1c3 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/fca6f1c3 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/fca6f1c3 Branch: refs/heads/trunk Commit: fca6f1c3a56aa13c7fda385cba5fdae59dc990ed Parents: c9362c8 Author: Alejandro Fernandez Authored: Wed Nov 2 14:52:24 2016 -0700 Committer: Alejandro Fernandez Committed: Wed Nov 2 14:52:26 2016 -0700 ---------------------------------------------------------------------- .../libraries/script/dummy.py | 106 +++++++++++++++++++ .../PERF/1.0/configuration/cluster-env.xml | 75 +++++++++++++ .../1.0/hooks/after-INSTALL/scripts/hook.py | 28 +++++ .../PERF/1.0/hooks/before-ANY/scripts/hook.py | 28 +++++ .../1.0/hooks/before-INSTALL/scripts/hook.py | 28 +++++ .../1.0/hooks/before-RESTART/scripts/hook.py | 28 +++++ .../PERF/1.0/hooks/before-START/scripts/hook.py | 28 +++++ .../main/resources/stacks/PERF/1.0/metainfo.xml | 22 ++++ .../PERF/1.0/properties/stack_features.json | 14 +++ .../stacks/PERF/1.0/properties/stack_tools.json | 4 + .../stacks/PERF/1.0/repos/repoinfo.xml | 27 +++++ .../stacks/PERF/1.0/role_command_order.json | 8 ++ .../services/HAPPY/configuration/happy-site.xml | 36 +++++++ .../stacks/PERF/1.0/services/HAPPY/metainfo.xml | 57 ++++++++++ .../1.0/services/HAPPY/package/scripts/dwarf.py | 38 +++++++ .../HAPPY/package/scripts/service_check.py | 30 ++++++ .../PERF/1.0/services/HAPPY/themes/theme.json | 65 ++++++++++++ .../services/SNOW/configuration/snow-site.xml | 36 +++++++ .../stacks/PERF/1.0/services/SNOW/metainfo.xml | 57 ++++++++++ .../SNOW/package/scripts/service_check.py | 30 ++++++ .../services/SNOW/package/scripts/snow_white.py | 38 +++++++ .../PERF/1.0/services/SNOW/themes/theme.json | 65 ++++++++++++ 22 files changed, 848 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/fca6f1c3/ambari-common/src/main/python/resource_management/libraries/script/dummy.py ---------------------------------------------------------------------- diff --git a/ambari-common/src/main/python/resource_management/libraries/script/dummy.py b/ambari-common/src/main/python/resource_management/libraries/script/dummy.py new file mode 100644 index 0000000..2a48de3 --- /dev/null +++ b/ambari-common/src/main/python/resource_management/libraries/script/dummy.py @@ -0,0 +1,106 @@ +""" +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. + +Ambari Agent + +""" + +__all__ = ["Dummy"] + +# Python Imports +import os + +# Local Imports +from resource_management.libraries.script.script import Script +from resource_management.core.resources.system import Directory, File, Execute +from ambari_commons.constants import AMBARI_SUDO_BINARY +from resource_management.core.exceptions import ComponentIsNotRunning + + +class Dummy(Script): + """ + Dummy component to be used for performance testing since doesn't actually run a service. + Reports status command based on the existence of a pid file. + """ + + # Whether or not configs have been loaded already in the prepare() method. + loaded = False + + def prepare(self): + # During restart commands which executes stop + start, avoid loading multiple times. + if self.loaded: + return + self.loaded = True + + self.config = Script.get_config() + # Cannot rely on system hostname since will run multiple Ambari agents on the same host. + self.host_name = self.config["hostname"] + + # Should still define self.component_name which is needed for status commands. + if "role" in self.config: + self.component_name = self.config["role"] + + self.pid_file = "/var/run/%s/%s.pid" % (self.host_name, self.component_name) + self.user = "root" + self.user_group = "root" + self.sudo = AMBARI_SUDO_BINARY + + print "Host: %s" % self.host_name + print "Component: %s" % self.component_name + print "Pid File: %s" % self.pid_file + + def install(self, env): + print "Install" + self.prepare() + + def configure(self, env): + print "Configure" + self.prepare() + + def start(self, env): + print "Start" + self.prepare() + + if not os.path.isfile(self.pid_file): + print "Creating pid file: %s" % self.pid_file + + Directory(os.path.dirname(self.pid_file), + owner=self.user, + group=self.user_group, + mode=0755, + create_parents=True + ) + + File(self.pid_file, + owner=self.user, + content="" + ) + + def stop(self, env): + print "Stop" + self.prepare() + + if os.path.isfile(self.pid_file): + print "Deleting pid file: %s" % self.pid_file + Execute("%s rm -rf %s" % (self.sudo, self.pid_file)) + + def status(self, env): + print "Status" + self.prepare() + + if not os.path.isfile(self.pid_file): + raise ComponentIsNotRunning() http://git-wip-us.apache.org/repos/asf/ambari/blob/fca6f1c3/ambari-server/src/main/resources/stacks/PERF/1.0/configuration/cluster-env.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/configuration/cluster-env.xml b/ambari-server/src/main/resources/stacks/PERF/1.0/configuration/cluster-env.xml new file mode 100644 index 0000000..a87d37e --- /dev/null +++ b/ambari-server/src/main/resources/stacks/PERF/1.0/configuration/cluster-env.xml @@ -0,0 +1,75 @@ + + + + + + + + stack_tools + + Stack specific tools + VALUE_FROM_PROPERTY_FILE + + stack_tools.json + json + true + false + false + + + + + + + stack_features + + List of features supported by the stack + VALUE_FROM_PROPERTY_FILE + + stack_features.json + json + true + false + false + + + + + + stack_root + /usr/perf + Stack root folder + + true + false + false + + + + + + security_enabled + false + Security + + + + http://git-wip-us.apache.org/repos/asf/ambari/blob/fca6f1c3/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/after-INSTALL/scripts/hook.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/after-INSTALL/scripts/hook.py b/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/after-INSTALL/scripts/hook.py new file mode 100644 index 0000000..7f6e819 --- /dev/null +++ b/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/after-INSTALL/scripts/hook.py @@ -0,0 +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 + +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. + +""" + +from resource_management.libraries.script import Hook + +class AfterInstallHook(Hook): + + def hook(self, env): + print "After Install Hook" + +if __name__ == "__main__": + AfterInstallHook().execute() http://git-wip-us.apache.org/repos/asf/ambari/blob/fca6f1c3/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-ANY/scripts/hook.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-ANY/scripts/hook.py b/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-ANY/scripts/hook.py new file mode 100644 index 0000000..90e0266 --- /dev/null +++ b/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-ANY/scripts/hook.py @@ -0,0 +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 + +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. + +""" + +from resource_management.libraries.script import Hook + +class BeforeAnyHook(Hook): + + def hook(self, env): + print "Before Any Hook" + +if __name__ == "__main__": + BeforeAnyHook().execute() http://git-wip-us.apache.org/repos/asf/ambari/blob/fca6f1c3/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-INSTALL/scripts/hook.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-INSTALL/scripts/hook.py b/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-INSTALL/scripts/hook.py new file mode 100644 index 0000000..9eca9ec --- /dev/null +++ b/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-INSTALL/scripts/hook.py @@ -0,0 +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 + +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. + +""" + +from resource_management.libraries.script import Hook + +class BeforeInstallHook(Hook): + + def hook(self, env): + print "Before Install Hook" + +if __name__ == "__main__": + BeforeInstallHook().execute() http://git-wip-us.apache.org/repos/asf/ambari/blob/fca6f1c3/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-RESTART/scripts/hook.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-RESTART/scripts/hook.py b/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-RESTART/scripts/hook.py new file mode 100644 index 0000000..a366129 --- /dev/null +++ b/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-RESTART/scripts/hook.py @@ -0,0 +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 + +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. + +""" + +from resource_management.libraries.script import Hook + +class BeforeRestartHook(Hook): + + def hook(self, env): + print "Before Restart Hook" + +if __name__ == "__main__": + BeforeRestartHook().execute() http://git-wip-us.apache.org/repos/asf/ambari/blob/fca6f1c3/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-START/scripts/hook.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-START/scripts/hook.py b/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-START/scripts/hook.py new file mode 100644 index 0000000..c5600a3 --- /dev/null +++ b/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-START/scripts/hook.py @@ -0,0 +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 + +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. + +""" + +from resource_management.libraries.script import Hook + +class BeforeStartHook(Hook): + + def hook(self, env): + print "Before Start Hook" + +if __name__ == "__main__": + BeforeStartHook().execute() http://git-wip-us.apache.org/repos/asf/ambari/blob/fca6f1c3/ambari-server/src/main/resources/stacks/PERF/1.0/metainfo.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/metainfo.xml b/ambari-server/src/main/resources/stacks/PERF/1.0/metainfo.xml new file mode 100644 index 0000000..45a63e5 --- /dev/null +++ b/ambari-server/src/main/resources/stacks/PERF/1.0/metainfo.xml @@ -0,0 +1,22 @@ + + + + + false + + http://git-wip-us.apache.org/repos/asf/ambari/blob/fca6f1c3/ambari-server/src/main/resources/stacks/PERF/1.0/properties/stack_features.json ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/properties/stack_features.json b/ambari-server/src/main/resources/stacks/PERF/1.0/properties/stack_features.json new file mode 100644 index 0000000..81640b6 --- /dev/null +++ b/ambari-server/src/main/resources/stacks/PERF/1.0/properties/stack_features.json @@ -0,0 +1,14 @@ +{ + "stack_features": [ + { + "name": "rolling_upgrade", + "description": "Rolling upgrade support", + "min_version": "1.0.0.0" + }, + { + "name": "config_versioning", + "description": "Configurable versions support", + "min_version": "1.0.0.0" + } + ] +} http://git-wip-us.apache.org/repos/asf/ambari/blob/fca6f1c3/ambari-server/src/main/resources/stacks/PERF/1.0/properties/stack_tools.json ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/properties/stack_tools.json b/ambari-server/src/main/resources/stacks/PERF/1.0/properties/stack_tools.json new file mode 100644 index 0000000..535b9d9 --- /dev/null +++ b/ambari-server/src/main/resources/stacks/PERF/1.0/properties/stack_tools.json @@ -0,0 +1,4 @@ +{ + "stack_selector": ["distro-select", "/usr/bin/distro-select", "distro-select"], + "conf_selector": ["conf-select", "/usr/bin/conf-select", "conf-select"] +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/fca6f1c3/ambari-server/src/main/resources/stacks/PERF/1.0/repos/repoinfo.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/repos/repoinfo.xml b/ambari-server/src/main/resources/stacks/PERF/1.0/repos/repoinfo.xml new file mode 100644 index 0000000..c5137fb --- /dev/null +++ b/ambari-server/src/main/resources/stacks/PERF/1.0/repos/repoinfo.xml @@ -0,0 +1,27 @@ + + + + + + http://foo + PERF-1.0 + PERF + true + + + http://git-wip-us.apache.org/repos/asf/ambari/blob/fca6f1c3/ambari-server/src/main/resources/stacks/PERF/1.0/role_command_order.json ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/role_command_order.json b/ambari-server/src/main/resources/stacks/PERF/1.0/role_command_order.json new file mode 100644 index 0000000..701b567 --- /dev/null +++ b/ambari-server/src/main/resources/stacks/PERF/1.0/role_command_order.json @@ -0,0 +1,8 @@ +{ + "_comment" : "Record format:", + "_comment" : "blockedRole-blockedCommand: [blockerRole1-blockerCommand1, blockerRole2-blockerCommand2, ...]", + "general_deps" : { + "_comment" : "dependencies for all cases", + "HAPPY-START": ["SNOW-START"] + } +} http://git-wip-us.apache.org/repos/asf/ambari/blob/fca6f1c3/ambari-server/src/main/resources/stacks/PERF/1.0/services/HAPPY/configuration/happy-site.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/HAPPY/configuration/happy-site.xml b/ambari-server/src/main/resources/stacks/PERF/1.0/services/HAPPY/configuration/happy-site.xml new file mode 100644 index 0000000..7d521b8 --- /dev/null +++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/HAPPY/configuration/happy-site.xml @@ -0,0 +1,36 @@ + + + + + + success.percentage + 100 + The success percentage of any operation. + Success percentage + + int + 0 + 100 + 10 + + + + http://git-wip-us.apache.org/repos/asf/ambari/blob/fca6f1c3/ambari-server/src/main/resources/stacks/PERF/1.0/services/HAPPY/metainfo.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/HAPPY/metainfo.xml b/ambari-server/src/main/resources/stacks/PERF/1.0/services/HAPPY/metainfo.xml new file mode 100644 index 0000000..36a2168 --- /dev/null +++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/HAPPY/metainfo.xml @@ -0,0 +1,57 @@ + + + + 2.0 + + + HAPPY + Happy + Always passes + 1.0 + + + + HAPPY + Happy + SLAVE + 0+ + + + PYTHON + 600 + + + + + + + PYTHON + 300 + + + true + + + + theme.json + true + + + + + http://git-wip-us.apache.org/repos/asf/ambari/blob/fca6f1c3/ambari-server/src/main/resources/stacks/PERF/1.0/services/HAPPY/package/scripts/dwarf.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/HAPPY/package/scripts/dwarf.py b/ambari-server/src/main/resources/stacks/PERF/1.0/services/HAPPY/package/scripts/dwarf.py new file mode 100644 index 0000000..b86c4c7 --- /dev/null +++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/HAPPY/package/scripts/dwarf.py @@ -0,0 +1,38 @@ +""" +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. + +Ambari Agent + +""" + +# Python Imports + +# Local Imports +from resource_management.libraries.script.dummy import Dummy + + +class Happy(Dummy): + """ + Dummy script that simulates a slave component. + """ + + def __init__(self): + super(Happy, self).__init__() + self.component_name = "HAPPY" + +if __name__ == "__main__": + Happy().execute() http://git-wip-us.apache.org/repos/asf/ambari/blob/fca6f1c3/ambari-server/src/main/resources/stacks/PERF/1.0/services/HAPPY/package/scripts/service_check.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/HAPPY/package/scripts/service_check.py b/ambari-server/src/main/resources/stacks/PERF/1.0/services/HAPPY/package/scripts/service_check.py new file mode 100644 index 0000000..270b082 --- /dev/null +++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/HAPPY/package/scripts/service_check.py @@ -0,0 +1,30 @@ +""" +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. + +Ambari Agent + +""" + +from resource_management.libraries.script.script import Script + +class ServiceCheck(Script): + + def service_check(self, env): + print "Service Check" + +if __name__ == "__main__": + ServiceCheck().execute() http://git-wip-us.apache.org/repos/asf/ambari/blob/fca6f1c3/ambari-server/src/main/resources/stacks/PERF/1.0/services/HAPPY/themes/theme.json ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/HAPPY/themes/theme.json b/ambari-server/src/main/resources/stacks/PERF/1.0/services/HAPPY/themes/theme.json new file mode 100644 index 0000000..46ac265 --- /dev/null +++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/HAPPY/themes/theme.json @@ -0,0 +1,65 @@ +{ + "name": "default", + "description": "Default theme", + "configuration": { + "layouts": [ + { + "name": "default", + "tabs": [ + { + "name": "settings", + "display-name": "Settings", + "layout": { + "tab-columns": "1", + "tab-rows": "1", + "sections": [ + { + "name": "section-general", + "display-name": "General", + "row-index": "0", + "column-index": "0", + "row-span": "1", + "column-span": "1", + "section-columns": "1", + "section-rows": "1", + "subsections": [ + { + "name": "subsection-general", + "display-name": "Features", + "row-index": "0", + "column-index": "0", + "row-span": "1", + "column-span": "1" + } + ] + } + ] + } + } + ] + } + ], + "placement": { + "configuration-layout": "default", + "configs": [ + { + "config": "happy-site/success.percentage", + "subsection-name": "subsection-general" + } + ] + }, + "widgets": [ + { + "config": "happy-site/success.percentage", + "widget": { + "type": "slider", + "units": [ + { + "unit-name": "percent" + } + ] + } + } + ] + } +} http://git-wip-us.apache.org/repos/asf/ambari/blob/fca6f1c3/ambari-server/src/main/resources/stacks/PERF/1.0/services/SNOW/configuration/snow-site.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/SNOW/configuration/snow-site.xml b/ambari-server/src/main/resources/stacks/PERF/1.0/services/SNOW/configuration/snow-site.xml new file mode 100644 index 0000000..7d521b8 --- /dev/null +++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/SNOW/configuration/snow-site.xml @@ -0,0 +1,36 @@ + + + + + + success.percentage + 100 + The success percentage of any operation. + Success percentage + + int + 0 + 100 + 10 + + + + http://git-wip-us.apache.org/repos/asf/ambari/blob/fca6f1c3/ambari-server/src/main/resources/stacks/PERF/1.0/services/SNOW/metainfo.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/SNOW/metainfo.xml b/ambari-server/src/main/resources/stacks/PERF/1.0/services/SNOW/metainfo.xml new file mode 100644 index 0000000..cbb57f6 --- /dev/null +++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/SNOW/metainfo.xml @@ -0,0 +1,57 @@ + + + + 2.0 + + + SNOW + Snow + Always passes + 1.0 + + + + SNOW_WHITE + Snow White + MASTER + 1 + + + PYTHON + 600 + + + + + + + PYTHON + 300 + + + true + + + + theme.json + true + + + + + http://git-wip-us.apache.org/repos/asf/ambari/blob/fca6f1c3/ambari-server/src/main/resources/stacks/PERF/1.0/services/SNOW/package/scripts/service_check.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/SNOW/package/scripts/service_check.py b/ambari-server/src/main/resources/stacks/PERF/1.0/services/SNOW/package/scripts/service_check.py new file mode 100644 index 0000000..270b082 --- /dev/null +++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/SNOW/package/scripts/service_check.py @@ -0,0 +1,30 @@ +""" +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. + +Ambari Agent + +""" + +from resource_management.libraries.script.script import Script + +class ServiceCheck(Script): + + def service_check(self, env): + print "Service Check" + +if __name__ == "__main__": + ServiceCheck().execute() http://git-wip-us.apache.org/repos/asf/ambari/blob/fca6f1c3/ambari-server/src/main/resources/stacks/PERF/1.0/services/SNOW/package/scripts/snow_white.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/SNOW/package/scripts/snow_white.py b/ambari-server/src/main/resources/stacks/PERF/1.0/services/SNOW/package/scripts/snow_white.py new file mode 100644 index 0000000..41bfa8a --- /dev/null +++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/SNOW/package/scripts/snow_white.py @@ -0,0 +1,38 @@ +""" +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. + +Ambari Agent + +""" + +# Python Imports + +# Local Imports +from resource_management.libraries.script.dummy import Dummy + + +class SnowWhite(Dummy): + """ + Dummy script that simulates a master component. + """ + + def __init__(self): + super(SnowWhite, self).__init__() + self.component_name = "SNOW_WHITE" + +if __name__ == "__main__": + SnowWhite().execute() http://git-wip-us.apache.org/repos/asf/ambari/blob/fca6f1c3/ambari-server/src/main/resources/stacks/PERF/1.0/services/SNOW/themes/theme.json ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/SNOW/themes/theme.json b/ambari-server/src/main/resources/stacks/PERF/1.0/services/SNOW/themes/theme.json new file mode 100644 index 0000000..31eb11f --- /dev/null +++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/SNOW/themes/theme.json @@ -0,0 +1,65 @@ +{ + "name": "default", + "description": "Default theme", + "configuration": { + "layouts": [ + { + "name": "default", + "tabs": [ + { + "name": "settings", + "display-name": "Settings", + "layout": { + "tab-columns": "1", + "tab-rows": "1", + "sections": [ + { + "name": "section-general", + "display-name": "General", + "row-index": "0", + "column-index": "0", + "row-span": "1", + "column-span": "1", + "section-columns": "1", + "section-rows": "1", + "subsections": [ + { + "name": "subsection-general", + "display-name": "Features", + "row-index": "0", + "column-index": "0", + "row-span": "1", + "column-span": "1" + } + ] + } + ] + } + } + ] + } + ], + "placement": { + "configuration-layout": "default", + "configs": [ + { + "config": "snow-site/success.percentage", + "subsection-name": "subsection-general" + } + ] + }, + "widgets": [ + { + "config": "snow-site/success.percentage", + "widget": { + "type": "slider", + "units": [ + { + "unit-name": "percent" + } + ] + } + } + ] + } +}